builtin assembler constraints

Chung-Ju Wu jasonwucj@gmail.com
Sat Feb 9 05:43:00 GMT 2013


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



More information about the Gcc-help mailing list