Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/InstCombine/X86/x86-scalar-max-min.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

75 lines
3.7 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt < %s -passes=instcombine -mtriple=x86_64-unknown-unknown -S | FileCheck %s
define <4 x float> @test_max_ss_nan(<4 x float> %a) {
; CHECK-LABEL: define <4 x float> @test_max_ss_nan(
; CHECK-SAME: <4 x float> [[A:%.*]]) {
; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> [[A]], <4 x float> <float +qnan, float poison, float poison, float poison>)
; CHECK-NEXT: ret <4 x float> [[RES]]
;
%res = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %a, <4 x float> <float 0x7FF8000000000000, float 0.0, float 0.0, float 0.0>)
ret <4 x float> %res
}
define <4 x float> @test_min_ss_inf(<4 x float> %a) {
; CHECK-LABEL: define <4 x float> @test_min_ss_inf(
; CHECK-SAME: <4 x float> [[A:%.*]]) {
; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> [[A]], <4 x float> <float +inf, float poison, float poison, float poison>)
; CHECK-NEXT: ret <4 x float> [[RES]]
;
%res = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> %a, <4 x float> <float 0x7FF0000000000000, float 0.0, float 0.0, float 0.0>)
ret <4 x float> %res
}
define <2 x double> @test_max_sd_neg_zero(<2 x double> %a) {
; CHECK-LABEL: define <2 x double> @test_max_sd_neg_zero(
; CHECK-SAME: <2 x double> [[A:%.*]]) {
; CHECK-NEXT: [[RES:%.*]] = call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> [[A]], <2 x double> <double -0.000000e+00, double poison>)
; CHECK-NEXT: ret <2 x double> [[RES]]
;
%res = call <2 x double> @llvm.x86.sse2.max.sd(<2 x double> %a, <2 x double> <double -0.0, double 0.0>)
ret <2 x double> %res
}
define <2 x double> @test_min_sd_neg_zero(<2 x double> %a) {
; CHECK-LABEL: define <2 x double> @test_min_sd_neg_zero(
; CHECK-SAME: <2 x double> [[A:%.*]]) {
; CHECK-NEXT: [[RES:%.*]] = call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> [[A]], <2 x double> <double -0.000000e+00, double poison>)
; CHECK-NEXT: ret <2 x double> [[RES]]
;
%res = call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %a, <2 x double> <double -0.0, double 0.0>)
ret <2 x double> %res
}
define <4 x float> @test_max_ss_variable_unsafe(<4 x float> %a, <4 x float> %b) {
; CHECK-LABEL: define <4 x float> @test_max_ss_variable_unsafe(
; CHECK-SAME: <4 x float> [[A:%.*]], <4 x float> [[B:%.*]]) {
; CHECK-NEXT: [[RES:%.*]] = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> [[A]], <4 x float> [[B]])
; CHECK-NEXT: ret <4 x float> [[RES]]
;
%res = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %a, <4 x float> %b)
ret <4 x float> %res
}
define <4 x float> @test_max_ss_safe_constants() {
; CHECK-LABEL: define <4 x float> @test_max_ss_safe_constants() {
; CHECK-NEXT: ret <4 x float> <float 2.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>
;
%res = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> <float 1.0, float 0.0, float 0.0, float 0.0>, <4 x float> <float 2.0, float 0.0, float 0.0, float 0.0>)
ret <4 x float> %res
}
define <2 x double> @test_min_sd_safe_expansion(<2 x i32> %a) {
; CHECK-LABEL: define <2 x double> @test_min_sd_safe_expansion(
; CHECK-SAME: <2 x i32> [[A:%.*]]) {
; CHECK-NEXT: [[SAFE_INPUT:%.*]] = sitofp <2 x i32> [[A]] to <2 x double>
; CHECK-NEXT: [[TMP1:%.*]] = extractelement <2 x double> [[SAFE_INPUT]], i64 0
; CHECK-NEXT: [[TMP2:%.*]] = call double @llvm.minnum.f64(double [[TMP1]], double 5.000000e+00)
; CHECK-NEXT: [[RES:%.*]] = insertelement <2 x double> [[SAFE_INPUT]], double [[TMP2]], i64 0
; CHECK-NEXT: ret <2 x double> [[RES]]
;
%safe_input = sitofp <2 x i32> %a to <2 x double>
%res = call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %safe_input, <2 x double> <double 5.0, double 0.0>)
ret <2 x double> %res
}