Commit fb603997 by Alexis Hetu Committed by Alexis Hétu

Struct equality comparison fixed

There's an LLVM bug currently that prevents us from using ICMP_EQ, but ICMP_NE works fine, so the "equality" test has been changed to "!inequality" to fix the issue. The fix should be reverted once LLVM is updated to a version where the ICMP_EQ issue is fixed. Change-Id: I79d6ca99554317cc64ffa2905ae2804bd4805e2a Reviewed-on: https://swiftshader-review.googlesource.com/5193Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent f7ae61e1
...@@ -5522,7 +5522,10 @@ namespace sw ...@@ -5522,7 +5522,10 @@ namespace sw
RValue<Int4> CmpEQ(RValue<Int4> x, RValue<Int4> y) RValue<Int4> CmpEQ(RValue<Int4> x, RValue<Int4> y)
{ {
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType())); // FIXME: An LLVM bug prevents us from using createICmpEQ currently.
// Restore the following line when LLVM is updated to a version where this issue is fixed.
// return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType()));
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
} }
RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y) RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y)
...@@ -5867,7 +5870,10 @@ namespace sw ...@@ -5867,7 +5870,10 @@ namespace sw
RValue<UInt4> CmpEQ(RValue<UInt4> x, RValue<UInt4> y) RValue<UInt4> CmpEQ(RValue<UInt4> x, RValue<UInt4> y)
{ {
return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType())); // FIXME: An LLVM bug prevents us from using createICmpEQ currently.
// Restore the following line when LLVM is updated to a version where this issue is fixed.
// return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType()));
return RValue<UInt4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType())) ^ UInt4(0xFFFFFFFF);
} }
RValue<UInt4> CmpLT(RValue<UInt4> x, RValue<UInt4> y) RValue<UInt4> CmpLT(RValue<UInt4> x, RValue<UInt4> y)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment