[llvm-commits] Fixing Bug 13662: paired register for inline asm with 64-bit data on ARM

Weiming Zhao weimingz at codeaurora.org
Thu Nov 1 15:35:21 PDT 2012


Hi Jakob & Jim,

I updated the instruction def of ldrexd/strexd to let them use GPRPair Reg
class.
I also fixed ldrexd/strexd intrinsics and atomic_64 lowering accordingly.
Disassembler and AsmParser are adjusted to fit the new instruction def.
The original test case "atomic-64bit.ll" is updated, so it's not checking
hardcoded R0,R1 or R2,R3

It passes the "make check", especially atomic-64bit.ll, ldstrexd,ll,
MC/ARM/basic-asm-instrucions.s, MC/ARM/diagnstics.s and MC/Disassembler/ARM/
basic-arm-instructions.txt

Please help to review it.

Thanks,
Weiming

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation


-----Original Message-----
From: Jim Grosbach [mailto:grosbach at apple.com] 
Sent: Wednesday, October 31, 2012 3:24 PM
To: Jakob Stoklund Olesen
Cc: weimingz at codeaurora.org; llvm-commits at cs.uiuc.edu; zinob at codeaurora.org
Subject: Re: [llvm-commits] Fixing Bug 13662: paired register for inline asm
with 64-bit data on ARM


On Oct 31, 2012, at 3:17 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:

> 
> On Oct 31, 2012, at 3:15 PM, "Weiming Zhao" <weimingz at codeaurora.org>
wrote:
> 
>> Hi Jakob,
>> 
>> I'm changing the ldrexd/strexd of ARMInstrInfo.td to def LDREXD: 
>> AIldrex<0b01, (outs GPRPair:$Rt),(ins addr_offset_none:$addr),
>>                     NoItinerary, "ldrexd", "\t$Rt, $addr", []> { let 
>> DecoderMethod = "DecodeDoubleRegLoad"; }
>> 
>> def STREXD : AIstrex<0b01, (outs GPR:$Rd),
>>                   (ins GPRPair:$Rt, addr_offset_none:$addr),
>>                   NoItinerary, "strexd", "\t$Rd, $Rt, $addr", []> { 
>> let DecoderMethod = "DecodeDoubleRegStore"; }
>> 
>> Is this the way you're referring to?
> 
> Exactly.
> 
>> So far, it almost works but I need to deal with printing "R0_R1" for 
>> the GPRPair reg name. I'm planning to do it in 
>> InstPrinter/ARMInstPrinter.cpp::printOperand().
> 
> I think that's right. Jim?

Sure, that'll work. Changing the instruction definitions like this will
require some work in the AsmParser, too, though. I'm surprised you're not
seeing a "make check" failure on basic-arm-instructions.s with these
changes.

-Jim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Remove-hard-coded-registers-in-ARM-ldrexd-and-strexd.patch
Type: application/octet-stream
Size: 23372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121101/e15cce48/attachment.obj>


More information about the llvm-commits mailing list