Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Richard Henderson
On 04/13/2011 09:05 AM, Feng LI wrote: >> You need to expand builtins yourself, a "named" expander doesn't do >> that for you. > > I'm not sure I understand this, I use define_expand to expand > the builtin function to RTX, and then define_insn * to match the > RTX and generate code. It seems it d

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Feng LI
On Wed, Apr 13, 2011 at 5:48 PM, Richard Guenther wrote: > On Wed, Apr 13, 2011 at 5:45 PM, Feng LI wrote: >> On Wed, Apr 13, 2011 at 5:32 PM, Ian Lance Taylor wrote: >>> Feng LI writes: >>> I use unspec_volatile for a function with void arguments and void return value for some initia

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Richard Guenther
On Wed, Apr 13, 2011 at 5:45 PM, Feng LI wrote: > On Wed, Apr 13, 2011 at 5:32 PM, Ian Lance Taylor wrote: >> Feng LI writes: >> >>> I use unspec_volatile for a function with void arguments and >>> void return value for some initialization work. But it didn't generate >>> code in this case. I th

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Feng LI
On Wed, Apr 13, 2011 at 5:32 PM, Ian Lance Taylor wrote: > Feng LI writes: > >> I use unspec_volatile for a function with void arguments and >> void return value for some initialization work. But it didn't generate >> code in this case. I think probably I need to add more restrictions >> some whe

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Richard Guenther
On Wed, Apr 13, 2011 at 5:32 PM, Ian Lance Taylor wrote: > Feng LI writes: > >> I use unspec_volatile for a function with void arguments and >> void return value for some initialization work. But it didn't generate >> code in this case. I think probably I need to add more restrictions >> some whe

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Ian Lance Taylor
Feng LI writes: > I use unspec_volatile for a function with void arguments and > void return value for some initialization work. But it didn't generate > code in this case. I think probably I need to add more restrictions > some where but I don't know why and how. The code looks like: > > extern

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Feng LI
Hi Ian, Thanks for your comments. On Wed, Apr 13, 2011 at 5:02 PM, Ian Lance Taylor wrote: > Feng LI writes: > >> I'm currently try to add intrinsic functions to extend the x86 instruction >> set. Encountered a problem when the intrinsic function's return value >> is void, where the asm will no

Re: Using intrinsic functions to extend the isa

2011-04-13 Thread Ian Lance Taylor
Feng LI writes: > I'm currently try to add intrinsic functions to extend the x86 instruction > set. Encountered a problem when the intrinsic function's return value > is void, where the asm will not generate in this case. > > the intrinsic function looks like: > > extern void > __attribute__((__g

Using intrinsic functions to extend the isa

2011-04-13 Thread Feng LI
Hi, I'm currently try to add intrinsic functions to extend the x86 instruction set. Encountered a problem when the intrinsic function's return value is void, where the asm will not generate in this case. the intrinsic function looks like: extern void __attribute__((__gnu_inline__, __always_inlin