shithub: mc

Download patch

ref: ba241976da36c9a1ee33e7969c3e5618ac680704
parent: d5c406d1a36d770c3d492b7412a149072d64412c
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 18 11:28:47 EST 2015

For 32 bit imms that aren't sign extended, we need to load.

    Check if the top bit is either a 0, or all top bits are fs; if they
    are we can use this as an immediate. Otherwise, load it.

--- a/6/simp.c
+++ b/6/simp.c
@@ -1371,7 +1371,7 @@
                 case Lint: 
                     /* we can only have up to 4 byte immediates, but they
                      * can be moved into 64 bit regs */
-                    if (args[0]->lit.intval < 0xffffffffULL)
+                    if ((uint64_t)args[0]->lit.intval < 0x7fffffffULL)
                         r = n;
                     else
                         r = simpblob(s, n, &s->blobs, &s->nblobs);