Message ID | 1378747670-25512-4-git-send-email-aurelien@aurel32.net |
---|---|
State | New |
Headers | show |
On 09/10/2013 05:27 AM, Aurelien Jarno wrote: > The shl_i32 op might set some bits of the unused 32 high bits of the > mask. Fix that by clearing the unused 32 high bits for all 32-bit ops > except load/store which operate on tl values. > > Cc: Richard Henderson <rth@twiddle.net> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> > --- > tcg/optimize.c | 6 ++++++ > 1 file changed, 6 insertions(+) Reviewed-by: Richard Henderson <rth@twiddle.net> r~
diff --git a/tcg/optimize.c b/tcg/optimize.c index 0ed8983..b1f736b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -791,6 +791,12 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr, break; } + /* 32-bit ops (non 64-bit ops and non load/store ops) generate 32-bit + results */ + if (!(tcg_op_defs[op].flags & (TCG_OPF_CALL_CLOBBER | TCG_OPF_64BIT))) { + mask &= 0xffffffffu; + } + if (mask == 0) { assert(def->nb_oargs == 1); s->gen_opc_buf[op_index] = op_to_movi(op);
The shl_i32 op might set some bits of the unused 32 high bits of the mask. Fix that by clearing the unused 32 high bits for all 32-bit ops except load/store which operate on tl values. Cc: Richard Henderson <rth@twiddle.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> --- tcg/optimize.c | 6 ++++++ 1 file changed, 6 insertions(+)