Afonso Bordado
2 years ago
committed by
GitHub
3 changed files with 64 additions and 2 deletions
@ -1,3 +1,4 @@ |
|||
test interpret |
|||
test run |
|||
set enable_llvm_abi_extensions=true |
|||
target aarch64 |
@ -0,0 +1,58 @@ |
|||
test interpret |
|||
test run |
|||
target aarch64 |
|||
target x86_64 |
|||
|
|||
function %ireduce_i16_i8(i16) -> i8 { |
|||
block0(v0: i16): |
|||
v1 = ireduce.i8 v0 |
|||
return v1 |
|||
} |
|||
; run: %ireduce_i16_i8(0xFF00) == 0x00 |
|||
; run: %ireduce_i16_i8(0x0042) == 0x42 |
|||
; run: %ireduce_i16_i8(0xFFFF) == 0xFF |
|||
|
|||
function %ireduce_i32_i8(i32) -> i8 { |
|||
block0(v0: i32): |
|||
v1 = ireduce.i8 v0 |
|||
return v1 |
|||
} |
|||
; run: %ireduce_i32_i8(0xFFFFFF00) == 0x00 |
|||
; run: %ireduce_i32_i8(0x00000042) == 0x42 |
|||
; run: %ireduce_i32_i8(0xFFFFFFFF) == 0xFF |
|||
|
|||
function %ireduce_i32_i16(i32) -> i16 { |
|||
block0(v0: i32): |
|||
v1 = ireduce.i16 v0 |
|||
return v1 |
|||
} |
|||
; run: %ireduce_i32_i16(0xFFFF0000) == 0x0000 |
|||
; run: %ireduce_i32_i16(0x00004242) == 0x4242 |
|||
; run: %ireduce_i32_i16(0xFFFFFFFF) == 0xFFFF |
|||
|
|||
function %ireduce_i64_i8(i64) -> i8 { |
|||
block0(v0: i64): |
|||
v1 = ireduce.i8 v0 |
|||
return v1 |
|||
} |
|||
; run: %ireduce_i64_i8(0xFFFFFFFF_FFFFFF00) == 0x00 |
|||
; run: %ireduce_i64_i8(0x00000000_00000042) == 0x42 |
|||
; run: %ireduce_i64_i8(0xFFFFFFFF_FFFFFFFF) == 0xFF |
|||
|
|||
function %ireduce_i64_i16(i64) -> i16 { |
|||
block0(v0: i64): |
|||
v1 = ireduce.i16 v0 |
|||
return v1 |
|||
} |
|||
; run: %ireduce_i64_i16(0xFFFFFFFF_FFFF0000) == 0x0000 |
|||
; run: %ireduce_i64_i16(0x00000000_00004242) == 0x4242 |
|||
; run: %ireduce_i64_i16(0xFFFFFFFF_FFFFFFFF) == 0xFFFF |
|||
|
|||
function %ireduce_i64_i32(i64) -> i32 { |
|||
block0(v0: i64): |
|||
v1 = ireduce.i32 v0 |
|||
return v1 |
|||
} |
|||
; run: %ireduce_i64_i32(0xFFFFFFFF_00000000) == 0x00000000 |
|||
; run: %ireduce_i64_i32(0x00000000_42424242) == 0x42424242 |
|||
; run: %ireduce_i64_i32(0xFFFFFFFF_FFFFFFFF) == 0xFFFFFFFF |
Loading…
Reference in new issue