[RISCV] Add specific tests for materialising imm32hi20 constants

i.e. constants that can be materialised with a single lui, as the lower 12 
bits are zero.

llvm-svn: 330274
This commit is contained in:
Alex Bradbury 2018-04-18 16:43:03 +00:00
parent 198e678576
commit 75a4e52580
1 changed files with 16 additions and 0 deletions

View File

@ -45,3 +45,19 @@ define i32 @neg_i32() nounwind {
; RV32I-NEXT: ret
ret i32 -559038737
}
define i32 @pos_i32_hi20_only() nounwind {
; RV32I-LABEL: pos_i32_hi20_only:
; RV32I: # %bb.0:
; RV32I-NEXT: lui a0, 16
; RV32I-NEXT: ret
ret i32 65536
}
define i32 @neg_i32_hi20_only() nounwind {
; RV32I-LABEL: neg_i32_hi20_only:
; RV32I: # %bb.0:
; RV32I-NEXT: lui a0, 1048560
; RV32I-NEXT: ret
ret i32 -65536
}