[spirv-writer] Handle bitwise or expression.
This CL adds output of the bitwise or command. Bug: tint:5 Change-Id: Iad9bafaa0a8394494615922c14c2d33d2d5701bb Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19409 Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
parent
f95862b806
commit
2de7cb978d
|
@ -615,6 +615,8 @@ uint32_t Builder::GenerateBinaryExpression(ast::BinaryExpression* expr) {
|
||||||
}
|
}
|
||||||
} else if (expr->IsNotEqual()) {
|
} else if (expr->IsNotEqual()) {
|
||||||
op = lhs_is_float_or_vec ? spv::Op::OpFOrdNotEqual : spv::Op::OpINotEqual;
|
op = lhs_is_float_or_vec ? spv::Op::OpFOrdNotEqual : spv::Op::OpINotEqual;
|
||||||
|
} else if (expr->IsOr()) {
|
||||||
|
op = spv::Op::OpBitwiseOr;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
BuilderTest,
|
BuilderTest,
|
||||||
BinaryArithIntegerTest,
|
BinaryArithIntegerTest,
|
||||||
testing::Values(BinaryData{ast::BinaryOp::kAdd, "OpIAdd"},
|
testing::Values(BinaryData{ast::BinaryOp::kAdd, "OpIAdd"},
|
||||||
BinaryData{ast::BinaryOp::kAnd, "OpBitwiseAnd"}));
|
BinaryData{ast::BinaryOp::kAnd, "OpBitwiseAnd"},
|
||||||
|
BinaryData{ast::BinaryOp::kOr, "OpBitwiseOr"}));
|
||||||
|
|
||||||
using BinaryArithFloatTest = testing::TestWithParam<BinaryData>;
|
using BinaryArithFloatTest = testing::TestWithParam<BinaryData>;
|
||||||
TEST_P(BinaryArithFloatTest, Scalar) {
|
TEST_P(BinaryArithFloatTest, Scalar) {
|
||||||
|
|
Loading…
Reference in New Issue