Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/InstSimplify/ConstProp/copysign.ll
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

129 lines
3.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
declare float @llvm.copysign.f32(float, float)
declare double @llvm.copysign.f64(double, double)
declare bfloat @llvm.copysign.bf16(bfloat, bfloat)
declare fp128 @llvm.copysign.f128(fp128, fp128)
declare ppc_fp128 @llvm.copysign.ppcf128(ppc_fp128, ppc_fp128)
define float @f32_01() {
; CHECK-LABEL: @f32_01(
; CHECK-NEXT: ret float -1.000000e+00
;
%x = call float @llvm.copysign.f32(float 1.0, float -2.0)
ret float %x
}
define float @f32_02() {
; CHECK-LABEL: @f32_02(
; CHECK-NEXT: ret float 2.000000e+00
;
%x = call float @llvm.copysign.f32(float -2.0, float 1.0)
ret float %x
}
define float @f32_03() {
; CHECK-LABEL: @f32_03(
; CHECK-NEXT: ret float -2.000000e+00
;
%x = call float @llvm.copysign.f32(float -2.0, float -1.0)
ret float %x
}
define double @f64_01() {
; CHECK-LABEL: @f64_01(
; CHECK-NEXT: ret double -1.000000e+00
;
%x = call double @llvm.copysign.f64(double 1.0, double -2.0)
ret double %x
}
define double @f64_02() {
; CHECK-LABEL: @f64_02(
; CHECK-NEXT: ret double 1.000000e+00
;
%x = call double @llvm.copysign.f64(double -1.0, double 2.0)
ret double %x
}
define double @f64_03() {
; CHECK-LABEL: @f64_03(
; CHECK-NEXT: ret double -1.000000e+00
;
%x = call double @llvm.copysign.f64(double -1.0, double -2.0)
ret double %x
}
define bfloat @bf16_01() {
; CHECK-LABEL: @bf16_01(
; CHECK-NEXT: ret bfloat -1.000000e+00
;
%x = call bfloat @llvm.copysign.bf16(bfloat 1.0, bfloat -2.0)
ret bfloat %x
}
define bfloat @bf16_02() {
; CHECK-LABEL: @bf16_02(
; CHECK-NEXT: ret bfloat 2.000000e+00
;
%x = call bfloat @llvm.copysign.bf16(bfloat -2.0, bfloat 1.0)
ret bfloat %x
}
define bfloat @bf16_03() {
; CHECK-LABEL: @bf16_03(
; CHECK-NEXT: ret bfloat -2.000000e+00
;
%x = call bfloat @llvm.copysign.bf16(bfloat -2.0, bfloat -1.0)
ret bfloat %x
}
define fp128 @f128_01() {
; CHECK-LABEL: @f128_01(
; CHECK-NEXT: ret fp128 f0x80000000000000010000000000000000
;
%x = call fp128 @llvm.copysign.f128(fp128 0xL00000000000000000000000000000001, fp128 0xL00000000000000008000000000000002)
ret fp128 %x
}
define fp128 @f128_02() {
; CHECK-LABEL: @f128_02(
; CHECK-NEXT: ret fp128 f0x00000000000000030000000000000000
;
%x = call fp128 @llvm.copysign.f128(fp128 0xL00000000000000008000000000000003, fp128 0xL00000000000000000000000000000004)
ret fp128 %x
}
define fp128 @f128_03() {
; CHECK-LABEL: @f128_03(
; CHECK-NEXT: ret fp128 f0x80000000000000050000000000000000
;
%x = call fp128 @llvm.copysign.f128(fp128 0xL00000000000000008000000000000005, fp128 0xL00000000000000008000000000000006)
ret fp128 %x
}
define ppc_fp128 @ppc128_01() {
; CHECK-LABEL: @ppc128_01(
; CHECK-NEXT: ret ppc_fp128 f0x80000000000000018000000000000000
;
%x = call ppc_fp128 @llvm.copysign.ppcf128(ppc_fp128 0xM00000000000000000000000000000001, ppc_fp128 0xM80000000000000000000000000000002)
ret ppc_fp128 %x
}
define ppc_fp128 @ppc128_02() {
; CHECK-LABEL: @ppc128_02(
; CHECK-NEXT: ret ppc_fp128 f0x80000000000000030000000000000000
;
%x = call ppc_fp128 @llvm.copysign.ppcf128(ppc_fp128 0xM80000000000000000000000000000003, ppc_fp128 0xM00000000000000000000000000000004)
ret ppc_fp128 %x
}
define ppc_fp128 @ppc128_03() {
; CHECK-LABEL: @ppc128_03(
; CHECK-NEXT: ret ppc_fp128 f0x00000000000000058000000000000000
;
%x = call ppc_fp128 @llvm.copysign.ppcf128(ppc_fp128 0xM80000000000000000000000000000005, ppc_fp128 0xM80000000000000000000000000000006)
ret ppc_fp128 %x
}