cranelift: Remove of/nof overflow flags from icmp (#4879)

* cranelift: Remove of/nof overflow flags from icmp

Neither Wasmtime nor cg-clif use these flags under any circumstances.
From discussion on #3060 I see it's long been unclear what purpose these
flags served.

Fixes #3060, fixes #4406, and fixes #4875... by deleting all the code
that could have been buggy.

This changes the cranelift-fuzzgen input format by removing some IntCC
options, so I've gone ahead and enabled I128 icmp tests at the same
time. Since only the of/nof cases were failing before, I expect these to
work.

* Restore trapif tests

It's still useful to validate that iadd_ifcout's iflags result can be
forwarded correctly to trapif, and for that purpose it doesn't really
matter what condition code is checked.
This commit is contained in:
Jamey Sharp
2022-09-07 08:38:41 -07:00
committed by GitHub
parent cd982c5a3f
commit 3d6d49daba
22 changed files with 8 additions and 788 deletions

View File

@@ -149,36 +149,6 @@ block0(v0: i128, v1: i128):
; csel x0, x11, x14, eq
; ret
function %icmp_of_i128(i128, i128) -> b1 {
block0(v0: i128, v1: i128):
v2 = icmp of v0, v1
return v2
}
; block0:
; subs xzr, x0, x2
; sbcs x11, x1, x3
; eor x13, x1, x3
; eor x11, x1, x11
; ands xzr, x13, x11
; cset x0, lt
; ret
function %icmp_nof_i128(i128, i128) -> b1 {
block0(v0: i128, v1: i128):
v2 = icmp nof v0, v1
return v2
}
; block0:
; subs xzr, x0, x2
; sbcs x11, x1, x3
; eor x13, x1, x3
; eor x11, x1, x11
; ands xzr, x13, x11
; cset x0, ge
; ret
function %f(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
v2 = ifcmp v0, v1
@@ -502,49 +472,3 @@ block1:
; block3:
; ret
function %i128_bricmp_of(i128, i128) {
block0(v0: i128, v1: i128):
br_icmp of v0, v1, block1
jump block1
block1:
return
}
; block0:
; subs xzr, x0, x2
; sbcs x9, x1, x3
; eor x11, x1, x3
; eor x9, x1, x9
; ands xzr, x11, x9
; b.lt label1 ; b label2
; block1:
; b label3
; block2:
; b label3
; block3:
; ret
function %i128_bricmp_nof(i128, i128) {
block0(v0: i128, v1: i128):
br_icmp nof v0, v1, block1
jump block1
block1:
return
}
; block0:
; subs xzr, x0, x2
; sbcs x9, x1, x3
; eor x11, x1, x3
; eor x9, x1, x9
; ands xzr, x11, x9
; b.ge label1 ; b label2
; block1:
; b label3
; block2:
; b label3
; block3:
; ret

View File

@@ -12,11 +12,11 @@ block0:
function %trap_iadd_ifcout(i64, i64) {
block0(v0: i64, v1: i64):
v2, v3 = iadd_ifcout v0, v1
trapif of v3, user0
trapif ult v3, user0
return
}
; block0:
; b.vc 8 ; udf
; b.hs 8 ; udf
; ret

View File

@@ -15,7 +15,7 @@ block0:
function %trap_iadd_ifcout(i64, i64) {
block0(v0: i64, v1: i64):
v2, v3 = iadd_ifcout v0, v1
trapif of v3, user0
trapif ult v3, user0
return
}
@@ -23,7 +23,7 @@ block0(v0: i64, v1: i64):
; movq %rsp, %rbp
; block0:
; addq %rdi, %rsi, %rdi
; jno ; ud2 user0 ;
; jnb ; ud2 user0 ;
; movq %rbp, %rsp
; popq %rbp
; ret