[llvm-commits] [PATCH] TargetRegisterInfo method to get native register indices

Charles Davis cdavis at mymail.mines.edu
Mon May 23 21:12:18 PDT 2011


On 5/23/11 9:37 PM, Jakob Stoklund Olesen wrote:
> 
> On May 23, 2011, at 7:58 PM, Charles Davis wrote:
> 
>> Hi,
>>
>> This patch adds a method to TargetRegisterInfo to get the native
>> register index corresponding to a LLVM register index. I've implemented
>> it for x86. Note that it returns 8-15 for r8-r15 (and xmm8-xmm15).
> 
>> I need this for my SEH directive-parsing methods, since the Win64 EH
>> streamer methods expect a native register number.
> 
> What is a 'native' register number in a target-independent context? Should this be an X86-specific function only?
It already is (see getX86RegNum() in lib/Target/X86RegisterInfo.cpp). I
didn't want to add an x86-specific dependency to COFFAsmParser (which
implements the SEH directives).

Come to think of it, maybe some of the SEH directives should be
x86-specific. They are x86-specific in GAS. It's just that I don't know
how to parse a directive that is both x86- and COFF-specific.

Chip



More information about the llvm-commits mailing list