diff options
Diffstat (limited to 'src/ir/bits.h')
-rw-r--r-- | src/ir/bits.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/ir/bits.h b/src/ir/bits.h index 95481eeab..950864a23 100644 --- a/src/ir/bits.h +++ b/src/ir/bits.h @@ -385,9 +385,26 @@ Index getMaxBits(Expression* curr, case WrapInt64: case ExtendUInt32: return std::min(Index(32), getMaxBits(unary->value, localInfoProvider)); + case ExtendS8Int32: { + auto maxBits = getMaxBits(unary->value, localInfoProvider); + return maxBits >= 8 ? Index(32) : maxBits; + } + case ExtendS16Int32: { + auto maxBits = getMaxBits(unary->value, localInfoProvider); + return maxBits >= 16 ? Index(32) : maxBits; + } + case ExtendS8Int64: { + auto maxBits = getMaxBits(unary->value, localInfoProvider); + return maxBits >= 8 ? Index(64) : maxBits; + } + case ExtendS16Int64: { + auto maxBits = getMaxBits(unary->value, localInfoProvider); + return maxBits >= 16 ? Index(64) : maxBits; + } + case ExtendS32Int64: case ExtendSInt32: { auto maxBits = getMaxBits(unary->value, localInfoProvider); - return maxBits == 32 ? Index(64) : maxBits; + return maxBits >= 32 ? Index(64) : maxBits; } default: { } |