aarch64: Add i128 load & store tests and refactor address calculation

The previous address calculation code had a bug where we tried to
add offsets into a temporary register before defining it, causing
the regalloc to complain.
This commit is contained in:
Afonso Bordado
2021-06-17 15:50:08 +01:00
parent 1c05e06bd5
commit c82764605f
3 changed files with 204 additions and 33 deletions

View File

@@ -89,3 +89,48 @@ block0(v0: i64,v1: i64):
; run: %i128_stack_store_load_big_offset(0x01234567_89ABCDEF, 0xFEDCBA98_76543210) == true
; run: %i128_stack_store_load_big_offset(0x06060606_06060606, 0xA00A00A0_0A00A00A) == true
; run: %i128_stack_store_load_big_offset(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == true
function %i128_store_load(i64, i64) -> b1 {
ss0 = explicit_slot 16
block0(v0: i64,v1: i64):
v2 = iconcat v0, v1
v3 = stack_addr.i64 ss0
store.i128 v2, v3
v4 = load.i128 v3
v5 = icmp.i128 eq v2, v4
return v5
}
; run: %i128_store_load(0, 0) == true
; run: %i128_store_load(-1, -1) == true
; run: %i128_store_load(-1, 0) == true
; run: %i128_store_load(0, -1) == true
; run: %i128_store_load(0x01234567_89ABCDEF, 0xFEDCBA98_76543210) == true
; run: %i128_store_load(0x06060606_06060606, 0xA00A00A0_0A00A00A) == true
; run: %i128_store_load(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == true
function %i128_store_load_offset(i64, i64) -> b1 {
ss0 = explicit_slot 32
block0(v0: i64,v1: i64):
v2 = iconcat v0, v1
v3 = stack_addr.i64 ss0
store.i128 v2, v3+16
v4 = load.i128 v3+16
v5 = icmp.i128 eq v2, v4
return v5
}
; run: %i128_store_load_offset(0, 0) == true
; run: %i128_store_load_offset(-1, -1) == true
; run: %i128_store_load_offset(-1, 0) == true
; run: %i128_store_load_offset(0, -1) == true
; run: %i128_store_load_offset(0x01234567_89ABCDEF, 0xFEDCBA98_76543210) == true
; run: %i128_store_load_offset(0x06060606_06060606, 0xA00A00A0_0A00A00A) == true
; run: %i128_store_load_offset(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == true