PATCH: Replace TARGET_64BIT with a pointer
H.J. Lu
hjl.tools@gmail.com
Mon Jun 2 13:36:00 GMT 2008
On Mon, Jun 02, 2008 at 02:54:40PM +0200, Paolo Bonzini wrote:
> Uros Bizjak wrote:
>> On Mon, Jun 2, 2008 at 10:26 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>
>>>> i386.c has many codes like
>>>>
>>>> if (TARGET_64BIT)
>>>> output_asm_insn ("pop{q}\t%0", xops);
>>>> else
>>>> output_asm_insn ("pop{l}\t%0", xops);
>>>>
>>>> On stack branch, there are more codes like that. This patch changes
>>>> it to
>>>>
>>>> output_asm_insn (ix86_pop1, xops);
>>>>
>>>> It will simplify i386.c. There are no regressions on Linux/Intel64.
>>>> OK for trunk?
>>> IMHO it is less nice to not see what the asm is in the insn. Can't you
>>> use a new % specifier that expands to either {q} or {l} dependent on
>>> TARGET_64BIT?
>>
>> There already is %z modifier. I guess this one should be
>> fixed/enhanced to also generate "q" for 64bit integer operands in the
>> same way as "l" is generated for 32bit int operands.
>
> Doesn't it do it already?
>
> if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT)
> {
> #ifdef GAS_MNEMONICS
> putc ('q', file);
> #else
> putc ('l', file);
> putc ('l', file);
> #endif
> }
> else
> putc ('l', file);
>
> So the above should be written as
>
> output_asm_insn ("pop%z0\t%0", xops);
>
%z is for x87. GAS_MNEMONICS isn't defined for Linux. I have
to default GAS_MNEMONICS to 0 and check integer register
operand.
H.J.
More information about the Gcc-patches
mailing list