Skip to contentSkip to conversation

target-mips: add ULL suffix in bitswap to avoid compiler warning

PATCH Applied Leon Alrae 2 participants 2 messages Oct 22, 2014 – Oct 24, 2014

lore
Share & tools
lore

Leon Alrae

author
#0 lore raw

PATCH 1/1 target-mips: add ULL suffix in bitswap to avoid compiler warning

---
 target-mips/op_helper.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
target-mips/op_helper.c +6 -6
index 5204ed8..9ec548c 100644
@@ -267,12 +267,12 @@ target_ulong helper_mulshiu(CPUMIPSState *env, target_ulong arg1,
 
 static inline target_ulong bitswap(target_ulong v)
 {
-    v = ((v >> 1) & (target_ulong)0x5555555555555555) |
-              ((v & (target_ulong)0x5555555555555555) << 1);
-    v = ((v >> 2) & (target_ulong)0x3333333333333333) |
-              ((v & (target_ulong)0x3333333333333333) << 2);
-    v = ((v >> 4) & (target_ulong)0x0F0F0F0F0F0F0F0F) |
-              ((v & (target_ulong)0x0F0F0F0F0F0F0F0F) << 4);
+    v = ((v >> 1) & (target_ulong)0x5555555555555555ULL) |
+              ((v & (target_ulong)0x5555555555555555ULL) << 1);
+    v = ((v >> 2) & (target_ulong)0x3333333333333333ULL) |
+              ((v & (target_ulong)0x3333333333333333ULL) << 2);
+    v = ((v >> 4) & (target_ulong)0x0F0F0F0F0F0F0F0FULL) |
+              ((v & (target_ulong)0x0F0F0F0F0F0F0F0FULL) << 4);
     return v;
 }
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 17 lines · Leon Alrae
---
 target-mips/op_helper.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
target-mips/op_helper.c +0 -4
index 5204ed8..9ec548c 100644
@@ -267,12 +267,12 @@ target_ulong helper_mulshiu(CPUMIPSState *env, target_ulong arg1,
 
 static inline target_ulong bitswap(target_ulong v)
 {
-    v = ((v >> 1) & (target_ulong)0x5555555555555555) |
-              ((v & (target_ulong)0x5555555555555555) << 1);
-    v = ((v >> 2) & (target_ulong)0x3333333333333333) |
-              ((v & (target_ulong)0x3333333333333333) << 2);

target-mips/op_helper.c target_ulong helper_mulshiu(CPUMIPSState *env, target_ulong arg1, · line 277

Quoted 10 lines
target-mips/op_helper.c +6 -2
-    v = ((v >> 4) & (target_ulong)0x0F0F0F0F0F0F0F0F) |
-              ((v & (target_ulong)0x0F0F0F0F0F0F0F0F) << 4);
+    v = ((v >> 1) & (target_ulong)0x5555555555555555ULL) |
+              ((v & (target_ulong)0x5555555555555555ULL) << 1);
+    v = ((v >> 2) & (target_ulong)0x3333333333333333ULL) |
+              ((v & (target_ulong)0x3333333333333333ULL) << 2);
+    v = ((v >> 4) & (target_ulong)0x0F0F0F0F0F0F0F0FULL) |
+              ((v & (target_ulong)0x0F0F0F0F0F0F0F0FULL) << 4);
     return v;
 }

Applied to master, thanks.

-- PMM