aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/vec_cast2.ll
blob: 5f6e7a853a332e7f7fcd297d9f92ae73b24695d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
; RUN: llc < %s -mtriple=i386-apple-darwin10 -mcpu=corei7-avx -mattr=+avx | FileCheck %s

;CHECK-LABEL: foo1_8:
;CHECK: vcvtdq2ps
;CHECK: ret
define <8 x float> @foo1_8(<8 x i8> %src) {
  %res = sitofp <8 x i8> %src to <8 x float>
  ret <8 x float> %res
}

;CHECK-LABEL: foo1_4:
;CHECK: vcvtdq2ps
;CHECK: ret
define <4 x float> @foo1_4(<4 x i8> %src) {
  %res = sitofp <4 x i8> %src to <4 x float>
  ret <4 x float> %res
}

;CHECK-LABEL: foo2_8:
;CHECK: vcvtdq2ps
;CHECK: ret
define <8 x float> @foo2_8(<8 x i8> %src) {
  %res = uitofp <8 x i8> %src to <8 x float>
  ret <8 x float> %res
}

;CHECK-LABEL: foo2_4:
;CHECK: vcvtdq2ps
;CHECK: ret
define <4 x float> @foo2_4(<4 x i8> %src) {
  %res = uitofp <4 x i8> %src to <4 x float>
  ret <4 x float> %res
}

;CHECK-LABEL: foo3_8:
;CHECK: vcvttps2dq
;CHECK: ret
define <8 x i8> @foo3_8(<8 x float> %src) {
  %res = fptosi <8 x float> %src to <8 x i8>
  ret <8 x i8> %res
}
;CHECK-LABEL: foo3_4:
;CHECK: vcvttps2dq
;CHECK: ret
define <4 x i8> @foo3_4(<4 x float> %src) {
  %res = fptosi <4 x float> %src to <4 x i8>
  ret <4 x i8> %res
}