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]

Using intrinsic functions to extend the isa


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_inline__, __artificial__))
__TTest (unsigned int __C, unsigned int __V, unsigned int offset)
{
  __builtin_ia32_ttest (__C, __V, offset);
}

and the corresponding md part is:

(define_expand "dta_ttest"
  [(set (match_operand:SI 1 "register_operand" "")
	(unspec:SI
	  [(match_operand:SI 2 "register_operand" "")
	   (match_operand:SI 3 "register_operand" "")]
	  UNSPEC_TSTORE))]
  "TARGET_DTA"
  "(void) operand0;")

(define_insn "*dta_ttest"
  [(set (match_operand:SI 0 "register_operand" "=r")
	(unspec:SI
	  [(match_operand:SI 1 "register_operand" "0")
	   (match_operand:SI 2 "register_operand" "")]
	  UNSPEC_TSTORE))]
  "TARGET_DTA"
  "ttest\t%0 %1 %2"
  [(set_attr "length" "3")
   (set_attr "mode" "SI")])


The asm will not generate "ttest\t %0 %1 %2" in this case, but if I
change the return value from void to uint, it will generate the correct
code.

I'm wondering how could I generate asm code for the intrinsic functions
with return value of void.

Thanks,
Feng


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