mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
8395251c0a
All insertf*/extractf* functions replaced with insert/extract since we have insertf and inserti forms. Added lowering for INSERT_VECTOR_ELT / EXTRACT_VECTOR_ELT for 512-bit vectors. Added lowering for EXTRACT/INSERT subvector for 512-bit vectors. Added a test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187491 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.2 KiB
LLVM
44 lines
1.2 KiB
LLVM
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
|
|
|
|
;CHECK: test1
|
|
;CHECK: vinsertps
|
|
;CHECK: vinsertf32x4
|
|
;CHECK: ret
|
|
define <16 x float> @test1(<16 x float> %x, float* %br, float %y) nounwind {
|
|
%rrr = load float* %br
|
|
%rrr2 = insertelement <16 x float> %x, float %rrr, i32 1
|
|
%rrr3 = insertelement <16 x float> %rrr2, float %y, i32 14
|
|
ret <16 x float> %rrr3
|
|
}
|
|
|
|
;CHECK: test2
|
|
;CHECK: vinsertf32x4
|
|
;CHECK: vextractf32x4
|
|
;CHECK: vinsertf32x4
|
|
;CHECK: ret
|
|
define <8 x double> @test2(<8 x double> %x, double* %br, double %y) nounwind {
|
|
%rrr = load double* %br
|
|
%rrr2 = insertelement <8 x double> %x, double %rrr, i32 1
|
|
%rrr3 = insertelement <8 x double> %rrr2, double %y, i32 6
|
|
ret <8 x double> %rrr3
|
|
}
|
|
|
|
;CHECK: test3
|
|
;CHECK: vextractf32x4
|
|
;CHECK: vinsertf32x4
|
|
;CHECK: ret
|
|
define <16 x float> @test3(<16 x float> %x) nounwind {
|
|
%eee = extractelement <16 x float> %x, i32 4
|
|
%rrr2 = insertelement <16 x float> %x, float %eee, i32 1
|
|
ret <16 x float> %rrr2
|
|
}
|
|
|
|
;CHECK: test4
|
|
;CHECK: vextracti32x4
|
|
;CHECK: vinserti32x4
|
|
;CHECK: ret
|
|
define <8 x i64> @test4(<8 x i64> %x) nounwind {
|
|
%eee = extractelement <8 x i64> %x, i32 4
|
|
%rrr2 = insertelement <8 x i64> %x, i64 %eee, i32 1
|
|
ret <8 x i64> %rrr2
|
|
} |