On Wed, Jun 27, 2007 at 06:45:26PM +1000, Hasjim Williams wrote: > > On Wed, 27 Jun 2007 18:15:12 +1000, "Hasjim Williams" <[EMAIL PROTECTED]> > said: > > > > if_then_else (ge (match_operand:CCFP 1 "cc_register" "") (const_int 0)) > > if_then_else (ge:CCFP (match_operand 1 "cc_register" "") (const_int 0)) > > > > Is the second line still valid syntax? > > The second line doesn't work. The first one does.
The second line is valid syntax, but e.g. combine expects that the operator doesn't have a mode, so the insn won't match. I think that's just an undocumented feature of the first argument to if_then_else. Also, the mode would be the mode of the result, not the mode of the comparison result in the cc register. Example: (set (reg:SI 0) (ge:SI (match_operand:CCFP 1 "cc_register" "") (const_int 0)) which means set register 0, which has SImode, to STORE_FLAG_VALUE if the last comparison had op0 >= op1, otherwise set register 0 to zero. > It also fixes up the > "internal compiler error: output_operand: '%l' operand isn't a label" > error... > > Incidentally, does anyone know if can you do something like: > if_then_else (ge (match_operand:!CCFP 1 "cc_register" "") (const_int 0)) You can't (but mode macros help). As Paolo says, you will have to define one or more new comparison modes and you will have to define branch insns which use the new mode(s), comparison insns which set the cc register in the new mode(s), new sCC style insns, and so on. Additionally, look at SELECT_CC_MODE and TARGET_CC_MODE_COMPATIBLE. If you have some sort of arm_output_compare_insn() function, modify that as well. The significance of defining a CCmode is that is says that comparisons done in that mode set the flags in a specific way. -- Rask Ingemann Lambertsen