Encode iconst.i32 for RISC-V.

For large constants with the low 12 bits clear, we already have the
"lui" encoding. Add "addi %x0" encodings for signed 12-bit constants.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-22 12:11:54 -07:00
parent e83e2ccf17
commit 9e02b9818f
5 changed files with 27 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ function %RV32I(i32 link [%x1]) -> i32 link [%x1] {
ebb0(v9999: i32):
; iconst.i32 needs legalizing, so it should throw a
[R#0,-] v1 = iconst.i32 1 ; error: Instruction failed to re-encode
[R#0,-] v1 = iconst.i32 0xf0f0f0f0f0 ; error: Instruction failed to re-encode
return v9999
}