Skip to content

Commit 454059c

Browse files
committed
Adding special rule for _BitInt(32) on RV64
1 parent 426ad0a commit 454059c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

riscv-cc.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ When passed in registers or on the stack, `_BitInt(N)` types are handled as
189189
follows:
190190
- For N < XLEN: Types are widened to XLEN bits, with upper bits sign-extended
191191
for signed `_BitInt(N)` or zero-extended for unsigned `_BitInt(N)`.
192+
However, for N = 32 in RV64, both signed and unsigned types are sign-extended.
193+
+
192194
- For N = XLEN: Types are passed using the same rules as scalars that are XLEN
193195
bits wide.
194196
- For XLEN < N ≤ 2×XLEN: Types are passed using the same rules as scalars that
@@ -200,6 +202,11 @@ follows:
200202
significant chunk are sign-extended for signed types or zero-extended for
201203
unsigned types.
202204

205+
[NOTE]
206+
====
207+
`_BitInt(32)` on RV64 has a special rule because it behaves consistently with regular `int` types.
208+
====
209+
203210
Scalars that are 2×XLEN bits wide are passed in a pair of argument registers,
204211
with the low-order XLEN bits in the lower-numbered register and the high-order
205212
XLEN bits in the higher-numbered register. If no argument registers are

0 commit comments

Comments
 (0)