Hi Eli, Thanks for the response I have one question inline. Regards, Ben [...]> The main problem that I have hit is regarding the use of CL registerin the> shift instructions. The problem is that ATT syntax states that itshould be> referenced as "%cl" while Intel says just "cl" but these referencesoccur in> X86InstInfo.td and this means that it is shared between Intel and ATT > printing! For example, the shift rules:We have two different output styles for precisely that reason.> The problem is that it does not make sense to have separate rules forIntel> and ATT and as such I wanted to get the lists advice on what peoplethink is> the best approach to resolving this issue so I can make the changes?The changes just mentioned looks correct. [bg]The problem is I am not sure of the best approach to take here. For example, one possible approach I can see is to following that of the HasSSE2 constraint and introduce something like the follow to X86.td: def IsIntelAsmWriter : Predicate<"Subtarget.isFlavorIntel()">; def IsATTAsmWriter : Predicate<"!Subtarget.isFlavorIntel()">; and then in X86InstrInfo.td make changes something like: def SHL8mCLIntel : I<0xD2, MRM4m, (outs), (ins i8mem :$dst), "shl{b}\t{%cl, $dst|$dst, CL}", [(store (shl (loadi8 addr:$dst), CL), addr:$dst)]>, requires<[IsIntelAsmWriter]>; def SHL8mCLATT : I<0xD2, MRM4m, (outs), (ins i8mem :$dst), "shl{b}\t{%cl, $dst|$dst, %CL}", [(store (shl (loadi8 addr:$dst), CL), addr:$dst)]>, requires<[IsATTAsmWriter]>; I can get this two work with additional changes to X86InstrInfocpp but the problem I have with this approach is that it introduces a lot of duplication, when all I really want to do is parameterize the final field in the string "shl{b}\t{%cl, $dst|$dst, %CL}". I was wondering (hoping :-) if you knew of a better method to handling this? [...] _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Mon, Jun 15, 2009 at 11:21 PM, Gaster, Benedict<Benedict.Gaster at amd.com> wrote:> I can get this two work with additional changes to X86InstrInfocpp but > the problem I have with this approach is that it introduces a lot of > duplication, when all I really want to do is parameterize the final > field in the string "shl{b}\t{%cl, $dst|$dst, %CL}". I was wondering > (hoping :-) if you knew of a better method to handling this?I think you're missing the whole point of the "|" construct; the left side is AT&T syntax, the right side is Intel syntax. -Eli
Hi Eli,
Yep I was being stupid.
Please find attached a patch for initial changes to get MASM working.
There is still one problem that I am looking into around changing
alignments within SEGMENTS. The problem is that MASM allows 2,4,16,256
alignments, default being 16, but LLVM is sometimes generating 32
alignment, for example, consider the following code:
float bar(float fy, float fx)
{
static const double foo[ 241] = {
6.24188099959573430842e-02,
6.63088949198234745008e-02,
}
}
Is generating the data segment:
_data segment PARA 'DATA'
__2E_str: ; .str
db 'out',0
__2E_str1: ; .str1
db 'in',0
public ___some_other_sruct_data
ALIGN 4
___some_other_sruct_data: ;
dd 7 ; 0x7
dd 3 ; 0x3
dd __2E_str
db 12 dup(0)
dd 7 ; 0x7
dd 3 ; 0x3
dd __2E_str1
db 12 dup(0)
db 12 dup(0)
sgv: ; sgv
db 1 dup(0)
ALIGN 4
lvgv: ; lvgv
ALIGN 32
foo: ;
dq 4589156319577832937 ; double value: 6.241881e-002
dq 4589442480094401190 ; double value: 6.630889e-002
MASM reports the following error:
error A2189:invalid combination with segment alignment : 32
Regards,
Ben
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
On Behalf Of Eli Friedman
Sent: Tuesday, June 16, 2009 12:10 AM
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] x86 Intel Syntax and MASM 9.x
On Mon, Jun 15, 2009 at 11:21 PM, Gaster,
Benedict<Benedict.Gaster at amd.com> wrote:> I can get this two work with additional changes to X86InstrInfocpp but
> the problem I have with this approach is that it introduces a lot of
> duplication, when all I really want to do is parameterize the final
> field in the string "shl{b}\t{%cl, $dst|$dst, %CL}". I was
wondering
> (hoping :-) if you knew of a better method to handling this?
I think you're missing the whole point of the "|" construct; the
left
side is AT&T syntax, the right side is Intel syntax.
-Eli
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: masm.patch
Type: application/octet-stream
Size: 15767 bytes
Desc: masm.patch
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20090616/691a2731/attachment.obj>