public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Use no-mmx,no-sse for LIBGCC2_UNWIND_ATTRIBUTE [PR104890]
@ 2022-03-15  9:18 Jakub Jelinek
  2022-03-15  9:22 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2022-03-15  9:18 UTC (permalink / raw)
  To: Richard Biener, Uros Bizjak; +Cc: gcc-patches

Hi!

Regardless of the outcome of the general-regs-only stuff in x86gprintrin.h,
apparently general-regs-only is much bigger hammer than no-sse, and e.g.
using 387 instructions in the unwinder isn't a big deal, it never needs
to realign the stack because of it.

So, the following patch uses no-sse (and adds no-mmx to it, even when not
strictly needed).

Bootstrapped/regtested on x86_64-linux and i686-linux, on the latter
both normally and with -msse2 -mfpmath=sse -mstackrealign in the options and
--enable-cet, ok for trunk?

2022-03-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/104890
	* config/i386/i386.h (LIBGCC2_UNWIND_ATTRIBUTE): Use no-mmx,no-sse
	instead of general-regs-only.

--- gcc/config/i386/i386.h.jj	2022-03-09 15:25:28.355498493 +0100
+++ gcc/config/i386/i386.h	2022-03-14 15:27:33.831976579 +0100
@@ -2848,10 +2848,10 @@ extern enum attr_cpu ix86_schedule;
 #define NUM_X86_64_MS_CLOBBERED_REGS 12
 #endif
 
-/* __builtin_eh_return can't handle stack realignment, so restrict to
-   general regs in 32-bit libgcc functions that call it.  */
+/* __builtin_eh_return can't handle stack realignment, so disable MMX/SSE
+   in 32-bit libgcc functions that call it.  */
 #ifndef __x86_64__
-#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("general-regs-only")))
+#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("no-mmx,no-sse")))
 #endif
 
 /*

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i386: Use no-mmx,no-sse for LIBGCC2_UNWIND_ATTRIBUTE [PR104890]
  2022-03-15  9:18 [PATCH] i386: Use no-mmx,no-sse for LIBGCC2_UNWIND_ATTRIBUTE [PR104890] Jakub Jelinek
@ 2022-03-15  9:22 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2022-03-15  9:22 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Uros Bizjak, gcc-patches

On Tue, 15 Mar 2022, Jakub Jelinek wrote:

> Hi!
> 
> Regardless of the outcome of the general-regs-only stuff in x86gprintrin.h,
> apparently general-regs-only is much bigger hammer than no-sse, and e.g.
> using 387 instructions in the unwinder isn't a big deal, it never needs
> to realign the stack because of it.
> 
> So, the following patch uses no-sse (and adds no-mmx to it, even when not
> strictly needed).
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, on the latter
> both normally and with -msse2 -mfpmath=sse -mstackrealign in the options and
> --enable-cet, ok for trunk?

OK.

> 2022-03-15  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/104890
> 	* config/i386/i386.h (LIBGCC2_UNWIND_ATTRIBUTE): Use no-mmx,no-sse
> 	instead of general-regs-only.
> 
> --- gcc/config/i386/i386.h.jj	2022-03-09 15:25:28.355498493 +0100
> +++ gcc/config/i386/i386.h	2022-03-14 15:27:33.831976579 +0100
> @@ -2848,10 +2848,10 @@ extern enum attr_cpu ix86_schedule;
>  #define NUM_X86_64_MS_CLOBBERED_REGS 12
>  #endif
>  
> -/* __builtin_eh_return can't handle stack realignment, so restrict to
> -   general regs in 32-bit libgcc functions that call it.  */
> +/* __builtin_eh_return can't handle stack realignment, so disable MMX/SSE
> +   in 32-bit libgcc functions that call it.  */
>  #ifndef __x86_64__
> -#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("general-regs-only")))
> +#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((target ("no-mmx,no-sse")))
>  #endif
>  
>  /*
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-15  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15  9:18 [PATCH] i386: Use no-mmx,no-sse for LIBGCC2_UNWIND_ATTRIBUTE [PR104890] Jakub Jelinek
2022-03-15  9:22 ` Richard Biener

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).