Files
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

176 lines
5.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-pc-unknown -mattr=+sse2 | FileCheck %s -check-prefixes=X86
; RUN: llc < %s -mtriple=x86_64-pc-unknown -mcpu=x86-64 | FileCheck %s -check-prefixes=X64-SSE2
; RUN: llc < %s -mtriple=x86_64-pc-unknown -mcpu=x86-64-v2 | FileCheck %s -check-prefixes=X64-SSE42
; RUN: llc < %s -mtriple=x86_64-pc-unknown -mcpu=x86-64-v3 | FileCheck %s -check-prefixes=X64-AVX,X64-AVX2
; RUN: llc < %s -mtriple=x86_64-pc-unknown -mcpu=x86-64-v4 | FileCheck %s -check-prefixes=X64-AVX,X64-AVX512
; PR19059
define i32 @isint_return(double %d) nounwind {
; X86-LABEL: isint_return:
; X86: # %bb.0:
; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
; X86-NEXT: cvttpd2dq %xmm0, %xmm1
; X86-NEXT: cvtdq2pd %xmm1, %xmm1
; X86-NEXT: cmpeqsd %xmm0, %xmm1
; X86-NEXT: movd %xmm1, %eax
; X86-NEXT: andl $1, %eax
; X86-NEXT: retl
;
; X64-SSE2-LABEL: isint_return:
; X64-SSE2: # %bb.0:
; X64-SSE2-NEXT: cvttpd2dq %xmm0, %xmm1
; X64-SSE2-NEXT: cvtdq2pd %xmm1, %xmm1
; X64-SSE2-NEXT: cmpeqsd %xmm0, %xmm1
; X64-SSE2-NEXT: movq %xmm1, %rax
; X64-SSE2-NEXT: andl $1, %eax
; X64-SSE2-NEXT: # kill: def $eax killed $eax killed $rax
; X64-SSE2-NEXT: retq
;
; X64-SSE42-LABEL: isint_return:
; X64-SSE42: # %bb.0:
; X64-SSE42-NEXT: roundsd $11, %xmm0, %xmm1
; X64-SSE42-NEXT: cmpeqsd %xmm0, %xmm1
; X64-SSE42-NEXT: movq %xmm1, %rax
; X64-SSE42-NEXT: andl $1, %eax
; X64-SSE42-NEXT: # kill: def $eax killed $eax killed $rax
; X64-SSE42-NEXT: retq
;
; X64-AVX2-LABEL: isint_return:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vroundsd $11, %xmm0, %xmm0, %xmm1
; X64-AVX2-NEXT: vcmpeqsd %xmm1, %xmm0, %xmm0
; X64-AVX2-NEXT: vmovq %xmm0, %rax
; X64-AVX2-NEXT: andl $1, %eax
; X64-AVX2-NEXT: # kill: def $eax killed $eax killed $rax
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: isint_return:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vroundsd $11, %xmm0, %xmm0, %xmm1
; X64-AVX512-NEXT: vcmpeqsd %xmm1, %xmm0, %k0
; X64-AVX512-NEXT: kmovw %k0, %eax
; X64-AVX512-NEXT: retq
%i = fptosi double %d to i32
%e = sitofp i32 %i to double
%c = fcmp oeq double %d, %e
%z = zext i1 %c to i32
ret i32 %z
}
define i32 @isint_float_return(float %f) nounwind {
; X86-LABEL: isint_float_return:
; X86: # %bb.0:
; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
; X86-NEXT: cvttps2dq %xmm0, %xmm1
; X86-NEXT: cvtdq2ps %xmm1, %xmm1
; X86-NEXT: cmpeqss %xmm0, %xmm1
; X86-NEXT: movd %xmm1, %eax
; X86-NEXT: andl $1, %eax
; X86-NEXT: retl
;
; X64-SSE2-LABEL: isint_float_return:
; X64-SSE2: # %bb.0:
; X64-SSE2-NEXT: cvttps2dq %xmm0, %xmm1
; X64-SSE2-NEXT: cvtdq2ps %xmm1, %xmm1
; X64-SSE2-NEXT: cmpeqss %xmm0, %xmm1
; X64-SSE2-NEXT: movd %xmm1, %eax
; X64-SSE2-NEXT: andl $1, %eax
; X64-SSE2-NEXT: retq
;
; X64-SSE42-LABEL: isint_float_return:
; X64-SSE42: # %bb.0:
; X64-SSE42-NEXT: roundss $11, %xmm0, %xmm1
; X64-SSE42-NEXT: cmpeqss %xmm0, %xmm1
; X64-SSE42-NEXT: movd %xmm1, %eax
; X64-SSE42-NEXT: andl $1, %eax
; X64-SSE42-NEXT: retq
;
; X64-AVX2-LABEL: isint_float_return:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vroundss $11, %xmm0, %xmm0, %xmm1
; X64-AVX2-NEXT: vcmpeqss %xmm1, %xmm0, %xmm0
; X64-AVX2-NEXT: vmovd %xmm0, %eax
; X64-AVX2-NEXT: andl $1, %eax
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: isint_float_return:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vroundss $11, %xmm0, %xmm0, %xmm1
; X64-AVX512-NEXT: vcmpeqss %xmm1, %xmm0, %k0
; X64-AVX512-NEXT: kmovw %k0, %eax
; X64-AVX512-NEXT: retq
%i = fptosi float %f to i32
%g = sitofp i32 %i to float
%c = fcmp oeq float %f, %g
%z = zext i1 %c to i32
ret i32 %z
}
declare void @foo()
define void @isint_branch(double %d) nounwind {
; X86-LABEL: isint_branch:
; X86: # %bb.0:
; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
; X86-NEXT: cvttpd2dq %xmm0, %xmm1
; X86-NEXT: cvtdq2pd %xmm1, %xmm1
; X86-NEXT: ucomisd %xmm1, %xmm0
; X86-NEXT: jne .LBB2_2
; X86-NEXT: jp .LBB2_2
; X86-NEXT: # %bb.1: # %true
; X86-NEXT: calll foo@PLT
; X86-NEXT: .LBB2_2: # %false
; X86-NEXT: retl
;
; X64-SSE2-LABEL: isint_branch:
; X64-SSE2: # %bb.0:
; X64-SSE2-NEXT: cvttpd2dq %xmm0, %xmm1
; X64-SSE2-NEXT: cvtdq2pd %xmm1, %xmm1
; X64-SSE2-NEXT: ucomisd %xmm1, %xmm0
; X64-SSE2-NEXT: jne .LBB2_2
; X64-SSE2-NEXT: jp .LBB2_2
; X64-SSE2-NEXT: # %bb.1: # %true
; X64-SSE2-NEXT: pushq %rax
; X64-SSE2-NEXT: callq foo@PLT
; X64-SSE2-NEXT: popq %rax
; X64-SSE2-NEXT: .LBB2_2: # %false
; X64-SSE2-NEXT: retq
;
; X64-SSE42-LABEL: isint_branch:
; X64-SSE42: # %bb.0:
; X64-SSE42-NEXT: roundsd $11, %xmm0, %xmm1
; X64-SSE42-NEXT: ucomisd %xmm1, %xmm0
; X64-SSE42-NEXT: jne .LBB2_2
; X64-SSE42-NEXT: jp .LBB2_2
; X64-SSE42-NEXT: # %bb.1: # %true
; X64-SSE42-NEXT: pushq %rax
; X64-SSE42-NEXT: callq foo@PLT
; X64-SSE42-NEXT: popq %rax
; X64-SSE42-NEXT: .LBB2_2: # %false
; X64-SSE42-NEXT: retq
;
; X64-AVX-LABEL: isint_branch:
; X64-AVX: # %bb.0:
; X64-AVX-NEXT: vroundsd $11, %xmm0, %xmm0, %xmm1
; X64-AVX-NEXT: vucomisd %xmm1, %xmm0
; X64-AVX-NEXT: jne .LBB2_2
; X64-AVX-NEXT: jp .LBB2_2
; X64-AVX-NEXT: # %bb.1: # %true
; X64-AVX-NEXT: pushq %rax
; X64-AVX-NEXT: callq foo@PLT
; X64-AVX-NEXT: popq %rax
; X64-AVX-NEXT: .LBB2_2: # %false
; X64-AVX-NEXT: retq
%i = fptosi double %d to i32
%e = sitofp i32 %i to double
%c = fcmp oeq double %d, %e
br i1 %c, label %true, label %false
true:
call void @foo()
ret void
false:
ret void
}