Files
TheRock/compiler/amd-llvm/flang/test/Fir/real.fir
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

52 lines
1.5 KiB
Plaintext

// Test lowering of REAL operations from FIR to LLVM IR
// RUN: tco %s | FileCheck %s
// CHECK-LABEL: @bar
func.func @bar(%a : f16, %b : f32, %c : f64, %d : f80, %e : f128) -> f80 {
// CHECK: fpext half %{{.*}} to x86_fp80
%1 = fir.convert %a : (f16) -> f80
// CHECK: fpext float %{{.*}} to x86_fp80
%2 = fir.convert %b : (f32) -> f80
// CHECK: fpext double %{{.*}} to x86_fp80
%3 = fir.convert %c : (f64) -> f80
// CHECK-NOT: fpext
// CHECK-NOT: fptrunc
%4 = fir.convert %d : (f80) -> f80
// CHECK: fptrunc fp128 %{{.*}} to x86_fp80
%5 = fir.convert %e : (f128) -> f80
// CHECK-NEXT: call x86_fp80
%6 = fir.call @foop(%1, %2, %3, %4, %5) : (f80, f80, f80, f80, f80) -> f80
return %6 : f80
}
// CHECK-LABEL: @foo
func.func @foo(%a : f128, %b : f128, %c : f128, %d : f128, %e : f128) -> f128 {
// CHECK: fadd fp128
%1 = arith.addf %a, %b : f128
// CHECK: fmul fp128
%2 = arith.mulf %1, %c : f128
// CHECK: fsub fp128
%3 = arith.subf %2, %d : f128
// CHECK: fdiv fp128
%4 = arith.divf %3, %e : f128
// CHECK: frem fp128
%5 = arith.remf %4, %a : f128
return %5 : f128
}
// CHECK-LABEL: @foop
func.func @foop(%a : f80, %b : f80, %c : f80, %d : f80, %e : f80) -> f80 {
// CHECK: fadd x86_fp80
%1 = arith.addf %a, %b : f80
// CHECK: fmul x86_fp80
%2 = arith.mulf %1, %c : f80
// CHECK: fsub x86_fp80
%3 = arith.subf %2, %d : f80
// CHECK: fdiv x86_fp80
%4 = arith.divf %3, %e : f80
// CHECK: frem x86_fp80
%5 = arith.remf %4, %a : f80
return %5 : f80
}