mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
03a77831cc
Update the entire regression test suite for the new shuffles. Remove most of the old testing which was devoted to the old shuffle lowering path and is no longer relevant really. Also remove a few other random tests that only really exercised shuffles and only incidently or without any interesting aspects to them. Benchmarking that I have done shows a few small regressions with this on LNT, zero measurable regressions on real, large applications, and for several benchmarks where the loop vectorizer fires in the hot path it shows 5% to 40% improvements for SSE2 and SSE3 code running on Sandy Bridge machines. Running on AMD machines shows even more dramatic improvements. When using newer ISA vector extensions the gains are much more modest, but the code is still better on the whole. There are a few regressions being tracked (PR21137, PR21138, PR21139) but by and large this is expected to be a win for x86 generated code performance. It is also more correct than the code it replaces. I have fuzz tested this extensively with ISA extensions up through AVX2 and found no crashes or miscompiles (yet...). The old lowering had a few miscompiles and crashers after a somewhat smaller amount of fuzz testing. There is one significant area where the new code path lags behind and that is in AVX-512 support. However, there was *extremely little* support for that already and so this isn't a significant step backwards and the new framework will probably make it easier to implement lowering that uses the full power of AVX-512's table-based shuffle+blend (IMO). Many thanks to Quentin, Andrea, Robert, and others for benchmarking assistance. Thanks to Adam and others for help with AVX-512. Thanks to Hal, Eric, and *many* others for answering my incessant questions about how the backend actually works. =] I will leave the old code path in the tree until the 3 PRs above are at least resolved to folks' satisfaction. Then I will rip it (and 1000s of lines of code) out. =] I don't expect this flag to stay around for very long. It may not survive next week. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219046 91177308-0d34-0410-b5e6-96231b3b80d8
38 lines
1.2 KiB
LLVM
38 lines
1.2 KiB
LLVM
; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=penryn | FileCheck %s
|
|
|
|
define <4 x float> @test(float %a) {
|
|
; CHECK-LABEL: test:
|
|
; CHECK: insertps $29, {{.*}}, %xmm0
|
|
; CHECK-NEXT: retl
|
|
|
|
entry:
|
|
%tmp = insertelement <4 x float> zeroinitializer, float %a, i32 1
|
|
%tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 2
|
|
%tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 3
|
|
ret <4 x float> %tmp6
|
|
}
|
|
|
|
define <2 x i64> @test2(i32 %a) {
|
|
; CHECK-LABEL: test2:
|
|
; CHECK: movd {{.*}}, %xmm0
|
|
; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,0,1]
|
|
; CHECK-NEXT: retl
|
|
|
|
entry:
|
|
%tmp7 = insertelement <4 x i32> zeroinitializer, i32 %a, i32 2
|
|
%tmp9 = insertelement <4 x i32> %tmp7, i32 0, i32 3
|
|
%tmp10 = bitcast <4 x i32> %tmp9 to <2 x i64>
|
|
ret <2 x i64> %tmp10
|
|
}
|
|
|
|
define <4 x float> @test3(<4 x float> %A) {
|
|
; CHECK-LABEL: test3:
|
|
; CHECK: insertps {{.*#+}} xmm0 = zero,xmm0[0],zero,zero
|
|
; CHECK-NEXT: retl
|
|
|
|
%tmp0 = extractelement <4 x float> %A, i32 0
|
|
%tmp1 = insertelement <4 x float> <float 0.000000e+00, float undef, float undef, float undef >, float %tmp0, i32 1
|
|
%tmp2 = insertelement <4 x float> %tmp1, float 0.000000e+00, i32 2
|
|
ret <4 x float> %tmp2
|
|
}
|