public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* i386: Reject -m96bit-long-double for 64bit targets [PR100041]
@ 2021-04-23 16:47 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2021-04-23 16:47 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

64bit targets default to 128bit long double, so -m96bit-long-double should
not be used.  Together with -m128bit-long-double, this option was intended
to be an optimization for 32bit targets only.

Error out when -m96bit-long-double is used with 64bit targets.

2021-04-23  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
    PR target/100041
    * config/i386/i386-options.c (ix86_option_override_internal):
    Error out when -m96bit-long-double is used with 64bit targets.
    * config/i386/i386.md (*pushxf_rounded): Remove pattern.

gcc/testsuite/

    PR target/100041
    * gcc.target/i386/pr79514.c (dg-error):
    Expect error for 64bit targets.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Pushed to mainline.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 2326 bytes --]

diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
index 91da2849c49..b1059c77b6b 100644
--- a/gcc/config/i386/i386-options.c
+++ b/gcc/config/i386/i386-options.c
@@ -2557,6 +2557,9 @@ ix86_option_override_internal (bool main_args_p,
 	opts->x_ix86_isa_flags
 	  |= TARGET_SUBTARGET64_ISA_DEFAULT & ~opts->x_ix86_isa_flags_explicit;
 
+      if (!TARGET_128BIT_LONG_DOUBLE_P (opts->x_target_flags))
+	error ("%<-m96bit-long-double%> is not compatible with this target");
+
       if (TARGET_RTD_P (opts->x_target_flags))
 	warning (0,
 		 main_args_p
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 9ff35d9a607..9e9dce6d433 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3044,36 +3044,6 @@
   operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);
 })
 
-(define_insn_and_split "*pushxf_rounded"
-  [(set (mem:XF
-	  (pre_modify:P
-	    (reg:P SP_REG)
-	    (plus:P (reg:P SP_REG) (const_int -16))))
-	(match_operand:XF 0 "nonmemory_no_elim_operand" "f,r,*r,C"))]
-  "TARGET_64BIT"
-  "#"
-  "&& 1"
-  [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -16)))
-   (set (match_dup 1) (match_dup 0))]
-{
-  rtx pat = PATTERN (curr_insn);
-  operands[1] = SET_DEST (pat);
-
-  /* Preserve memory attributes. */
-  operands[1] = replace_equiv_address (operands[1], stack_pointer_rtx);
-}
-  [(set_attr "type" "multi")
-   (set_attr "unit" "i387,*,*,*")
-   (set (attr "mode")
-	(cond [(eq_attr "alternative" "1,2,3")
-		 (const_string "DI")
-	      ]
-	      (const_string "XF")))
-   (set (attr "preferred_for_size")
-     (cond [(eq_attr "alternative" "1")
-              (symbol_ref "false")]
-           (symbol_ref "true")))])
-
 (define_insn "*pushxf"
   [(set (match_operand:XF 0 "push_operand" "=<,<,<,<,<")
 	(match_operand:XF 1 "general_no_elim_operand" "f,r,*r,oF,oC"))]
diff --git a/gcc/testsuite/gcc.target/i386/pr79514.c b/gcc/testsuite/gcc.target/i386/pr79514.c
index c5b7bf8ef67..8235da6e14c 100644
--- a/gcc/testsuite/gcc.target/i386/pr79514.c
+++ b/gcc/testsuite/gcc.target/i386/pr79514.c
@@ -1,6 +1,7 @@
 /* PR target/79514 */
 /* { dg-do compile } */
 /* { dg-options "-m96bit-long-double" } */
+/* { dg-error "'-m96bit-long-double' is not compatible" "" { target { ! ia32 } } 0 } */
 
 extern void bar (long double);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23 16:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 16:47 i386: Reject -m96bit-long-double for 64bit targets [PR100041] Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).