Skip to content

Commit 1ad6811

Browse files
authored
Merge pull request #280 from kito-cheng/abi-flen
Use ABI_FLEN rather than FLEN in `Hardware Floating-point Calling Convention
2 parents 00bd770 + 4fde87e commit 1ad6811

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
@@ -196,9 +196,9 @@ whether or not the integer registers have been exhausted.
196196
The remainder of this section applies only to named arguments. Variadic
197197
arguments are passed according to the integer calling convention.
198198

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

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

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

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

@@ -235,7 +235,7 @@ floating-point reals.
235235
A struct containing one floating-point real and one integer (or bitfield), in
236236
either order, is passed in a floating-point register and an integer register,
237237
without extending the integer to XLEN bits, provided the floating-point real
238-
is no more than FLEN bits wide and the integer is no more than XLEN bits wide,
238+
is no more than ABI_FLEN bits wide and the integer is no more than XLEN bits wide,
239239
and at least one floating-point argument register and at least one integer
240240
argument register is available. Otherwise, it is passed according to the
241241
integer calling convention.
@@ -247,7 +247,7 @@ Values are returned in the same manner as a first named argument of the same
247247
type would be passed.
248248

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

252252
=== ILP32E Calling Convention
253253

@@ -281,11 +281,11 @@ EF_RISCV_FLOAT_ABI_SOFT).
281281

282282
[[abi-ilp32f]]
283283
ILP32F:: ILP32 with hardware floating-point calling
284-
convention for FLEN=32 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_SINGLE).
284+
convention for ABI_FLEN=32 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_SINGLE).
285285

286286
[[abi-ilp32d]]
287287
ILP32D:: ILP32 with hardware floating-point calling
288-
convention for FLEN=64 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_DOUBLE).
288+
convention for ABI_FLEN=64 (i.e. ELFCLASS32 and EF_RISCV_FLOAT_ABI_DOUBLE).
289289

290290
[[abi-ilp32e]]
291291
ILP32E:: <<ILP32E Calling Convention,ILP32E calling-convention>> only,
@@ -299,15 +299,15 @@ EF_RISCV_FLOAT_ABI_SOFT).
299299

300300
[[abi-lp64f]]
301301
LP64F:: LP64 with hardware floating-point calling
302-
convention for FLEN=32 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_SINGLE).
302+
convention for ABI_FLEN=32 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_SINGLE).
303303

304304
[[abi-lp64d]]
305305
LP64D:: LP64 with hardware floating-point calling
306-
convention for FLEN=64 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_DOUBLE).
306+
convention for ABI_FLEN=64 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_DOUBLE).
307307

308308
[[abi-lp64q]]
309309
LP64Q:: LP64 with hardware floating-point calling
310-
convention for FLEN=128 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_QUAD).
310+
convention for ABI_FLEN=128 (i.e. ELFCLASS64 and EF_RISCV_FLOAT_ABI_QUAD).
311311

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

0 commit comments

Comments
 (0)