X86 CostModel: Add support for a some of the common arithmetic instructions for SSE4...
[oota-llvm.git] / test / Analysis / CostModel / X86 / arith.ll
1 ; RUN: opt < %s  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
2
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4 target triple = "x86_64-apple-macosx10.8.0"
5
6 define i32 @add(i32 %arg) {
7   ;CHECK: cost of 1 {{.*}} add
8   %A = add <4 x i32> undef, undef
9   ;CHECK: cost of 4 {{.*}} add
10   %B = add <8 x i32> undef, undef
11   ;CHECK: cost of 1 {{.*}} add
12   %C = add <2 x i64> undef, undef
13   ;CHECK: cost of 4 {{.*}} add
14   %D = add <4 x i64> undef, undef
15   ;CHECK: cost of 1 {{.*}} ret
16   ret i32 undef
17 }
18
19
20 define i32 @xor(i32 %arg) {
21   ;CHECK: cost of 1 {{.*}} xor
22   %A = xor <4 x i32> undef, undef
23   ;CHECK: cost of 1 {{.*}} xor
24   %B = xor <8 x i32> undef, undef
25   ;CHECK: cost of 1 {{.*}} xor
26   %C = xor <2 x i64> undef, undef
27   ;CHECK: cost of 1 {{.*}} xor
28   %D = xor <4 x i64> undef, undef
29   ;CHECK: cost of 1 {{.*}} ret
30   ret i32 undef
31 }
32
33
34 define i32 @fmul(i32 %arg) {
35   ;CHECK: cost of 1 {{.*}} fmul
36   %A = fmul <4 x float> undef, undef
37   ;CHECK: cost of 1 {{.*}} fmul
38   %B = fmul <8 x float> undef, undef
39   ret i32 undef
40 }