This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: builtin assembler constraints


2013/2/9 Grobman Alexander-R53196 <R53196@freescale.com>:
> Hi,
>
> I'm trying to incorporate new PPC instructions into a C code. These instructions use limited set of GPRs as operands i.e. only even registers can be used as a source,
>
> Is there way to specify that in the asm() statement?
>
>
> Regards
> Alex.
>

Hi Grobman,

If you can express the new PPC instructions with existing rtx,
you should be able to design patterns in your machine description file
and GCC will match it. Otherwise, you can create your own
'unspec' or 'unspec_volatile' rtx pattern and generate them on demand
(e.g. when users call a builtin function that is provided by yourself).
I think that is a better strategy than using asm() statement.

For even number registers, I guess their usage is for DImode or DFmode operand.
In that case, you can use HARD_REGNO_MODE_OK to restrict register number.


Best regards,
jasonwucj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]