Commit 0e712410 by Chris Forbes

Add support for OpUndef

Treat OpUndef identically to OpConstantNull for now. Change-Id: I721f2bf5e053d6a8d6f563272b1d44b6636a157c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27529Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent 7cdf79cc
......@@ -215,7 +215,9 @@ namespace sw
CreateConstant(insn).constantValue[0] = ~0u; // represent boolean true as all bits set
break;
case spv::OpConstantNull:
case spv::OpUndef:
{
// TODO: consider a real LLVM-level undef. For now, zero is a perfectly good value.
// OpConstantNull forms a constant of arbitrary type, all zeros.
auto &object = CreateConstant(insn);
auto &objectTy = getType(object.type);
......@@ -1062,6 +1064,7 @@ namespace sw
case spv::OpConstantTrue:
case spv::OpConstantFalse:
case spv::OpConstantComposite:
case spv::OpUndef:
case spv::OpExtension:
case spv::OpCapability:
case spv::OpEntryPoint:
......
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