[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:
dan sinclair 2020-04-14 15:04:11 +00:00 committed by dan sinclair
parent f95862b806
commit 2de7cb978d
2 changed files with 4 additions and 1 deletions

View File

@ -615,6 +615,8 @@ uint32_t Builder::GenerateBinaryExpression(ast::BinaryExpression* expr) {
}
} else if (expr->IsNotEqual()) {
op = lhs_is_float_or_vec ? spv::Op::OpFOrdNotEqual : spv::Op::OpINotEqual;
} else if (expr->IsOr()) {
op = spv::Op::OpBitwiseOr;
} else {
return 0;
}

View File

@ -122,7 +122,8 @@ INSTANTIATE_TEST_SUITE_P(
BuilderTest,
BinaryArithIntegerTest,
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>;
TEST_P(BinaryArithFloatTest, Scalar) {