-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3008 from afonso360/aarch64-i128-ireduce
aarch64: Implement ireduce for i128 values
- Loading branch information
Showing
3 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
test compile | ||
set unwind_info=false | ||
target aarch64 | ||
|
||
function %ireduce_128_64(i128) -> i64 { | ||
block0(v0: i128): | ||
v1 = ireduce.i64 v0 | ||
return v1 | ||
} | ||
; check: stp fp, lr, [sp, #-16]! | ||
; nextln: mov fp, sp | ||
; nextln: ldp fp, lr, [sp], #16 | ||
; nextln: ret | ||
|
||
function %ireduce_128_32(i128) -> i32 { | ||
block0(v0: i128): | ||
v1 = ireduce.i32 v0 | ||
return v1 | ||
} | ||
; check: stp fp, lr, [sp, #-16]! | ||
; nextln: mov fp, sp | ||
; nextln: ldp fp, lr, [sp], #16 | ||
; nextln: ret | ||
|
||
function %ireduce_128_16(i128) -> i16 { | ||
block0(v0: i128): | ||
v1 = ireduce.i16 v0 | ||
return v1 | ||
} | ||
; check: stp fp, lr, [sp, #-16]! | ||
; nextln: mov fp, sp | ||
; nextln: ldp fp, lr, [sp], #16 | ||
; nextln: ret | ||
|
||
function %ireduce_128_8(i128) -> i8 { | ||
block0(v0: i128): | ||
v1 = ireduce.i8 v0 | ||
return v1 | ||
} | ||
; check: stp fp, lr, [sp, #-16]! | ||
; nextln: mov fp, sp | ||
; nextln: ldp fp, lr, [sp], #16 | ||
; nextln: ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
test run | ||
target aarch64 | ||
target x86_64 machinst | ||
|
||
function %ireduce_128_64(i64, i64) -> i64 { | ||
block0(v0: i64, v1: i64): | ||
v2 = iconcat v0, v1 | ||
v3 = ireduce.i64 v2 | ||
return v3 | ||
} | ||
; run: %ireduce_128_64(0, 0) == 0 | ||
; run: %ireduce_128_64(-1, -1) == -1 | ||
; run: %ireduce_128_64(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == 0xC0FFEEEE_DECAFFFF | ||
|
||
function %ireduce_128_32(i64, i64) -> i32 { | ||
block0(v0: i64, v1: i64): | ||
v2 = iconcat v0, v1 | ||
v3 = ireduce.i32 v2 | ||
return v3 | ||
} | ||
; run: %ireduce_128_32(0, 0) == 0 | ||
; run: %ireduce_128_32(-1, -1) == -1 | ||
; run: %ireduce_128_32(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == 0xDECAFFFF | ||
|
||
function %ireduce_128_16(i64, i64) -> i16 { | ||
block0(v0: i64, v1: i64): | ||
v2 = iconcat v0, v1 | ||
v3 = ireduce.i16 v2 | ||
return v3 | ||
} | ||
; run: %ireduce_128_16(0, 0) == 0 | ||
; run: %ireduce_128_16(-1, -1) == -1 | ||
; run: %ireduce_128_16(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == 0xFFFF | ||
|
||
function %ireduce_128_8(i64, i64) -> i8 { | ||
block0(v0: i64, v1: i64): | ||
v2 = iconcat v0, v1 | ||
v3 = ireduce.i8 v2 | ||
return v3 | ||
} | ||
; run: %ireduce_128_8(0, 0) == 0 | ||
; run: %ireduce_128_8(-1, -1) == -1 | ||
; run: %ireduce_128_8(0xC0FFEEEE_DECAFFFF, 0xDECAFFFF_C0FFEEEE) == 0xFF |