Commit 9ae6cfd7 by Nicolas Capens Committed by Nicolas Capens

Fix remaining LLVM integer vector comparisons.

Change-Id: I35cd9c9e4510529a324f6bd3dfd91e56b834cbca Reviewed-on: https://swiftshader-review.googlesource.com/14268Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 823c1c10
......@@ -4786,7 +4786,10 @@ namespace sw
RValue<Int4> CmpLT(RValue<Int4> x, RValue<Int4> y)
{
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLT(x.value, y.value), Int4::getType()));
// FIXME: An LLVM bug causes SExt(ICmpCC()) to produce 0 or 1 instead of 0 or ~0
// Restore the following line when LLVM is updated to a version where this issue is fixed.
// return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLT(x.value, y.value), Int4::getType()));
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGE(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
}
RValue<Int4> CmpLE(RValue<Int4> x, RValue<Int4> y)
......@@ -4799,7 +4802,10 @@ namespace sw
RValue<Int4> CmpNEQ(RValue<Int4> x, RValue<Int4> y)
{
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType()));
// FIXME: An LLVM bug causes SExt(ICmpCC()) to produce 0 or 1 instead of 0 or ~0
// Restore the following line when LLVM is updated to a version where this issue is fixed.
// return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpNE(x.value, y.value), Int4::getType()));
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpEQ(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
}
RValue<Int4> CmpNLT(RValue<Int4> x, RValue<Int4> y)
......@@ -4812,7 +4818,10 @@ namespace sw
RValue<Int4> CmpNLE(RValue<Int4> x, RValue<Int4> y)
{
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGT(x.value, y.value), Int4::getType()));
// FIXME: An LLVM bug causes SExt(ICmpCC()) to produce 0 or 1 instead of 0 or ~0
// Restore the following line when LLVM is updated to a version where this issue is fixed.
// return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSGT(x.value, y.value), Int4::getType()));
return RValue<Int4>(Nucleus::createSExt(Nucleus::createICmpSLE(x.value, y.value), Int4::getType())) ^ Int4(0xFFFFFFFF);
}
RValue<Int4> Max(RValue<Int4> x, RValue<Int4> 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