Adapting created intrinsics to PowerPC backend

Hi,

I have implemented intrinsics which are placeholders
for instructions executed elsewhere (e.g. in HW).

So i have two types of intrinsics migrate_begin and
migrate_end. Now i would like to make these intrinsics
known to the PowerPC backend. Since the hardware
initialization can not be implemented by one
instruction it has to be expanded to a library call or
lowered to something the ppc backend can understand?

If it is possible to add the functionality of these
functions to a library:
Where is this library and how can these functions be
added?

Is it correct that entries in IntrinsicsPowerPC.td
and
PPCInstrInfo.td files have to be done to make these
new intrinsics known?

"migrate_begin" is an instruction with a variable
argument list. Is there some
special handling necessary to add variable argument
functions?

I would be thankful for any hints regarding this
PowerPC backend adaptation.

Thank You
Aditya

Hi,

I have implemented intrinsics which are placeholders
for instructions executed elsewhere (e.g. in HW).

So i have two types of intrinsics migrate_begin and
migrate_end. Now i would like to make these intrinsics
known to the PowerPC backend. Since the hardware
initialization can not be implemented by one
instruction it has to be expanded to a library call or
lowered to something the ppc backend can understand?

If it is possible to add the functionality of these
functions to a library:
Where is this library and how can these functions be
added?

Is it correct that entries in IntrinsicsPowerPC.td
and
PPCInstrInfo.td files have to be done to make these
new intrinsics known?

You would add the definition to IntrinsicsPowerPC.td to let it be known. Then you can add a instruction selection pattern to PPCInstrInfo.td so it would be translated to the right PPC instruction(s). Alternatively, you can add C++ code to PPCISelDAGToDAG.cpp to do the translation.

"migrate_begin" is an instruction with a variable
argument list. Is there some
special handling necessary to add variable argument
functions?

In theory, you just need to specify the matching instruction input operands "variable_ops".

Evan