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
215 lines
11 KiB
C
215 lines
11 KiB
C
// REQUIRES: x86-registered-target
|
|
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512dq -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=UNCONSTRAINED --check-prefix=COMMON --check-prefix=COMMONIR
|
|
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512dq -ffp-exception-behavior=maytrap -DSTRICT=1 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefix=CONSTRAINED --check-prefix=COMMON --check-prefix=COMMONIR --implicit-check-not=fpexcept.maytrap
|
|
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512dq -S -o - -Wall -Werror | FileCheck %s --check-prefix=CHECK-ASM --check-prefix=COMMON
|
|
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512dq -ffp-exception-behavior=maytrap -DSTRICT=1 -S -o - -Wall -Werror | FileCheck %s --check-prefix=CHECK-ASM --check-prefix=COMMON --implicit-check-not=fpexcept.maytrap
|
|
|
|
// Any cases of "fpexcept.maytrap" in this test are clang bugs.
|
|
|
|
#ifdef STRICT
|
|
// Test that the constrained intrinsics are picking up the exception
|
|
// metadata from the AST instead of the global default from the command line.
|
|
|
|
#pragma float_control(except, on)
|
|
#endif
|
|
|
|
|
|
#include <immintrin.h>
|
|
|
|
__m512d test_mm512_cvtepi64_pd(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvtepi64_pd
|
|
// UNCONSTRAINED: sitofp <8 x i64> %{{.*}} to <8 x double>
|
|
// CONSTRAINED: call <8 x double> @llvm.experimental.constrained.sitofp.v8f64.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// CHECK-ASM: vcvtqq2pd
|
|
return _mm512_cvtepi64_pd(__A);
|
|
}
|
|
|
|
__m512d test_mm512_mask_cvtepi64_pd(__m512d __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvtepi64_pd
|
|
// UNCONSTRAINED: sitofp <8 x i64> %{{.*}} to <8 x double>
|
|
// CONSTRAINED: call <8 x double> @llvm.experimental.constrained.sitofp.v8f64.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2pd
|
|
return _mm512_mask_cvtepi64_pd(__W, __U, __A);
|
|
}
|
|
|
|
__m512d test_mm512_maskz_cvtepi64_pd(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvtepi64_pd
|
|
// UNCONSTRAINED: sitofp <8 x i64> %{{.*}} to <8 x double>
|
|
// CONSTRAINED: call <8 x double> @llvm.experimental.constrained.sitofp.v8f64.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2pd
|
|
return _mm512_maskz_cvtepi64_pd(__U, __A);
|
|
}
|
|
|
|
__m512d test_mm512_cvt_roundepi64_pd(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvt_roundepi64_pd
|
|
// COMMONIR: @llvm.x86.avx512.sitofp.round.v8f64.v8i64
|
|
// CHECK-ASM: vcvtqq2pd
|
|
return _mm512_cvt_roundepi64_pd(__A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m512d test_mm512_mask_cvt_roundepi64_pd(__m512d __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvt_roundepi64_pd
|
|
// COMMONIR: @llvm.x86.avx512.sitofp.round.v8f64.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2pd
|
|
return _mm512_mask_cvt_roundepi64_pd(__W, __U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m512d test_mm512_maskz_cvt_roundepi64_pd(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvt_roundepi64_pd
|
|
// COMMONIR: @llvm.x86.avx512.sitofp.round.v8f64.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2pd
|
|
return _mm512_maskz_cvt_roundepi64_pd(__U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m256 test_mm512_cvtepi64_ps(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvtepi64_ps
|
|
// UNCONSTRAINED: sitofp <8 x i64> %{{.*}} to <8 x float>
|
|
// CONSTRAINED: call <8 x float> @llvm.experimental.constrained.sitofp.v8f32.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// CHECK-ASM: vcvtqq2ps
|
|
return _mm512_cvtepi64_ps(__A);
|
|
}
|
|
|
|
__m256 test_mm512_mask_cvtepi64_ps(__m256 __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvtepi64_ps
|
|
// UNCONSTRAINED: sitofp <8 x i64> %{{.*}} to <8 x float>
|
|
// CONSTRAINED: call <8 x float> @llvm.experimental.constrained.sitofp.v8f32.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2ps
|
|
return _mm512_mask_cvtepi64_ps(__W, __U, __A);
|
|
}
|
|
|
|
__m256 test_mm512_maskz_cvtepi64_ps(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvtepi64_ps
|
|
// UNCONSTRAINED: sitofp <8 x i64> %{{.*}} to <8 x float>
|
|
// CONSTRAINED: call <8 x float> @llvm.experimental.constrained.sitofp.v8f32.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2ps
|
|
return _mm512_maskz_cvtepi64_ps(__U, __A);
|
|
}
|
|
|
|
__m256 test_mm512_cvt_roundepi64_ps(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvt_roundepi64_ps
|
|
// COMMONIR: @llvm.x86.avx512.sitofp.round.v8f32.v8i64
|
|
// CHECK-ASM: vcvtqq2ps
|
|
return _mm512_cvt_roundepi64_ps(__A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m256 test_mm512_mask_cvt_roundepi64_ps(__m256 __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvt_roundepi64_ps
|
|
// COMMONIR: @llvm.x86.avx512.sitofp.round.v8f32.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2ps
|
|
return _mm512_mask_cvt_roundepi64_ps(__W, __U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m256 test_mm512_maskz_cvt_roundepi64_ps(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvt_roundepi64_ps
|
|
// COMMONIR: @llvm.x86.avx512.sitofp.round.v8f32.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtqq2ps
|
|
return _mm512_maskz_cvt_roundepi64_ps(__U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m512d test_mm512_cvtepu64_pd(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvtepu64_pd
|
|
// UNCONSTRAINED: uitofp <8 x i64> %{{.*}} to <8 x double>
|
|
// CONSTRAINED: call <8 x double> @llvm.experimental.constrained.uitofp.v8f64.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// CHECK-ASM: vcvtuqq2pd
|
|
return _mm512_cvtepu64_pd(__A);
|
|
}
|
|
|
|
__m512d test_mm512_mask_cvtepu64_pd(__m512d __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvtepu64_pd
|
|
// UNCONSTRAINED: uitofp <8 x i64> %{{.*}} to <8 x double>
|
|
// CONSTRAINED: call <8 x double> @llvm.experimental.constrained.uitofp.v8f64.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2pd
|
|
return _mm512_mask_cvtepu64_pd(__W, __U, __A);
|
|
}
|
|
|
|
__m512d test_mm512_maskz_cvtepu64_pd(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvtepu64_pd
|
|
// UNCONSTRAINED: uitofp <8 x i64> %{{.*}} to <8 x double>
|
|
// CONSTRAINED: call <8 x double> @llvm.experimental.constrained.uitofp.v8f64.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2pd
|
|
return _mm512_maskz_cvtepu64_pd(__U, __A);
|
|
}
|
|
|
|
__m512d test_mm512_cvt_roundepu64_pd(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvt_roundepu64_pd
|
|
// COMMONIR: @llvm.x86.avx512.uitofp.round.v8f64.v8i64
|
|
// CHECK-ASM: vcvtuqq2pd
|
|
return _mm512_cvt_roundepu64_pd(__A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m512d test_mm512_mask_cvt_roundepu64_pd(__m512d __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvt_roundepu64_pd
|
|
// COMMONIR: @llvm.x86.avx512.uitofp.round.v8f64.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2pd
|
|
return _mm512_mask_cvt_roundepu64_pd(__W, __U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m512d test_mm512_maskz_cvt_roundepu64_pd(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvt_roundepu64_pd
|
|
// COMMONIR: @llvm.x86.avx512.uitofp.round.v8f64.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x double> %{{.*}}, <8 x double> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2pd
|
|
return _mm512_maskz_cvt_roundepu64_pd(__U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m256 test_mm512_cvtepu64_ps(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvtepu64_ps
|
|
// UNCONSTRAINED: uitofp <8 x i64> %{{.*}} to <8 x float>
|
|
// CONSTRAINED: call <8 x float> @llvm.experimental.constrained.uitofp.v8f32.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// CHECK-ASM: vcvtuqq2ps
|
|
return _mm512_cvtepu64_ps(__A);
|
|
}
|
|
|
|
__m256 test_mm512_mask_cvtepu64_ps(__m256 __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvtepu64_ps
|
|
// UNCONSTRAINED: uitofp <8 x i64> %{{.*}} to <8 x float>
|
|
// CONSTRAINED: call <8 x float> @llvm.experimental.constrained.uitofp.v8f32.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2ps
|
|
return _mm512_mask_cvtepu64_ps(__W, __U, __A);
|
|
}
|
|
|
|
__m256 test_mm512_maskz_cvtepu64_ps(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvtepu64_ps
|
|
// UNCONSTRAINED: uitofp <8 x i64> %{{.*}} to <8 x float>
|
|
// CONSTRAINED: call <8 x float> @llvm.experimental.constrained.uitofp.v8f32.v8i64(<8 x i64> %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict")
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2ps
|
|
return _mm512_maskz_cvtepu64_ps(__U, __A);
|
|
}
|
|
|
|
__m256 test_mm512_cvt_roundepu64_ps(__m512i __A) {
|
|
// COMMON-LABEL: test_mm512_cvt_roundepu64_ps
|
|
// COMMONIR: @llvm.x86.avx512.uitofp.round.v8f32.v8i64
|
|
// CHECK-ASM: vcvtuqq2ps
|
|
return _mm512_cvt_roundepu64_ps(__A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m256 test_mm512_mask_cvt_roundepu64_ps(__m256 __W, __mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_mask_cvt_roundepu64_ps
|
|
// COMMONIR: @llvm.x86.avx512.uitofp.round.v8f32.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2ps
|
|
return _mm512_mask_cvt_roundepu64_ps(__W, __U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|
|
__m256 test_mm512_maskz_cvt_roundepu64_ps(__mmask8 __U, __m512i __A) {
|
|
// COMMON-LABEL: test_mm512_maskz_cvt_roundepu64_ps
|
|
// COMMONIR: @llvm.x86.avx512.uitofp.round.v8f32.v8i64
|
|
// COMMONIR: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
|
|
// CHECK-ASM: vcvtuqq2ps
|
|
return _mm512_maskz_cvt_roundepu64_ps(__U, __A, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
|
|
}
|
|
|