Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/Complex/ops.mlir
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

94 lines
3.0 KiB
MLIR

// RUN: mlir-opt %s | mlir-opt | FileCheck %s
// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
// CHECK-LABEL: func @ops(
// CHECK-SAME: %[[F:.*]]: f32) {
func.func @ops(%f: f32) {
// CHECK: complex.constant [1.{{.*}}, -1.{{.*}}] : complex<f64>
%cst_f64 = complex.constant [0.1, -1.0] : complex<f64>
// CHECK: complex.constant [1.{{.*}} : f32, -1.{{.*}} : f32] : complex<f32>
%cst_f32 = complex.constant [0.1 : f32, -1.0 : f32] : complex<f32>
// CHECK: complex.constant [true, false] : complex<i1>
%cst_i1 = complex.constant [1 : i1, 0 : i1] : complex<i1>
// CHECK: %[[C:.*]] = complex.create %[[F]], %[[F]] : complex<f32>
%complex = complex.create %f, %f : complex<f32>
// CHECK: complex.re %[[C]] : complex<f32>
%real = complex.re %complex : complex<f32>
// CHECK: complex.im %[[C]] : complex<f32>
%imag = complex.im %complex : complex<f32>
// CHECK: complex.abs %[[C]] : complex<f32>
%abs = complex.abs %complex : complex<f32>
// CHECK: complex.add %[[C]], %[[C]] : complex<f32>
%sum = complex.add %complex, %complex : complex<f32>
// CHECK: complex.cos %[[C]] : complex<f32>
%cos = complex.cos %complex : complex<f32>
// CHECK: complex.div %[[C]], %[[C]] : complex<f32>
%div = complex.div %complex, %complex : complex<f32>
// CHECK: complex.eq %[[C]], %[[C]] : complex<f32>
%eq = complex.eq %complex, %complex : complex<f32>
// CHECK: complex.exp %[[C]] : complex<f32>
%exp = complex.exp %complex : complex<f32>
// CHECK: complex.expm1 %[[C]] : complex<f32>
%expm1 = complex.expm1 %complex : complex<f32>
// CHECK: complex.log %[[C]] : complex<f32>
%log = complex.log %complex : complex<f32>
// CHECK: complex.log1p %[[C]] : complex<f32>
%log1p = complex.log1p %complex : complex<f32>
// CHECK: complex.mul %[[C]], %[[C]] : complex<f32>
%prod = complex.mul %complex, %complex : complex<f32>
// CHECK: complex.neg %[[C]] : complex<f32>
%neg = complex.neg %complex : complex<f32>
// CHECK: complex.neq %[[C]], %[[C]] : complex<f32>
%neq = complex.neq %complex, %complex : complex<f32>
// CHECK: complex.sign %[[C]] : complex<f32>
%sign = complex.sign %complex : complex<f32>
// CHECK: complex.sin %[[C]] : complex<f32>
%sin = complex.sin %complex : complex<f32>
// CHECK: complex.sub %[[C]], %[[C]] : complex<f32>
%diff = complex.sub %complex, %complex : complex<f32>
// CHECK: complex.tanh %[[C]] : complex<f32>
%tanh = complex.tanh %complex : complex<f32>
// CHECK: complex.pow %[[C]], %[[C]] : complex<f32>
%pow = complex.pow %complex, %complex : complex<f32>
// CHECK: complex.sqrt %[[C]] : complex<f32>
%sqrt = complex.sqrt %complex : complex<f32>
// CHECK: complex.rsqrt %[[C]] : complex<f32>
%rsqrt = complex.rsqrt %complex : complex<f32>
// CHECK: complex.atan2 %[[C]], %[[C]] : complex<f32>
%atan2 = complex.atan2 %complex, %complex : complex<f32>
// CHECK: complex.tan %[[C]] : complex<f32>
%tan = complex.tan %complex : complex<f32>
// CHECK: complex.bitcast %[[C]]
%i64 = complex.bitcast %complex : complex<f32> to i64
return
}