| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=x86-64 -mno-sse -mno-mmx" } */ |
| 3 |
/* { dg-add-options bind_pic_locally } */ |
| 4 |
|
| 5 |
/* Test that the intrinsics in <x86gprintrin.h> compile with optimization. |
| 6 |
All of them are defined as inline functions that reference the proper |
| 7 |
builtin functions. |
| 8 |
|
| 9 |
Defining away "extern" and "__inline" results in all of them being |
| 10 |
compiled as proper functions. */ |
| 11 |
|
| 12 |
#define extern |
| 13 |
#define __inline |
| 14 |
|
| 15 |
/* Following intrinsics require immediate arguments. */ |
| 16 |
|
| 17 |
/* lwpintrin.h */ |
| 18 |
#define __builtin_ia32_lwpval32(D2, D1, F) __builtin_ia32_lwpval32 (D2, D1, 1) |
| 19 |
#define __builtin_ia32_lwpval64(D2, D1, F) __builtin_ia32_lwpval64 (D2, D1, 1) |
| 20 |
#define __builtin_ia32_lwpins32(D2, D1, F) __builtin_ia32_lwpins32 (D2, D1, 1) |
| 21 |
#define __builtin_ia32_lwpins64(D2, D1, F) __builtin_ia32_lwpins64 (D2, D1, 1) |
| 22 |
|
| 23 |
/* tbmintrin.h */ |
| 24 |
#define __builtin_ia32_bextri_u32(X, Y) __builtin_ia32_bextr_u32 (X, 1) |
| 25 |
#define __builtin_ia32_bextri_u64(X, Y) __builtin_ia32_bextr_u64 (X, 1) |
| 26 |
|
| 27 |
/* rtmintrin.h */ |
| 28 |
#define __builtin_ia32_xabort(M) __builtin_ia32_xabort(1) |
| 29 |
|
| 30 |
/* cmpccxadd.h */ |
| 31 |
#define __builtin_ia32_cmpccxadd(A, B, C, D) __builtin_ia32_cmpccxadd(A, B, C, 1) |
| 32 |
#define __builtin_ia32_cmpccxadd64(A, B, C, D) __builtin_ia32_cmpccxadd64(A, B, C, 1) |
| 33 |
|
| 34 |
/* usermsrintrin.h */ |
| 35 |
#define __builtin_ia32_urdmsr(A) __builtin_ia32_urdmsr(1) |
| 36 |
#define __builtin_ia32_uwrmsr(A, B) __builtin_ia32_uwrmsr(1, B) |
| 37 |
|
| 38 |
#ifdef __x86_64__ |
| 39 |
#pragma GCC target ("adx,bmi,bmi2,clflushopt,clwb,clzero,cmpccxadd,enqcmd,fsgsbase,fxsr,hreset,lwp,lzcnt,mwaitx,pconfig,pku,popcnt,prefetchi,raoint,rdpid,rdrnd,rdseed,tbm,rtm,serialize,sgx,tsxldtrk,uintr,usermsr,xsavec,xsaveopt,xsaves,wbnoinvd") |
| 40 |
#else |
| 41 |
#pragma GCC target ("adx,bmi,bmi2,clflushopt,clwb,clzero,enqcmd,fsgsbase,fxsr,hreset,lwp,lzcnt,mwaitx,pconfig,pku,popcnt,raoint,rdpid,rdrnd,rdseed,tbm,rtm,serialize,sgx,tsxldtrk,xsavec,xsaveopt,xsaves,wbnoinvd") |
| 42 |
#endif |
| 43 |
|
| 44 |
#include <x86gprintrin.h> |