-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cranelift: Fix
icmp_imm
for small types in interpreter
- Loading branch information
Showing
11 changed files
with
87 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
test interpret | ||
test run | ||
target aarch64 | ||
target x86_64 | ||
target s390x | ||
|
||
function %icmp_imm_eq_i8(i8) -> b1 { | ||
block0(v0: i8): | ||
v1 = icmp_imm eq v0, 0x44 | ||
return v1 | ||
} | ||
; run: %icmp_imm_eq_i8(0) == false | ||
; run: %icmp_imm_eq_i8(-1) == false | ||
; run: %icmp_imm_eq_i8(0x44) == true | ||
|
||
function %icmp_neg_eq_i8(i8) -> b1 { | ||
block0(v0: i8): | ||
v1 = icmp_imm eq v0, 0xf4 | ||
return v1 | ||
} | ||
; run: %icmp_neg_eq_i8(0) == false | ||
; run: %icmp_neg_eq_i8(-1) == false | ||
; run: %icmp_neg_eq_i8(0xf4) == true | ||
|
||
function %icmp_imm_eq_i16(i16) -> b1 { | ||
block0(v0: i16): | ||
v1 = icmp_imm eq v0, 0x4444 | ||
return v1 | ||
} | ||
; run: %icmp_imm_eq_i16(0) == false | ||
; run: %icmp_imm_eq_i16(-1) == false | ||
; run: %icmp_imm_eq_i16(0x4444) == true | ||
|
||
function %icmp_neg_eq_i16(i16) -> b1 { | ||
block0(v0: i16): | ||
v1 = icmp_imm eq v0, 0xff44 | ||
return v1 | ||
} | ||
; run: %icmp_neg_eq_i16(0) == false | ||
; run: %icmp_neg_eq_i16(-1) == false | ||
; run: %icmp_neg_eq_i16(0xff44) == true | ||
|
||
function %icmp_imm_eq_i32(i32) -> b1 { | ||
block0(v0: i32): | ||
v1 = icmp_imm eq v0, 0x4444_4444 | ||
return v1 | ||
} | ||
; run: %icmp_imm_eq_i32(0) == false | ||
; run: %icmp_imm_eq_i32(-1) == false | ||
; run: %icmp_imm_eq_i32(0x4444_4444) == true | ||
|
||
function %icmp_neg_eq_i32(i32) -> b1 { | ||
block0(v0: i32): | ||
v1 = icmp_imm eq v0, 0xffff_4444 | ||
return v1 | ||
} | ||
; run: %icmp_neg_eq_i32(0) == false | ||
; run: %icmp_neg_eq_i32(-1) == false | ||
; run: %icmp_neg_eq_i32(0xffff_4444) == true | ||
|
||
function %icmp_imm_eq_i64(i64) -> b1 { | ||
block0(v0: i64): | ||
v1 = icmp_imm eq v0, 0x4444_4444_4444_4444 | ||
return v1 | ||
} | ||
; run: %icmp_imm_eq_i64(0) == false | ||
; run: %icmp_imm_eq_i64(-1) == false | ||
; run: %icmp_imm_eq_i64(0x4444_4444_4444_4444) == true | ||
|
||
function %icmp_neg_eq_i64(i64) -> b1 { | ||
block0(v0: i64): | ||
v1 = icmp_imm eq v0, 0xffff_ffff_4444_4444 | ||
return v1 | ||
} | ||
; run: %icmp_neg_eq_i64(0) == false | ||
; run: %icmp_neg_eq_i64(-1) == false | ||
; run: %icmp_neg_eq_i64(0xffff_ffff_4444_4444) == true |
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
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
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
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
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