Add GLSL std450 extended instruction 72-80.
authorLei Zhang <antiagainst@google.com>
Thu, 27 Aug 2015 18:20:19 +0000 (14:20 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:52:01 +0000 (12:52 -0400)
source/ext_inst.cpp
test/ExtInstGLSLstd450.cpp

index 717b3b0..ca2a197 100644 (file)
@@ -93,7 +93,19 @@ static const spv_ext_inst_desc_t glslStd450Entries[] = {
     // clang-format on
     {GLSL450Inst2(Reflect)},
     {GLSL450Inst3(Refract)},
-    // TODO: Add remaining GLSL.std.450 instructions
+    // clang-format off
+    {"FindILsb", GLSLstd450::GLSLstd450FindILSB, {SPV_OPERAND_TYPE_ID}},
+    {"FindSMsb", GLSLstd450::GLSLstd450FindSMSB, {SPV_OPERAND_TYPE_ID}},
+    {"FindUMsb", GLSLstd450::GLSLstd450FindUMSB, {SPV_OPERAND_TYPE_ID}},
+    // clang-format on
+    {GLSL450Inst1(InterpolateAtCentroid)},
+    {GLSL450Inst2(InterpolateAtSample)},
+    {GLSL450Inst2(InterpolateAtOffset)},
+    // clang-format off
+    {"UaddCarry", GLSLstd450::GLSLstd450AddCarry, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}},
+    {"UsubBorrow", GLSLstd450::GLSLstd450SubBorrow, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}},
+    {"UmulExtended", GLSLstd450::GLSLstd450MulExtended, { SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}},
+    // clang-format on
 };
 
 static const spv_ext_inst_desc_t openclStd12Entries[] = {
index 574ff6c..31cb4f6 100644 (file)
@@ -208,4 +208,17 @@ INSTANTIATE_TEST_CASE_P(
         // clang-format on
         {kF32Type, kF32Const, "%4", "Reflect", "%5 %5", 70, 7, {5, 5}},
         {kF32Type, kF32Const, "%4", "Refract", "%5 %5 %5", 71, 8, {5, 5, 5}},
+        {kS32Type, kI32Const, "%4", "FindILsb", "%5", 72, 6, {5}},
+        {kS32Type, kI32Const, "%4", "FindSMsb", "%5", 73, 6, {5}},
+        {kU32Type, kI32Const, "%4", "FindUMsb", "%5", 74, 6, {5}},
+        {kF32Type, kF32Const, "%4", "InterpolateAtCentroid", "%5", 75, 6, {5}},
+        // clang-format off
+        {kF32Type, kF32Const, "%4", "InterpolateAtSample", "%5 %5", 76, 7, {5, 5}},
+        {kF32Type, kF32Const, "%4", "InterpolateAtOffset", "%5 %5", 77, 7, {5, 5}},
+        // clang-format on
+        {kU32Type, kI32Const, "%4", "UaddCarry", "%5 %5 %5", 78, 8, {5, 5, 5}},
+        {kU32Type, kI32Const, "%4", "UsubBorrow", "%5 %5 %5", 79, 8, {5, 5, 5}},
+        // clang-format off
+        {kU32Type, kI32Const, "%4", "UmulExtended", "%5 %5 %5 %5", 80, 9, {5, 5, 5, 5}},
+        // clang-format on
     })));