void helper_float_3(float *buf) {
  for (int j = 0; j < 8; j += 8) {
    __asm__ volatile("vmovups (%0), %%ymm0\n"
                     "vpermilps $160, %%ymm0, %%ymm8\n"
                     "vpermilps $245, %%ymm0, %%ymm9\n"
                     "vxorps %%ymm10, %%ymm10, %%ymm10\n"
                     "vsubps %%ymm9, %%ymm10, %%ymm11\n"
                     "vaddsubps %%ymm11, %%ymm8, %%ymm0\n"
                     "vpermilps $68, %%ymm0, %%ymm8\n"
                     "vpermilps $238, %%ymm0, %%ymm9\n"
                     "vxorps %%ymm10, %%ymm10, %%ymm10\n"
                     "vsubps %%ymm9, %%ymm10, %%ymm11\n"
                     "vblendps $204, %%ymm11, %%ymm9, %%ymm12\n"
                     "vaddps %%ymm8, %%ymm12, %%ymm0\n"
                     "vxorps %%ymm8, %%ymm8, %%ymm8\n"
                     "vsubps %%ymm0, %%ymm8, %%ymm9\n"
                     "vperm2f128 $0, %%ymm0, %%ymm0, %%ymm10\n"
                     "vperm2f128 $49, %%ymm9, %%ymm0, %%ymm11\n"
                     "vaddps %%ymm10, %%ymm11, %%ymm0\n"
                     "vmovups %%ymm0, (%0)\n" ::"r"(buf + j)
                     : "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5",
                       "%ymm6", "%ymm7", "%ymm8", "%ymm9", "%ymm10", "%ymm11",
                       "%ymm12", "%ymm13", "%ymm14", "%ymm15", "memory");
  }
}


x86 assembly (clang, -O0):
<helper_float_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1194 <helper_float_3+0x94>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
vmovups (%rax),%ymm0
vpermilps $0xa0,%ymm0,%ymm8
vpermilps $0xf5,%ymm0,%ymm9
vxorps %ymm10,%ymm10,%ymm10
vsubps %ymm9,%ymm10,%ymm11
vaddsubps %ymm11,%ymm8,%ymm0
vpermilps $0x44,%ymm0,%ymm8
vpermilps $0xee,%ymm0,%ymm9
vxorps %ymm10,%ymm10,%ymm10
vsubps %ymm9,%ymm10,%ymm11
vblendps $0xcc,%ymm11,%ymm9,%ymm12
vaddps %ymm8,%ymm12,%ymm0
vxorps %ymm8,%ymm8,%ymm8
vsubps %ymm0,%ymm8,%ymm9
vperm2f128 $0x0,%ymm0,%ymm0,%ymm10
vperm2f128 $0x31,%ymm9,%ymm0,%ymm11
vaddps %ymm10,%ymm11,%ymm0
vmovups %ymm0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <helper_float_3+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_float_3>:
vmovups (%rdi),%ymm0
vpermilps $0xa0,%ymm0,%ymm8
vpermilps $0xf5,%ymm0,%ymm9
vxorps %ymm10,%ymm10,%ymm10
vsubps %ymm9,%ymm10,%ymm11
vaddsubps %ymm11,%ymm8,%ymm0
vpermilps $0x44,%ymm0,%ymm8
vpermilps $0xee,%ymm0,%ymm9
vxorps %ymm10,%ymm10,%ymm10
vsubps %ymm9,%ymm10,%ymm11
vblendps $0xcc,%ymm11,%ymm9,%ymm12
vaddps %ymm8,%ymm12,%ymm0
vxorps %ymm8,%ymm8,%ymm8
vsubps %ymm0,%ymm8,%ymm9
vperm2f128 $0x0,%ymm0,%ymm0,%ymm10
vperm2f128 $0x31,%ymm9,%ymm0,%ymm11
vaddps %ymm10,%ymm11,%ymm0
vmovups %ymm0,(%rdi)
ret

LLVM IR (-O0):
define void @helper_float_3(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 8
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @helper_float_3(float* %0) {
tail call void asm sideeffect "vmovups ($0), %ymm0\0Avpermilps $$160, %ymm0, %ymm8\0Avpermilps $$245, %ymm0, %ymm9\0Avxorps %ymm10, %ymm10, %ymm10\0Avsubps %ymm9, %ymm10, %ymm11\0Avaddsubps %ymm11, %ymm8, %ymm0\0Avpermilps $$68, %ymm0, %ymm8\0Avpermilps $$238, %ymm0, %ymm9\0Avxorps %ymm10, %ymm10, %ymm10\0Avsubps %ymm9, %ymm10, %ymm11\0Avblendps $$204, %ymm11, %ymm9, %ymm12\0Avaddps %ymm8, %ymm12, %ymm0\0Avxorps %ymm8, %ymm8, %ymm8\0Avsubps %ymm0, %ymm8, %ymm9\0Avperm2f128 $$0, %ymm0, %ymm0, %ymm10\0Avperm2f128 $$49, %ymm9, %ymm0, %ymm11\0Avaddps %ymm10, %ymm11, %ymm0\0Avmovups %ymm0, ($0)\0A", "r,~{ymm0},~{ymm1},~{ymm2},~{ymm3},~{ymm4},~{ymm5},~{ymm6},~{ymm7},~{ymm8},~{ymm9},~{ymm10},~{ymm11},~{ymm12},~{ymm13},~{ymm14},~{ymm15},~{memory},~{dirflag},~{fpsr},~{flags}"(float* %0)
ret void
}