Fix legalization of icmp ugt (#1278)

Previously, the same pattern (pmax + pcmpeq) as `uge` was used but this logic was incorrect for operands with equal values.
This commit is contained in:
Andrew Brown
2019-12-16 13:14:51 -08:00
committed by Sean Stangl
parent 6181f20326
commit 4433ad2858
3 changed files with 25 additions and 5 deletions

View File

@@ -15,7 +15,9 @@ function %icmp_ugt_i32x4(i32x4, i32x4) -> b32x4 {
ebb0(v0: i32x4, v1: i32x4):
v2 = icmp ugt v0, v1
; check: v3 = x86_pmaxu v0, v1
; nextln: v2 = icmp eq v0, v3
; nextln: v4 = icmp eq v3, v1
; nextln: v5 = vconst.b32x4 0xffffffffffffffffffffffffffffffff
; nextln: v2 = bxor v5, v4
return v2
}

View File

@@ -158,6 +158,20 @@ ebb0:
}
; run
function %icmp_ult_i16x8() -> b1 {
ebb0:
v0 = vconst.i16x8 [-1 -1 -1 -1 -1 -1 -1 -1]
v1 = vconst.i16x8 [-1 -1 -1 -1 -1 -1 -1 -1]
v2 = icmp ult v0, v1
v3 = vconst.i16x8 0x00
v4 = raw_bitcast.i16x8 v2
v5 = icmp eq v3, v4
v8 = vall_true v5
return v8
}
; run
function %icmp_sle_i16x8() -> b1 {
ebb0:
v0 = vconst.i16x8 [-1 -1 0 0 0 0 0 0]