← Documents Documentation/arch/arm/nwfpe/nwfpe.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

NetWinder Floating Point Emulator Introduction

NWFPE 0.92의 구현 목표, portability 구조, SoftFloat 기반, bug-report 방식과 license 조건을 설명합니다.

Source pathDocumentation/arch/arm/nwfpe/nwfpe.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

nwfpe.rst:1-74

NWFPE는 compiler가 emit하는 instruction의 동작 구현을 먼저 목표로 하고, OS-specific code를 `fpmodule.*`로 격리해 portability를 확보했습니다. arithmetic core는 검증된 SoftFloat를 재사용합니다.

NWFPE architecture
layer역할대표 요소
OS adapterkernel·ABI 차이 격리fpmodule.*, C_SYMBOL_NAME
FPE decoderARM instruction 처리C + inline assembler
ArithmeticIEEE binary floating pointSoftFloat Release 2

portability를 위해 책임을 분리한 구조입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 Introduction
2 ============
3
4 This directory contains the version 0.92 test release of the NetWinder
5 Floating Point Emulator.
6
7 The majority of the code was written by me, Scott Bambrough It is
8 written in C, with a small number of routines in inline assembler
9 where required. It was written quickly, with a goal of implementing a
10 working version of all the floating point instructions the compiler
11 emits as the first target. I have attempted to be as optimal as
12 possible, but there remains much room for improvement.
13
14 I have attempted to make the emulator as portable as possible. One of
15 the problems is with leading underscores on kernel symbols. Elf
16 kernels have no leading underscores, a.out compiled kernels do. I
17 have attempted to use the C_SYMBOL_NAME macro wherever this may be
18 important.
19
20 Another choice I made was in the file structure. I have attempted to
21 contain all operating system specific code in one module (fpmodule.*).
22 All the other files contain emulator specific code. This should allow
23 others to port the emulator to NetBSD for instance relatively easily.
24
25 The floating point operations are based on SoftFloat Release 2, by
26 John Hauser. SoftFloat is a software implementation of floating-point
27 that conforms to the IEC/IEEE Standard for Binary Floating-point
28 Arithmetic. As many as four formats are supported: single precision,
29 double precision, extended double precision, and quadruple precision.
30 All operations required by the standard are implemented, except for
31 conversions to and from decimal. We use only the single precision,
32 double precision and extended double precision formats. The port of
33 SoftFloat to the ARM was done by Phil Blundell, based on an earlier
34 port of SoftFloat version 1 by Neil Carson for NetBSD/arm32.
35
36 The file README.FPE contains a description of what has been implemented
37 so far in the emulator. The file TODO contains a information on what
38 remains to be done, and other ideas for the emulator.
39
40 Bug reports, comments, suggestions should be directed to me at
41 <scottb@netwinder.org>. General reports of "this program doesn't
42 work correctly when your emulator is installed" are useful for
43 determining that bugs still exist; but are virtually useless when
44 attempting to isolate the problem. Please report them, but don't
45 expect quick action. Bugs still exist. The problem remains in isolating
46 which instruction contains the bug. Small programs illustrating a specific
47 problem are a godsend.
48
49 Legal Notices
50 -------------
51
52 The NetWinder Floating Point Emulator is free software. Everything Rebel.com
53 has written is provided under the GNU GPL. See the file COPYING for copying
54 conditions. Excluded from the above is the SoftFloat code. John Hauser's
55 legal notice for SoftFloat is included below.
56
57 -------------------------------------------------------------------------------
58
59 SoftFloat Legal Notice
60
61 SoftFloat was written by John R. Hauser. This work was made possible in
62 part by the International Computer Science Institute, located at Suite 600,
63 1947 Center Street, Berkeley, California 94704. Funding was partially
64 provided by the National Science Foundation under grant MIP-9311980. The
65 original version of this code was written as part of a project to build
66 a fixed-point vector processor in collaboration with the University of
67 California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek.
68
69 THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
70 has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
71 TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
72 PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
73 AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
74 -------------------------------------------------------------------------------
75

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Introduction

1-6

이 directory에는 NetWinder Floating Point Emulator version 0.92 test release가 들어 있습니다.

Implementation goals

7-13

대부분의 code는 Scott Bambrough가 C로 작성했고 필요한 일부 routine만 inline assembler를 사용합니다. compiler가 emit하는 모든 floating-point instruction의 동작 version을 먼저 완성하는 것이 목표였으며 가능한 한 최적화했지만 개선 여지가 많이 남아 있습니다.

Portability and file structure

14-24

emulator를 최대한 portable하게 만들려 했습니다. kernel symbol의 leading underscore가 문제인데 ELF kernel에는 없고 a.out으로 compile한 kernel에는 있으므로 중요한 곳마다 `C_SYMBOL_NAME` macro를 사용했습니다.

operating-system-specific code는 `fpmodule.*` 하나에 모으고 나머지 file에는 emulator-specific code만 두었습니다. 이 분리는 NetBSD 같은 다른 OS로 비교적 쉽게 port할 수 있게 합니다.

SoftFloat foundation

25-39

floating-point operation은 John Hauser의 SoftFloat Release 2를 기반으로 합니다. SoftFloat는 IEC/IEEE Standard for Binary Floating-point Arithmetic을 따르는 software 구현입니다.

formatSoftFloat 지원NWFPE 사용
single precision지원사용
double precision지원사용
extended double precision지원사용
quadruple precision지원사용하지 않음

표준이 요구하는 operation 중 decimal 변환을 제외한 모든 것을 SoftFloat가 구현합니다. ARM port는 Phil Blundell이 수행했으며 Neil Carson이 NetBSD/arm32용으로 만든 SoftFloat version 1 port를 바탕으로 했습니다.

`README.FPE`에는 현재 구현 상태가, `TODO`에는 남은 작업과 emulator 아이디어가 들어 있습니다.

Bug reports

40-48

bug report, comment, suggestion은 `<scottb@netwinder.org>`로 보내도록 안내합니다. 단순히 프로그램이 emulator에서 틀리게 동작한다는 report는 bug 존재 확인에는 유용하지만 원인 instruction을 격리하기에는 거의 도움이 되지 않습니다.

특정 문제를 재현하는 작은 program이 가장 유용합니다. 문서는 bug가 여전히 존재하며 어느 instruction의 문제인지 격리하는 일이 핵심이라고 명시합니다.