aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-12-21 15:36:31 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-12-21 15:36:31 -0500
commit0e73100c7ef5f5f8b6b4813936d7b34a7615f027 (patch)
tree53cf2045e6bb239207de30a8cbd8f375638824b0
parent54dad0c2605f905a0e78b4e88a03e7c262ef5c2f (diff)
downloadgcc-0e73100c7ef5f5f8b6b4813936d7b34a7615f027.zip
gcc-0e73100c7ef5f5f8b6b4813936d7b34a7615f027.tar.gz
gcc-0e73100c7ef5f5f8b6b4813936d7b34a7615f027.tar.bz2
(sqrtsf2, sinsf2, sindf2, sinxf2): Define.
(cossf2, cosdf2, cosxf2): Likewise. (sqrtxf2): Operand 1 now XFmode. From-SVN: r8685
-rw-r--r--gcc/config/m68k/m68k.md86
1 files changed, 85 insertions, 1 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 196df8b..761bb4f 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -64,6 +64,12 @@
;;- "%$" single-precision fp specifier ("s" or "") f%$add.x fp0,fp1
;;- "%&" double-precision fp specifier ("d" or "") f%&add.x fp0,fp1
+;; UNSPEC usage:
+;; 1 This is a `sin' operation. The mode of the UNSPEC is MODE_FLOAT.
+;; operand 1 is the argument for `sin'.
+;; 2 This is a `cos' operation. The mode of the UNSPEC is MODE_FLOAT.
+;; operand 1 is the argument for `cos'.
+
;;- Information about 68040 port.
;;- The 68040 executes all 68030 and 68881/2 instructions, but some must
@@ -3465,6 +3471,18 @@
;; Sqrt instruction for the 68881
+(define_insn "sqrtsf2"
+ [(set (match_operand:SF 0 "general_operand" "=f")
+ (sqrt:SF (match_operand:SF 1 "general_operand" "fm")))]
+ "TARGET_68881"
+ "*
+{
+ if (FP_REG_P (operands[1]))
+ return \"fsqrt%.x %1,%0\";
+ else
+ return \"fsqrt%.s %1,%0\";
+}")
+
(define_insn "sqrtdf2"
[(set (match_operand:DF 0 "general_operand" "=f")
(sqrt:DF (match_operand:DF 1 "general_operand" "fm")))]
@@ -5930,9 +5948,75 @@
(define_insn "sqrtxf2"
[(set (match_operand:XF 0 "general_operand" "=f")
- (sqrt:XF (match_operand:DF 1 "nonimmediate_operand" "fm")))]
+ (sqrt:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))]
"TARGET_68881"
"*
{
return \"fsqrt%.x %1,%0\";
}")
+
+(define_insn "sinsf2"
+ [(set (match_operand:SF 0 "general_operand" "=f")
+ (unspec:SF [(match_operand:SF 1 "general_operand" "fm")] 1))]
+ "TARGET_68881 && flag_fast_math"
+ "*
+{
+ if (FP_REG_P (operands[1]))
+ return \"fsin%.x %1,%0\";
+ else
+ return \"fsin%.s %1,%0\";
+}")
+
+(define_insn "sindf2"
+ [(set (match_operand:DF 0 "general_operand" "=f")
+ (unspec:DF [(match_operand:DF 1 "general_operand" "fm")] 1))]
+ "TARGET_68881 && flag_fast_math"
+ "*
+{
+ if (FP_REG_P (operands[1]))
+ return \"fsin%.x %1,%0\";
+ else
+ return \"fsin%.d %1,%0\";
+}")
+
+(define_insn "sinxf2"
+ [(set (match_operand:XF 0 "general_operand" "=f")
+ (unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 1))]
+ "TARGET_68881 && flag_fast_math"
+ "*
+{
+ return \"fsin%.x %1,%0\";
+}")
+
+(define_insn "cossf2"
+ [(set (match_operand:SF 0 "general_operand" "=f")
+ (unspec:SF [(match_operand:SF 1 "general_operand" "fm")] 2))]
+ "TARGET_68881 && flag_fast_math"
+ "*
+{
+ if (FP_REG_P (operands[1]))
+ return \"fcos%.x %1,%0\";
+ else
+ return \"fcos%.s %1,%0\";
+}")
+
+(define_insn "cosdf2"
+ [(set (match_operand:DF 0 "general_operand" "=f")
+ (unspec:DF [(match_operand:DF 1 "general_operand" "fm")] 2))]
+ "TARGET_68881 && flag_fast_math"
+ "*
+{
+ if (FP_REG_P (operands[1]))
+ return \"fcos%.x %1,%0\";
+ else
+ return \"fcos%.d %1,%0\";
+}")
+
+(define_insn "cosxf2"
+ [(set (match_operand:XF 0 "general_operand" "=f")
+ (unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 2))]
+ "TARGET_68881 && flag_fast_math"
+ "*
+{
+ return \"fcos%.x %1,%0\";
+}")