Przeglądaj źródła

Revert "Change WaveAllBitCount and WavePrefixBitCount into same OpClass WaveBitCount." (#412)

This reverts commit 65a3367a0382d6125871e3339bd38fee8a33ec81.
Xiang Li 8 lat temu
rodzic
commit
36defff0b9

+ 1 - 1
include/dxc/HLSL/DxilConstants.h

@@ -598,9 +598,9 @@ namespace DXIL {
     WaveActiveBallot,
     WaveActiveBit,
     WaveActiveOp,
+    WaveAllOp,
     WaveAllTrue,
     WaveAnyTrue,
-    WaveBitCount,
     WaveGetLaneCount,
     WaveGetLaneIndex,
     WaveIsFirstLane,

+ 2 - 2
lib/HLSL/DxilOperations.cpp

@@ -236,8 +236,8 @@ const OP::OpCodeProperty OP::m_OpCodeProps[(unsigned)OP::OpCode::NumOpCodes] = {
   {  OC::LegacyDoubleToUInt32,    "LegacyDoubleToUInt32",     OCC::LegacyDoubleToUInt32,     "legacyDoubleToUInt32",        true, false, false, false, false, false, false, false, false, Attribute::ReadNone, },
 
   // Wave                                                                                                                   void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64  function attribute
-  {  OC::WaveAllBitCount,         "WaveAllBitCount",          OCC::WaveBitCount,             "waveBitCount",                true, false, false, false, false, false, false, false, false, Attribute::None,     },
-  {  OC::WavePrefixBitCount,      "WavePrefixBitCount",       OCC::WaveBitCount,             "waveBitCount",                true, false, false, false, false, false, false, false, false, Attribute::None,     },
+  {  OC::WaveAllBitCount,         "WaveAllBitCount",          OCC::WaveAllOp,                "waveAllOp",                   true, false, false, false, false, false, false, false, false, Attribute::None,     },
+  {  OC::WavePrefixBitCount,      "WavePrefixBitCount",       OCC::WavePrefixOp,             "wavePrefixOp",                true, false, false, false, false, false, false, false, false, Attribute::None,     },
 
   // Pixel shader                                                                                                           void,     h,     f,     d,    i1,    i8,   i16,   i32,   i64  function attribute
   {  OC::AttributeAtVertex,       "AttributeAtVertex",        OCC::AttributeAtVertex,        "attributeAtVertex",          false,  true,  true, false, false, false, false, false, false, Attribute::ReadNone, },

+ 0 - 16
tools/clang/test/CodeGenHLSL/OpClass.hlsl

@@ -1,16 +0,0 @@
-// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
-
-// Make sure WavePrefixSum and WavePrefixCountBits use different function.
-// CHECK: dx.op.wavePrefixOp.i64(i32 121
-// CHECK: dx.op.waveBitCount(i32 135
-// CHECK: dx.op.waveBitCount(i32 136
-
-float4 main() : SV_TARGET {
-  uint3 u3 = { 1, 2, 3 };
-  u3 += WavePrefixSum(3);
-
-  uint u = 0;
-  u += WaveActiveCountBits(1);
-  u += WavePrefixCountBits(1);
-  return u + u3.xyzx;
-}

+ 0 - 5
tools/clang/unittests/HLSL/CompilerTest.cpp

@@ -557,7 +557,6 @@ public:
   TEST_METHOD(CodeGenNegabs1)
   TEST_METHOD(CodeGenNoise)
   TEST_METHOD(CodeGenNonUniform)
-  TEST_METHOD(CodeGenOpClass)
   TEST_METHOD(CodeGenOptForNoOpt)
   TEST_METHOD(CodeGenOptForNoOpt2)
   TEST_METHOD(CodeGenOptionGis)
@@ -2982,10 +2981,6 @@ TEST_F(CompilerTest, CodeGenNonUniform) {
   CodeGenTestCheck(L"..\\CodeGenHLSL\\NonUniform.hlsl");
 }
 
-TEST_F(CompilerTest, CodeGenOpClass) {
-  CodeGenTestCheck(L"..\\CodeGenHLSL\\OpClass.hlsl");
-}
-
 TEST_F(CompilerTest, CodeGenOptForNoOpt) {
   CodeGenTestCheck(L"..\\CodeGenHLSL\\optForNoOpt.hlsl");
 }

+ 2 - 2
utils/hct/hctdb.py

@@ -1041,11 +1041,11 @@ class db_dxil(object):
             db_dxil_param(2, "d", "value", "double value to convert")])
         next_op_idx += 1
 
-        self.add_dxil_op("WaveAllBitCount", next_op_idx, "WaveBitCount", "returns the count of bits set to 1 across the wave", "v", "", [
+        self.add_dxil_op("WaveAllBitCount", next_op_idx, "WaveAllOp", "returns the count of bits set to 1 across the wave", "v", "", [
             db_dxil_param(0, "i32", "", "operation result"),
             db_dxil_param(2, "i1", "value", "input value")])
         next_op_idx += 1
-        self.add_dxil_op("WavePrefixBitCount", next_op_idx, "WaveBitCount", "returns the count of bits set to 1 on prior lanes", "v", "", [
+        self.add_dxil_op("WavePrefixBitCount", next_op_idx, "WavePrefixOp", "returns the count of bits set to 1 on prior lanes", "v", "", [
             db_dxil_param(0, "i32", "", "operation result"),
             db_dxil_param(2, "i1", "value", "input value")])
         next_op_idx += 1