Skip to content

Commit

Permalink
Add support for OpIsInf, OpIsNan
Browse files Browse the repository at this point in the history
Bug: b/126873455
Change-Id: I5cac6eedf2d17bed6f01275e6d80cf8227886a8e
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26468
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
  • Loading branch information
chrisforbes committed Mar 8, 2019
1 parent b124373 commit 3ed33ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Pipeline/SpirvShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ namespace sw
case spv::OpBitcast:
case spv::OpSelect:
case spv::OpExtInst:
case spv::OpIsInf:
case spv::OpIsNan:
// Instructions that yield an intermediate value
{
TypeID typeId = insn.word(1);
Expand Down Expand Up @@ -1003,6 +1005,8 @@ namespace sw
case spv::OpConvertSToF:
case spv::OpConvertUToF:
case spv::OpBitcast:
case spv::OpIsInf:
case spv::OpIsNan:
EmitUnaryOp(insn, routine);
break;

Expand Down Expand Up @@ -1418,6 +1422,12 @@ namespace sw
case spv::OpBitcast:
dst.emplace(i, val);
break;
case spv::OpIsInf:
dst.emplace(i, As<SIMD::Float>(IsInf(val)));
break;
case spv::OpIsNan:
dst.emplace(i, As<SIMD::Float>(IsNan(val)));
break;
default:
UNIMPLEMENTED("Unhandled unary operator %s", OpcodeName(insn.opcode()).c_str());
}
Expand Down

0 comments on commit 3ed33ce

Please sign in to comment.