22
33// CHECK-DAG: @__ocml_cabs_f32(complex<f32>) -> f32
44// CHECK-DAG: @__ocml_cabs_f64(complex<f64>) -> f64
5+ // CHECK-DAG: @__ocml_carg_f32(complex<f32>) -> f32
6+ // CHECK-DAG: @__ocml_carg_f64(complex<f64>) -> f64
7+ // CHECK-DAG: @__ocml_ccos_f32(complex<f32>) -> complex<f32>
8+ // CHECK-DAG: @__ocml_ccos_f64(complex<f64>) -> complex<f64>
59// CHECK-DAG: @__ocml_cexp_f32(complex<f32>) -> complex<f32>
610// CHECK-DAG: @__ocml_cexp_f64(complex<f64>) -> complex<f64>
11+ // CHECK-DAG: @__ocml_clog_f32(complex<f32>) -> complex<f32>
12+ // CHECK-DAG: @__ocml_clog_f64(complex<f64>) -> complex<f64>
13+ // CHECK-DAG: @__ocml_conj_f32(complex<f32>) -> complex<f32>
14+ // CHECK-DAG: @__ocml_conj_f64(complex<f64>) -> complex<f64>
15+ // CHECK-DAG: @__ocml_cpow_f32(complex<f32>, complex<f32>) -> complex<f32>
16+ // CHECK-DAG: @__ocml_cpow_f64(complex<f64>, complex<f64>) -> complex<f64>
17+ // CHECK-DAG: @__ocml_csin_f32(complex<f32>) -> complex<f32>
18+ // CHECK-DAG: @__ocml_csin_f64(complex<f64>) -> complex<f64>
19+ // CHECK-DAG: @__ocml_csqrt_f32(complex<f32>) -> complex<f32>
20+ // CHECK-DAG: @__ocml_csqrt_f64(complex<f64>) -> complex<f64>
21+ // CHECK-DAG: @__ocml_ctan_f32(complex<f32>) -> complex<f32>
22+ // CHECK-DAG: @__ocml_ctan_f64(complex<f64>) -> complex<f64>
23+ // CHECK-DAG: @__ocml_ctanh_f32(complex<f32>) -> complex<f32>
24+ // CHECK-DAG: @__ocml_ctanh_f64(complex<f64>) -> complex<f64>
725
826//CHECK-LABEL: @abs_caller
927func.func @abs_caller (%f: complex <f32 >, %d: complex <f64 >) -> (f32 , f64 ) {
@@ -15,6 +33,26 @@ func.func @abs_caller(%f: complex<f32>, %d: complex<f64>) -> (f32, f64) {
1533 return %rf , %rd : f32 , f64
1634}
1735
36+ //CHECK-LABEL: @angle_caller
37+ func.func @angle_caller (%f: complex <f32 >, %d: complex <f64 >) -> (f32 , f64 ) {
38+ // CHECK: %[[AF:.*]] = call @__ocml_carg_f32(%{{.*}})
39+ %af = complex.angle %f : complex <f32 >
40+ // CHECK: %[[AD:.*]] = call @__ocml_carg_f64(%{{.*}})
41+ %ad = complex.angle %d : complex <f64 >
42+ // CHECK: return %[[AF]], %[[AD]]
43+ return %af , %ad : f32 , f64
44+ }
45+
46+ //CHECK-LABEL: @cos_caller
47+ func.func @cos_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
48+ // CHECK: %[[CF:.*]] = call @__ocml_ccos_f32(%{{.*}})
49+ %cf = complex.cos %f : complex <f32 >
50+ // CHECK: %[[CD:.*]] = call @__ocml_ccos_f64(%{{.*}})
51+ %cd = complex.cos %d : complex <f64 >
52+ // CHECK: return %[[CF]], %[[CD]]
53+ return %cf , %cd : complex <f32 >, complex <f64 >
54+ }
55+
1856//CHECK-LABEL: @exp_caller
1957func.func @exp_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
2058 // CHECK: %[[EF:.*]] = call @__ocml_cexp_f32(%{{.*}})
@@ -24,3 +62,73 @@ func.func @exp_caller(%f: complex<f32>, %d: complex<f64>) -> (complex<f32>, comp
2462 // CHECK: return %[[EF]], %[[ED]]
2563 return %ef , %ed : complex <f32 >, complex <f64 >
2664}
65+
66+ //CHECK-LABEL: @log_caller
67+ func.func @log_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
68+ // CHECK: %[[LF:.*]] = call @__ocml_clog_f32(%{{.*}})
69+ %lf = complex.log %f : complex <f32 >
70+ // CHECK: %[[LD:.*]] = call @__ocml_clog_f64(%{{.*}})
71+ %ld = complex.log %d : complex <f64 >
72+ // CHECK: return %[[LF]], %[[LD]]
73+ return %lf , %ld : complex <f32 >, complex <f64 >
74+ }
75+
76+ //CHECK-LABEL: @conj_caller
77+ func.func @conj_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
78+ // CHECK: %[[CF:.*]] = call @__ocml_conj_f32(%{{.*}})
79+ %cf2 = complex.conj %f : complex <f32 >
80+ // CHECK: %[[CD:.*]] = call @__ocml_conj_f64(%{{.*}})
81+ %cd2 = complex.conj %d : complex <f64 >
82+ // CHECK: return %[[CF]], %[[CD]]
83+ return %cf2 , %cd2 : complex <f32 >, complex <f64 >
84+ }
85+
86+ //CHECK-LABEL: @pow_caller
87+ func.func @pow_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
88+ // CHECK: %[[PF:.*]] = call @__ocml_cpow_f32(%{{.*}}, %{{.*}})
89+ %pf = complex.pow %f , %f : complex <f32 >
90+ // CHECK: %[[PD:.*]] = call @__ocml_cpow_f64(%{{.*}}, %{{.*}})
91+ %pd = complex.pow %d , %d : complex <f64 >
92+ // CHECK: return %[[PF]], %[[PD]]
93+ return %pf , %pd : complex <f32 >, complex <f64 >
94+ }
95+
96+ //CHECK-LABEL: @sin_caller
97+ func.func @sin_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
98+ // CHECK: %[[SF:.*]] = call @__ocml_csin_f32(%{{.*}})
99+ %sf2 = complex.sin %f : complex <f32 >
100+ // CHECK: %[[SD:.*]] = call @__ocml_csin_f64(%{{.*}})
101+ %sd2 = complex.sin %d : complex <f64 >
102+ // CHECK: return %[[SF]], %[[SD]]
103+ return %sf2 , %sd2 : complex <f32 >, complex <f64 >
104+ }
105+
106+ //CHECK-LABEL: @sqrt_caller
107+ func.func @sqrt_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
108+ // CHECK: %[[SF:.*]] = call @__ocml_csqrt_f32(%{{.*}})
109+ %sf = complex.sqrt %f : complex <f32 >
110+ // CHECK: %[[SD:.*]] = call @__ocml_csqrt_f64(%{{.*}})
111+ %sd = complex.sqrt %d : complex <f64 >
112+ // CHECK: return %[[SF]], %[[SD]]
113+ return %sf , %sd : complex <f32 >, complex <f64 >
114+ }
115+
116+ //CHECK-LABEL: @tan_caller
117+ func.func @tan_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
118+ // CHECK: %[[TF:.*]] = call @__ocml_ctan_f32(%{{.*}})
119+ %tf2 = complex.tan %f : complex <f32 >
120+ // CHECK: %[[TD:.*]] = call @__ocml_ctan_f64(%{{.*}})
121+ %td2 = complex.tan %d : complex <f64 >
122+ // CHECK: return %[[TF]], %[[TD]]
123+ return %tf2 , %td2 : complex <f32 >, complex <f64 >
124+ }
125+
126+ //CHECK-LABEL: @tanh_caller
127+ func.func @tanh_caller (%f: complex <f32 >, %d: complex <f64 >) -> (complex <f32 >, complex <f64 >) {
128+ // CHECK: %[[TF:.*]] = call @__ocml_ctanh_f32(%{{.*}})
129+ %tf = complex.tanh %f : complex <f32 >
130+ // CHECK: %[[TD:.*]] = call @__ocml_ctanh_f64(%{{.*}})
131+ %td = complex.tanh %d : complex <f64 >
132+ // CHECK: return %[[TF]], %[[TD]]
133+ return %tf , %td : complex <f32 >, complex <f64 >
134+ }
0 commit comments