mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
[msl] Handle packed conversions in shift expressions.
Similar to the handling of packed values in the arithmetic operators the shift operators need to cast to the unpacked type before doing the as_type casts. Bug: tint:1542 Change-Id: I4289c45ab0a067ce122f61675fe5e251a83b6f8b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105720 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
840e42477d
commit
d5139b4463
@@ -590,8 +590,18 @@ bool GeneratorImpl::EmitBinary(std::ostream& out, const ast::BinaryExpression* e
|
||||
ScopedParen sp(out);
|
||||
{
|
||||
ScopedBitCast lhs_uint_cast(this, out, lhs_type, unsigned_type_of(lhs_type));
|
||||
if (!EmitExpression(out, expr->lhs)) {
|
||||
return false;
|
||||
|
||||
// In case the type is packed, cast to our own type in order to remove the packing.
|
||||
// Otherwise, this just casts to itself.
|
||||
if (lhs_type->is_signed_integer_vector()) {
|
||||
ScopedCast lhs_self_cast(this, out, lhs_type, lhs_type);
|
||||
if (!EmitExpression(out, expr->lhs)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!EmitExpression(out, expr->lhs)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!emit_op()) {
|
||||
|
||||
Reference in New Issue
Block a user