Skip to content

Commit 4fde87e

Browse files
committed
Use ABI_FLEN rather than FLEN in Hardware Floating-point Calling Convention
There is few FLEN are really should refer to ISA's FLEN, especially for the NaN-boxing rules. Also added a NOTE to mention compiler/libraries should did the NaN-boxinb for soft-float floating operations. Fix #268.
1 parent 966a1ac commit 4fde87e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

riscv-cc.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ whether or not the integer registers have been exhausted.
191191
The remainder of this section applies only to named arguments. Variadic
192192
arguments are passed according to the integer calling convention.
193193

194-
For the purposes of this section, FLEN refers to the width of a floating-point
195-
register in the ABI. The ABI's FLEN must be no wider than the ISA's FLEN. The
196-
ISA might have wider floating-point registers than the ABI.
194+
ABI_FLEN refers to the width of a floating-point register in the ABI.
195+
The ABI_FLEN must be no wider than the ISA's FLEN. The ISA might have wider
196+
floating-point registers than the ABI.
197197

198198
For the purposes of this section, "struct" refers to a C struct with its
199199
hierarchy flattened, including any array fields. That is, `struct { struct
@@ -209,7 +209,7 @@ __attribute__((__packed__)) { int i; double d }` are treated the same, as are
209209
((aligned (8))); }`.
210210

211211
A real floating-point argument is passed in a floating-point argument
212-
register if it is no more than FLEN bits wide and at least one floating-point
212+
register if it is no more than ABI_FLEN bits wide and at least one floating-point
213213
argument register is available. Otherwise, it is passed according to the
214214
integer calling convention.
215215
When a floating-point argument narrower than FLEN bits is passed in a
@@ -219,7 +219,7 @@ A struct containing just one floating-point real is passed as though it were
219219
a standalone floating-point real.
220220

221221
A struct containing two floating-point reals is passed in two floating-point
222-
registers, if neither real is more than FLEN bits wide and at least two floating-point
222+
registers, if neither real is more than ABI_FLEN bits wide and at least two floating-point
223223
argument registers are available. (The registers need not be an aligned pair.)
224224
Otherwise, it is passed according to the integer calling convention.
225225

@@ -230,7 +230,7 @@ floating-point reals.
230230
A struct containing one floating-point real and one integer (or bitfield), in
231231
either order, is passed in a floating-point register and an integer register,
232232
without extending the integer to XLEN bits, provided the floating-point real
233-
is no more than FLEN bits wide and the integer is no more than XLEN bits wide,
233+
is no more than ABI_FLEN bits wide and the integer is no more than XLEN bits wide,
234234
and at least one floating-point argument register and at least one integer
235235
argument register is available. Otherwise, it is passed according to the
236236
integer calling convention.
@@ -242,7 +242,7 @@ Values are returned in the same manner as a first named argument of the same
242242
type would be passed.
243243

244244
Floating-point registers fs0-fs11 shall be preserved across procedure calls,
245-
provided they hold values no more than FLEN bits wide.
245+
provided they hold values no more than ABI_FLEN bits wide.
246246

247247
=== ILP32E Calling Convention
248248

@@ -276,11 +276,11 @@ EF_RISCV_FLOAT_ABI_SOFT).
276276

277277
[[abi-ilp32f]]
278278
ILP32F:: ILP32 with hardware floating-point calling
279-
convention for FLEN=32 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_SINGLE).
279+
convention for ABI_FLEN=32 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_SINGLE).
280280

281281
[[abi-ilp32d]]
282282
ILP32D:: ILP32 with hardware floating-point calling
283-
convention for FLEN=64 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_DOUBLE).
283+
convention for ABI_FLEN=64 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_DOUBLE).
284284

285285
[[abi-ilp32e]]
286286
ILP32E:: <<ILP32E Calling Convention,ILP32E calling-convention>> only,
@@ -294,15 +294,15 @@ EF_RISCV_FLOAT_ABI_SOFT).
294294

295295
[[abi-lp64f]]
296296
LP64F:: LP64 with hardware floating-point calling
297-
convention for FLEN=32 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_SINGLE).
297+
convention for ABI_FLEN=32 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_SINGLE).
298298

299299
[[abi-lp64d]]
300300
LP64D:: LP64 with hardware floating-point calling
301-
convention for FLEN=64 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_DOUBLE).
301+
convention for ABI_FLEN=64 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_DOUBLE).
302302

303303
[[abi-lp64q]]
304304
LP64Q:: LP64 with hardware floating-point calling
305-
convention for FLEN=128 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_QUAD).
305+
convention for ABI_FLEN=128 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_QUAD).
306306

307307
The ILP32* ABIs are only compatible with RV32* ISAs, and the LP64* ABIs are
308308
only compatible with RV64* ISAs. A future version of this specification may

0 commit comments

Comments
 (0)