Skip to contentSkip to conversation

tcg: Fix typo in tcg_gen_hswap_i64

PATCH In review Richard Henderson 3 participants 3 messages Aug 25

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcg: Fix typo in tcg_gen_hswap_i64

Fixes 288d39e26d ("tcg: Simplify bswap/hswap expansion using bitswap")

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4229

---
 tcg/tcg-op.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/tcg-op.c +1 -1
index 28d3b2a847c..2c88f4f7ca9 100644
@@ -1887,7 +1887,7 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg)
  */
 void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg)
 {
-    gen_bitswap_i64(ret, ret, 0x0000ffff0000ffffull);
+    gen_bitswap_i64(ret, arg, 0x0000ffff0000ffffull);
     tcg_gen_wswap_i64(ret, ret);
 }
 
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Richard Henderson
Fixes 288d39e26d ("tcg: Simplify bswap/hswap expansion using bitswap")

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4229

---
 tcg/tcg-op.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/tcg-op.c +0 -0
index 28d3b2a847c..2c88f4f7ca9 100644

tcg/tcg-op.c void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) · line 1893

Quoted 8 lines
tcg/tcg-op.c +1 -1
@@ -1887,7 +1887,7 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg)
  */
 void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg)
 {
-    gen_bitswap_i64(ret, ret, 0x0000ffff0000ffffull);
+    gen_bitswap_i64(ret, arg, 0x0000ffff0000ffffull);
     tcg_gen_wswap_i64(ret, ret);
 }
 

thanks
-- PMM

Reviewed-by on v1 1/1
#2 lore raw
In reply to Richard Henderson
Quoted 12 lines · Richard Henderson
Fixes 288d39e26d ("tcg: Simplify bswap/hswap expansion using bitswap")

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4229

---
  tcg/tcg-op.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tcg/tcg-op.c +0 -0
index 28d3b2a847c..2c88f4f7ca9 100644

tcg/tcg-op.c void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) · line 1890

Quoted 5 lines
tcg/tcg-op.c +1 -1
@@ -1887,7 +1887,7 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg)
   */
  void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg)
  {
-    gen_bitswap_i64(ret, ret, 0x0000ffff0000ffffull);
+    gen_bitswap_i64(ret, arg, 0x0000ffff0000ffffull);

I was pretty sure that would be the kind of mistake but missed it :)

Quoted 3 lines
tcg/tcg-op.c +0 -0
      tcg_gen_wswap_i64(ret, ret);
  }