Files
TheRock/compiler/amd-llvm/clang/test/CodeGen/X86/avx10_2_512convert-builtins.c
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

319 lines
13 KiB
C

// RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=x86_64 -target-feature +avx10.2 \
// RUN: -emit-llvm -o - -Wno-invalid-feature-combination -Wall -Werror | FileCheck %s
// RUN: %clang_cc1 %s -flax-vector-conversions=none -ffreestanding -triple=i386 -target-feature +avx10.2 \
// RUN: -emit-llvm -o - -Wno-invalid-feature-combination -Wall -Werror | FileCheck %s
#include <immintrin.h>
__m512h test_mm512_cvtx2ps_ph(__m512 __A, __m512 __B) {
// CHECK-LABEL: @test_mm512_cvtx2ps_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvt2ps2phx.512
return _mm512_cvtx2ps_ph(__A, __B);
}
__m512h test_mm512_mask_cvtx2ps_ph(__m512h __W, __mmask32 __U, __m512 __A, __m512 __B) {
// CHECK-LABEL: @test_mm512_mask_cvtx2ps_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvt2ps2phx.512
return _mm512_mask_cvtx2ps_ph(__W, __U, __A, __B);
}
__m512h test_mm512_maskz_cvtx2ps_ph(__mmask32 __U, __m512 __A, __m512 __B) {
// CHECK-LABEL: @test_mm512_maskz_cvtx2ps_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvt2ps2phx.512
return _mm512_maskz_cvtx2ps_ph(__U, __A, __B);
}
__m512h test_mm512_cvtx_round2ps_ph(__m512 __A, __m512 __B) {
// CHECK-LABEL: @test_mm512_cvtx_round2ps_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvt2ps2phx.512
return _mm512_cvtx_round2ps_ph(__A, __B, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
}
__m512h test_mm512_mask_cvtx_round2ps_ph(__m512h __W, __mmask32 __U, __m512 __A, __m512 __B) {
// CHECK-LABEL: @test_mm512_mask_cvtx_round2ps_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvt2ps2phx.512
return _mm512_mask_cvtx_round2ps_ph(__W, __U, __A, __B, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
}
__m512h test_mm512_maskz_cvtx_round2ps_ph(__mmask32 __U, __m512 __A, __m512 __B) {
// CHECK-LABEL: @test_mm512_maskz_cvtx_round2ps_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvt2ps2phx.512
return _mm512_maskz_cvtx_round2ps_ph(__U, __A, __B, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC);
}
__m256i test_mm512_cvtbiasph_bf8(__m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvtbiasph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2bf8512(
return _mm512_cvtbiasph_bf8(__A, __B);
}
__m256i test_mm512_mask_cvtbiasph_bf8(__m256i __W, __mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvtbiasph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2bf8512(
return _mm512_mask_cvtbiasph_bf8(__W, __U, __A, __B);
}
__m256i test_mm512_maskz_cvtbiasph_bf8(__mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvtbiasph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2bf8512(
return _mm512_maskz_cvtbiasph_bf8(__U, __A, __B);
}
__m256i test_mm512_cvts_biasph_bf8(__m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvts_biasph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2bf8s512(
return _mm512_cvts_biasph_bf8(__A, __B);
}
__m256i test_mm512_mask_cvts_biasph_bf8(__m256i __W, __mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvts_biasph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2bf8s512(
return _mm512_mask_cvts_biasph_bf8(__W, __U, __A, __B);
}
__m256i test_mm512_maskz_cvts_biasph_bf8(__mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvts_biasph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2bf8s512(
return _mm512_maskz_cvts_biasph_bf8(__U, __A, __B);
}
__m256i test_mm512_cvtbiasph_hf8(__m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvtbiasph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2hf8512(
return _mm512_cvtbiasph_hf8(__A, __B);
}
__m256i test_mm512_mask_cvtbiasph_hf8(__m256i __W, __mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvtbiasph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2hf8512(
return _mm512_mask_cvtbiasph_hf8(__W, __U, __A, __B);
}
__m256i test_mm512_maskz_cvtbiasph_hf8(__mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvtbiasph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2hf8512(
return _mm512_maskz_cvtbiasph_hf8(__U, __A, __B);
}
__m256i test_mm512_cvts_biasph_hf8(__m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvts_biasph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2hf8s512(
return _mm512_cvts_biasph_hf8(__A, __B);
}
__m256i test_mm512_mask_cvts_biasph_hf8(__m256i __W, __mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvts_biasph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2hf8s512(
return _mm512_mask_cvts_biasph_hf8(__W, __U, __A, __B);
}
__m256i test_mm512_maskz_cvts_biasph_hf8(__mmask32 __U, __m512i __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvts_biasph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtbiasph2hf8s512(
return _mm512_maskz_cvts_biasph_hf8(__U, __A, __B);
}
__m512i test_mm512_cvt2ph_bf8(__m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvt2ph_bf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2bf8512(
return _mm512_cvt2ph_bf8(__A, __B);
}
__m512i test_mm512_mask_cvt2ph_bf8(__m512i __W, __mmask32 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvt2ph_bf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2bf8512(
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
// CHECK: ret <8 x i64> %{{.*}}
return _mm512_mask_cvt2ph_bf8(__W, __U, __A, __B);
}
__m512i test_mm512_maskz_cvt2ph_bf8(__mmask32 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvt2ph_bf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2bf8512(
// CHECK: zeroinitializer
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
return _mm512_maskz_cvt2ph_bf8(__U, __A, __B);
}
__m512i test_mm512_cvts_2ph_bf8(__m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvts_2ph_bf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2bf8s512(
return _mm512_cvts_2ph_bf8(__A, __B);
}
__m512i test_mm512_mask_cvts_2ph_bf8(__m512i __W, __mmask64 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvts_2ph_bf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2bf8s512(
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
// CHECK: ret <8 x i64> %{{.*}}
return _mm512_mask_cvts_2ph_bf8(__W, __U, __A, __B);
}
__m512i test_mm512_maskz_cvts_2ph_bf8(__mmask64 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvts_2ph_bf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2bf8s512(
// CHECK: zeroinitializer
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
return _mm512_maskz_cvts_2ph_bf8(__U, __A, __B);
}
__m512i test_mm512_cvt2ph_hf8(__m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvt2ph_hf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2hf8512(
return _mm512_cvt2ph_hf8(__A, __B);
}
__m512i test_mm512_mask_cvt2ph_hf8(__m512i __W, __mmask64 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvt2ph_hf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2hf8512(
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
// CHECK: ret <8 x i64> %{{.*}}
return _mm512_mask_cvt2ph_hf8(__W, __U, __A, __B);
}
__m512i test_mm512_maskz_cvt2ph_hf8(__mmask64 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvt2ph_hf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2hf8512(
// CHECK: zeroinitializer
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
return _mm512_maskz_cvt2ph_hf8(__U, __A, __B);
}
__m512i test_mm512_cvts_2ph_hf8(__m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_cvts_2ph_hf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2hf8s512(
return _mm512_cvts_2ph_hf8(__A, __B);
}
__m512i test_mm512_mask_cvts_2ph_hf8(__m512i __W, __mmask64 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_mask_cvts_2ph_hf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2hf8s512(
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
// CHECK: ret <8 x i64> %{{.*}}
return _mm512_mask_cvts_2ph_hf8(__W, __U, __A, __B);
}
__m512i test_mm512_maskz_cvts_2ph_hf8(__mmask64 __U, __m512h __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvts_2ph_hf8(
// CHECK: call <64 x i8> @llvm.x86.avx10.vcvt2ph2hf8s512(
// CHECK: zeroinitializer
// CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}
return _mm512_maskz_cvts_2ph_hf8(__U, __A, __B);
}
__m512h test_mm512_cvthf8_ph(__m256i __A) {
// CHECK-LABEL: @test_mm512_cvthf8_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvthf82ph512(
return _mm512_cvthf8_ph(__A);
}
__m512h test_mm512_mask_cvthf8_ph(__m512h __A, __mmask32 __B, __m256i __C) {
// CHECK-LABEL: @test_mm512_mask_cvthf8_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvthf82ph512(
return _mm512_mask_cvthf8_ph(__A, __B, __C);
}
__m512h test_mm512_maskz_cvthf8_ph(__mmask32 __A, __m256i __B) {
// CHECK-LABEL: @test_mm512_maskz_cvthf8_ph(
// CHECK: call <32 x half> @llvm.x86.avx10.mask.vcvthf82ph512(
return _mm512_maskz_cvthf8_ph(__A, __B);
}
__m256i test_mm512_cvtph_bf8(__m512h __A) {
// CHECK-LABEL: @test_mm512_cvtph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2bf8512(
return _mm512_cvtph_bf8(__A);
}
__m256i test_mm512_mask_cvtph_bf8(__m256i __A, __mmask32 __B, __m512h __C) {
// CHECK-LABEL: @test_mm512_mask_cvtph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2bf8512(
return _mm512_mask_cvtph_bf8(__A, __B, __C);
}
__m256i test_mm512_maskz_cvtph_bf8(__mmask32 __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvtph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2bf8512(
return _mm512_maskz_cvtph_bf8(__A, __B);
}
__m256i test_mm512_cvts_ph_bf8(__m512h __A) {
// CHECK-LABEL: @test_mm512_cvts_ph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2bf8s512(
return _mm512_cvts_ph_bf8(__A);
}
__m256i test_mm512_mask_cvts_ph_bf8(__m256i __A, __mmask32 __B, __m512h __C) {
// CHECK-LABEL: @test_mm512_mask_cvts_ph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2bf8s512(
return _mm512_mask_cvts_ph_bf8(__A, __B, __C);
}
__m256i test_mm512_maskz_cvts_ph_bf8(__mmask32 __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvts_ph_bf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2bf8s512(
return _mm512_maskz_cvts_ph_bf8(__A, __B);
}
__m256i test_mm512_cvtph_hf8(__m512h __A) {
// CHECK-LABEL: @test_mm512_cvtph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2hf8512(
return _mm512_cvtph_hf8(__A);
}
__m256i test_mm512_mask_cvtph_hf8(__m256i __A, __mmask32 __B, __m512h __C) {
// CHECK-LABEL: @test_mm512_mask_cvtph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2hf8512(
return _mm512_mask_cvtph_hf8(__A, __B, __C);
}
__m256i test_mm512_maskz_cvtph_hf8(__mmask32 __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvtph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2hf8512(
return _mm512_maskz_cvtph_hf8(__A, __B);
}
__m256i test_mm512_cvts_ph_hf8(__m512h __A) {
// CHECK-LABEL: @test_mm512_cvts_ph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2hf8s512(
return _mm512_cvts_ph_hf8(__A);
}
__m256i test_mm512_mask_cvts_ph_hf8(__m256i __A, __mmask32 __B, __m512h __C) {
// CHECK-LABEL: @test_mm512_mask_cvts_ph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2hf8s512(
return _mm512_mask_cvts_ph_hf8(__A, __B, __C);
}
__m256i test_mm512_maskz_cvts_ph_hf8(__mmask32 __A, __m512h __B) {
// CHECK-LABEL: @test_mm512_maskz_cvts_ph_hf8(
// CHECK: call <32 x i8> @llvm.x86.avx10.mask.vcvtph2hf8s512(
return _mm512_maskz_cvts_ph_hf8(__A, __B);
}
__m512h test_mm512_cvtbf8_ph(__m256i A) {
// CHECK-LABEL: @test_mm512_cvtbf8_ph
// CHECK: sext <32 x i8> %{{.*}} to <32 x i16>
// CHECK: @llvm.x86.avx512.pslli.w.512
// CHECK: ret <32 x half> %{{.*}}
return _mm512_cvtbf8_ph(A);
}
__m512h test_mm512_mask_cvtbf8_ph(__m512h S, __mmask32 M, __m256i A) {
// CHECK-LABEL: @test_mm512_mask_cvtbf8_ph
// CHECK: sext <32 x i8> %{{.*}} to <32 x i16>
// CHECK: @llvm.x86.avx512.pslli.w.512
// CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
// CHECK: ret <32 x half> %{{.*}}
return _mm512_mask_cvtbf8_ph(S, M, A);
}
__m512h test_mm512_maskz_cvtbf8_ph(__mmask32 M, __m256i A) {
// CHECK-LABEL: @test_mm512_maskz_cvtbf8_ph
// CHECK: sext <32 x i8> %{{.*}} to <32 x i16>
// CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
// CHECK: @llvm.x86.avx512.pslli.w.512
// CHECK: ret <32 x half> %{{.*}}
return _mm512_maskz_cvtbf8_ph(M, A);
}