cmp-tofp.ll
1.47 KB
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
; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
;
; Costs for conversion of i1 vectors to vectors of double.
define <2 x double> @fun0(<2 x i8> %val1, <2 x i8> %val2) {
%cmp = icmp eq <2 x i8> %val1, %val2
%v = uitofp <2 x i1> %cmp to <2 x double>
ret <2 x double> %v
; CHECK: fun0
; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i8> %val1, %val2
; CHECK: cost of 5 for instruction: %v = uitofp <2 x i1> %cmp to <2 x double>
}
define <2 x double> @fun1(<2 x i8> %val1, <2 x i8> %val2) {
%cmp = icmp eq <2 x i8> %val1, %val2
%v = sitofp <2 x i1> %cmp to <2 x double>
ret <2 x double> %v
; CHECK: fun1
; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i8> %val1, %val2
; CHECK: cost of 4 for instruction: %v = sitofp <2 x i1> %cmp to <2 x double>
}
define <2 x double> @fun2(<2 x i64> %val1, <2 x i64> %val2) {
%cmp = icmp eq <2 x i64> %val1, %val2
%v = uitofp <2 x i1> %cmp to <2 x double>
ret <2 x double> %v
; CHECK: fun2
; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i64> %val1, %val2
; CHECK: cost of 2 for instruction: %v = uitofp <2 x i1> %cmp to <2 x double>
}
define <2 x double> @fun3(<2 x i64> %val1, <2 x i64> %val2) {
%cmp = icmp eq <2 x i64> %val1, %val2
%v = sitofp <2 x i1> %cmp to <2 x double>
ret <2 x double> %v
; CHECK: fun3
; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i64> %val1, %val2
; CHECK: cost of 1 for instruction: %v = sitofp <2 x i1> %cmp to <2 x double>
}