From edb174da8d16d7c7429a790c4ee985996f848105 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 29 Jun 2013 00:32:39 +0100 Subject: [PATCH 1/2] Fix incorrect encoding of 'push lr' and 'pop pc'. --HG-- branch : dtrg-videocore --- mach/vc4/as/mach5.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mach/vc4/as/mach5.c b/mach/vc4/as/mach5.c index 350806e11..e98f67594 100644 --- a/mach/vc4/as/mach5.c +++ b/mach/vc4/as/mach5.c @@ -174,13 +174,11 @@ void stack_instr(quad opcode, int loreg, int hireg, int extrareg) case 26: /* lr */ extrareg = 26; hireg = loreg = -1; - b = 0; break; case 31: /* pc */ extrareg = 31; hireg = loreg = -1; - b = 0; break; default: @@ -204,7 +202,10 @@ void stack_instr(quad opcode, int loreg, int hireg, int extrareg) serror("invalid register range"); if (hireg == -1) - m = 31; + { + b = 3; + m = 15; + } else m = hireg - loreg; From 8b6951dac002428c8a8585137418754cfeae1a56 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 29 Jun 2013 00:35:07 +0100 Subject: [PATCH 2/2] Fix incorrect offset encoding in lea (sp) instructions. --HG-- branch : dtrg-videocore --- mach/vc4/as/mach5.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mach/vc4/as/mach5.c b/mach/vc4/as/mach5.c index e98f67594..5f10facf0 100644 --- a/mach/vc4/as/mach5.c +++ b/mach/vc4/as/mach5.c @@ -457,6 +457,7 @@ void lea_stack_instr(int rd, long va, int rs) if (rs != 25) serror("source register must be sp"); + va /= 4; if (!fitx(va, 6)) serror("offset too big to encode in instruction"); va = maskx(va, 6);