This is the mail archive of the gcc@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: How can I write a builtin func?


2010/12/10 WANG.Jiong <wong.kwongyuan@gmail.com>:
> On 12/10/2010 02:17 PM, Liu wrote:
>
> Hi all,
>       I'm porting gcc to a MIPS-based DSP, I need write some builtin
> func for some insns, but I can't find a doc., any one should help me?
> Show me a example please? Thanks very much.
>
> Liu.
>
>
> Maybe you should at least implement the following two hooks:
>
> TARGET_INIT_BUILTINS
> ????? ---> to do some initialization
>
> TARGET_EXPAND_BUILTIN
> ????? ---> to expand builtin related tree to rtl
> ????????????? I suggest you define some UNSPEC rtl,? like:
> ???????????????? (define_insn "xxx"
> ???????????????????? [set (match_operand: .....)
> ???????????????????????????? (unspec:.... [...] UNSPEC_XXX)]
> ????????????????? ......
> ??????????????? )
>
> ????????????? and then expand builtin tree to these rtl by calling the
> related gen_xxx
>
> Suggest you to see s390's related hook implementation.
>
> --
> Best,
> Wong.KwongYuan

Dear Wong.KwongYuan,
      Thank you very much! Your answer is very clear!
      I'll look into it, maybe you will help me more when I get more problems.
Thanks again!

Liu.


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