CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
110 lines
3.9 KiB
Plaintext
110 lines
3.9 KiB
Plaintext
// RUN: fir-opt --convert-complex-pow %s | FileCheck %s
|
|
|
|
module {
|
|
func.func @pow_c4_i4(%arg0: complex<f32>, %arg1: i32) -> complex<f32> {
|
|
%0 = complex.powi %arg0, %arg1 : complex<f32>, i32
|
|
return %0 : complex<f32>
|
|
}
|
|
|
|
func.func @pow_c4_i4_fast(%arg0: complex<f32>, %arg1: i32) -> complex<f32> {
|
|
%0 = complex.powi %arg0, %arg1 fastmath<fast> : complex<f32>, i32
|
|
return %0 : complex<f32>
|
|
}
|
|
|
|
func.func @pow_c4_i8(%arg0: complex<f32>, %arg1: i64) -> complex<f32> {
|
|
%0 = complex.powi %arg0, %arg1 : complex<f32>, i64
|
|
return %0 : complex<f32>
|
|
}
|
|
|
|
func.func @pow_c8_i4(%arg0: complex<f64>, %arg1: i32) -> complex<f64> {
|
|
%0 = complex.powi %arg0, %arg1 : complex<f64>, i32
|
|
return %0 : complex<f64>
|
|
}
|
|
|
|
func.func @pow_c8_i8(%arg0: complex<f64>, %arg1: i64) -> complex<f64> {
|
|
%0 = complex.powi %arg0, %arg1 : complex<f64>, i64
|
|
return %0 : complex<f64>
|
|
}
|
|
|
|
func.func @pow_c16_i4(%arg0: complex<f128>, %arg1: i32) -> complex<f128> {
|
|
%0 = complex.powi %arg0, %arg1 : complex<f128>, i32
|
|
return %0 : complex<f128>
|
|
}
|
|
|
|
func.func @pow_c16_i8(%arg0: complex<f128>, %arg1: i64) -> complex<f128> {
|
|
%0 = complex.powi %arg0, %arg1 : complex<f128>, i64
|
|
return %0 : complex<f128>
|
|
}
|
|
|
|
func.func @pow_c4_fast(%arg0: complex<f32>, %arg1: f32) -> complex<f32> {
|
|
%c1 = arith.constant 1.0 : f32
|
|
%0 = complex.create %arg1, %c1 : complex<f32>
|
|
%1 = complex.pow %arg0, %0 fastmath<fast> : complex<f32>
|
|
return %1 : complex<f32>
|
|
}
|
|
|
|
func.func @pow_c8_complex(%arg0: complex<f64>, %arg1: f64) -> complex<f64> {
|
|
%c2 = arith.constant 2.0 : f64
|
|
%0 = complex.create %arg1, %c2 : complex<f64>
|
|
%1 = complex.pow %arg0, %0 : complex<f64>
|
|
return %1 : complex<f64>
|
|
}
|
|
|
|
func.func @pow_c16_complex(%arg0: complex<f128>, %arg1: f128) -> complex<f128> {
|
|
%c3 = arith.constant 3.0 : f128
|
|
%0 = complex.create %arg1, %c3 : complex<f128>
|
|
%1 = complex.pow %arg0, %0 : complex<f128>
|
|
return %1 : complex<f128>
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: func.func @pow_c4_i4(
|
|
// CHECK: fir.call @_FortranAcpowi(%{{.*}}, %{{.*}}) : (complex<f32>, i32) -> complex<f32>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c4_i4_fast(
|
|
// CHECK: fir.call @_FortranAcpowi(%{{.*}}, %{{.*}}) fastmath<fast> : (complex<f32>, i32) -> complex<f32>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c4_i8(
|
|
// CHECK: fir.call @_FortranAcpowk(%{{.*}}, %{{.*}}) : (complex<f32>, i64) -> complex<f32>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c8_i4(
|
|
// CHECK: fir.call @_FortranAzpowi(%{{.*}}, %{{.*}}) : (complex<f64>, i32) -> complex<f64>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c8_i8(
|
|
// CHECK: fir.call @_FortranAzpowk(%{{.*}}, %{{.*}}) : (complex<f64>, i64) -> complex<f64>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c16_i4(
|
|
// CHECK: fir.call @_FortranAcqpowi(%{{.*}}, %{{.*}}) : (complex<f128>, i32) -> complex<f128>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c16_i8(
|
|
// CHECK: fir.call @_FortranAcqpowk(%{{.*}}, %{{.*}}) : (complex<f128>, i64) -> complex<f128>
|
|
// CHECK-NOT: complex.pow
|
|
// CHECK-NOT: complex.powi
|
|
|
|
// CHECK-LABEL: func.func @pow_c4_fast(
|
|
// CHECK: %[[EXP:.*]] = complex.create %{{.*}}, %{{.*}} : complex<f32>
|
|
// CHECK: fir.call @cpowf(%{{.*}}, %[[EXP]]) fastmath<fast> : (complex<f32>, complex<f32>) -> complex<f32>
|
|
// CHECK-NOT: complex.pow
|
|
|
|
// CHECK-LABEL: func.func @pow_c8_complex(
|
|
// CHECK: %[[EXP:.*]] = complex.create %{{.*}}, %{{.*}} : complex<f64>
|
|
// CHECK: fir.call @cpow(%{{.*}}, %[[EXP]]) : (complex<f64>, complex<f64>) -> complex<f64>
|
|
// CHECK-NOT: complex.pow
|
|
|
|
// CHECK-LABEL: func.func @pow_c16_complex(
|
|
// CHECK: %[[EXP:.*]] = complex.create %{{.*}}, %{{.*}} : complex<f128>
|
|
// CHECK: fir.call @_FortranACPowF128(%{{.*}}, %[[EXP]]) : (complex<f128>, complex<f128>) -> complex<f128>
|
|
// CHECK-NOT: complex.pow
|