From a41b6f0458604a32d34e94f68644055285a11ab5 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Mon, 23 Jan 2017 16:19:38 -0500 Subject: [PATCH] Allow more PowerPC instructions in relocations. 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/led/relocate.c b/util/led/relocate.c index 7e2f9db10..036b7dbb8 100644 --- a/util/led/relocate.c +++ b/util/led/relocate.c @@ -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;