@@ -265,6 +265,39 @@ (define_attr "cpu"
rs64a,mpccore,cell,ppca2,titan"
(const (symbol_ref "(enum attr_cpu) rs6000_tune")))
+;; The ISA we implement.
+(define_attr "isa" "any,p5,p6,p7,p7v,p8v,p9v" (const_string "any"))
+
+;; Is this alternative enabled for the current CPU/ISA/etc.?
+(define_attr "enabled" ""
+ (cond
+ [(eq_attr "isa" "any")
+ (const_int 1)
+
+ (and (eq_attr "isa" "p5")
+ (match_test "TARGET_POPCNTB"))
+ (const_int 1)
+
+ (and (eq_attr "isa" "p6")
+ (match_test "TARGET_CMPB"))
+ (const_int 1)
+
+ (and (eq_attr "isa" "p7")
+ (match_test "TARGET_POPCNTD"))
+ (const_int 1)
+
+ (and (eq_attr "isa" "p7v")
+ (match_test "TARGET_VSX"))
+ (const_int 1)
+
+ (and (eq_attr "isa" "p8v")
+ (match_test "TARGET_P8_VECTOR"))
+ (const_int 1)
+
+ (and (eq_attr "isa" "p9v")
+ (match_test "TARGET_P9_VECTOR"))
+ (const_int 1)
+ ] (const_int 0)))
;; If this instruction is microcoded on the CELL processor
; The default for load extended, the recorded instructions and rotate/shifts by a variable is always microcoded