On Fri, Dec 06, 2013 at 10:59:37AM -0500, Vladimir Makarov wrote:
> It is still two different patterns.  One for reload and one for LRA.
> Attribute enabled is mostly used to describe insn constraints for
> subtargets.

I meant something like:
(define_insn "*bswapdi2_64bit"
  [(set (match_operand:DI 0 "reg_or_mem_operand" "=&r,Z,??&r,r")
       (bswap:DI (match_operand:DI 1 "reg_or_mem_operand" "Z,r,r,r")))
   (clobber (match_scratch:DI 2 "=&b,&b,&r,&r"))
   (clobber (match_scratch:DI 3 "=&r,&r,&r,&r"))
   (clobber (match_scratch:DI 4 "=&r,X,&r,&r"))]
  "TARGET_POWERPC64 && !TARGET_LDBRX
   && (REG_P (operands[0]) || REG_P (operands[1]))
   && !(MEM_P (operands[0]) && MEM_VOLATILE_P (operands[0]))
   && !(MEM_P (operands[1]) && MEM_VOLATILE_P (operands[1]))"
  "#"
  [(set_attr "length" "16,12,36,36")
   (set (attr "enabled")
        (cond [(eq_attr "alternative" "0,1")
                 (const_int 1)
               (and (eq_attr "alternative" "2")
                    (match_test "!rs6000_lra_flag"))
                 (const_int 1)
               (and (eq_attr "alternative" "3")
                    (match_test "rs6000_lra_flag"))
                 (const_int 1)]
              (const_int 0)]))])

That is just one pattern.
And of course
(define_attr "enabled" "" (const_int 1))
somewhere early, because rs6000 wasn't using enabled attribute yet.

        Jakub

Reply via email to