Skip to content

Commit 8397044

Browse files
authored
Merge pull request KhronosGroup#2260 from gnl21/not-equal
Use OpFUnordNotEqual for floating-point !=
2 parents adacba3 + 182ab46 commit 8397044

File tree

691 files changed

+793
-792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

691 files changed

+793
-792
lines changed

SPIRV/GlslangToSpv.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5616,7 +5616,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD
56165616
case glslang::EOpNotEqual:
56175617
case glslang::EOpVectorNotEqual:
56185618
if (isFloat)
5619-
binOp = spv::OpFOrdNotEqual;
5619+
binOp = spv::OpFUnordNotEqual;
56205620
else if (isBool)
56215621
binOp = spv::OpLogicalNotEqual;
56225622
else
@@ -6314,7 +6314,7 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
63146314
case glslang::EOpConvFloatToBool:
63156315
zero = builder.makeFloatConstant(0.0F);
63166316
zero = makeSmearedConstant(zero, vectorSize);
6317-
return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero);
6317+
return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
63186318
case glslang::EOpConvBoolToFloat:
63196319
convOp = spv::OpSelect;
63206320
zero = builder.makeFloatConstant(0.0F);
@@ -6463,11 +6463,11 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
64636463
case glslang::EOpConvDoubleToBool:
64646464
zero = builder.makeDoubleConstant(0.0);
64656465
zero = makeSmearedConstant(zero, vectorSize);
6466-
return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero);
6466+
return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
64676467
case glslang::EOpConvFloat16ToBool:
64686468
zero = builder.makeFloat16Constant(0.0F);
64696469
zero = makeSmearedConstant(zero, vectorSize);
6470-
return builder.createBinOp(spv::OpFOrdNotEqual, destType, operand, zero);
6470+
return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
64716471
case glslang::EOpConvBoolToDouble:
64726472
convOp = spv::OpSelect;
64736473
zero = builder.makeDoubleConstant(0.0);
@@ -8655,7 +8655,8 @@ int GetSpirvGeneratorVersion()
86558655
// versions 4 and 6 each generate OpArrayLength as it has long been done
86568656
// return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
86578657
// return 8; // switch to new dead block eliminator; use OpUnreachable
8658-
return 9; // don't include opaque function parameters in OpEntryPoint global's operand list
8658+
// return 9; // don't include opaque function parameters in OpEntryPoint global's operand list
8659+
return 10; // Generate OpFUnordNotEqual for != comparisons
86598660
}
86608661

86618662
// Write SPIR-V out to a binary file

SPIRV/SpvBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b
21662166
Op op;
21672167
switch (getMostBasicTypeClass(valueType)) {
21682168
case OpTypeFloat:
2169-
op = equal ? OpFOrdEqual : OpFOrdNotEqual;
2169+
op = equal ? OpFOrdEqual : OpFUnordNotEqual;
21702170
break;
21712171
case OpTypeInt:
21722172
default:

Test/baseLegalResults/hlsl.aliasOpaque.frag.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.aliasOpaque.frag
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 89
55

66
Capability Shader

Test/baseLegalResults/hlsl.flattenOpaque.frag.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.flattenOpaque.frag
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 190
55

66
Capability Shader

Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.flattenOpaqueInit.vert
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 139
55

66
Capability Shader

Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.flattenOpaqueInitMix.vert
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 99
55

66
Capability Shader

Test/baseLegalResults/hlsl.flattenSubset.frag.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.flattenSubset.frag
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 67
55

66
Capability Shader

Test/baseLegalResults/hlsl.flattenSubset2.frag.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.flattenSubset2.frag
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 53
55

66
Capability Shader

Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.partialFlattenLocal.vert
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 159
55

66
Capability Shader

Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hlsl.partialFlattenMixed.vert
22
// Module Version 10000
3-
// Generated by (magic number): 80009
3+
// Generated by (magic number): 8000a
44
// Id's are bound by 36
55

66
Capability Shader

0 commit comments

Comments
 (0)