diff mbox

[1/2] tcg: Fix regression in tcg_gen_deposit_i64.

Message ID 1320185203-28036-1-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Nov. 1, 2011, 10:06 p.m. UTC
The error being caused by the failure to copy the other half of
the input to the output after having narrowed the deposit operation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg-op.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

malc Nov. 1, 2011, 10:17 p.m. UTC | #1
On Tue, 1 Nov 2011, Richard Henderson wrote:

> The error being caused by the failure to copy the other half of
> the input to the output after having narrowed the deposit operation.

Thanks, applied.

> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/tcg-op.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
> index 24ec7fc..8637fe8 100644
> --- a/tcg/tcg-op.h
> +++ b/tcg/tcg-op.h
> @@ -2090,6 +2090,7 @@ static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1,
>  
>  #if TCG_TARGET_REG_BITS == 32
>      if (ofs >= 32) {
> +        tcg_gen_mov_i32(TCGV_LOW(ret), TCGV_LOW(arg1));
>          tcg_gen_deposit_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1),
>                              TCGV_LOW(arg2), ofs - 32, len);
>          return;
> @@ -2097,6 +2098,7 @@ static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1,
>      if (ofs + len <= 32) {
>          tcg_gen_deposit_i32(TCGV_LOW(ret), TCGV_LOW(arg1),
>                              TCGV_LOW(arg2), ofs, len);
> +        tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1));
>          return;
>      }
>  #endif
>
Alexander Graf Nov. 2, 2011, 5:30 p.m. UTC | #2
Richard Henderson wrote:
> The error being caused by the failure to copy the other half of
> the input to the output after having narrowed the deposit operation.
>   

Thanks, this makes my ppc32 host work again :)

Alex
diff mbox

Patch

diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 24ec7fc..8637fe8 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -2090,6 +2090,7 @@  static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1,
 
 #if TCG_TARGET_REG_BITS == 32
     if (ofs >= 32) {
+        tcg_gen_mov_i32(TCGV_LOW(ret), TCGV_LOW(arg1));
         tcg_gen_deposit_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1),
                             TCGV_LOW(arg2), ofs - 32, len);
         return;
@@ -2097,6 +2098,7 @@  static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1,
     if (ofs + len <= 32) {
         tcg_gen_deposit_i32(TCGV_LOW(ret), TCGV_LOW(arg1),
                             TCGV_LOW(arg2), ofs, len);
+        tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_HIGH(arg1));
         return;
     }
 #endif