@@ -16,6 +16,9 @@ declare <16 x i32> @llvm.smax.v16i32(<16 x i32>, <16 x i32>)
16
16
declare float @llvm.fmuladd.f32 (float , float , float )
17
17
declare <16 x float > @llvm.fmuladd.v16f32 (<16 x float >, <16 x float >, <16 x float >)
18
18
19
+ declare float @llvm.log2.f32 (float )
20
+ declare <16 x float > @llvm.log2.v16f32 (<16 x float >)
21
+
19
22
declare i32 @llvm.cttz.i32 (i32 , i1 )
20
23
declare <16 x i32 > @llvm.cttz.v16i32 (<16 x i32 >, i1 )
21
24
@@ -83,6 +86,32 @@ define void @fmuladd(float %a, float %b, float %c, <16 x float> %va, <16 x float
83
86
ret void
84
87
}
85
88
89
+ define void @log2 (float %a , <16 x float > %va ) {
90
+ ; THRU-LABEL: 'log2'
91
+ ; THRU-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %s = call float @llvm.log2.f32(float %a)
92
+ ; THRU-NEXT: Cost Model: Found an estimated cost of 672 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
93
+ ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
94
+ ;
95
+ ; LATE-LABEL: 'log2'
96
+ ; LATE-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %s = call float @llvm.log2.f32(float %a)
97
+ ; LATE-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
98
+ ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
99
+ ;
100
+ ; SIZE-LABEL: 'log2'
101
+ ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.log2.f32(float %a)
102
+ ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
103
+ ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
104
+ ;
105
+ ; SIZE_LATE-LABEL: 'log2'
106
+ ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.log2.f32(float %a)
107
+ ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x float> @llvm.log2.v16f32(<16 x float> %va)
108
+ ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
109
+ ;
110
+ %s = call float @llvm.log2.f32 (float %a )
111
+ %v = call <16 x float > @llvm.log2.v16f32 (<16 x float > %va )
112
+ ret void
113
+ }
114
+
86
115
define void @cttz (i32 %a , <16 x i32 > %va ) {
87
116
; THRU-LABEL: 'cttz'
88
117
; THRU-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.cttz.i32(i32 %a, i1 false)
0 commit comments