sparc.md (isa attribute): Add sparclet.
authorDoug Evans <dje@gnu.org>
Tue, 23 Apr 1996 23:59:58 +0000 (23:59 +0000)
committerDoug Evans <dje@gnu.org>
Tue, 23 Apr 1996 23:59:58 +0000 (23:59 +0000)
* sparc/sparc.md (isa attribute): Add sparclet.
(*smacsi3,*smacdi3,*umacdi3): Use match_operand, not match_dup
for third arg.
(*mulsidi3_sp32,const_mulsidi3,*umulsidi3_sp32, const_umulsidi3): Use
smuld,umuld for sparclet.

From-SVN: r11871

gcc/config/sparc/sparc.md

index d2c5730010035adf37b0c121aeac72a12bf202e7..eb9e3c705de6f14e4a063765e576e9b1caeda665 100644 (file)
 ;; Attribute for the instruction set.
 ;; At present we only need to distinguish v9/!v9, but for clarity we
 ;; test TARGET_V8 too.
-(define_attr "isa" "v6,v8,v9"
+(define_attr "isa" "v6,v8,v9,sparclet"
  (const
   (cond [(symbol_ref "TARGET_V9") (const_string "v9")
-        (symbol_ref "TARGET_V8") (const_string "v8")]
+        (symbol_ref "TARGET_V8") (const_string "v8")
+        (symbol_ref "TARGET_SPARCLET") (const_string "sparclet")]
        (const_string "v6"))))
 
 ;; Architecture size.
        (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
                 (sign_extend:DI (match_operand:SI 2 "register_operand" "r"))))]
   "TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS"
-  "smul %1,%2,%R0\;rd %%y,%0"
-  [(set_attr "length" "2")])
+  "*
+{
+  return TARGET_SPARCLET ? \"smuld %1,%2,%R0\" : \"smul %1,%2,%R0\;rd %%y,%0\";
+}"
+  [(set (attr "length")
+       (if_then_else (eq_attr "isa" "sparclet")
+                     (const_int 1) (const_int 2)))])
 
 ;; Extra pattern, because sign_extend of a constant isn't valid.
 
        (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
                 (match_operand:SI 2 "small_int" "I")))]
   "TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS"
-  "smul %1,%2,%R0\;rd %%y,%0"
-  [(set_attr "length" "2")])
+  "*
+{
+  return TARGET_SPARCLET ? \"smuld %1,%2,%R0\" : \"smul %1,%2,%R0\;rd %%y,%0\";
+}"
+  [(set (attr "length")
+       (if_then_else (eq_attr "isa" "sparclet")
+                     (const_int 1) (const_int 2)))])
 
 (define_expand "smulsi3_highpart"
   [(set (match_operand:SI 0 "register_operand" "")
        (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
                 (zero_extend:DI (match_operand:SI 2 "register_operand" "r"))))]
   "TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS"
-  "umul %1,%2,%R0\;rd %%y,%0"
-  [(set_attr "length" "2")])
+  "*
+{
+  return TARGET_SPARCLET ? \"umuld %1,%2,%R0\" : \"umul %1,%2,%R0\;rd %%y,%0\";
+}"
+  [(set (attr "length")
+       (if_then_else (eq_attr "isa" "sparclet")
+                     (const_int 1) (const_int 2)))])
 
 ;; Extra pattern, because sign_extend of a constant isn't valid.
 
        (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
                 (match_operand:SI 2 "uns_small_int" "")))]
   "TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS"
-  "umul %1,%2,%R0\;rd %%y,%0"
-  [(set_attr "length" "2")])
+  "*
+{
+  return TARGET_SPARCLET ? \"umuld %1,%2,%R0\" : \"umul %1,%2,%R0\;rd %%y,%0\";
+}"
+  [(set (attr "length")
+       (if_then_else (eq_attr "isa" "sparclet")
+                     (const_int 1) (const_int 2)))])
 
 (define_expand "umulsi3_highpart"
   [(set (match_operand:SI 0 "register_operand" "")
   [(set (match_operand:SI 0 "register_operand" "+r")
        (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "%r")
                          (match_operand:SI 2 "arith_operand" "rI"))
-                (match_dup 0)))]
+                (match_operand:SI 3 "register_operand" "0")))]
   "TARGET_SPARCLET"
   "smac %1,%2,%0"
   [(set_attr "type" "imul")])
                           (match_operand:SI 1 "register_operand" "%r"))
                          (sign_extend:DI
                           (match_operand:SI 2 "register_operand" "r")))
-                (match_dup 0)))]
+                (match_operand:DI 3 "register_operand" "0")))]
   "TARGET_SPARCLET"
   "smacd %1,%2,%R0"
   [(set_attr "type" "imul")])
                           (match_operand:SI 1 "register_operand" "%r"))
                          (zero_extend:DI
                           (match_operand:SI 2 "register_operand" "r")))
-                (match_dup 0)))]
+                (match_operand:DI 3 "register_operand" "0")))]
   "TARGET_SPARCLET"
   "umacd %1,%2,%R0"
   [(set_attr "type" "imul")])