aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
commit071b4126c613881f4cb25b4e5c39032964827f88 (patch)
tree7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/testsuite/gcc.target/i386
parent845d23f3ea08ba873197c275a8857eee7edad996 (diff)
parentcaa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff)
downloadgcc-devel/gfortran-test.zip
gcc-devel/gfortran-test.tar.gz
gcc-devel/gfortran-test.tar.bz2
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/testsuite/gcc.target/i386')
-rw-r--r--gcc/testsuite/gcc.target/i386/20020224-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/apx-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/asm-hard-reg-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/attributes-error.c42
-rw-r--r--gcc/testsuite/gcc.target/i386/attributes-ignore.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/memcpy-strategy-14.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/memcpy-strategy-15.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-10.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-11.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-12.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-13.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-14.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-15.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/memset-strategy-16.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/no-callee-saved-19a.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/no-callee-saved-19b.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/no-callee-saved-19d.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/no-callee-saved-19e.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/noplt-gd-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/noplt-ld-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr103785.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr119795.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/pr120427-5.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr120941-1.c49
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121208-1a.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121208-1b.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121208-2a.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121208-2b.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121208-3a.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121208-3b.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121274.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121303.c26
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121410.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121497.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121540-1.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121540-2.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-1a.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-1b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-2.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-3.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-4.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-5a.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121541-5b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121572-1a.c41
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121572-1b.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121572-2a.c39
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121572-2b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121607-1a.c59
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121607-1b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121635-1a.c21
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121635-1b.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121658.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121668-1a.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121668-1b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121694-1a.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121694-1b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121699.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121725-1a.c41
-rw-r--r--gcc/testsuite/gcc.target/i386/pr121725-1b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr15184-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36533.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr44130.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr59099.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-10a.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-10b.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-1a.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-1b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-2a.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-2b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-3.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-4a.c51
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-4b.c6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-5.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-6a.c67
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-6b.c28
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-7.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-8a.c82
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-8b.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-9a.c39
-rw-r--r--gcc/testsuite/gcc.target/i386/pr81501-9b.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/pr90579.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c64
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c196
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c85
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/shift-v16qi-4.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sibcall-8.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/sw-1.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/uintr-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/uintr-5.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vect_unroll-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/vect_unroll-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/vect_unroll-3.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/vect_unroll-4.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/vect_unroll-5.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/vect_unroll-6.c12
101 files changed, 1725 insertions, 38 deletions
diff --git a/gcc/testsuite/gcc.target/i386/20020224-1.c b/gcc/testsuite/gcc.target/i386/20020224-1.c
index 2905719..769332b 100644
--- a/gcc/testsuite/gcc.target/i386/20020224-1.c
+++ b/gcc/testsuite/gcc.target/i386/20020224-1.c
@@ -4,6 +4,7 @@
while callee was actually not poping it up (as the hidden argument
was passed in register). */
/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
/* { dg-options "-O2 -fomit-frame-pointer" } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.target/i386/apx-1.c b/gcc/testsuite/gcc.target/i386/apx-1.c
index 4e580ec..b118928 100644
--- a/gcc/testsuite/gcc.target/i386/apx-1.c
+++ b/gcc/testsuite/gcc.target/i386/apx-1.c
@@ -3,6 +3,6 @@
/* { dg-error "'-mapxf' is not supported for 32-bit code" "" { target ia32 } 0 } */
void
-apx_hanlder ()
+apx_handler ()
{
}
diff --git a/gcc/testsuite/gcc.target/i386/asm-hard-reg-2.c b/gcc/testsuite/gcc.target/i386/asm-hard-reg-2.c
index b35cf53..756f6f8 100644
--- a/gcc/testsuite/gcc.target/i386/asm-hard-reg-2.c
+++ b/gcc/testsuite/gcc.target/i386/asm-hard-reg-2.c
@@ -8,7 +8,7 @@ test (void)
#ifdef __x86_64__
int z __attribute__ ((mode (TI)));
#else
- long z;
+ long long z;
#endif
__asm__ __volatile__ ("" : "=A" (z), "={rbx}" (y));
diff --git a/gcc/testsuite/gcc.target/i386/attributes-error.c b/gcc/testsuite/gcc.target/i386/attributes-error.c
index 405eda5..5d1c77d 100644
--- a/gcc/testsuite/gcc.target/i386/attributes-error.c
+++ b/gcc/testsuite/gcc.target/i386/attributes-error.c
@@ -1,12 +1,40 @@
+/* { dg-options "-msse2" } */
/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */
-void foo1(int i, int j) __attribute__((fastcall, cdecl)); /* { dg-error "not compatible" } */
-void foo2(int i, int j) __attribute__((fastcall, stdcall)); /* { dg-error "not compatible" } */
+void foo1(int i, int j) __attribute__((cdecl, regparm(2)));
+void foo2(int i, int j) __attribute__((stdcall, regparm(2)));
void foo3(int i, int j) __attribute__((fastcall, regparm(2))); /* { dg-error "not compatible" } */
-void foo4(int i, int j) __attribute__((stdcall, cdecl)); /* { dg-error "not compatible" } */
-void foo5(int i, int j) __attribute__((stdcall, fastcall)); /* { dg-error "not compatible" } */
-void foo6(int i, int j) __attribute__((cdecl, fastcall)); /* { dg-error "not compatible" } */
-void foo7(int i, int j) __attribute__((cdecl, stdcall)); /* { dg-error "not compatible" } */
-void foo8(int i, int j) __attribute__((regparm(2), fastcall)); /* { dg-error "not compatible" } */
+void foo4(int i, int j) __attribute__((thiscall, regparm(2))); /* { dg-error "not compatible" } */
+void foo5(int i, int j) __attribute__((sseregparm, regparm(2)));
+
+void foo6(int i, int j) __attribute__((stdcall, fastcall)); /* { dg-error "not compatible" } */
+void foo7(int i, int j) __attribute__((regparm(2), fastcall)); /* { dg-error "not compatible" } */
+void foo8(int i, int j) __attribute__((cdecl, fastcall)); /* { dg-error "not compatible" } */
+void foo9(int i, int j) __attribute__((thiscall, fastcall)); /* { dg-error "not compatible" } */
+void foo10(int i, int j) __attribute__((sseregparm, fastcall));
+
+void foo11(int i, int j) __attribute__((cdecl, stdcall)); /* { dg-error "not compatible" } */
+void foo12(int i, int j) __attribute__((fastcall, stdcall)); /* { dg-error "not compatible" } */
+void foo13(int i, int j) __attribute__((thiscall, stdcall)); /* { dg-error "not compatible" } */
+void foo14(int i, int j) __attribute__((regparm(2), stdcall));
+void foo15(int i, int j) __attribute__((sseregparm, stdcall));
+
+void foo16(int i, int j) __attribute__((stdcall, cdecl)); /* { dg-error "not compatible" } */
+void foo17(int i, int j) __attribute__((fastcall, cdecl)); /* { dg-error "not compatible" } */
+void foo18(int i, int j) __attribute__((thiscall, cdecl)); /* { dg-error "not compatible" } */
+void foo19(int i, int j) __attribute__((regparm(2), cdecl));
+void foo20(int i, int j) __attribute__((sseregparm, cdecl));
+
+void foo21(int i, int j) __attribute__((stdcall, thiscall)); /* { dg-error "not compatible" } */
+void foo22(int i, int j) __attribute__((fastcall, thiscall)); /* { dg-error "not compatible" } */
+void foo23(int i, int j) __attribute__((cdecl, thiscall)); /* { dg-error "not compatible" } */
+void foo24(int i, int j) __attribute__((regparm(2), thiscall)); /* { dg-error "not compatible" } */
+void foo25(int i, int j) __attribute__((sseregparm, thiscall));
+
+void foo26(int i, int j) __attribute__((cdecl, sseregparm));
+void foo27(int i, int j) __attribute__((fastcall, sseregparm));
+void foo28(int i, int j) __attribute__((stdcall, sseregparm));
+void foo29(int i, int j) __attribute__((thiscall, sseregparm));
+void foo30(int i, int j) __attribute__((regparm(2), sseregparm));
diff --git a/gcc/testsuite/gcc.target/i386/attributes-ignore.c b/gcc/testsuite/gcc.target/i386/attributes-ignore.c
new file mode 100644
index 0000000..93a3770
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/attributes-ignore.c
@@ -0,0 +1,8 @@
+/* { dg-do compile { target { ! ia32 } } } */
+
+void foo1(int i, int j) __attribute__((regparm(0))); /* { dg-warning "ignored" } */
+void foo2(int i, int j) __attribute__((stdcall)); /* { dg-warning "ignored" } */
+void foo3(int i, int j) __attribute__((fastcall)); /* { dg-warning "ignored" } */
+void foo4(int i, int j) __attribute__((cdecl)); /* { dg-warning "ignored" } */
+void foo5(int i, int j) __attribute__((thiscall)); /* { dg-warning "ignored" } */
+void foo6(int i, int j) __attribute__((sseregparm)); /* { dg-warning "ignored" } */
diff --git a/gcc/testsuite/gcc.target/i386/memcpy-strategy-14.c b/gcc/testsuite/gcc.target/i386/memcpy-strategy-14.c
new file mode 100644
index 0000000..44cd652
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memcpy-strategy-14.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-avx -msse2 -mtune=generic -minline-all-stringops -mstringop-strategy=vector_loop" } */
+/* { dg-final { scan-assembler-times "movaps" 8 } } */
+
+char a[2048];
+char b[2048];
+void t (void)
+{
+ __builtin_memcpy (a, b, 2048);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memcpy-strategy-15.c b/gcc/testsuite/gcc.target/i386/memcpy-strategy-15.c
new file mode 100644
index 0000000..ea8e4be
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memcpy-strategy-15.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-avx -msse2 -mtune=generic -minline-all-stringops -mstringop-strategy=vector_loop" } */
+/* { dg-final { scan-assembler-times "movups" 8 } } */
+
+char *a;
+char *b;
+void t (void)
+{
+ __builtin_memcpy (a, b, 2048);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-10.c b/gcc/testsuite/gcc.target/i386/memset-strategy-10.c
new file mode 100644
index 0000000..b4a93a7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-10.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -march=x86-64 -mstringop-strategy=vector_loop -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**foo:
+**.LFB[0-9]+:
+** .cfi_startproc
+** xorps %xmm0, %xmm0
+** xorl %eax, %eax
+** movq %rax, 48\(%(e|r)di\)
+** movups %xmm0, \(%(e|r)di\)
+** movups %xmm0, 16\(%(e|r)di\)
+** movups %xmm0, 32\(%(e|r)di\)
+** ret
+**...
+*/
+
+void
+foo (char *a)
+{
+ __builtin_memset (a, 0, 56);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-11.c b/gcc/testsuite/gcc.target/i386/memset-strategy-11.c
new file mode 100644
index 0000000..851c6fa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-11.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-avx -msse2 -mtune=generic -minline-all-stringops -mstringop-strategy=vector_loop" } */
+/* { dg-final { scan-assembler-times "movaps" 4 } } */
+
+char a[2048];
+void t (void)
+{
+ __builtin_memset (a, 0, 2048);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-12.c b/gcc/testsuite/gcc.target/i386/memset-strategy-12.c
new file mode 100644
index 0000000..06cac03
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-12.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-sse -mstringop-strategy=vector_loop" } */
+
+void
+foo (char *a)
+{
+ __builtin_memset (a, 0, 56);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-13.c b/gcc/testsuite/gcc.target/i386/memset-strategy-13.c
new file mode 100644
index 0000000..be67610
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-13.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-sse -mstringop-strategy=unrolled_loop -fasynchronous-unwind-tables -fdwarf2-cfi-asm" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**foo:
+**.LFB[0-9]+:
+** .cfi_startproc
+** xorl %eax, %eax
+** movq %rax, \(%(e|r)di\)
+** movq %rax, 8\(%(e|r)di\)
+** movq %rax, 16\(%(e|r)di\)
+** movq %rax, 24\(%(e|r)di\)
+** movq %rax, 32\(%(e|r)di\)
+** movq %rax, 40\(%(e|r)di\)
+** movq %rax, 48\(%(e|r)di\)
+** ret
+**...
+*/
+
+void
+foo (char *a)
+{
+ __builtin_memset (a, 0, 56);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-14.c b/gcc/testsuite/gcc.target/i386/memset-strategy-14.c
new file mode 100644
index 0000000..144235e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-14.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -march=x86-64 -mstringop-strategy=vector_loop" } */
+
+void
+foo (char *a, int c)
+{
+ __builtin_memset (a, c, 56);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-15.c b/gcc/testsuite/gcc.target/i386/memset-strategy-15.c
new file mode 100644
index 0000000..66f9fa6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-15.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -mno-avx -msse2 -mtune=generic -mstringop-strategy=vector_loop" } */
+/* { dg-final { scan-assembler-times "movups" 4} } */
+
+char *a;
+void t (void)
+{
+ __builtin_memset (a, 0, 2048);
+}
diff --git a/gcc/testsuite/gcc.target/i386/memset-strategy-16.c b/gcc/testsuite/gcc.target/i386/memset-strategy-16.c
new file mode 100644
index 0000000..a8d60e4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memset-strategy-16.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mstringop-strategy=rep_4byte" } */
+
+extern unsigned x[];
+void
+foo (void)
+{
+ __builtin_memset(x, 0, 847);
+}
diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-19a.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-19a.c
index 12f35cf..3ba578d 100644
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-19a.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-19a.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && lp64 } } } */
-/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mno-apxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mno-apxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-19b.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-19b.c
index c9343a6..dc38936 100644
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-19b.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-19b.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && maybe_x32 } } } */
-/* { dg-options "-O2 -mx32 -fno-pic -mtune=generic -msse2 -mno-apxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* { dg-options "-O2 -mx32 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mno-apxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c
index 05aca9f..e7f247b 100644
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && ia32 } } } */
-/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-19d.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-19d.c
index b3caa3d..4657e17 100644
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-19d.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-19d.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && lp64 } } } */
-/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-19e.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-19e.c
index 3fcb41f..8e0bbe8 100644
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-19e.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-19e.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && maybe_x32 } } } */
-/* { dg-options "-O2 -mx32 -fno-pic -mtune=generic -msse2 -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* { dg-options "-O2 -mx32 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
diff --git a/gcc/testsuite/gcc.target/i386/noplt-gd-1.c b/gcc/testsuite/gcc.target/i386/noplt-gd-1.c
index 5d5b531..7eac70a 100644
--- a/gcc/testsuite/gcc.target/i386/noplt-gd-1.c
+++ b/gcc/testsuite/gcc.target/i386/noplt-gd-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && tls_get_addr_via_got } } } */
-/* { dg-options "-fpic -fno-plt" } */
+/* { dg-options "-fpic -fno-plt -mtls-dialect=gnu" } */
extern __thread int gd;
diff --git a/gcc/testsuite/gcc.target/i386/noplt-ld-1.c b/gcc/testsuite/gcc.target/i386/noplt-ld-1.c
index 8769830..12dcb7a 100644
--- a/gcc/testsuite/gcc.target/i386/noplt-ld-1.c
+++ b/gcc/testsuite/gcc.target/i386/noplt-ld-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { *-*-linux* && tls_get_addr_via_got } } } */
-/* { dg-options "-fpic -fno-plt" } */
+/* { dg-options "-fpic -fno-plt -mtls-dialect=gnu" } */
static __thread int ld;
diff --git a/gcc/testsuite/gcc.target/i386/pr103785.c b/gcc/testsuite/gcc.target/i386/pr103785.c
index 5503b96..49d6c56 100644
--- a/gcc/testsuite/gcc.target/i386/pr103785.c
+++ b/gcc/testsuite/gcc.target/i386/pr103785.c
@@ -11,7 +11,10 @@ struct wrapper_t
struct wrapper_t **table;
-__attribute__ ((weak, regparm (2)))
+#ifndef __x86_64__
+__attribute__ ((regparm (2)))
+#endif
+__attribute__ ((weak))
void
update (long k, long e)
{
diff --git a/gcc/testsuite/gcc.target/i386/pr119795.c b/gcc/testsuite/gcc.target/i386/pr119795.c
new file mode 100644
index 0000000..03c91cc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr119795.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O -fschedule-insns -favoid-store-forwarding" } */
+
+unsigned a, b, c;
+
+void
+foo (_BitInt(2) b2, unsigned _BitInt(255) by, unsigned _BitInt(5) b5,
+ unsigned _BitInt(256) *ret)
+{
+ unsigned _BitInt(255) bx = b2;
+ by += 0x80000000000000000000000000000000wb;
+ __builtin_memmove (&b, &c, 3);
+ unsigned d = b;
+ unsigned e = __builtin_stdc_rotate_right (0x1uwb % b5, a);
+ unsigned _BitInt(256) r = by + bx + d + e;
+ *ret = r;
+}
+
+int
+main ()
+{
+ unsigned _BitInt(256) x;
+ foo (0, -1, 2, &x);
+ if (x != 0x80000000000000000000000000000000wb)
+ __builtin_abort();
+} \ No newline at end of file
diff --git a/gcc/testsuite/gcc.target/i386/pr120427-5.c b/gcc/testsuite/gcc.target/i386/pr120427-5.c
new file mode 100644
index 0000000..7199aef
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr120427-5.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-Oz" } */
+
+long long
+func1 (void)
+{
+ return -1;
+}
+/* { dg-final { scan-assembler-times "pushq\[ \\t\]+\\\$-1" 1 } } */
+/* { dg-final { scan-assembler-times "popq\[ \\t\]+%rax" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr120941-1.c b/gcc/testsuite/gcc.target/i386/pr120941-1.c
new file mode 100644
index 0000000..b4fc6ac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr120941-1.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -march=x86-64-v3" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */
+
+/*
+**bar:
+**.LFB[0-9]+:
+**...
+** vbroadcastsd .LC4\(%rip\), %ymm2
+** leal 2\(%rbx\), %eax
+** vbroadcastsd .LC2\(%rip\), %ymm4
+** negl %eax
+**...
+*/
+
+extern void foo (int);
+
+enum { N_CELL_ENTRIES1 = 2 }
+typedef LBM_Grid1[64];
+enum { N_CELL_ENTRIES2 = 2 }
+typedef LBM_Grid2[64];
+LBM_Grid1 grid1;
+LBM_Grid2 grid2;
+extern int n;
+
+void
+LBM_handleInOutFlow()
+{
+ int i, j;
+ for (; i; i += 2)
+ {
+ for (j = 0; j < n; j++)
+ {
+ grid1[i] = 1.0 / 36.0 * i;
+ grid2[i] = 1.0 / 36.0 * i;
+ }
+ }
+}
+
+int main_t;
+void
+bar (void)
+{
+ for (; main_t; main_t++) {
+ LBM_handleInOutFlow();
+ foo (main_t);
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121208-1a.c b/gcc/testsuite/gcc.target/i386/pr121208-1a.c
new file mode 100644
index 0000000..f799bc8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121208-1a.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fPIC -mno-avx -mno-mmx -mno-80387 -mtls-dialect=gnu" } */
+
+extern __thread int bar;
+extern void func (void);
+
+__attribute__((no_caller_saved_registers))
+void
+foo (int error)
+{
+ bar = 1; /* { dg-error -mtls-dialect=gnu2 } */
+ if (error == 0)
+ func ();
+ bar = 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121208-1b.c b/gcc/testsuite/gcc.target/i386/pr121208-1b.c
new file mode 100644
index 0000000..ba37abc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121208-1b.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fPIC -mno-avx -mno-mmx -mno-80387 -mtls-dialect=gnu2" } */
+
+#include "pr121208-1a.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr121208-2a.c b/gcc/testsuite/gcc.target/i386/pr121208-2a.c
new file mode 100644
index 0000000..c1891ae
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121208-2a.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fPIC -mtls-dialect=gnu" } */
+
+typedef unsigned int uword_t __attribute__ ((mode (__word__)));
+extern __thread int bar;
+extern void func (void);
+
+__attribute__((target("general-regs-only")))
+__attribute__((interrupt))
+void
+foo (void *frame, uword_t error)
+{
+ bar = 1; /* { dg-error -mtls-dialect=gnu2 } */
+ if (error == 0)
+ func ();
+ bar = 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121208-2b.c b/gcc/testsuite/gcc.target/i386/pr121208-2b.c
new file mode 100644
index 0000000..269b120
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121208-2b.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fPIC -mtls-dialect=gnu2" } */
+
+#include "pr121208-2a.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr121208-3a.c b/gcc/testsuite/gcc.target/i386/pr121208-3a.c
new file mode 100644
index 0000000..26fe687
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121208-3a.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fPIC -mtls-dialect=gnu" } */
+
+typedef unsigned int uword_t __attribute__ ((mode (__word__)));
+extern __thread int bar;
+extern void func (void);
+
+__attribute__((target("general-regs-only")))
+__attribute__((interrupt))
+void
+foo (void *frame)
+{
+ bar = 1; /* { dg-error -mtls-dialect=gnu2 } */
+ if (frame == 0)
+ func ();
+ bar = 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121208-3b.c b/gcc/testsuite/gcc.target/i386/pr121208-3b.c
new file mode 100644
index 0000000..b672d75
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121208-3b.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fPIC -mtls-dialect=gnu2" } */
+
+#include "pr121208-3a.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr121274.c b/gcc/testsuite/gcc.target/i386/pr121274.c
new file mode 100644
index 0000000..16760cf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121274.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-march=x86-64-v4 -O2" } */
+/* { dg-final { scan-assembler-not "vpextrq" } } */
+/* { dg-final { scan-assembler-not "vpinsrq" } } */
+
+typedef int v16si __attribute__((vector_size(64)));
+typedef int v4si __attribute__((vector_size(16)));
+
+v4si f(v16si x)
+{
+ return __builtin_shufflevector(x, x, 0, 1, 2, 3);
+}
+
+v4si g(v16si x)
+{
+return __builtin_shufflevector(x, x, 4, 5, 6, 7);
+}
+
+v4si f1(__int128 *x)
+{
+ __int128 t = *x;
+ asm("":"+x"(t));
+ return (v4si)t;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121303.c b/gcc/testsuite/gcc.target/i386/pr121303.c
new file mode 100644
index 0000000..7900bce
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121303.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -favoid-store-forwarding" } */
+
+typedef struct {
+ bool is_ssa;
+} nir_src;
+
+nir_src nir_src_init;
+
+typedef struct {
+ nir_src src;
+ char swizzle[6];
+} nir_alu_src;
+
+void nir_src_bit_size(nir_src);
+
+void nir_lower_fb_read_instr() {
+ {
+ nir_alu_src alu_src = {nir_src_init}, src = alu_src;
+ nir_src_bit_size(src.src);
+ }
+ {
+ nir_alu_src alu_src = {nir_src_init}, src = alu_src;
+ nir_src_bit_size(src.src);
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121410.c b/gcc/testsuite/gcc.target/i386/pr121410.c
new file mode 100644
index 0000000..04bab91
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121410.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=x86-64 -mavx512f -mstore-max=128" } */
+
+extern unsigned _BitInt(3719) a;
+extern _BitInt(465) g;
+void
+foo(void)
+{
+ _BitInt(465) b = a >> 1860;
+ g = b + b;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121497.c b/gcc/testsuite/gcc.target/i386/pr121497.c
new file mode 100644
index 0000000..ce55f95
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121497.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse2 -w" } */
+
+extern void a(int *);
+int q;
+void b(int c, int d, int e, int f, int g, int h) {
+ int t[] = {c, d, e, f, g, h};
+ a(t);
+}
+int main() {
+ int k[2], i = 0, *p();
+ if (q) {
+ for (; (int)p + i < 2; i++)
+ k[i] = -1294967296;
+ b(k[0] + 7, k[0] + 9, k[0] + 6, k[0] + 9, k[0] + 9, k[0] + 6);
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121540-1.c b/gcc/testsuite/gcc.target/i386/pr121540-1.c
new file mode 100644
index 0000000..dee9c27
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121540-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=x86-64" } */
+
+void
+ __attribute__ ((no_caller_saved_registers))
+fn (void)
+{ /* { dg-message "sorry, unimplemented: MMX/3Dnow instructions aren't allowed" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121540-2.c b/gcc/testsuite/gcc.target/i386/pr121540-2.c
new file mode 100644
index 0000000..15a3f40
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121540-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=x86-64 -mno-mmx" } */
+
+void
+ __attribute__ ((no_caller_saved_registers))
+fn (void)
+{ /* { dg-message "sorry, unimplemented: 80387 instructions aren't allowed" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-1a.c b/gcc/testsuite/gcc.target/i386/pr121541-1a.c
new file mode 100644
index 0000000..83884a7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-1a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -march=x86-64" } */
+
+extern long double d;
+
+__attribute__ ((target("no-80387")))
+void
+func1 (void)
+{
+ d *= 3; /* { dg-error "x87 register return with x87 disabled" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-1b.c b/gcc/testsuite/gcc.target/i386/pr121541-1b.c
new file mode 100644
index 0000000..f440b14
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-1b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2" } */
+
+#include "pr121541-1a.c"
+
+/* { dg-final { scan-assembler "call\[\\t \]+_?__mulxf3" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-2.c b/gcc/testsuite/gcc.target/i386/pr121541-2.c
new file mode 100644
index 0000000..281341e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-80387" } */
+
+extern long double d;
+
+__attribute__ ((target("80387")))
+void
+func1 (void)
+{
+ d *= 3;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-3.c b/gcc/testsuite/gcc.target/i386/pr121541-3.c
new file mode 100644
index 0000000..380fab2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mgeneral-regs-only" } */
+
+extern long double d;
+
+__attribute__ ((target("80387")))
+void
+func1 (void)
+{
+ d *= 3;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-4.c b/gcc/testsuite/gcc.target/i386/pr121541-4.c
new file mode 100644
index 0000000..1f4381a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern long double d;
+
+__attribute__ ((target("general-regs-only","80387")))
+void
+func1 (void)
+{
+ d *= 3;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-5a.c b/gcc/testsuite/gcc.target/i386/pr121541-5a.c
new file mode 100644
index 0000000..e6137e2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-5a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -march=x86-64" } */
+
+extern long double d;
+
+__attribute__ ((target("80387","general-regs-only")))
+void
+func1 (void)
+{
+ d *= 3; /* { dg-error "x87 register return with x87 disabled" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121541-5b.c b/gcc/testsuite/gcc.target/i386/pr121541-5b.c
new file mode 100644
index 0000000..b61a7fe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121541-5b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2" } */
+
+#include "pr121541-5a.c"
+
+/* { dg-final { scan-assembler "call\[\\t \]+_?__mulxf3" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121572-1a.c b/gcc/testsuite/gcc.target/i386/pr121572-1a.c
new file mode 100644
index 0000000..270d8ff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121572-1a.c
@@ -0,0 +1,41 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O0 -fpic -fplt -mtls-dialect=gnu" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**bug:
+**.LFB[0-9]+:
+**...
+** leaq tv_cache@tlsld\(%rip\), %rdi
+** call __tls_get_addr@PLT
+** movl \$-1, %edi
+** mov[l|q] %[e|r]ax, %[e|r]bx
+** call val@PLT
+**...
+*/
+
+extern __thread int tv_cache __attribute__ ((visibility ("hidden")));
+extern void use_cache (int);
+extern int val (int v);
+
+__attribute__ ((optimize (2)))
+void
+bug (void)
+{
+ int compared = val (-1);
+
+ if (compared == 0 || (compared > 0 && val (2) == 0))
+ {
+ __builtin_trap ();
+ }
+
+ if (compared < 0)
+ {
+ use_cache (tv_cache);
+ return;
+ }
+
+ use_cache (tv_cache);
+ __builtin_trap ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121572-1b.c b/gcc/testsuite/gcc.target/i386/pr121572-1b.c
new file mode 100644
index 0000000..8a60891
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121572-1b.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O0 -fpic -fplt -mtls-dialect=gnu2" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**bug:
+**.LFB[0-9]+:
+**...
+** lea[l|q] tv_cache@TLSDESC\(%rip\), %[e|r]ax
+** movl \$-1, %edi
+** call \*tv_cache@TLSCALL\(%[e|r]ax\)
+** mov[l|q] %[e|r]ax, %[e|r]bx
+** call val@PLT
+**...
+*/
+
+#include "pr121572-1a.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr121572-2a.c b/gcc/testsuite/gcc.target/i386/pr121572-2a.c
new file mode 100644
index 0000000..38b2546
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121572-2a.c
@@ -0,0 +1,39 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu" } */
+
+typedef enum
+{
+ MPFR_RNDN
+} mpfr_rnd_t;
+typedef int mpfr_t[1];
+long __gmpfr_emin, mpfr_agm_expo_0;
+_Thread_local long __gmpfr_emax;
+int mpfr_agm_compare, mpfr_agm___trans_tmp_1;
+mpfr_t mpfr_agm_u;
+void mpfr_mul (int *, int, int, mpfr_rnd_t);
+int
+mpfr_agm (int op1)
+{
+ int op2 = 0;
+ if (__builtin_expect (mpfr_agm_compare == 0, 0))
+ return 0;
+ if (mpfr_agm_compare > 0)
+ {
+ int t = op1;
+ op2 = t;
+ }
+ mpfr_agm_expo_0 = __gmpfr_emax;
+ for (;;)
+ {
+ retry:
+ mpfr_mul (mpfr_agm_u, op1, op2, MPFR_RNDN);
+ if (0)
+ goto retry;
+ if (__builtin_expect (mpfr_agm___trans_tmp_1, 1))
+ break;
+ }
+ __gmpfr_emin = __gmpfr_emax;
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121572-2b.c b/gcc/testsuite/gcc.target/i386/pr121572-2b.c
new file mode 100644
index 0000000..33d7002
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121572-2b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr121572-2a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*__gmpfr_emax@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121607-1a.c b/gcc/testsuite/gcc.target/i386/pr121607-1a.c
new file mode 100644
index 0000000..4c04706
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121607-1a.c
@@ -0,0 +1,59 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu -fno-semantic-interposition -fstack-protector" } */
+
+typedef enum
+{
+ bfd_error_invalid_error_code
+} bfd_error_type;
+thread_local bfd_error_type bfd_error;
+int aout_16_write_syms___trans_tmp_1;
+short aout_16_write_syms_g_0_0;
+void xvec_0 (long, void *);
+
+typedef struct
+{
+ int output_section;
+} asection;
+
+void bfd_asymbol_section ();
+
+struct pdp11_external_nlist
+{
+ char e_desc[2];
+ char e_type[1];
+ char e_ovly[10];
+} translate_to_native_sym_flags (struct pdp11_external_nlist *sym_pointer)
+{
+ asection *sec;
+ sym_pointer->e_type[0] &= 5;
+ bfd_asymbol_section ();
+ if (sec == 0)
+ {
+ bfd_error_type error_tag;
+ bfd_error = error_tag;
+ }
+ if (sec->output_section)
+ {
+ bfd_error_type error_tag;
+ bfd_error = error_tag;
+ }
+}
+
+bool
+aout_16_write_syms (void *abfd)
+{
+ for (; aout_16_write_syms___trans_tmp_1;)
+ {
+ struct pdp11_external_nlist nsp;
+ if (abfd)
+ {
+ xvec_0 (aout_16_write_syms_g_0_0, nsp.e_desc);
+ nsp.e_ovly[0] = 0;
+ }
+ else
+ nsp.e_type[0] = 0;
+ translate_to_native_sym_flags (&nsp);
+ }
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121607-1b.c b/gcc/testsuite/gcc.target/i386/pr121607-1b.c
new file mode 100644
index 0000000..3663067
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121607-1b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2 -fno-semantic-interposition -fstack-protector" } */
+
+#include "pr121607-1a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*bfd_error@TLSCALL\\(%(?:r|e)ax\\)" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121635-1a.c b/gcc/testsuite/gcc.target/i386/pr121635-1a.c
new file mode 100644
index 0000000..4db7def
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121635-1a.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu" } */
+
+extern int get_cordz_mean_interval ();
+extern thread_local long cordz_next_sample, kIntervalIfDisabled;
+extern bool cordz_should_profile_slow (void);
+inline bool
+cordz_should_profile (void)
+{
+ return cordz_should_profile_slow ();
+}
+bool
+cordz_should_profile_slow (void)
+{
+ int mean_interval = get_cordz_mean_interval ();
+ if (mean_interval)
+ cordz_next_sample = kIntervalIfDisabled;
+ return cordz_next_sample || cordz_should_profile ();
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121635-1b.c b/gcc/testsuite/gcc.target/i386/pr121635-1b.c
new file mode 100644
index 0000000..4095fb5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121635-1b.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr121635-1a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*cordz_next_sample@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*kIntervalIfDisabled@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121658.c b/gcc/testsuite/gcc.target/i386/pr121658.c
new file mode 100644
index 0000000..0437316
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121658.c
@@ -0,0 +1,11 @@
+/* PR target/121658 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512f -mgfni" } */
+
+__attribute__((__vector_size__(64))) unsigned char v;
+
+void
+foo (void)
+{
+ v = (v << 7) | (v >> 1);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121668-1a.c b/gcc/testsuite/gcc.target/i386/pr121668-1a.c
new file mode 100644
index 0000000..eb55308
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121668-1a.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-Og -g -fpic -fplt -mtls-dialect=gnu" } */
+
+typedef int caml_domain_state;
+thread_local caml_domain_state caml_state;
+void
+caml_empty_mark_stack ()
+{
+ while (caml_state)
+ caml_state = 0;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121668-1b.c b/gcc/testsuite/gcc.target/i386/pr121668-1b.c
new file mode 100644
index 0000000..54a2775
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121668-1b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-Og -g -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr121668-1a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*caml_state@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121694-1a.c b/gcc/testsuite/gcc.target/i386/pr121694-1a.c
new file mode 100644
index 0000000..af9c657
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121694-1a.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-Og -fpic -fplt -mtls-dialect=gnu" } */
+
+extern void func1 (long *);
+extern int func2 (void);
+extern void func3 (void);
+static __thread long foo;
+static __thread long bar;
+long
+func (void)
+{
+ func1 (&foo);
+ func1 (&bar);
+ if (func2 ())
+ func3 ();
+ return foo + bar;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121694-1b.c b/gcc/testsuite/gcc.target/i386/pr121694-1b.c
new file mode 100644
index 0000000..76ebbf7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121694-1b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-Og -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr121694-1a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*_TLS_MODULE_BASE_@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121699.c b/gcc/testsuite/gcc.target/i386/pr121699.c
new file mode 100644
index 0000000..80c1404
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121699.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-march=znver4 -O3" } */
+
+typedef struct
+{
+ int u32;
+} nir_const_value;
+
+nir_const_value *evaluate_prmt_nv__dst_val;
+
+int evaluate_prmt_nv__src_0, evaluate_prmt_nv_src;
+
+void
+evaluate_prmt_nv (unsigned num_components)
+{
+ for (unsigned _i = 0; _i < num_components; _i++)
+ {
+ char x = evaluate_prmt_nv_src;
+ if (evaluate_prmt_nv__src_0)
+ x = x >> 7;
+ evaluate_prmt_nv__dst_val[_i].u32 = x;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr121725-1a.c b/gcc/testsuite/gcc.target/i386/pr121725-1a.c
new file mode 100644
index 0000000..d0a498c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121725-1a.c
@@ -0,0 +1,41 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O3 -fpic -fplt -mtls-dialect=gnu" } */
+
+typedef enum
+{
+ bfd_error_invalid_error_code
+} bfd_error_type;
+static thread_local bfd_error_type bfd_error;
+extern int sections;
+extern void *bfd_alloc_ret;
+extern int bfd_alloc___o;
+extern long bfd_alloc_size;
+
+extern void _objalloc_alloc (int *, long);
+
+bfd_error_type
+bfd_get_error ()
+{
+ return bfd_error;
+}
+
+bool
+s7_bfd_score_elf_late_size_sections ()
+{
+ for (; sections;)
+ {
+ if (bfd_alloc_size)
+ {
+ bfd_error_type error_tag;
+ bfd_error = error_tag;
+ }
+ _objalloc_alloc (&bfd_alloc___o, 0);
+ if (bfd_alloc_ret)
+ {
+ bfd_error_type error_tag;
+ bfd_error = error_tag;
+ }
+ }
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr121725-1b.c b/gcc/testsuite/gcc.target/i386/pr121725-1b.c
new file mode 100644
index 0000000..0b97a8a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr121725-1b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O3 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr121725-1a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*bfd_error@TLSCALL\\(%(?:r|e)ax\\)" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr15184-2.c b/gcc/testsuite/gcc.target/i386/pr15184-2.c
index cb8201f..dd50c42 100644
--- a/gcc/testsuite/gcc.target/i386/pr15184-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr15184-2.c
@@ -1,4 +1,4 @@
-/* PR 15184 second two tests
+/* PR 15184 second two tests */
/* { dg-do compile { target ia32 } } */
/* { dg-options "-O2 -march=pentiumpro" } */
/* { dg-additional-options "-fno-PIE" { target ia32 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr36533.c b/gcc/testsuite/gcc.target/i386/pr36533.c
index 8d71ece..8699d26 100644
--- a/gcc/testsuite/gcc.target/i386/pr36533.c
+++ b/gcc/testsuite/gcc.target/i386/pr36533.c
@@ -55,14 +55,22 @@ typedef struct
S1 *s18;
} S7;
-__attribute__((regparm (3), noinline)) int
+#ifndef __x86_64__
+__attribute__((regparm (3)))
+#endif
+__attribute__((noinline))
+int
fn1 (const char *x, void *y, S1 *z)
{
asm volatile ("" : : : "memory");
return *x + (y != 0);
}
-__attribute__((regparm (3), noinline)) int
+#ifndef __x86_64__
+__attribute__((regparm (3)))
+#endif
+__attribute__((noinline))
+int
fn2 (const char *x, int y, S2 *z)
{
asm volatile ("" : : : "memory");
@@ -84,7 +92,11 @@ fn3 (S3 *p)
return (S3 *) ((char *) p + fn4 (p->s9));
}
-__attribute__((regparm (3), noinline)) int
+#ifndef __x86_64__
+__attribute__((regparm (3)))
+#endif
+__attribute__((noinline))
+int
fn5 (void)
{
asm volatile ("" : : : "memory");
@@ -116,7 +128,11 @@ fn6 (S3 *w, int x, S2 *y, S4 *z)
return a;
}
-__attribute__((regparm (3), noinline)) unsigned int
+#ifndef __x86_64__
+__attribute__((regparm (3)))
+#endif
+__attribute__((noinline))
+unsigned int
test (void *u, S6 *v, S1 **w, S7 *x, S2 *y, S1 *z)
{
unsigned b = v->s17->s16;
diff --git a/gcc/testsuite/gcc.target/i386/pr44130.c b/gcc/testsuite/gcc.target/i386/pr44130.c
index 2ad7409..6269dc8 100644
--- a/gcc/testsuite/gcc.target/i386/pr44130.c
+++ b/gcc/testsuite/gcc.target/i386/pr44130.c
@@ -21,6 +21,8 @@ void testf (void)
xxxxx[5] = __builtin_copysignf (-0.0, Yf[5]);
xxxxx[6] = __builtin_copysignf (__builtin_inff (), Yf[6]);
xxxxx[7] = __builtin_copysignf (-__builtin_nanf (""), Yf[7]);
+
+ asm("":"=m"(xxxxx));
for (i = 0; i < 8; ++i)
if (__builtin_memcmp (xxxxx+i, Zf+i, sizeof(float)) != 0)
abort ();
diff --git a/gcc/testsuite/gcc.target/i386/pr59099.c b/gcc/testsuite/gcc.target/i386/pr59099.c
index cf4a8da..21dfbc2 100644
--- a/gcc/testsuite/gcc.target/i386/pr59099.c
+++ b/gcc/testsuite/gcc.target/i386/pr59099.c
@@ -13,10 +13,17 @@ struct s
};
-void* f (struct s *, struct s *) __attribute__ ((noinline, regparm(1)));
+void* f (struct s *, struct s *)
+#ifndef __x86_64__
+__attribute__ ((regparm(1)))
+#endif
+__attribute__ ((noinline))
+;
void*
+#ifndef __x86_64__
__attribute__ ((regparm(1)))
+#endif
f (struct s *p, struct s *p2)
{
void *gp, *gp1;
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-10a.c b/gcc/testsuite/gcc.target/i386/pr81501-10a.c
new file mode 100644
index 0000000..438abf3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-10a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -mtls-dialect=gnu" } */
+
+static __thread int foo = 30;
+
+int *
+test1 (void)
+{
+ __builtin_printf ("foo: %d\n", foo);
+ return &foo;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-10b.c b/gcc/testsuite/gcc.target/i386/pr81501-10b.c
new file mode 100644
index 0000000..4cd1da8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-10b.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr81501-10a.c"
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-1a.c b/gcc/testsuite/gcc.target/i386/pr81501-1a.c
new file mode 100644
index 0000000..30b4642
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-1a.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu" } */
+
+void a(long *);
+int b(void);
+void c(void);
+static __thread long e;
+long
+d(void)
+{
+ a(&e);
+ if (b())
+ c();
+ return e;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-1b.c b/gcc/testsuite/gcc.target/i386/pr81501-1b.c
new file mode 100644
index 0000000..de25f22
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-1b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr81501-1a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*e@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-2a.c b/gcc/testsuite/gcc.target/i386/pr81501-2a.c
new file mode 100644
index 0000000..a06302a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-2a.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu" } */
+
+void a(long *);
+int b(void);
+void c(void);
+extern __thread long e;
+long
+d(void)
+{
+ a(&e);
+ if (b())
+ c();
+ return e;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-2b.c b/gcc/testsuite/gcc.target/i386/pr81501-2b.c
new file mode 100644
index 0000000..4afb742
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-2b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr81501-2a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*e@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-3.c b/gcc/testsuite/gcc.target/i386/pr81501-3.c
new file mode 100644
index 0000000..d422063
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+static __thread int local1;
+int *
+get_local1 (void)
+{
+ return &local1;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-4a.c b/gcc/testsuite/gcc.target/i386/pr81501-4a.c
new file mode 100644
index 0000000..0c655e2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-4a.c
@@ -0,0 +1,51 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64 -fpic -fplt -mtls-dialect=gnu" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**in_dso:
+**.LFB[0-9]+:
+**...
+** movl %edi, %.*
+**...
+** mov(l|q) %(e|r)si, %.*
+**...
+** call __tls_get_addr@PLT
+**...
+*/
+
+__thread int foo;
+
+extern void bar1 (int *, int *);
+extern void bar2 (int);
+extern void bar3 (const char *);
+
+int
+in_dso (int n, int *caller_foop)
+{
+ int *foop;
+ int result = 0;
+
+ bar3 ("foo"); /* Make sure PLT is used before macros. */
+ asm ("" ::: "memory");
+
+ foop = &foo;
+
+ if (caller_foop != (void *) 0 && foop != caller_foop)
+ {
+ bar1 (caller_foop, foop);
+ result = 1;
+ }
+ else if (*foop != n)
+ {
+ bar2 (n);
+ result = 1;
+ }
+
+ *foop = 16;
+
+ return result;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-4b.c b/gcc/testsuite/gcc.target/i386/pr81501-4b.c
new file mode 100644
index 0000000..5d35712
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-4b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu2" } */
+
+#include "pr81501-4a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*\*foo@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-5.c b/gcc/testsuite/gcc.target/i386/pr81501-5.c
new file mode 100644
index 0000000..7f666e1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu" } */
+
+extern __thread int __bid_IDEC_glbflags;
+extern long __bid64qq_div_bid_y_0_1;
+extern void get_BID64(int *);
+void
+__bid64qq_div(void)
+{
+ if (__bid64qq_div_bid_y_0_1)
+ __bid_IDEC_glbflags |= 1;
+ get_BID64(&__bid_IDEC_glbflags);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-6a.c b/gcc/testsuite/gcc.target/i386/pr81501-6a.c
new file mode 100644
index 0000000..db8acf8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-6a.c
@@ -0,0 +1,67 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64 -fpic -fplt -mtls-dialect=gnu" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**in_dso:
+**.LFB[0-9]+:
+**...
+** mov(l|q) %(e|r)dx, %.*
+**...
+** movl %edi, %.*
+**...
+** mov(l|q) %(e|r)si, %.*
+**...
+** call __tls_get_addr@PLT
+**...
+*/
+
+__thread int foo;
+__thread int bar;
+
+extern void fun1 (int *, int *);
+extern void fun2 (int);
+extern void fun3 (const char *);
+
+int
+in_dso (int n, int *caller_foop, int *caller_barp)
+{
+ int *foop;
+ int *barp;
+ int result = 0;
+
+ fun3 ("foo"); /* Make sure PLT is used before macros. */
+ asm ("" ::: "memory");
+
+ foop = &foo;
+ barp = &bar;
+
+ if (caller_foop != (void *) 0 && foop != caller_foop)
+ {
+ fun1 (caller_foop, foop);
+ result = 1;
+ if (caller_barp != (void *) 0 && barp != caller_barp)
+ {
+ fun1 (caller_barp, barp);
+ result = 2;
+ }
+ else if (*barp != n)
+ {
+ fun2 (n);
+ result = 3;
+ }
+ }
+ else if (*foop != n)
+ {
+ fun2 (n);
+ result = 4;
+ }
+
+ *barp = 16;
+ *foop = 16;
+
+ return result;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-6b.c b/gcc/testsuite/gcc.target/i386/pr81501-6b.c
new file mode 100644
index 0000000..0b71f0a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-6b.c
@@ -0,0 +1,28 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64 -fpic -fplt -mtls-dialect=gnu2" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**in_dso:
+**.LFB[0-9]+:
+**...
+** lea(l|q) bar@TLSDESC\(%rip\), %(e|r)ax
+** mov(l|q) %(e|r)si, %.*
+**...
+** mov(l|q) %(e|r)dx, %.*
+**...
+** movl %edi, %.*
+**...
+** call \*bar@TLSCALL\(%(e|r)ax\)
+**...
+** lea(l|q) foo@TLSDESC\(%rip\), %(e|r)ax
+**...
+** call \*foo@TLSCALL\(%(e|r)ax\)
+**...
+*/
+
+#include "pr81501-6a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*foo@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*bar@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-7.c b/gcc/testsuite/gcc.target/i386/pr81501-7.c
new file mode 100644
index 0000000..b2fe5d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-7.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fplt -mtls-dialect=gnu" } */
+
+extern int __bid_IDEC_glbround, __bid64qqq_fma_save_fpsf;
+extern __thread int __bid_IDEC_glbflags;
+typedef struct {
+ long w[2];
+} UINT128;
+extern long __bid64qqq_fma_res_0_1;
+extern void bid128_ext_fma(UINT128, UINT128);
+void
+__bid64qqq_fma(UINT128 y, UINT128 z)
+{
+ __bid_IDEC_glbflags = 0;
+ bid128_ext_fma(y, z);
+ if (__bid_IDEC_glbround || __bid64qqq_fma_res_0_1)
+ __bid_IDEC_glbflags |= __bid64qqq_fma_save_fpsf;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-8a.c b/gcc/testsuite/gcc.target/i386/pr81501-8a.c
new file mode 100644
index 0000000..7e14ef5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-8a.c
@@ -0,0 +1,82 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64 -fpic -fplt -mtls-dialect=gnu" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**in_dso:
+**.LFB[0-9]+:
+**...
+** mov(l|q) %(e|r)dx, %.*
+**...
+** movl %edi, %.*
+**...
+** mov(l|q) %(e|r)si, %.*
+**...
+** testb %al, %al
+**...
+** call __tls_get_addr@PLT
+**...
+*/
+
+#include <stdarg.h>
+
+__thread int foo;
+__thread int bar;
+
+extern void fun1 (int *, int *);
+extern void fun2 (int);
+extern void fun3 (const char *);
+
+int
+in_dso (int n, int *caller_foop, int *caller_barp, ...)
+{
+ int *foop;
+ int *barp;
+ int result;
+ va_list ap;
+ double d;
+
+ va_start (ap, caller_barp);
+
+ result = 0;
+
+ fun3 ("foo"); /* Make sure PLT is used before macros. */
+ asm ("" ::: "memory");
+
+ foop = &foo;
+ barp = &bar;
+
+ if (caller_foop != (void *) 0 && foop != caller_foop)
+ {
+ fun1 (caller_foop, foop);
+ result = 1;
+ if (caller_barp != (void *) 0 && barp != caller_barp)
+ {
+ fun1 (caller_barp, barp);
+ result = 2;
+ }
+ else if (*barp != n)
+ {
+ fun2 (n);
+ result = 3;
+ }
+ }
+ else if (*foop != n)
+ {
+ fun2 (n);
+ result = 4;
+ }
+
+ *barp = 16;
+ *foop = 16;
+
+ d = va_arg (ap, double);
+ if (d != 1234.0)
+ result = 10;
+ va_end (ap);
+
+ return result;
+}
+
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 2 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-8b.c b/gcc/testsuite/gcc.target/i386/pr81501-8b.c
new file mode 100644
index 0000000..778b2fb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-8b.c
@@ -0,0 +1,31 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64 -fpic -fplt -mtls-dialect=gnu2" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**in_dso:
+**.LFB[0-9]+:
+**...
+** mov(l|q) %(e|r)si, %.*
+**...
+** mov(l|q) %(e|r)dx, %.*
+**...
+** movl %edi, %.*
+**...
+** testb %al, %al
+**...
+** lea(l|q) bar@TLSDESC\(%rip\), %(e|r)ax
+**...
+** call \*bar@TLSCALL\(%(e|r)ax\)
+**...
+** lea(l|q) foo@TLSDESC\(%rip\), %(e|r)ax
+**...
+** call \*foo@TLSCALL\(%(e|r)ax\)
+**...
+*/
+
+#include "pr81501-8a.c"
+
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*foo@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*bar@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-9a.c b/gcc/testsuite/gcc.target/i386/pr81501-9a.c
new file mode 100644
index 0000000..66a2768
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-9a.c
@@ -0,0 +1,39 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64-v4 -fpic -fplt -mtls-dialect=gnu" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+
+/*
+**foo:
+**.LFB[0-9]+:
+**...
+** vpbroadcastb %edi, %zmm0
+**...
+** call __tls_get_addr@PLT
+**...
+*/
+
+#include <immintrin.h>
+
+extern __m512i sinkz;
+extern __m256i sinky;
+extern __m128i sinkx;
+extern void func1 (long *);
+extern int func2 (void);
+extern void func3 (void);
+static __thread long var;
+
+long
+foo (char c)
+{
+ func1 (&var);
+ if (func2 ())
+ func3 ();
+ sinkx = _mm_set1_epi8 (c);
+ sinkz = _mm512_set1_epi8 (c);
+ sinky = _mm256_set1_epi8 (c);
+ return var;
+}
+
+/* { dg-final { scan-assembler-times "vpbroadcastb" 1 } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]__tls_get_addr@PLT" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr81501-9b.c b/gcc/testsuite/gcc.target/i386/pr81501-9b.c
new file mode 100644
index 0000000..711b177
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr81501-9b.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -march=x86-64-v4 -fpic -fplt -mtls-dialect=gnu2" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target { ! ia32 } } {^\t?\.} } } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+
+/*
+**foo:
+**.LFB[0-9]+:
+**...
+** vpbroadcastb %edi, %zmm0
+**...
+** lea(l|q) var@TLSDESC\(%rip\), %(e|r)ax
+**...
+** call \*var@TLSCALL\(%(e|r)ax\)
+**...
+*/
+
+#include "pr81501-9a.c"
+
+/* { dg-final { scan-assembler-times "vpbroadcastb" 1 } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]\\*var@TLSCALL\\(%(?:r|e)ax\\)" 1 { target { ! ia32 } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr90579.c b/gcc/testsuite/gcc.target/i386/pr90579.c
index ab48a44..e8c6bad3 100644
--- a/gcc/testsuite/gcc.target/i386/pr90579.c
+++ b/gcc/testsuite/gcc.target/i386/pr90579.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -mavx2 -mfpmath=sse" } */
+/* { dg-options "-O3 -mavx2 -mfpmath=sse -fno-pie" } */
extern double r[6];
extern double a[];
@@ -16,8 +16,5 @@ loop (int k, double x)
return t;
}
-/* Verify we end up with scalar loads from r for the final sum. */
-/* { dg-final { scan-assembler "vaddsd\tr\\\+40" } } */
-/* { dg-final { scan-assembler "vaddsd\tr\\\+32" } } */
-/* { dg-final { scan-assembler "vaddsd\tr\\\+24" } } */
-/* { dg-final { scan-assembler "vaddsd\tr\\\+16" } } */
+/* Verify we end up with no loads from r. */
+/* { dg-final { scan-assembler-not "v\[ma\]\[^\t \]+\tr" } } */
diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c
new file mode 100644
index 0000000..cb576eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c
@@ -0,0 +1,64 @@
+/* { dg-do compile } */
+/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -march=x86-64 -mtune=generic" } */
+/* { dg-final { scan-assembler-times "vgf2p8affineqb" 14 } } */
+
+#ifndef N
+#define N 5
+#endif
+
+void
+ubyteshiftl (unsigned char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ a[i] <<= N;
+}
+
+void
+ubyteshiftr (unsigned char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ a[i] >>= N;
+}
+
+void
+ubyteshiftl_mask (unsigned char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ if (a[i] & 1)
+ a[i] <<= N;
+}
+
+void
+sbyteshiftl (signed char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ a[i] <<= N;
+}
+
+void
+sbyteshiftr (signed char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ a[i] >>= N;
+}
+
+void
+ubyteror (unsigned char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ a[i] = a[i] << N | a[i] >> (8 - N);
+}
+
+void
+ubyterol (unsigned char *a, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ a[i] = a[i] >> N | a[i] << (8 - N);
+}
diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c
new file mode 100644
index 0000000..c46af84
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-2.c
@@ -0,0 +1,196 @@
+/* { dg-do run } */
+/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -Wno-shift-count-negative -march=x86-64 -mtune=generic" } */
+
+#include <string.h>
+
+#ifndef N1
+#define N1 5
+#endif
+
+#ifndef N2
+#define N2 3
+#endif
+
+#ifndef N3
+#define N3 1
+#endif
+
+#ifndef N4
+#define N4 7
+#endif
+
+#ifndef N5
+#define N5 -3
+#endif
+
+#ifndef FILLER
+#define FILLER 0xab
+#endif
+
+#define FUNC(N) \
+ void ubyteshiftl##N(unsigned char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ a[i] <<= N; \
+ } \
+ \
+ void ubyteshiftr##N(unsigned char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ a[i] >>= N; \
+ } \
+ \
+ void ubyteshiftl_mask##N(unsigned char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ if (a[i] & 1) \
+ a[i] <<= N; \
+ } \
+ \
+ void sbyteshiftl##N(signed char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ a[i] <<= N; \
+ } \
+ \
+ void sbyteshiftr##N(signed char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ a[i] >>= N; \
+ } \
+ \
+ void ubyteror##N(unsigned char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ a[i] = a[i] << N | a[i] >> (8-N); \
+ } \
+ \
+ void ubyterol##N(unsigned char *a, int len) \
+ { \
+ int i; \
+ for (i = 0; i < len; i++) \
+ a[i] = a[i] >> N | a[i] << (8-N); \
+ } \
+ void ubyteshiftl##N##ref(unsigned char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ a[i] <<= N; \
+ } \
+ \
+ void ubyteshiftr##N##ref(unsigned char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ a[i] >>= N; \
+ } \
+ \
+ void ubyteshiftl_mask##N##ref(unsigned char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ if (a[i] & 1) \
+ a[i] <<= N; \
+ } \
+ \
+ void sbyteshiftl##N##ref(signed char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ a[i] <<= N; \
+ } \
+ \
+ void sbyteshiftr##N##ref(signed char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ a[i] >>= N; \
+ } \
+ \
+ void ubyteror##N##ref(unsigned char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ a[i] = a[i] << N | a[i] >> (8-N); \
+ } \
+ \
+ void ubyterol##N##ref(unsigned char *a, int len) \
+ { \
+ int i; \
+ _Pragma("GCC novector") \
+ for (i = 0; i < len; i++) \
+ a[i] = a[i] >> N | a[i] << (8-N); \
+ }
+
+FUNC (N1)
+FUNC (N2)
+FUNC (N3)
+FUNC (N4)
+FUNC (N5)
+
+#define TEST(N, func) \
+ memset (array, filler, len); \
+ func##N (array, len); \
+ memset (array2, filler, len); \
+ func##N##ref (array2, len); \
+ if (memcmp (array, array2, len)) __builtin_abort ()
+
+int main ()
+{
+ __builtin_cpu_init ();
+ if (!__builtin_cpu_supports ("gfni"))
+ return 0;
+
+ const unsigned long len = 256;
+ char array[len], array2[len];
+ unsigned char filler = FILLER;
+
+ TEST (N1, ubyteshiftl);
+ TEST (N1, ubyteshiftl_mask);
+ TEST (N1, sbyteshiftl);
+ TEST (N1, sbyteshiftr);
+ TEST (N1, ubyteror);
+ TEST (N1, ubyterol);
+
+ TEST (N2, ubyteshiftl);
+ TEST (N2, ubyteshiftl_mask);
+ TEST (N2, sbyteshiftl);
+ TEST (N2, sbyteshiftr);
+ TEST (N2, ubyteror);
+ TEST (N2, ubyterol);
+
+ TEST (N3, ubyteshiftl);
+ TEST (N3, ubyteshiftl_mask);
+ TEST (N3, sbyteshiftl);
+ TEST (N3, sbyteshiftr);
+ TEST (N3, ubyteror);
+ TEST (N3, ubyterol);
+
+ TEST (N4, ubyteshiftl);
+ TEST (N4, ubyteshiftl_mask);
+ TEST (N4, sbyteshiftl);
+ TEST (N4, sbyteshiftr);
+ TEST (N4, ubyteror);
+ TEST (N4, ubyterol);
+
+ TEST (N5, ubyteshiftl);
+ TEST (N5, ubyteshiftl_mask);
+ TEST (N5, sbyteshiftl);
+ TEST (N5, sbyteshiftr);
+ TEST (N5, ubyteror);
+ TEST (N5, ubyterol);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c
new file mode 100644
index 0000000..2099f4e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-3.c
@@ -0,0 +1,85 @@
+/* { dg-do compile } */
+/* { dg-options "-mgfni -mavx512bw -mavx512f -O3 -march=x86-64 -mtune=generic" } */
+/* { dg-final { scan-assembler-times "vgf2p8affineqb" 12 } } */
+
+/* Based on a test case from Andrew Pinski */
+
+#ifndef N
+#define N 5
+#endif
+
+void
+ubyteshiftl (unsigned char *restrict a, unsigned char *restrict b, unsigned char *restrict c, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ a[i] = c[i] ? (a[i] | b[i]) << N : a[i];
+ a[i] = (!c[i]) ? (a[i] ^ b[i]) << N : a[i];
+ }
+}
+
+void
+ubyteshiftr (unsigned char *restrict a, unsigned char *restrict b, unsigned char *restrict c, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ a[i] = c[i] ? (a[i] | b[i]) >> N : a[i];
+ a[i] = (!c[i]) ? (a[i] ^ b[i]) >> N : a[i];
+ }
+}
+
+void
+sbyteshiftl (signed char *restrict a, signed char *restrict b, signed char *restrict c, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ a[i] = c[i] ? (a[i] | b[i]) << N : a[i];
+ a[i] = (!c[i]) ? (a[i] ^ b[i]) << N : a[i];
+ }
+}
+
+void
+sbyteshiftr (signed char *restrict a, signed char *restrict b, signed char *restrict c, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ a[i] = c[i] ? (a[i] | b[i]) >> N : a[i];
+ a[i] = (!c[i]) ? (a[i] ^ b[i]) >> N : a[i];
+ }
+}
+
+static inline unsigned char rol8(unsigned char v, int c)
+{
+ return (v >> c) | (v << (8-c));
+}
+
+static inline unsigned char ror8(unsigned char v, int c)
+{
+ return (v << c) | (v >> (8-c));
+}
+
+void
+ubyterol (unsigned char *restrict a, unsigned char *restrict b, unsigned char *restrict c, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ a[i] = c[i] ? rol8(a[i] | b[i], N) : a[i];
+ a[i] = (!c[i]) ? rol8(a[i] ^ b[i], N) : a[i];
+ }
+}
+
+void
+ubyteror (unsigned char *restrict a, unsigned char *restrict b, unsigned char *restrict c, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ a[i] = c[i] ? ror8(a[i] | b[i], N) : a[i];
+ a[i] = (!c[i]) ? ror8(a[i] ^ b[i], N) : a[i];
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c
new file mode 100644
index 0000000..b8489a6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-5.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-mgfni -mavx -O3 -Wno-shift-count-negative -march=x86-64 -mtune=generic" } */
+/* { dg-final { scan-assembler-times "vgf2p8affineqb" 31 } } */
+
+#include "shift-gf2p8affine-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c
new file mode 100644
index 0000000..bf8d341
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-6.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-mgfni -O3 -Wno-shift-count-negative -march=x86-64 -mtune=generic" } */
+/* { dg-final { scan-assembler-times "vgf2p8affineqb" 0 } } */
+
+#include "shift-gf2p8affine-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c
new file mode 100644
index 0000000..8e93bb3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-7.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O3 -Wno-shift-count-negative -mtune=generic -march=x86-64" } */
+/* { dg-final { scan-assembler-times "vgf2p8affineqb" 53 } } */
+
+#include "shift-gf2p8affine-2.c"
diff --git a/gcc/testsuite/gcc.target/i386/shift-v16qi-4.c b/gcc/testsuite/gcc.target/i386/shift-v16qi-4.c
new file mode 100644
index 0000000..edc2b21
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/shift-v16qi-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-mgfni -mavx512vl -mavx512bw -mavx512f -O2" } */
+/* { dg-final { scan-assembler-times "vpcmpgtb" 1 } } */
+
+typedef char v16qi __attribute__((vector_size(16)));
+
+v16qi
+foo (v16qi a)
+{
+ return a >> 7;
+}
diff --git a/gcc/testsuite/gcc.target/i386/sibcall-8.c b/gcc/testsuite/gcc.target/i386/sibcall-8.c
index 3ab3809..29ebfe5 100644
--- a/gcc/testsuite/gcc.target/i386/sibcall-8.c
+++ b/gcc/testsuite/gcc.target/i386/sibcall-8.c
@@ -1,23 +1,29 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
+#ifndef __x86_64__
+#define REGPARM __attribute__((regparm(1)))
+#else
+#define REGPARM
+#endif
+
extern void abort (void);
-static int __attribute__((regparm(1)))
+static int REGPARM
bar(void *arg)
{
return arg != bar;
}
-static int __attribute__((noinline,noclone,regparm(1)))
-foo(int (__attribute__((regparm(1))) **bar)(void*))
+static int __attribute__((noinline,noclone)) REGPARM
+foo(int (REGPARM **bar)(void*))
{
return (*bar)(*bar);
}
int main()
{
- int (__attribute__((regparm(1))) *p)(void*) = bar;
+ int (REGPARM *p)(void*) = bar;
if (foo(&p))
abort();
return 0;
diff --git a/gcc/testsuite/gcc.target/i386/sw-1.c b/gcc/testsuite/gcc.target/i386/sw-1.c
index 14db3ce..025f0e1 100644
--- a/gcc/testsuite/gcc.target/i386/sw-1.c
+++ b/gcc/testsuite/gcc.target/i386/sw-1.c
@@ -7,7 +7,10 @@
int c;
int x[2000];
-__attribute__((regparm(1))) void foo (int a, int b)
+#ifndef __x86_64__
+__attribute__((regparm(1)))
+#endif
+void foo (int a, int b)
{
int t[200];
if (a == 0 || c == 0)
diff --git a/gcc/testsuite/gcc.target/i386/uintr-2.c b/gcc/testsuite/gcc.target/i386/uintr-2.c
index 0a83c66..a0d2514 100644
--- a/gcc/testsuite/gcc.target/i386/uintr-2.c
+++ b/gcc/testsuite/gcc.target/i386/uintr-2.c
@@ -15,6 +15,6 @@ foo (void *frame, uword_t uirrv)
void
__attribute__((interrupt))
-UINTR_hanlder (struct __uintr_frame *frame, uword_t uirrv)
+UINTR_handler (struct __uintr_frame *frame, uword_t uirrv)
{
}
diff --git a/gcc/testsuite/gcc.target/i386/uintr-5.c b/gcc/testsuite/gcc.target/i386/uintr-5.c
index 49cb2ec..7c7c12f 100644
--- a/gcc/testsuite/gcc.target/i386/uintr-5.c
+++ b/gcc/testsuite/gcc.target/i386/uintr-5.c
@@ -7,6 +7,6 @@
typedef unsigned int uword_t __attribute__ ((mode (__word__)));
void
-UINTR_hanlder (struct __uintr_frame *frame, uword_t uirrv)
+UINTR_handler (struct __uintr_frame *frame, uword_t uirrv)
{
}
diff --git a/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c b/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
index f5e71e4..58ff7f0 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pragma-target-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-O0" } */
+/* { dg-options "-O0 -mno-sse3 -mtune=generic" } */
/* { dg-final { scan-assembler-times "paddd.+xmm\[0-9]+" 1 } } */
/* { dg-final { scan-assembler-times "vfmadd132ps.+ymm\[0-9]+" 1 } } */
/* { dg-final { scan-assembler-times "vpaddw.+zmm\[0-9]+" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c b/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c
index 3496804..f6dbd54 100644
--- a/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c
+++ b/gcc/testsuite/gcc.target/i386/vect-pragma-target-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-O0" } */
+/* { dg-options "-O0 -mno-sse3 -mtune=generic" } */
/* { dg-final { scan-assembler-times "paddd.+xmm\[0-9]+" 1 } } */
/* { dg-final { scan-assembler-times "vfmadd132ps.+ymm\[0-9]+" 1 } } */
/* { dg-final { scan-assembler-times "vpaddw.+zmm\[0-9]+" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/vect_unroll-1.c b/gcc/testsuite/gcc.target/i386/vect_unroll-1.c
new file mode 100644
index 0000000..2e294d3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vect_unroll-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v3 -Ofast" } */
+/* { dg-final { scan-assembler-times {(?n)vfmadd[1-3]*ps[^\n]*ymm} 4 } } */
+
+float
+foo (float* a, float* b, int n)
+{
+ float sum = 0;
+ for (int i = 0; i != n; i++)
+ sum += a[i] * b[i];
+ return sum;
+}
diff --git a/gcc/testsuite/gcc.target/i386/vect_unroll-2.c b/gcc/testsuite/gcc.target/i386/vect_unroll-2.c
new file mode 100644
index 0000000..069f7d3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vect_unroll-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v3 -Ofast" } */
+/* { dg-final { scan-assembler-times {(?n)vfnmadd[1-3]*ps[^\n]*ymm} 4 } } */
+
+float
+foo (float* a, float* b, int n)
+{
+ float sum = 0;
+ for (int i = 0; i != n; i++)
+ sum -= a[i] * b[i];
+ return sum;
+}
diff --git a/gcc/testsuite/gcc.target/i386/vect_unroll-3.c b/gcc/testsuite/gcc.target/i386/vect_unroll-3.c
new file mode 100644
index 0000000..6860c2f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vect_unroll-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mavxvnni -O3" } */
+/* { dg-final { scan-assembler-times {(?n)vpdpbusd[^\n]*ymm} 4 } } */
+
+int
+foo (unsigned char* a, char* b, int n)
+{
+ int sum = 0;
+ for (int i = 0; i != n; i++)
+ sum += a[i] * b[i];
+ return sum;
+}
diff --git a/gcc/testsuite/gcc.target/i386/vect_unroll-4.c b/gcc/testsuite/gcc.target/i386/vect_unroll-4.c
new file mode 100644
index 0000000..01d8af6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vect_unroll-4.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v3 -O3 -mno-avxvnni" } */
+/* { dg-final { scan-assembler-times {(?n)vpmaddwd[^\n]*ymm} 4 } } */
+
+int
+foo (unsigned char* a, char* b, int n)
+{
+ int sum = 0;
+ for (int i = 0; i != n; i++)
+ sum += a[i] * b[i];
+ return sum;
+}
diff --git a/gcc/testsuite/gcc.target/i386/vect_unroll-5.c b/gcc/testsuite/gcc.target/i386/vect_unroll-5.c
new file mode 100644
index 0000000..c6375b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vect_unroll-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v3 -Ofast -mgather" } */
+/* { dg-final { scan-assembler-times {(?n)vfmadd[1-3]*ps[^\n]*ymm} 1 } } */
+
+float
+foo (float* a, int* b, float* c, int n)
+{
+ float sum = 0;
+ for (int i = 0; i != n; i++)
+ sum += a[b[i]] *c[i];
+ return sum;
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/vect_unroll-6.c b/gcc/testsuite/gcc.target/i386/vect_unroll-6.c
new file mode 100644
index 0000000..b64c2fb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/vect_unroll-6.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-march=x86-64-v3 -Ofast" } */
+/* { dg-final { scan-assembler-times {(?n)vfmadd[1-3]*ps[^\n]*ymm} 4 } } */
+
+float
+foo (float* a, float* b, int n)
+{
+ float sum = 0;
+ for (int i = 0; i != n; i++)
+ sum = __builtin_fma (a[i], b[i], sum);
+ return sum;
+}