Skip to contentSkip to conversation

tcg: Fix regression in tcg_gen_deposit_i64.

PATCH Applied Richard Henderson 3 participants 4 messages Nov 1, 2011 – Nov 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tcg: Fix regression in tcg_gen_deposit_i64.

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

---
 tcg/tcg-op.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
tcg/tcg-op.h +2 -0
index 24ec7fc..8637fe8 100644
@@ -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
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 2/2 tcg: Fix whitespace in tcg-op.h.

Removing the only tabs in the file.

---
 tcg/tcg-op.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
tcg/tcg-op.h +4 -4
index 8637fe8..82e04e7 100644
@@ -2042,8 +2042,8 @@ static inline void tcg_gen_rotri_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2)
 }
 
 static inline void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1,
-				       TCGv_i32 arg2, unsigned int ofs,
-				       unsigned int len)
+                                       TCGv_i32 arg2, unsigned int ofs,
+                                       unsigned int len)
 {
     uint32_t mask;
     TCGv_i32 t1;
@@ -2073,8 +2073,8 @@ static inline void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1,
 }
 
 static inline void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1,
-				       TCGv_i64 arg2, unsigned int ofs,
-				       unsigned int len)
+                                       TCGv_i64 arg2, unsigned int ofs,
+                                       unsigned int len)
 {
     uint64_t mask;
     TCGv_i64 t1;
Signature · 1 line
1.7.6.4
Applied
#2 lore raw
In reply to Richard Henderson
Quoted 2 lines · Richard Henderson

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.

Quoted 27 lines
---
 tcg/tcg-op.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
tcg/tcg-op.h +2 -0
index 24ec7fc..8637fe8 100644
@@ -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
Signature · 1 line
mailto:[email protected]
#3 lore raw
In reply to Richard Henderson
Quoted 3 lines · Richard Henderson

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