|
From: Alexander G. <ag...@su...> - 2011-11-24 22:57:18
|
Hi list, While trying to debug some gcc breakage, I stumbled over an unimplemented opcode in 3.7.0: ==30077== Command: /usr/lib/gcc/armv7l-suse-linux-gnueabi/4.6/../../../../armv7l-suse-linux-gnueabi/bin/as -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -meabi=5 -o /tmp/ccP7oOkQ.o /tmp/ccX6YmBQ.s ==30077== disInstr(thumb): unhandled instruction: 0xEB0D 0x0E4B ==30077== valgrind: Unrecognised instruction at address 0xcffb. ==30077== at 0xCFFA: ??? (in /usr/bin/as) According to Peter the opcode is valid and missing in today's svn too: <pm215> agraf: 0xEB0D 0x0E4B: that is ADD.W r14, r13, r11 lsl 1 (encoding T3) so looks ok <pm215> let me just see if it's fixed in svn <pm215> nope, svn still has this bug, valgrind isn't allowing ADD.W rd, r13, rm, shifted I'm not that deep into valgrind code (and ARM asm), so if someone more knowledgable could implement this opcode I will gladly give it a try with my as binary and see where it borks next :). Thanks, Alex |
|
From: Julian S. <js...@ac...> - 2011-11-25 10:00:28
|
On Thursday, November 24, 2011, Alexander Graf wrote:
> <pm215> agraf: 0xEB0D 0x0E4B: that is ADD.W r14, r13, r11 lsl 1 (encoding
> T3) so looks ok <pm215> let me just see if it's fixed in svn
> <pm215> nope, svn still has this bug, valgrind isn't allowing ADD.W rd,
> r13, rm, shifted
>
> I'm not that deep into valgrind code (and ARM asm), so if someone more
> knowledgable could implement this opcode I will gladly give it a try with
> my as binary and see where it borks next :).
Either .. file a bug report, and I'll fix it. But that won't be for at
about a week. Or you can try fixing it yourself (should be very simple).
In guest_arm_toIR.c around about line 16345 you should see the relevant
handlers
/* ---------- (T3) ADD{S}.W Rd, Rn, Rm, {shift} ---------- */
/* ---------- (T3) SUB{S}.W Rd, Rn, Rm, {shift} ---------- */
/* ---------- (T3) RSB{S}.W Rd, Rn, Rm, {shift} ---------- */
Your problem is to set the "Bool valid" to True (see the code) since
in this case it's ruled out by rN being r13 (which causes it to be
considered as a BadReg).
actually for a quick hack, you could probably just replace "!isBadReg(rN)"
with "rN != 15". That's not a clean long term fix tho.
J
|
|
From: Alexander G. <ag...@su...> - 2011-11-25 10:04:13
|
On 25.11.2011, at 10:52, Julian Seward <js...@ac...> wrote:
> On Thursday, November 24, 2011, Alexander Graf wrote:
>> <pm215> agraf: 0xEB0D 0x0E4B: that is ADD.W r14, r13, r11 lsl 1 (encoding
>> T3) so looks ok <pm215> let me just see if it's fixed in svn
>> <pm215> nope, svn still has this bug, valgrind isn't allowing ADD.W rd,
>> r13, rm, shifted
>>
>> I'm not that deep into valgrind code (and ARM asm), so if someone more
>> knowledgable could implement this opcode I will gladly give it a try with
>> my as binary and see where it borks next :).
>
> Either .. file a bug report, and I'll fix it. But that won't be for at
> about a week. Or you can try fixing it yourself (should be very simple).
>
> In guest_arm_toIR.c around about line 16345 you should see the relevant
> handlers
>
> /* ---------- (T3) ADD{S}.W Rd, Rn, Rm, {shift} ---------- */
> /* ---------- (T3) SUB{S}.W Rd, Rn, Rm, {shift} ---------- */
> /* ---------- (T3) RSB{S}.W Rd, Rn, Rm, {shift} ---------- */
>
> Your problem is to set the "Bool valid" to True (see the code) since
> in this case it's ruled out by rN being r13 (which causes it to be
> considered as a BadReg).
>
> actually for a quick hack, you could probably just replace "!isBadReg(rN)"
> with "rN != 15". That's not a clean long term fix tho.
I just removed the imm5==0 and shift==0 checks for add.w :). That way I was able to at least debug my actual problem.
It would still be nice to have a real fix at the end of the day though. Would you prefer me to file a bug report or is this email enough to make you aware of it? :)
Thanks,
Alex
>
|
|
From: Julian S. <js...@ac...> - 2011-11-25 10:09:29
|
On Friday, November 25, 2011, Alexander Graf wrote: > That way I was able to at least debug my actual problem. Good. > It would still be nice to have a real fix at the end of the day though. > Would you prefer me to file a bug report or is this email enough to make > you aware of it? :) Please file a bug report. Reports submitted by email tend to get forgotten about or fall through the cracks. J |