1 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding| FileCheck %s
4 ; CHECK: vmovd %xmm0, %eax ## encoding: [0x62
6 define i32 @test1(float %x) {
7 %res = bitcast float %x to i32
12 ; CHECK: vmovd %edi, %xmm0 ## encoding: [0x62
14 define <4 x i32> @test2(i32 %x) {
15 %res = insertelement <4 x i32>undef, i32 %x, i32 0
20 ; CHECK: vmovq %rdi, %xmm0 ## encoding: [0x62
22 define <2 x i64> @test3(i64 %x) {
23 %res = insertelement <2 x i64>undef, i64 %x, i32 0
28 ; CHECK: vmovd (%rdi), %xmm0 ## encoding: [0x62
30 define <4 x i32> @test4(i32* %x) {
32 %res = insertelement <4 x i32>undef, i32 %y, i32 0
37 ; CHECK: vmovss %xmm0, (%rdi) ## encoding: [0x62
39 define void @test5(float %x, float* %y) {
40 store float %x, float* %y, align 4
45 ; CHECK: vmovsd %xmm0, (%rdi) ## encoding: [0x62
47 define void @test6(double %x, double* %y) {
48 store double %x, double* %y, align 8
53 ; CHECK: vmovss (%rdi), %xmm0 ## encoding: [0x62
55 define float @test7(i32* %x) {
57 %res = bitcast i32 %y to float
62 ; CHECK: vmovd %xmm0, %eax ## encoding: [0x62
64 define i32 @test8(<4 x i32> %x) {
65 %res = extractelement <4 x i32> %x, i32 0
70 ; CHECK: vmovq %xmm0, %rax ## encoding: [0x62
72 define i64 @test9(<2 x i64> %x) {
73 %res = extractelement <2 x i64> %x, i32 0
77 ; CHECK-LABEL: @test10
78 ; CHECK: vmovd (%rdi), %xmm0 ## encoding: [0x62
80 define <4 x i32> @test10(i32* %x) {
81 %y = load i32* %x, align 4
82 %res = insertelement <4 x i32>zeroinitializer, i32 %y, i32 0
86 ; CHECK-LABEL: @test11
87 ; CHECK: vmovss (%rdi), %xmm0 ## encoding: [0x62
89 define <4 x float> @test11(float* %x) {
90 %y = load float* %x, align 4
91 %res = insertelement <4 x float>zeroinitializer, float %y, i32 0
95 ; CHECK-LABEL: @test12
96 ; CHECK: vmovsd (%rdi), %xmm0 ## encoding: [0x62
98 define <2 x double> @test12(double* %x) {
99 %y = load double* %x, align 8
100 %res = insertelement <2 x double>zeroinitializer, double %y, i32 0
104 ; CHECK-LABEL: @test13
105 ; CHECK: vmovq %rdi, %xmm0 ## encoding: [0x62
107 define <2 x i64> @test13(i64 %x) {
108 %res = insertelement <2 x i64>zeroinitializer, i64 %x, i32 0
112 ; CHECK-LABEL: @test14
113 ; CHECK: vmovd %edi, %xmm0 ## encoding: [0x62
115 define <4 x i32> @test14(i32 %x) {
116 %res = insertelement <4 x i32>zeroinitializer, i32 %x, i32 0
120 ; CHECK-LABEL: @test15
121 ; CHECK: vmovd (%rdi), %xmm0 ## encoding: [0x62
123 define <4 x i32> @test15(i32* %x) {
124 %y = load i32* %x, align 4
125 %res = insertelement <4 x i32>zeroinitializer, i32 %y, i32 0
129 ; CHECK-LABEL: test16
132 define <16 x i32> @test16(i8 * %addr) {
133 %vaddr = bitcast i8* %addr to <16 x i32>*
134 %res = load <16 x i32>* %vaddr, align 1
138 ; CHECK-LABEL: test17
141 define <16 x i32> @test17(i8 * %addr) {
142 %vaddr = bitcast i8* %addr to <16 x i32>*
143 %res = load <16 x i32>* %vaddr, align 64
147 ; CHECK-LABEL: test18
150 define void @test18(i8 * %addr, <8 x i64> %data) {
151 %vaddr = bitcast i8* %addr to <8 x i64>*
152 store <8 x i64>%data, <8 x i64>* %vaddr, align 64