mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 03:41:34 +00:00
[spirv-reader] Add ordered float inequalities
Bug: tint:3 Change-Id: I302001a7d368cb09068df1220e81885a813fa247 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/20246 Reviewed-by: dan sinclair <dsinclair@google.com>
This commit is contained in:
parent
ce84ac5023
commit
a82384ee97
@ -111,15 +111,19 @@ ast::BinaryOp ConvertBinaryOp(SpvOp opcode) {
|
|||||||
return ast::BinaryOp::kLogicalOr;
|
return ast::BinaryOp::kLogicalOr;
|
||||||
case SpvOpUGreaterThan:
|
case SpvOpUGreaterThan:
|
||||||
case SpvOpSGreaterThan:
|
case SpvOpSGreaterThan:
|
||||||
|
case SpvOpFOrdGreaterThan:
|
||||||
return ast::BinaryOp::kGreaterThan;
|
return ast::BinaryOp::kGreaterThan;
|
||||||
case SpvOpUGreaterThanEqual:
|
case SpvOpUGreaterThanEqual:
|
||||||
case SpvOpSGreaterThanEqual:
|
case SpvOpSGreaterThanEqual:
|
||||||
|
case SpvOpFOrdGreaterThanEqual:
|
||||||
return ast::BinaryOp::kGreaterThanEqual;
|
return ast::BinaryOp::kGreaterThanEqual;
|
||||||
case SpvOpULessThan:
|
case SpvOpULessThan:
|
||||||
case SpvOpSLessThan:
|
case SpvOpSLessThan:
|
||||||
|
case SpvOpFOrdLessThan:
|
||||||
return ast::BinaryOp::kLessThan;
|
return ast::BinaryOp::kLessThan;
|
||||||
case SpvOpULessThanEqual:
|
case SpvOpULessThanEqual:
|
||||||
case SpvOpSLessThanEqual:
|
case SpvOpSLessThanEqual:
|
||||||
|
case SpvOpFOrdLessThanEqual:
|
||||||
return ast::BinaryOp::kLessThanEqual;
|
return ast::BinaryOp::kLessThanEqual;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -362,6 +362,52 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
AstFor("v2float_50_60"), "not_equal",
|
AstFor("v2float_50_60"), "not_equal",
|
||||||
AstFor("v2float_60_50")}));
|
AstFor("v2float_60_50")}));
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
SpvParserTest_FOrdLessThan,
|
||||||
|
SpvBinaryLogicalTest,
|
||||||
|
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdLessThan",
|
||||||
|
"float_60", "__bool",
|
||||||
|
"ScalarConstructor{50.000000}", "less_than",
|
||||||
|
"ScalarConstructor{60.000000}"},
|
||||||
|
BinaryData{"v2bool", "v2float_50_60", "OpFOrdLessThan",
|
||||||
|
"v2float_60_50", "__vec_2__bool",
|
||||||
|
AstFor("v2float_50_60"), "less_than",
|
||||||
|
AstFor("v2float_60_50")}));
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
SpvParserTest_FOrdLessThanEqual,
|
||||||
|
SpvBinaryLogicalTest,
|
||||||
|
::testing::Values(
|
||||||
|
BinaryData{"bool", "float_50", "OpFOrdLessThanEqual", "float_60",
|
||||||
|
"__bool", "ScalarConstructor{50.000000}", "less_than_equal",
|
||||||
|
"ScalarConstructor{60.000000}"},
|
||||||
|
BinaryData{"v2bool", "v2float_50_60", "OpFOrdLessThanEqual",
|
||||||
|
"v2float_60_50", "__vec_2__bool", AstFor("v2float_50_60"),
|
||||||
|
"less_than_equal", AstFor("v2float_60_50")}));
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
SpvParserTest_FOrdGreaterThan,
|
||||||
|
SpvBinaryLogicalTest,
|
||||||
|
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdGreaterThan",
|
||||||
|
"float_60", "__bool",
|
||||||
|
"ScalarConstructor{50.000000}", "greater_than",
|
||||||
|
"ScalarConstructor{60.000000}"},
|
||||||
|
BinaryData{"v2bool", "v2float_50_60", "OpFOrdGreaterThan",
|
||||||
|
"v2float_60_50", "__vec_2__bool",
|
||||||
|
AstFor("v2float_50_60"), "greater_than",
|
||||||
|
AstFor("v2float_60_50")}));
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
SpvParserTest_FOrdGreaterThanEqual,
|
||||||
|
SpvBinaryLogicalTest,
|
||||||
|
::testing::Values(
|
||||||
|
BinaryData{"bool", "float_50", "OpFOrdGreaterThanEqual", "float_60",
|
||||||
|
"__bool", "ScalarConstructor{50.000000}",
|
||||||
|
"greater_than_equal", "ScalarConstructor{60.000000}"},
|
||||||
|
BinaryData{"v2bool", "v2float_50_60", "OpFOrdGreaterThanEqual",
|
||||||
|
"v2float_60_50", "__vec_2__bool", AstFor("v2float_50_60"),
|
||||||
|
"greater_than_equal", AstFor("v2float_60_50")}));
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SpvParserTest_LogicalAnd,
|
SpvParserTest_LogicalAnd,
|
||||||
SpvBinaryLogicalTest,
|
SpvBinaryLogicalTest,
|
||||||
@ -642,16 +688,14 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
// TODO(dneto): OpIsInf - likely builtin function TBD
|
// TODO(dneto): OpIsInf - likely builtin function TBD
|
||||||
// TODO(dneto): Kernel-guarded instructions.
|
// TODO(dneto): Kernel-guarded instructions.
|
||||||
// TODO(dneto): OpSelect - likely builtin function TBD
|
// TODO(dneto): OpSelect - likely builtin function TBD
|
||||||
|
//
|
||||||
|
// Unordered float inequalities: blocked pending the resolution of
|
||||||
|
// https://github.com/gpuweb/gpuweb/issues/706
|
||||||
// TODO(dneto): OpFUnordEqual
|
// TODO(dneto): OpFUnordEqual
|
||||||
// TODO(dneto): OpFOrdNotEqual
|
|
||||||
// TODO(dneto): OpFUnordNotEqual
|
// TODO(dneto): OpFUnordNotEqual
|
||||||
// TODO(dneto): OpFOrdLessThan
|
|
||||||
// TODO(dneto): OpFUnordLessThan
|
// TODO(dneto): OpFUnordLessThan
|
||||||
// TODO(dneto): OpFOrdGreaterThan
|
|
||||||
// TODO(dneto): OpFUnordGreaterThan
|
// TODO(dneto): OpFUnordGreaterThan
|
||||||
// TODO(dneto): OpFOrdLessThanEqual
|
|
||||||
// TODO(dneto): OpFUnordLessThanEqual
|
// TODO(dneto): OpFUnordLessThanEqual
|
||||||
// TODO(dneto): OpFOrdGreaterThanEqual
|
|
||||||
// TODO(dneto): OpFUnordGreaterThanEqual
|
// TODO(dneto): OpFUnordGreaterThanEqual
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user