Skip to content

Commit fbb3086

Browse files
committed
[CostModel][X86] Add UMUL fixed point cost tests
llvm-svn: 353153
1 parent 3b25196 commit fbb3086

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

llvm/test/Analysis/CostModel/X86/arith-fix.ll

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,66 @@ define i32 @smul(i32 %arg) {
7373

7474
ret i32 undef
7575
}
76+
77+
declare i64 @llvm.umul.fix.i64(i64, i64, i32)
78+
declare <2 x i64> @llvm.umul.fix.v2i64(<2 x i64>, <2 x i64>, i32)
79+
declare <4 x i64> @llvm.umul.fix.v4i64(<4 x i64>, <4 x i64>, i32)
80+
declare <8 x i64> @llvm.umul.fix.v8i64(<8 x i64>, <8 x i64>, i32)
81+
82+
declare i32 @llvm.umul.fix.i32(i32, i32, i32)
83+
declare <4 x i32> @llvm.umul.fix.v4i32(<4 x i32>, <4 x i32>, i32)
84+
declare <8 x i32> @llvm.umul.fix.v8i32(<8 x i32>, <8 x i32>, i32)
85+
declare <16 x i32> @llvm.umul.fix.v16i32(<16 x i32>, <16 x i32>, i32)
86+
87+
declare i16 @llvm.umul.fix.i16(i16, i16, i32)
88+
declare <8 x i16> @llvm.umul.fix.v8i16(<8 x i16>, <8 x i16>, i32)
89+
declare <16 x i16> @llvm.umul.fix.v16i16(<16 x i16>, <16 x i16>, i32)
90+
declare <32 x i16> @llvm.umul.fix.v32i16(<32 x i16>, <32 x i16>, i32)
91+
92+
declare i8 @llvm.umul.fix.i8(i8, i8, i32)
93+
declare <16 x i8> @llvm.umul.fix.v16i8(<16 x i8>, <16 x i8>, i32)
94+
declare <32 x i8> @llvm.umul.fix.v32i8(<32 x i8>, <32 x i8>, i32)
95+
declare <64 x i8> @llvm.umul.fix.v64i8(<64 x i8>, <64 x i8>, i32)
96+
97+
define i32 @umul(i32 %arg) {
98+
; CHECK-LABEL: 'umul'
99+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I64 = call i64 @llvm.umul.fix.i64(i64 undef, i64 undef, i32 3)
100+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V2I64 = call <2 x i64> @llvm.umul.fix.v2i64(<2 x i64> undef, <2 x i64> undef, i32 3)
101+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V4I64 = call <4 x i64> @llvm.umul.fix.v4i64(<4 x i64> undef, <4 x i64> undef, i32 3)
102+
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V8I64 = call <8 x i64> @llvm.umul.fix.v8i64(<8 x i64> undef, <8 x i64> undef, i32 3)
103+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I32 = call i32 @llvm.umul.fix.i32(i32 undef, i32 undef, i32 3)
104+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V4I32 = call <4 x i32> @llvm.umul.fix.v4i32(<4 x i32> undef, <4 x i32> undef, i32 3)
105+
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V8I32 = call <8 x i32> @llvm.umul.fix.v8i32(<8 x i32> undef, <8 x i32> undef, i32 3)
106+
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V16I32 = call <16 x i32> @llvm.umul.fix.v16i32(<16 x i32> undef, <16 x i32> undef, i32 3)
107+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I16 = call i16 @llvm.umul.fix.i16(i16 undef, i16 undef, i32 3)
108+
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V8I16 = call <8 x i16> @llvm.umul.fix.v8i16(<8 x i16> undef, <8 x i16> undef, i32 3)
109+
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V16I16 = call <16 x i16> @llvm.umul.fix.v16i16(<16 x i16> undef, <16 x i16> undef, i32 3)
110+
; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %V32I16 = call <32 x i16> @llvm.umul.fix.v32i16(<32 x i16> undef, <32 x i16> undef, i32 3)
111+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I8 = call i8 @llvm.umul.fix.i8(i8 undef, i8 undef, i32 3)
112+
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V16I8 = call <16 x i8> @llvm.umul.fix.v16i8(<16 x i8> undef, <16 x i8> undef, i32 3)
113+
; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %V32I8 = call <32 x i8> @llvm.umul.fix.v32i8(<32 x i8> undef, <32 x i8> undef, i32 3)
114+
; CHECK-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %V64I8 = call <64 x i8> @llvm.umul.fix.v64i8(<64 x i8> undef, <64 x i8> undef, i32 3)
115+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
116+
;
117+
%I64 = call i64 @llvm.umul.fix.i64(i64 undef, i64 undef, i32 3)
118+
%V2I64 = call <2 x i64> @llvm.umul.fix.v2i64(<2 x i64> undef, <2 x i64> undef, i32 3)
119+
%V4I64 = call <4 x i64> @llvm.umul.fix.v4i64(<4 x i64> undef, <4 x i64> undef, i32 3)
120+
%V8I64 = call <8 x i64> @llvm.umul.fix.v8i64(<8 x i64> undef, <8 x i64> undef, i32 3)
121+
122+
%I32 = call i32 @llvm.umul.fix.i32(i32 undef, i32 undef, i32 3)
123+
%V4I32 = call <4 x i32> @llvm.umul.fix.v4i32(<4 x i32> undef, <4 x i32> undef, i32 3)
124+
%V8I32 = call <8 x i32> @llvm.umul.fix.v8i32(<8 x i32> undef, <8 x i32> undef, i32 3)
125+
%V16I32 = call <16 x i32> @llvm.umul.fix.v16i32(<16 x i32> undef, <16 x i32> undef, i32 3)
126+
127+
%I16 = call i16 @llvm.umul.fix.i16(i16 undef, i16 undef, i32 3)
128+
%V8I16 = call <8 x i16> @llvm.umul.fix.v8i16(<8 x i16> undef, <8 x i16> undef, i32 3)
129+
%V16I16 = call <16 x i16> @llvm.umul.fix.v16i16(<16 x i16> undef, <16 x i16> undef, i32 3)
130+
%V32I16 = call <32 x i16> @llvm.umul.fix.v32i16(<32 x i16> undef, <32 x i16> undef, i32 3)
131+
132+
%I8 = call i8 @llvm.umul.fix.i8(i8 undef, i8 undef, i32 3)
133+
%V16I8 = call <16 x i8> @llvm.umul.fix.v16i8(<16 x i8> undef, <16 x i8> undef, i32 3)
134+
%V32I8 = call <32 x i8> @llvm.umul.fix.v32i8(<32 x i8> undef, <32 x i8> undef, i32 3)
135+
%V64I8 = call <64 x i8> @llvm.umul.fix.v64i8(<64 x i8> undef, <64 x i8> undef, i32 3)
136+
137+
ret i32 undef
138+
}

0 commit comments

Comments
 (0)