Hello! > This is heavily inspired by a proof-of-concept patch David > Bremner sent to me the other week. > > * config/sparc/sparc.md (UNSPEC_FCMPLE, UNSPEC_FCMPNE, > UNSPEC_FCMPGT, UNSPEC_FCMPEQ): Delete and reduce to... > (UNSPEC_FCMP): New unspec. > (gcond): New code iterator. > (gcond_name): New code attr. > (GCM): New mode iterator. > (gcm_name): New mode attr. > (fcmp{le,ne,gt,eq}{16,32}_vis): Reimplement using iterators.
You don't need gcond_name, gcond can be used directly in the pattern: -(define_insn "fcmpeq32<P:mode>_vis" +(define_insn "fcmp<gcond_name><gcm_name><P:mode>_vis" (define_insn "fcmp<gcond:code><gcm_name><P:mode>_vis" [(set (match_operand:P 0 "register_operand" "=r") - (unspec:P [(match_operand:V2SI 1 "register_operand" "e") - (match_operand:V2SI 2 "register_operand" "e")] - UNSPEC_FCMPEQ))] + (unspec:P [(gcond:GCM (match_operand:GCM 1 "register_operand" "e") + (match_operand:GCM 2 "register_operand" "e"))] + UNSPEC_FCMP))] "TARGET_VIS" - "fcmpeq32\t%1, %2, %0" + "fcmp<gcond_name><gcm_name>\t%1, %2, %0" "fcmp<gcond:code>..." [(set_attr "type" "fpmul") (set_attr "fptype" "double")]) Uros.