2
2
3
3
module {
4
4
func.func @pow_c4_i4(%arg0: complex<f32>, %arg1: i32) -> complex<f32> {
5
- %c0 = arith.constant 0.000000e+00 : f32
6
- %c1 = fir.convert %arg1 : (i32) -> f32
7
- %c2 = complex.create %c1 , %c0 : complex<f32>
8
- %0 = complex.pow %arg0, %c2 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f32>
9
- return %0 : complex<f32>
5
+ %c0 = arith.constant 0.0 : f32
6
+ %0 = fir.convert %arg1 : (i32) -> f32
7
+ %1 = complex.create %0 , %c0 : complex<f32>
8
+ %2 = complex.pow %arg0, %1 : complex<f32>
9
+ return %2 : complex<f32>
10
10
}
11
11
12
12
func.func @pow_c4_i8(%arg0: complex<f32>, %arg1: i64) -> complex<f32> {
13
- %c0 = arith.constant 0.000000e+00 : f32
14
- %c1 = fir.convert %arg1 : (i64) -> f32
15
- %c2 = complex.create %c1, %c0 : complex<f32>
16
- %0 = complex.pow %arg0, %c2 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f32>
17
- return %0 : complex<f32>
18
- }
19
-
20
- func.func @pow_c4_c4(%arg0: complex<f32>, %arg1: complex<f32>) -> complex<f32> {
21
- %0 = complex.pow %arg0, %arg1 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f32>
22
- return %0 : complex<f32>
13
+ %c0 = arith.constant 0.0 : f32
14
+ %0 = fir.convert %arg1 : (i64) -> f32
15
+ %1 = complex.create %0, %c0 : complex<f32>
16
+ %2 = complex.pow %arg0, %1 : complex<f32>
17
+ return %2 : complex<f32>
23
18
}
24
19
25
20
func.func @pow_c8_i4(%arg0: complex<f64>, %arg1: i32) -> complex<f64> {
26
- %c0 = arith.constant 0.000000e+00 : f64
27
- %c1 = fir.convert %arg1 : (i32) -> f64
28
- %c2 = complex.create %c1 , %c0 : complex<f64>
29
- %0 = complex.pow %arg0, %c2 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f64>
30
- return %0 : complex<f64>
21
+ %c0 = arith.constant 0.0 : f64
22
+ %0 = fir.convert %arg1 : (i32) -> f64
23
+ %1 = complex.create %0 , %c0 : complex<f64>
24
+ %2 = complex.pow %arg0, %1 : complex<f64>
25
+ return %2 : complex<f64>
31
26
}
32
27
33
28
func.func @pow_c8_i8(%arg0: complex<f64>, %arg1: i64) -> complex<f64> {
34
- %c0 = arith.constant 0.000000e+00 : f64
35
- %c1 = fir.convert %arg1 : (i64) -> f64
36
- %c2 = complex.create %c1, %c0 : complex<f64>
37
- %0 = complex.pow %arg0, %c2 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f64>
38
- return %0 : complex<f64>
39
- }
40
-
41
- func.func @pow_c8_c8(%arg0: complex<f64>, %arg1: complex<f64>) -> complex<f64> {
42
- %0 = complex.pow %arg0, %arg1 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f64>
43
- return %0 : complex<f64>
29
+ %c0 = arith.constant 0.0 : f64
30
+ %0 = fir.convert %arg1 : (i64) -> f64
31
+ %1 = complex.create %0, %c0 : complex<f64>
32
+ %2 = complex.pow %arg0, %1 : complex<f64>
33
+ return %2 : complex<f64>
44
34
}
45
35
46
36
func.func @pow_c16_i4(%arg0: complex<f128>, %arg1: i32) -> complex<f128> {
47
- %c0 = arith.constant 0.000000e+00 : f128
48
- %c1 = fir.convert %arg1 : (i32) -> f128
49
- %c2 = complex.create %c1 , %c0 : complex<f128>
50
- %0 = complex.pow %arg0, %c2 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f128>
51
- return %0 : complex<f128>
37
+ %c0 = arith.constant 0.0 : f128
38
+ %0 = fir.convert %arg1 : (i32) -> f128
39
+ %1 = complex.create %0 , %c0 : complex<f128>
40
+ %2 = complex.pow %arg0, %1 : complex<f128>
41
+ return %2 : complex<f128>
52
42
}
53
43
54
44
func.func @pow_c16_i8(%arg0: complex<f128>, %arg1: i64) -> complex<f128> {
55
- %c0 = arith.constant 0.000000e+00 : f128
56
- %c1 = fir.convert %arg1 : (i64) -> f128
57
- %c2 = complex.create %c1, %c0 : complex<f128>
58
- %0 = complex.pow %arg0, %c2 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f128>
59
- return %0 : complex<f128>
45
+ %c0 = arith.constant 0.0 : f128
46
+ %0 = fir.convert %arg1 : (i64) -> f128
47
+ %1 = complex.create %0, %c0 : complex<f128>
48
+ %2 = complex.pow %arg0, %1 : complex<f128>
49
+ return %2 : complex<f128>
50
+ }
51
+
52
+ func.func @pow_c4_fast(%arg0: complex<f32>, %arg1: f32) -> complex<f32> {
53
+ %c1 = arith.constant 1.0 : f32
54
+ %0 = complex.create %arg1, %c1 : complex<f32>
55
+ %1 = complex.pow %arg0, %0 fastmath<fast> : complex<f32>
56
+ return %1 : complex<f32>
57
+ }
58
+
59
+ func.func @pow_c8_complex(%arg0: complex<f64>, %arg1: f64) -> complex<f64> {
60
+ %c2 = arith.constant 2.0 : f64
61
+ %0 = complex.create %arg1, %c2 : complex<f64>
62
+ %1 = complex.pow %arg0, %0 : complex<f64>
63
+ return %1 : complex<f64>
60
64
}
61
65
62
- func.func @pow_c16_c16(%arg0: complex<f128>, %arg1: complex<f128>) -> complex<f128> {
63
- %0 = complex.pow %arg0, %arg1 {fastmath = #arith.fastmath<reassoc, contract, nsz>} : complex<f128>
64
- return %0 : complex<f128>
66
+ func.func @pow_c16_complex(%arg0: complex<f128>, %arg1: f128) -> complex<f128> {
67
+ %c3 = arith.constant 3.0 : f128
68
+ %0 = complex.create %arg1, %c3 : complex<f128>
69
+ %1 = complex.pow %arg0, %0 : complex<f128>
70
+ return %1 : complex<f128>
65
71
}
66
72
}
67
73
68
74
// CHECK-LABEL: func.func @pow_c4_i4(
69
- // CHECK: fir.call @_FortranAcpowi(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f32>, i32) -> complex<f32>
75
+ // CHECK: fir.call @_FortranAcpowi(%{{.*}}, %{{.*}}) : (complex<f32>, i32) -> complex<f32>
70
76
// CHECK-NOT: complex.pow
71
77
72
78
// CHECK-LABEL: func.func @pow_c4_i8(
73
- // CHECK: fir.call @_FortranAcpowk(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f32>, i64) -> complex<f32>
74
- // CHECK-NOT: complex.pow
75
-
76
- // CHECK-LABEL: func.func @pow_c4_c4(
77
- // CHECK: fir.call @cpowf(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f32>, complex<f32>) -> complex<f32>
79
+ // CHECK: fir.call @_FortranAcpowk(%{{.*}}, %{{.*}}) : (complex<f32>, i64) -> complex<f32>
78
80
// CHECK-NOT: complex.pow
79
81
80
82
// CHECK-LABEL: func.func @pow_c8_i4(
81
- // CHECK: fir.call @_FortranAzpowi(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f64>, i32) -> complex<f64>
83
+ // CHECK: fir.call @_FortranAzpowi(%{{.*}}, %{{.*}}) : (complex<f64>, i32) -> complex<f64>
82
84
// CHECK-NOT: complex.pow
83
85
84
86
// CHECK-LABEL: func.func @pow_c8_i8(
85
- // CHECK: fir.call @_FortranAzpowk(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f64>, i64) -> complex<f64>
86
- // CHECK-NOT: complex.pow
87
-
88
- // CHECK-LABEL: func.func @pow_c8_c8(
89
- // CHECK: fir.call @cpow(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f64>, complex<f64>) -> complex<f64>
87
+ // CHECK: fir.call @_FortranAzpowk(%{{.*}}, %{{.*}}) : (complex<f64>, i64) -> complex<f64>
90
88
// CHECK-NOT: complex.pow
91
89
92
90
// CHECK-LABEL: func.func @pow_c16_i4(
93
- // CHECK: fir.call @_FortranAcqpowi(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f128>, i32) -> complex<f128>
91
+ // CHECK: fir.call @_FortranAcqpowi(%{{.*}}, %{{.*}}) : (complex<f128>, i32) -> complex<f128>
94
92
// CHECK-NOT: complex.pow
95
93
96
94
// CHECK-LABEL: func.func @pow_c16_i8(
97
- // CHECK: fir.call @_FortranAcqpowk(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f128>, i64) -> complex<f128>
95
+ // CHECK: fir.call @_FortranAcqpowk(%{{.*}}, %{{.*}}) : (complex<f128>, i64) -> complex<f128>
98
96
// CHECK-NOT: complex.pow
99
97
100
- // CHECK-LABEL: func.func @pow_c16_c16(
101
- // CHECK: fir.call @_FortranACPowF128(%{{.*}}, %{{.*}}) fastmath<reassoc,nsz,contract> : (complex<f128>, complex<f128>) -> complex<f128>
98
+ // CHECK-LABEL: func.func @pow_c4_fast(
99
+ // CHECK: %[[EXP:.*]] = complex.create %{{.*}}, %{{.*}} : complex<f32>
100
+ // CHECK: fir.call @cpowf(%{{.*}}, %[[EXP]]) fastmath<fast> : (complex<f32>, complex<f32>) -> complex<f32>
102
101
// CHECK-NOT: complex.pow
102
+
103
+ // CHECK-LABEL: func.func @pow_c8_complex(
104
+ // CHECK: %[[EXP:.*]] = complex.create %{{.*}}, %{{.*}} : complex<f64>
105
+ // CHECK: fir.call @cpow(%{{.*}}, %[[EXP]]) : (complex<f64>, complex<f64>) -> complex<f64>
106
+ // CHECK-NOT: complex.pow
107
+
108
+ // CHECK-LABEL: func.func @pow_c16_complex(
109
+ // CHECK: %[[EXP:.*]] = complex.create %{{.*}}, %{{.*}} : complex<f128>
110
+ // CHECK: fir.call @_FortranACPowF128(%{{.*}}, %[[EXP]]) : (complex<f128>, complex<f128>) -> complex<f128>
111
+ // CHECK-NOT: complex.pow
0 commit comments