Page MenuHomePhabricator

[X86] Add _mm256_set_m128 and friends
ClosedPublic

Authored by mkuper on May 19 2015, 8:48 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mkuper updated this revision to Diff 26066.May 19 2015, 8:48 AM
mkuper retitled this revision from to [X86] Add _mm256_set_m128 and friends.
mkuper updated this object.
mkuper edited the test plan for this revision. (Show Details)
mkuper added a reviewer: delena.
mkuper added a subscriber: Unknown Object (MLST).

Hi Michael,

I suggested a couple of changes to the patch.

I hope it helps!
-Andrea

lib/Headers/avxintrin.h
1273–1278 ↗(On Diff #26066)

You can simply this using a single shuffle.

_mm256_set_m128 (__m128 __hi, __m128 __lo) {
  return (__m256) __builtin_shufflevector(__lo, __hi, 0, 1, 2, 3, 4, 5, 6, 7);
}
test/CodeGen/avx-shuffle-builtins.c
177–183 ↗(On Diff #26066)

You would only need to check for a single shufflevector with mask <0,1,2,3,4,5,6,7> if you simplify the body of '_mm256_set_m128'.

Argh, right, for some reason I thought __builtin_shufflevector was more restricted in terms of types than actual shufflevector.

Thanks, Andrea!

This revision was automatically updated to reflect the committed changes.