Fix alignment with MSVC.

pull/4504/head
Jussi Pakkanen 6 years ago
parent 0859442480
commit 75648a2c9e
  1. 3
      test cases/common/152 simd/simd_sse2.c
  2. 3
      test cases/common/152 simd/simd_sse3.c
  3. 3
      test cases/common/152 simd/simd_sse41.c
  4. 3
      test cases/common/152 simd/simd_sse42.c
  5. 3
      test cases/common/152 simd/simd_ssse3.c
  6. 3
      test cases/common/152 simd/simdchecker.c
  7. 8
      test cases/common/152 simd/simdfuncs.h

@ -1,7 +1,6 @@
#include<simdconfig.h>
#include<simdfuncs.h>
#include<emmintrin.h>
#include<stdalign.h>
#ifdef _MSC_VER
int sse2_available() {
@ -22,7 +21,7 @@ int sse2_available() {
#endif
void increment_sse2(float arr[4]) {
alignas(16) double darr[4];
ALIGN_16 double darr[4];
__m128d val1 = _mm_set_pd(arr[0], arr[1]);
__m128d val2 = _mm_set_pd(arr[2], arr[3]);
__m128d one = _mm_set_pd(1.0, 1.0);

@ -1,6 +1,5 @@
#include<simdconfig.h>
#include<simdfuncs.h>
#include<stdalign.h>
#ifdef _MSC_VER
#include<intrin.h>
@ -23,7 +22,7 @@ int sse3_available() {
#endif
void increment_sse3(float arr[4]) {
alignas(16) double darr[4];
ALIGN_16 double darr[4];
__m128d val1 = _mm_set_pd(arr[0], arr[1]);
__m128d val2 = _mm_set_pd(arr[2], arr[3]);
__m128d one = _mm_set_pd(1.0, 1.0);

@ -1,7 +1,6 @@
#include<simdconfig.h>
#include<simdfuncs.h>
#include<stdalign.h>
#include<stdint.h>
#ifdef _MSC_VER
@ -25,7 +24,7 @@ int sse41_available() {
#endif
void increment_sse41(float arr[4]) {
alignas(16) double darr[4];
ALIGN_16 double darr[4];
__m128d val1 = _mm_set_pd(arr[0], arr[1]);
__m128d val2 = _mm_set_pd(arr[2], arr[3]);
__m128d one = _mm_set_pd(1.0, 1.0);

@ -1,7 +1,6 @@
#include<simdconfig.h>
#include<simdfuncs.h>
#include<stdint.h>
#include<stdalign.h>
#ifdef _MSC_VER
#include<intrin.h>
@ -28,7 +27,7 @@ int sse42_available() {
#endif
void increment_sse42(float arr[4]) {
alignas(16) double darr[4];
ALIGN_16 double darr[4];
__m128d val1 = _mm_set_pd(arr[0], arr[1]);
__m128d val2 = _mm_set_pd(arr[2], arr[3]);
__m128d one = _mm_set_pd(1.0, 1.0);

@ -1,6 +1,5 @@
#include<simdconfig.h>
#include<simdfuncs.h>
#include<stdalign.h>
#include<emmintrin.h>
#include<tmmintrin.h>
@ -31,7 +30,7 @@ int ssse3_available() {
#endif
void increment_ssse3(float arr[4]) {
alignas(16) double darr[4];
ALIGN_16 double darr[4];
__m128d val1 = _mm_set_pd(arr[0], arr[1]);
__m128d val2 = _mm_set_pd(arr[2], arr[3]);
__m128d one = _mm_set_pd(1.0, 1.0);

@ -1,5 +1,4 @@
#include<simdfuncs.h>
#include<stdalign.h>
#include<stdio.h>
#include<string.h>
@ -26,7 +25,7 @@ int check_simd_implementation(float *four,
int main(int argc, char **argv) {
static const float four_initial[4] = {2.0, 3.0, 4.0, 5.0};
alignas(16) float four[4];
ALIGN_16 float four[4];
const float expected[4] = {3.0, 4.0, 5.0, 6.0};
int r=0;
const int blocksize = 4;

@ -2,6 +2,14 @@
#include<simdconfig.h>
#ifdef _MSC_VER
#define ALIGN_16 __declspec(align(16))
#else
#include<stdalign.h>
#define ALIGN_16 alignas(16)
#endif
/* Yes, I do know that arr[4] decays into a pointer
* as a function argument. Don't do this in real code
* but for this test it is ok.

Loading…
Cancel
Save