external/swiftshader
Revision | 0e712410582f85d3388c939b6c0da6b3e1d761f0 (tree) |
---|---|
Time | 2019-03-19 23:38:30 |
Author | Chris Forbes <chrisforbes@goog...> |
Commiter | 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/+/27529
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
@@ -215,7 +215,9 @@ namespace sw | ||
215 | 215 | CreateConstant(insn).constantValue[0] = ~0u; // represent boolean true as all bits set |
216 | 216 | break; |
217 | 217 | case spv::OpConstantNull: |
218 | + case spv::OpUndef: | |
218 | 219 | { |
220 | + // TODO: consider a real LLVM-level undef. For now, zero is a perfectly good value. | |
219 | 221 | // OpConstantNull forms a constant of arbitrary type, all zeros. |
220 | 222 | auto &object = CreateConstant(insn); |
221 | 223 | auto &objectTy = getType(object.type); |
@@ -1062,6 +1064,7 @@ namespace sw | ||
1062 | 1064 | case spv::OpConstantTrue: |
1063 | 1065 | case spv::OpConstantFalse: |
1064 | 1066 | case spv::OpConstantComposite: |
1067 | + case spv::OpUndef: | |
1065 | 1068 | case spv::OpExtension: |
1066 | 1069 | case spv::OpCapability: |
1067 | 1070 | case spv::OpEntryPoint: |