Skip to content

Commit

Permalink
restore compat with LDC 1.12 arm32
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Piolat committed Jan 22, 2025
1 parent fc5d672 commit cc545d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 11 additions & 3 deletions source/inteli/emmintrin.d
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,9 @@ unittest
__m128i A = _mm_set_epi32(3, 2, 1, 0);
foreach(i; 0..4)
assert(A.array[i] == i);
enum B = _mm_setr_epi32(0, 1, 2, 3);

static if (__VERSION__ >= 2094)
enum __m128i B = _mm_setr_epi32(0, 1, 2, 3);
}

/// Set packed 64-bit integers with the supplied values.
Expand Down Expand Up @@ -3478,7 +3480,10 @@ unittest
int4 A = cast(int4) _mm_set1_epi32(31);
for (int i = 0; i < 4; ++i)
assert(A.array[i] == 31);
enum B = _mm_set1_epi32(3);

// compile-time should work
static if (__VERSION__ >= 2094)
enum __m128 B = _mm_set1_epi32(3);
}

/// Broadcast 64-bit integer `a` to all elements.
Expand Down Expand Up @@ -3573,7 +3578,10 @@ unittest
int4 A = cast(int4) _mm_setr_epi32(-1, 0, -2147483648, 2147483647);
int[4] correct = [-1, 0, -2147483648, 2147483647];
assert(A.array == correct);
enum B = _mm_setr_epi32(0, 1, 2, 3);

// compile-time should work
static if (__VERSION__ >= 2094)
enum __m128i B = _mm_setr_epi32(0, 1, 2, 3);
}

/// Set packed 64-bit integers with the supplied values in reverse order.
Expand Down
6 changes: 5 additions & 1 deletion source/inteli/xmmintrin.d
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,11 @@ unittest
float[4] correct = [42.0f, 42.0f, 42.0f, 42.0f];
__m128 A = _mm_set1_ps(42.0f);
assert(A.array == correct);
enum B = _mm_set1_ps(2.4f);

static if (__VERSION__ >= 2094)
{
enum __m128 B = _mm_set1_ps(2.4f);
}
}

/// Set the MXCSR control and status register with the value in unsigned 32-bit integer `controlWord`.
Expand Down

0 comments on commit cc545d6

Please sign in to comment.