Allow more PowerPC instructions in relocations.
authorGeorge Koehler <xkernigh@netscape.net>
Mon, 23 Jan 2017 21:19:38 +0000 (16:19 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Mon, 23 Jan 2017 21:19:38 +0000 (16:19 -0500)
I need this for relocations in lis/lfd pairs.  I add lfd along with
addi, lfs, lha, stfs, stfd to the list.

util/led/relocate.c

index 7e2f9db..036b7db 100644 (file)
@@ -107,14 +107,20 @@ static uint32_t get_vc4_valu(char* addr)
 
 static bool is_powerpc_memory_op(uint32_t opcode)
 {
-       /* Tests for any PowerPC memory indirection instruction where the payload
-        * is a *signed* 16-bit value. */
+       /* Tests for any PowerPC memory indirection instruction (or
+        * addi) where the payload is a *signed* 16-bit value. */
        switch ((opcode & 0xfc000000) >> 26)
        {
+               case 14: /* addi */
                case 34: /* lbz */
+               case 48: /* lfs */
+               case 50: /* lfd */
+               case 42: /* lha */
                case 40: /* lhz */
                case 32: /* lwz */
                case 38: /* stb */
+               case 52: /* stfs */
+               case 54: /* stfd */
                case 44: /* sth */
                case 36: /* stw */
                        return true;