about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-04-20 15:10:12 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-04-20 15:10:24 +0200
commite0ef2489434aac58815cdef3e8ef94dcc26dbd36 (patch)
tree8b119f78f88e6c3dfe19164cce16a4d6098c66ae /src
parentcdcb0a46dc9a54c023002edd0d04ed79e817a6cd (diff)
downloadbox64-e0ef2489434aac58815cdef3e8ef94dcc26dbd36.tar.gz
box64-e0ef2489434aac58815cdef3e8ef94dcc26dbd36.zip
[ARM64_PRINTER] Fix some case of DecodeBit not working for 64bits values
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/arm64/arm64_printer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dynarec/arm64/arm64_printer.c b/src/dynarec/arm64/arm64_printer.c
index 7401942b..f9866570 100644
--- a/src/dynarec/arm64/arm64_printer.c
+++ b/src/dynarec/arm64/arm64_printer.c
@@ -34,10 +34,12 @@ uint64_t DecodeBitMasks(int N, int imms, int immr)
     if(s==levels) return 0;

     uint64_t mask = (1LL<<(s+1))-1;

     if(r) { // rotate

-         mask=(mask>>r)|(mask<<(e-r));

-         mask&=((1LL<<e)-1);

+        mask=(mask>>r)|(mask<<(e-r));

+        if(e<64) {

+            mask&=((1LL<<e)-1);

+        }

     }

-    while (e<64) {  // replicate

+    while(e<64) {  // replicate

         mask|=(mask<<e);

         e<<=1;

     }