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]

combiner? reload? ...


Fellows,

I've got an arch which:
registers are 16 bits,
pointer - 16 bits (HImode).

I define pattern:

(define_insn "tstsi"
  [(set (cc0) (match_operand:SI 0 "general_operand_msp430" "m,r"))]
 ""
 "* {
        output_asm_insn(\"tstsi %0\", operands);
        return \"\";
} "
  [(set_attr "length" "4,2")
   (set_attr "cc" "compare,compare")])
 
the predicate also takes into account volatile vars.

Then for the code given:
volatile long a;
void foo()
{
        while(a);
}

Gcc produces (optimization is turned on):
.L4:
        mov     &a, r12          ;  34  *movhi3/6       [length = 2]
        bis     &a+2, r12        ;  15  *iorhi3_3/5     [length = 2]
        tst     r12      ;  16  *tsthi1/2       [length = 1]
        jne     .L4      ;  17  bne     [length = 1]

and does not see 'tstsi' insn pattern.
Should I define something extra to force gcc to see tstsi pattern?

Thanks in advance,
Dmitry.



*********************************************************************
   ("`-''-/").___..--''"`-._     (\       Dimmy the Wild      UA1ACZ
    `6_ 6  )   `-.  (     ).`-.__.`)      Enterprise Information Sys 
    (_Y_.)'  ._   )  `._ `. ``-..-'       Nevsky prospekt,   20 / 44
  _..`--'_..-_/  /--'_.' ,'               Saint Petersburg,   Russia
 (il),-''  (li),'  ((!.-'                 +7 (812) 314-8860, 5585314
*********************************************************************


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