This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

'long double' support for Darwin


I tried to use -mlong-double-128 on Darwin, and it didn't work very
well, because some (not all) of the md file conditionals were
AIX-specific.  This fixes it.

Bootstrapped & tested on powerpc-darwin.  (Very light testing of the
actual -mlong-double-128 support, since there's no runtime library
available.)

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/rs6000-longdoubledarwin.patch=============
2003-11-14  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/rs6000.md: Add 'DEFAULT_ABI == ABI_DARWIN'
	to each place where TARGET_LONG_DOUBLE_128 is used with
	DEFAULT_ABI == ABI_AIX.

Index: config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.272
diff -u -p -u -p -r1.272 rs6000.md
--- config/rs6000/rs6000.md	12 Nov 2003 22:52:09 -0000	1.272
+++ config/rs6000/rs6000.md	14 Nov 2003 19:01:40 -0000
@@ -8202,15 +8202,15 @@
 (define_expand "movtf"
   [(set (match_operand:TF 0 "general_operand" "")
 	(match_operand:TF 1 "any_operand" ""))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }")
 
 (define_insn "*movtf_internal"
   [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,m,!r,!r,!r")
 	(match_operand:TF 1 "input_operand" "f,m,f,G,H,F"))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128
    && (gpc_reg_operand (operands[0], TFmode)
        || gpc_reg_operand (operands[1], TFmode))"
   "*
@@ -8314,8 +8314,8 @@
 (define_insn "extenddftf2"
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
 	(float_extend:TF (match_operand:DF 1 "gpc_reg_operand" "f")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "*
 {
   if (REGNO (operands[0]) == REGNO (operands[1]))
@@ -8328,8 +8328,8 @@
 (define_insn "extendsftf2"
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
 	(float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "f")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "*
 {
   if (REGNO (operands[0]) == REGNO (operands[1]))
@@ -8342,8 +8342,8 @@
 (define_insn "trunctfdf2"
   [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
 	(float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "fadd %0,%1,%L1"
   [(set_attr "type" "fp")
    (set_attr "length" "8")])
@@ -8352,8 +8352,8 @@
   [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
 	(float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f")))
    (clobber (match_scratch:DF 2 "=f"))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT
-   && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "#"
   "&& reload_completed"
   [(set (match_dup 2)
@@ -8366,7 +8366,8 @@
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
         (float:TF (match_operand:DI 1 "gpc_reg_operand" "*f")))
    (clobber (match_scratch:DF 2 "=f"))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_POWERPC64
    && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "#"
   "&& reload_completed"
@@ -8380,8 +8381,8 @@
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
         (float:TF (match_operand:SI 1 "gpc_reg_operand" "r")))
    (clobber (match_scratch:DF 2 "=f"))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "#"
   "&& reload_completed"
   [(set (match_dup 2)
@@ -8394,7 +8395,8 @@
   [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
         (fix:DI (match_operand:TF 1 "gpc_reg_operand" "f")))
    (clobber (match_scratch:DF 2 "=f"))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_POWERPC64
    && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "#"
   "&& reload_completed"
@@ -8408,8 +8410,8 @@
   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
         (fix:SI (match_operand:TF 1 "gpc_reg_operand" "f")))
    (clobber (match_scratch:DF 2 "=f"))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "#"
   "&& reload_completed"
   [(set (match_dup 2)
@@ -8421,8 +8423,8 @@
 (define_insn "negtf2"
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
 	(neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "*
 {
   if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
@@ -8436,8 +8438,8 @@
 (define_insn "abstf2"
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
 	(abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "*
 {
   if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
@@ -8451,8 +8453,8 @@
 (define_insn ""
   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
 	(neg:TF (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f"))))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "*
 {
   if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
@@ -10978,8 +10980,8 @@
 (define_expand "cmptf"
   [(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "")
 		       (match_operand:TF 1 "gpc_reg_operand" "")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT
-   && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "
 {
   rs6000_compare_op0 = operands[0];
@@ -11344,8 +11346,8 @@
   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
 	(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
 		      (match_operand:TF 2 "gpc_reg_operand" "f")))]
-  "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
-   && TARGET_LONG_DOUBLE_128"
+  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
   "fcmpu %0,%1,%2\;bne %0,$+4\;fcmpu %0,%L1,%L2"
   [(set_attr "type" "fpcompare")
    (set_attr "length" "12")])
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]