diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-18 10:33:36 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-18 10:33:36 +0000 |
commit | 0f15bf2ebe4b001a06ab7869f0c7bcbb74b5469e (patch) | |
tree | 7393ac7f037f04ea997b60a08f0eba639c9798d6 /gcc/testsuite/gcc.target/i386 | |
parent | 80135bd9bbf06da9d0214ece3c59c301d3af3a2b (diff) | |
download | gcc-0f15bf2ebe4b001a06ab7869f0c7bcbb74b5469e.tar.gz |
2010-11-18 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 166897
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@166899 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386')
27 files changed, 453 insertions, 29 deletions
diff --git a/gcc/testsuite/gcc.target/i386/alias-1.c b/gcc/testsuite/gcc.target/i386/alias-1.c new file mode 100644 index 00000000000..adbe2f7c3ff --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/alias-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ + +int yum; +void dessert (void) { ++yum; } +extern void jelly (void) __attribute__ ((alias ("dessert"), weak)); +extern void wobbly (void) __attribute__ ((alias ("jelly"), weak)); + +/* { dg-final { scan-assembler "wobbly" } } */ +/* { dg-final { scan-assembler "jelly" } } */ diff --git a/gcc/testsuite/gcc.target/i386/bmi-1.c b/gcc/testsuite/gcc.target/i386/bmi-1.c new file mode 100644 index 00000000000..dc964ba3d92 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/bmi-1.c @@ -0,0 +1,46 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mbmi " } */ +/* { dg-final { scan-assembler "andn\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "bextr\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blsi\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blsmsk\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blsr\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "tzcntl\[^\\n]*(%|)eax" } } */ + +#include <x86intrin.h> + +unsigned int +func_andn32 (unsigned int X, unsigned int Y) +{ + return __andn_u32(X, Y); +} + +unsigned int +func_bextr32 (unsigned int X, unsigned int Y) +{ + return __bextr_u32(X, Y); +} + +unsigned int +func_blsi32 (unsigned int X) +{ + return __blsi_u32(X); +} + +unsigned int +func_blsmsk32 (unsigned int X) +{ + return __blsmsk_u32(X); +} + +unsigned int +func_blsr32 (unsigned int X) +{ + return __blsr_u32(X); +} + +unsigned int +func_tzcnt32 (unsigned int X) +{ + return __tzcnt_u32(X); +} diff --git a/gcc/testsuite/gcc.target/i386/bmi-2.c b/gcc/testsuite/gcc.target/i386/bmi-2.c new file mode 100644 index 00000000000..4f8c14f3a48 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/bmi-2.c @@ -0,0 +1,47 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mbmi " } */ +/* { dg-final { scan-assembler "andn\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "bextr\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blsi\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blsmsk\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blsr\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "tzcntq\[^\\n]*(%|)rax" } } */ + +#include <x86intrin.h> + +unsigned long long +func_andn64 (unsigned long long X, unsigned long long Y) +{ + return __andn_u64 (X, Y); +} + +unsigned long long +func_bextr64 (unsigned long long X, unsigned long long Y) +{ + return __bextr_u64 (X, Y); +} + +unsigned long long +func_blsi64 (unsigned long long X) +{ + return __blsi_u64 (X); +} + +unsigned long long +func_blsmsk64 (unsigned long long X) +{ + return __blsmsk_u64 (X); +} + +unsigned long long +func_blsr64 (unsigned long long X) +{ + return __blsr_u64 (X); +} + +unsigned long long +func_tzcnt64 (unsigned long long X) +{ + return __tzcnt_u64 (X); +} diff --git a/gcc/testsuite/gcc.target/i386/bmi-3.c b/gcc/testsuite/gcc.target/i386/bmi-3.c new file mode 100644 index 00000000000..ddc5e0f66e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/bmi-3.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mbmi " } */ +/* { dg-final { scan-assembler "tzcntw\[^\\n]*(%|)ax" } } */ + +#include <x86intrin.h> + +unsigned short +func_tzcnt16 (unsigned short X) +{ + return __tzcnt_u16(X); +} diff --git a/gcc/testsuite/gcc.target/i386/bmi-4.c b/gcc/testsuite/gcc.target/i386/bmi-4.c new file mode 100644 index 00000000000..e0a11616232 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/bmi-4.c @@ -0,0 +1,13 @@ +/* { dg-do link } */ +/* { dg-options "-O2 -mbmi" } */ + +#include <x86intrin.h> + +/* Test that a constant operand 0 to tzcnt gets folded. */ +extern void link_error(void); +int main() +{ + if (__tzcnt_u32(0) != 32) + link_error(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/bmi-5.c b/gcc/testsuite/gcc.target/i386/bmi-5.c new file mode 100644 index 00000000000..906bf217cc1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/bmi-5.c @@ -0,0 +1,14 @@ +/* { dg-do link } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mbmi" } */ + +#include <x86intrin.h> + +/* Test that a constant operand 0 to tzcnt gets folded. */ +extern void link_error(void); +int main() +{ + if (__tzcnt_u64(0) != 64) + link_error(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/bmi-6.c b/gcc/testsuite/gcc.target/i386/bmi-6.c new file mode 100644 index 00000000000..a4489e0b5a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/bmi-6.c @@ -0,0 +1,13 @@ +/* { dg-do link } */ +/* { dg-options "-O2 -mbmi" } */ + +#include <x86intrin.h> + +/* Test that a constant operand 0 to tzcnt gets folded. */ +extern void link_error(void); +int main() +{ + if (__tzcnt_u16(0) != 16) + link_error(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/funcspec-5.c b/gcc/testsuite/gcc.target/i386/funcspec-5.c index 34da51ceb9f..1e18dcf871f 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-5.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-5.c @@ -5,6 +5,7 @@ extern void test_abm (void) __attribute__((__target__("abm"))); extern void test_aes (void) __attribute__((__target__("aes"))); +extern void test_bmi (void) __attribute__((__target__("bmi"))); extern void test_mmx (void) __attribute__((__target__("mmx"))); extern void test_pclmul (void) __attribute__((__target__("pclmul"))); extern void test_popcnt (void) __attribute__((__target__("popcnt"))); @@ -18,9 +19,11 @@ extern void test_sse4_2 (void) __attribute__((__target__("sse4.2"))); extern void test_sse4a (void) __attribute__((__target__("sse4a"))); extern void test_fma4 (void) __attribute__((__target__("fma4"))); extern void test_ssse3 (void) __attribute__((__target__("ssse3"))); +extern void test_tbm (void) __attribute__((__target__("tbm"))); extern void test_no_abm (void) __attribute__((__target__("no-abm"))); extern void test_no_aes (void) __attribute__((__target__("no-aes"))); +extern void test_no_bmi (void) __attribute__((__target__("no-bmi"))); extern void test_no_mmx (void) __attribute__((__target__("no-mmx"))); extern void test_no_pclmul (void) __attribute__((__target__("no-pclmul"))); extern void test_no_popcnt (void) __attribute__((__target__("no-popcnt"))); @@ -34,6 +37,7 @@ extern void test_no_sse4_2 (void) __attribute__((__target__("no-sse4.2"))); extern void test_no_sse4a (void) __attribute__((__target__("no-sse4a"))); extern void test_no_fma4 (void) __attribute__((__target__("no-fma4"))); extern void test_no_ssse3 (void) __attribute__((__target__("no-ssse3"))); +extern void test_no_tbm (void) __attribute__((__target__("no-tbm"))); extern void test_arch_i386 (void) __attribute__((__target__("arch=i386"))); extern void test_arch_i486 (void) __attribute__((__target__("arch=i486"))); diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c index 575be9bbbdd..92a3cb52d7b 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-6.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c @@ -5,6 +5,7 @@ extern void test_abm (void) __attribute__((__target__("abm"))); extern void test_aes (void) __attribute__((__target__("aes"))); +extern void test_bmi (void) __attribute__((__target__("bmi"))); extern void test_mmx (void) __attribute__((__target__("mmx"))); extern void test_pclmul (void) __attribute__((__target__("pclmul"))); extern void test_popcnt (void) __attribute__((__target__("popcnt"))); @@ -18,9 +19,11 @@ extern void test_sse4_2 (void) __attribute__((__target__("sse4.2"))); extern void test_sse4a (void) __attribute__((__target__("sse4a"))); extern void test_fma4 (void) __attribute__((__target__("fma4"))); extern void test_ssse3 (void) __attribute__((__target__("ssse3"))); +extern void test_tbm (void) __attribute__((__target__("tbm"))); extern void test_no_abm (void) __attribute__((__target__("no-abm"))); extern void test_no_aes (void) __attribute__((__target__("no-aes"))); +extern void test_no_bmi (void) __attribute__((__target__("no-bmi"))); extern void test_no_mmx (void) __attribute__((__target__("no-mmx"))); extern void test_no_pclmul (void) __attribute__((__target__("no-pclmul"))); extern void test_no_popcnt (void) __attribute__((__target__("no-popcnt"))); @@ -34,6 +37,7 @@ extern void test_no_sse4_2 (void) __attribute__((__target__("no-sse4.2"))); extern void test_no_sse4a (void) __attribute__((__target__("no-sse4a"))); extern void test_no_fma4 (void) __attribute__((__target__("no-fma4"))); extern void test_no_ssse3 (void) __attribute__((__target__("no-ssse3"))); +extern void test_no_tbm (void) __attribute__((__target__("no-tbm"))); extern void test_arch_nocona (void) __attribute__((__target__("arch=nocona"))); extern void test_arch_core2 (void) __attribute__((__target__("arch=core2"))); diff --git a/gcc/testsuite/gcc.target/i386/pr39082-1.c b/gcc/testsuite/gcc.target/i386/pr39082-1.c index 81b5bb66d2b..0a788d11650 100644 --- a/gcc/testsuite/gcc.target/i386/pr39082-1.c +++ b/gcc/testsuite/gcc.target/i386/pr39082-1.c @@ -30,6 +30,6 @@ foo2 (void) int foo3 (int x) { - union un u = bar2 (x); /* { dg-message "note: The ABI of passing union with long double has changed in GCC 4.4" } */ + union un u = bar2 (x); /* { dg-message "note: the ABI of passing union with long double has changed in GCC 4.4" } */ return u.i; } diff --git a/gcc/testsuite/gcc.target/i386/pr39545-1.c b/gcc/testsuite/gcc.target/i386/pr39545-1.c index 281c8cbf369..e7e41164b25 100644 --- a/gcc/testsuite/gcc.target/i386/pr39545-1.c +++ b/gcc/testsuite/gcc.target/i386/pr39545-1.c @@ -17,7 +17,7 @@ foo (struct flex s) struct flex bar (int x) -{ /* { dg-message "note: The ABI of passing struct with a flexible array member has changed in GCC 4.4" } */ +{ /* { dg-message "note: the ABI of passing struct with a flexible array member has changed in GCC 4.4" } */ struct flex s; s.i = x; return s; diff --git a/gcc/testsuite/gcc.target/i386/pr39545-2.c b/gcc/testsuite/gcc.target/i386/pr39545-2.c index 143c3827fd6..46deecbe0b4 100644 --- a/gcc/testsuite/gcc.target/i386/pr39545-2.c +++ b/gcc/testsuite/gcc.target/i386/pr39545-2.c @@ -11,7 +11,7 @@ struct flex struct flex foo (int x) -{ /* { dg-message "note: The ABI of passing struct with a flexible array member has changed in GCC 4.4" } */ +{ /* { dg-message "note: the ABI of passing struct with a flexible array member has changed in GCC 4.4" } */ struct flex s; s.i = x; return s; diff --git a/gcc/testsuite/gcc.target/i386/pr39678.c b/gcc/testsuite/gcc.target/i386/pr39678.c index 70e8ff497cd..0548466d6de 100644 --- a/gcc/testsuite/gcc.target/i386/pr39678.c +++ b/gcc/testsuite/gcc.target/i386/pr39678.c @@ -10,7 +10,7 @@ struct X { struct X foo (float *p) -{ /* { dg-message "note: The ABI of passing structure with complex float member has changed in GCC 4.4" } */ +{ /* { dg-message "note: the ABI of passing structure with complex float member has changed in GCC 4.4" } */ struct X x; x.c = -3; __real x.val = p[0]; diff --git a/gcc/testsuite/gcc.target/i386/pr45352-2.c b/gcc/testsuite/gcc.target/i386/pr45352-2.c index 58713af869f..5f9ebb18fc8 100644 --- a/gcc/testsuite/gcc.target/i386/pr45352-2.c +++ b/gcc/testsuite/gcc.target/i386/pr45352-2.c @@ -40,9 +40,10 @@ typedef struct { int xvmc_last_slice_code;} mpeg2dec_accel_t; -static bitstream_init (picture_t * picture, void *start) +static int bitstream_init (picture_t * picture, void *start) { picture->bitstream_ptr = start; + return (int) (long) start; } static slice_xvmc_init (picture_t * picture, int code) { @@ -55,7 +56,7 @@ static slice_xvmc_init (picture_t * picture, int code) picture->f_motion.ref [0] [0] - = forward_reference_frame->base + (offset ? picture->pitches[0] : 0); + = (char) (long) (forward_reference_frame->base + (offset ? picture->pitches[0] : 0)); picture->f_motion.ref[0][1] = (offset); if (picture->picture_structure) picture->pitches[0] <<= picture->pitches[1] <<= 1; @@ -90,7 +91,7 @@ void mpeg2_xvmc_slice (mpeg2dec_accel_t * accel, picture_t * picture, int code, uint8_t buffer,int mba_inc) { - xine_xvmc_t * xvmc = bitstream_init (picture, buffer); + xine_xvmc_t * xvmc = (xine_xvmc_t *) (long) bitstream_init (picture, (void *) (long) buffer); slice_xvmc_init (picture, code); while (1) { diff --git a/gcc/testsuite/gcc.target/i386/pr46095.c b/gcc/testsuite/gcc.target/i386/pr46095.c new file mode 100644 index 00000000000..ab9501e7818 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr46095.c @@ -0,0 +1,12 @@ +/* PR debug/46095 */ +/* { dg-do compile { target lp64 } } */ +/* { dg-options "-O -fschedule-insns2 -fno-omit-frame-pointer -fstack-protector" } */ + +extern void bar (char *); + +void +foo (void) +{ + char c[0x80000000UL]; + bar (c); +} diff --git a/gcc/testsuite/gcc.target/i386/pr46419.c b/gcc/testsuite/gcc.target/i386/pr46419.c new file mode 100644 index 00000000000..3b722283ef3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr46419.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ +/* { dg-require-effective-target sse } */ + +#include "sse-check.h" + +#include <xmmintrin.h> + +void __attribute__((noinline)) +sse_test (void) +{ + char image[4]; + __m128 image4; + float out[4] __attribute__ ((aligned (16))); + int i; + + for (i = 0; i < 4; i++) + image[i] = i + 1; + + image4 = + _mm_cvtpi8_ps (_mm_setr_pi8 + (image[0], image[1], image[2], image[3], 0, 0, 0, 0)); + _mm_store_ps (out, image4); + _mm_empty (); + + for (i = 0; i < 4; i++) + if (out[i] != (float) (i + 1)) + abort (); + + image4 = + _mm_cvtpu8_ps (_mm_setr_pi8 + (image[0], image[1], image[2], image[3], 0, 0, 0, 0)); + _mm_store_ps (out, image4); + _mm_empty (); + + for (i = 0; i < 4; i++) + if (out[i] != (float) (i + 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr46470.c b/gcc/testsuite/gcc.target/i386/pr46470.c new file mode 100644 index 00000000000..eacba4b4131 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr46470.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -fomit-frame-pointer -fasynchronous-unwind-tables" } */ +/* { dg-options "-Os -fomit-frame-pointer -mpreferred-stack-boundary=3 -fasynchronous-unwind-tables" { target ilp32 } } */ + +void f(); +void g() { f(); f(); } + +/* Both stack allocate and deallocate should be converted to push/pop. */ +/* { dg-final { scan-assembler-not "sp" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr46491.c b/gcc/testsuite/gcc.target/i386/pr46491.c new file mode 100644 index 00000000000..82f704c266f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr46491.c @@ -0,0 +1,22 @@ +/* PR tree-optimization/46491 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +__attribute__((noinline)) int +foo (int *p) +{ + int r; + asm ("movl $6, (%1)\n\txorl %0, %0" : "=r" (r) : "r" (p) : "memory"); + return r; +} + +int +main (void) +{ + int p = 8; + if ((foo (&p) ? : p) != 6) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c index 6591c12d2c6..5a8e6967b42 100644 --- a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c +++ b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c @@ -31,4 +31,5 @@ void t3(void) r[i] = sqrtf (a[i]); } -/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 3 } } */ +/* Last loop is small enough to be fully unrolled. */ +/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 6 } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse-12.c b/gcc/testsuite/gcc.target/i386/sse-12.c index 2d50f41d540..4f8aaec6d3a 100644 --- a/gcc/testsuite/gcc.target/i386/sse-12.c +++ b/gcc/testsuite/gcc.target/i386/sse-12.c @@ -1,8 +1,9 @@ -/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, xopintrin.h, mm3dnow.h, - abmintrin.h, lwpintrin.h, popcntintrin.h and mm_malloc.h are usable +/* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h, + xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h, + popcntintrin.h and mm_malloc.h are usable with -O -std=c89 -pedantic-errors. */ /* { dg-do compile } */ -/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */ +/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mbmi -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c" } */ #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c index 01809d0cffa..188b2e6dc08 100644 --- a/gcc/testsuite/gcc.target/i386/sse-13.c +++ b/gcc/testsuite/gcc.target/i386/sse-13.c @@ -1,14 +1,16 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */ +/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mbmi -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c" } */ #include <mm_malloc.h> /* Test that the intrinsics compile with optimization. All of them are defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h, - xopintrin.h, abmintrin.h, lwpintrin.h, popcntintrin.h and mm3dnow.h - that reference the proper builtin functions. Defining away - "extern" and "__inline" results in all of them being compiled as - proper functions. */ + mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h, + tbmintrin.h, lwpintrin.h, popcntintrin.h and mm_malloc.h that + reference the proper builtin functions. + + Defining away "extern" and "__inline" results in all of them being + compiled as proper functions. */ #define extern #define __inline @@ -141,4 +143,9 @@ #define __builtin_ia32_lwpins32(D2, D1, F) __builtin_ia32_lwpins32 (D2, D1, 1) #define __builtin_ia32_lwpins64(D2, D1, F) __builtin_ia32_lwpins64 (D2, D1, 1) +/* tbmintrin.h */ +#define __builtin_ia32_bextri_u32(X, Y) __builtin_ia32_bextri_u32 (X, 1) +#define __builtin_ia32_bextri_u64(X, Y) __builtin_ia32_bextri_u64 (X, 1) + + #include <x86intrin.h> diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index d256e68c4be..22ea61f68b4 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -1,11 +1,13 @@ /* { dg-do compile } */ -/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mxop -msse4a -maes -mpclmul -mpopcnt -mabm -mlwp -mfsgsbase -mrdrnd -mf16c" } */ +/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mbmi -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c" } */ #include <mm_malloc.h> /* Test that the intrinsics compile without optimization. All of them are - defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h, xopintrin.h, - lwpintrin.h and mm3dnow.h that reference the proper builtin functions. + defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, + fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, + lwpintrin.h and mm_malloc.h that reference the proper builtin functions. + Defining away "extern" and "__inline" results in all of them being compiled as proper functions. */ @@ -177,3 +179,9 @@ test_2 ( __lwpins32, unsigned char, unsigned int, unsigned int, 1) test_2 ( __lwpval64, void, unsigned long long, unsigned int, 1) test_2 ( __lwpins64, unsigned char, unsigned long long, unsigned int, 1) #endif + +/* tbmintrin.h */ +test_1 ( __bextri_u32, unsigned int, unsigned int, 1) +#ifdef __x86_64__ +test_1 ( __bextri_u64, unsigned long long, unsigned long long, 1) +#endif diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index bb0472d471c..e28164d080d 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -6,10 +6,10 @@ /* Test that the intrinsics compile without optimization. All of them are defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h, - xopintrin.h, lwpintrin.h, popcntintrin.h and mm3dnow.h that - reference the proper builtin functions. Defining away "extern" and - "__inline" results in all of them being compiled as proper - functions. */ + xopintrin.h, tbmintrin.h, lwpintrin.h, popcntintrin.h and + mm3dnow.h that reference the proper builtin functions. Defining + away "extern" and "__inline" results in all of them being compiled as + proper functions. */ #define extern #define __inline @@ -39,7 +39,7 @@ #ifndef DIFFERENT_PRAGMAS -#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,aes,pclmul,xop,popcnt,abm,lwp,fsgsbase,rdrnd,f16c") +#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse4a,aes,pclmul,xop,popcnt,abm,lwp,fsgsbase,rdrnd,f16c,tbm") #endif /* Following intrinsics require immediate arguments. They @@ -188,3 +188,13 @@ test_2 ( __lwpins64, unsigned char, unsigned long long, unsigned int, 1) test_1 (_cvtss_sh, unsigned short, float, 1) test_1 (_mm_cvtps_ph, __m128i, __m128, 1) test_1 (_mm256_cvtps_ph, __m128i, __m256, 1) + +/* tbmintrin.h (TBM). */ +#ifdef DIFFERENT_PRAGMAS +#pragma GCC target ("tbm") +#endif +#include <x86intrin.h> +test_1 ( __bextri_u32, unsigned int, unsigned int, 1) +#ifdef __x86_64__ +test_1 ( __bextri_u64, unsigned long long, unsigned long long, 1) +#endif diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c index 0e15bb25418..3d932e16bbf 100644 --- a/gcc/testsuite/gcc.target/i386/sse-23.c +++ b/gcc/testsuite/gcc.target/i386/sse-23.c @@ -5,9 +5,9 @@ /* Test that the intrinsics compile with optimization. All of them are defined as inline functions in {,x,e,p,t,s,w,a}mmintrin.h, - xopintrin.h, lwpintrin.h, popcntintrin.h and mm3dnow.h that - reference the proper builtin functions. Defining away "extern" and - "__inline" results in all of them being compiled as proper + xopintrin.h, lwpintrin.h, tbmintrin.h, popcntintrin.h and mm3dnow.h + that reference the proper builtin functions. Defining away "extern" + and "__inline" results in all of them being compiled as proper functions. */ #define extern @@ -141,7 +141,11 @@ #define __builtin_ia32_lwpins32(D2, D1, F) __builtin_ia32_lwpins32 (D2, D1, 1) #define __builtin_ia32_lwpins64(D2, D1, F) __builtin_ia32_lwpins64 (D2, D1, 1) -#pragma GCC target ("3dnow,sse4,sse4a,aes,pclmul,xop,abm,popcnt,lwp,fsgsbase,rdrnd,f16c") +/* tbmintrin.h */ +#define __builtin_ia32_bextri_u32(X, Y) __builtin_ia32_bextr_u32 (X, 1) +#define __builtin_ia32_bextri_u64(X, Y) __builtin_ia32_bextr_u64 (X, 1) + +#pragma GCC target ("3dnow,sse4,sse4a,aes,pclmul,xop,abm,popcnt,lwp,tbm,fsgsbase,rdrnd,f16c") #include <wmmintrin.h> #include <smmintrin.h> #include <mm3dnow.h> diff --git a/gcc/testsuite/gcc.target/i386/sse-24.c b/gcc/testsuite/gcc.target/i386/sse-24.c index d18b08e977d..daeb968a24f 100644 --- a/gcc/testsuite/gcc.target/i386/sse-24.c +++ b/gcc/testsuite/gcc.target/i386/sse-24.c @@ -1,5 +1,5 @@ /* PR target/44338 */ /* { dg-do compile } */ -/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -mno-fused-madd" } */ +/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -ffp-contract=off" } */ #include "sse-23.c" diff --git a/gcc/testsuite/gcc.target/i386/tbm-1.c b/gcc/testsuite/gcc.target/i386/tbm-1.c new file mode 100644 index 00000000000..2c16d74db49 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/tbm-1.c @@ -0,0 +1,74 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mtbm" } */ +/* { dg-final { scan-assembler "bextr\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blcfill\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blci\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blcic\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blcmsk\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blcs\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blsfill\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "blsic\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "t1mskc\[^\\n]*(%|)eax" } } */ +/* { dg-final { scan-assembler "tzmsk\[^\\n]*(%|)eax" } } */ + +#include <x86intrin.h> + +unsigned int +func_bextri32 (unsigned int X) +{ + return __bextri_u32 (X, 0x101); +} + +unsigned int +func_blcfill32 (unsigned int X) +{ + return __blcfill_u32 (X); +} + +unsigned int +func_blci32 (unsigned int X) +{ + return __blci_u32 (X); +} + +unsigned int +func_blcic32 (unsigned int X) +{ + return __blcic_u32 (X); +} + +unsigned int +func_blcmsk32 (unsigned int X) +{ + return __blcmsk_u32 (X); +} + +unsigned int +func_blcs32 (unsigned int X) +{ + return __blcs_u32 (X); +} + +unsigned int +func_blsfill32 (unsigned int X) +{ + return __blsfill_u32 (X); +} + +unsigned int +func_blsic32 (unsigned int X) +{ + return __blsic_u32 (X); +} + +unsigned int +func_t1mskc32 (unsigned int X) +{ + return __t1mskc_u32 (X); +} + +unsigned int +func_tzmsk32 (unsigned int X) +{ + return __tzmsk_u32 (X); +} diff --git a/gcc/testsuite/gcc.target/i386/tbm-2.c b/gcc/testsuite/gcc.target/i386/tbm-2.c new file mode 100644 index 00000000000..447e0ab66c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/tbm-2.c @@ -0,0 +1,75 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mtbm" } */ +/* { dg-final { scan-assembler "bextr\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blcfill\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blci\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blcic\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blcmsk\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blcs\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blsfill\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "blsic\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "t1mskc\[^\\n]*(%|)rax" } } */ +/* { dg-final { scan-assembler "tzmsk\[^\\n]*(%|)rax" } } */ + +#include <x86intrin.h> + +unsigned long long +func_bextri64 (unsigned long long X) +{ + return __bextri_u64 (X, 0x101); +} + +unsigned long long +func_blcfill64 (unsigned long long X) +{ + return __blcfill_u64 (X); +} + +unsigned long long +func_blci64 (unsigned long long X) +{ + return __blci_u64 (X); +} + +unsigned long long +func_blcic64 (unsigned long long X) +{ + return __blcic_u64 (X); +} + +unsigned long long +func_blcmsk64 (unsigned long long X) +{ + return __blcmsk_u64 (X); +} + +unsigned long long +func_blcs64 (unsigned long long X) +{ + return __blcs_u64 (X); +} + +unsigned long long +func_blsfill64 (unsigned long long X) +{ + return __blsfill_u64 (X); +} + +unsigned long long +func_blsic64 (unsigned long long X) +{ + return __blsic_u64 (X); +} + +unsigned long long +func_t1mskc64 (unsigned long long X) +{ + return __t1mskc_u64 (X); +} + +unsigned long long +func_tzmsk64 (unsigned long long X) +{ + return __tzmsk_u64 (X); +} |