66 lines · c
1// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512fp16 -fclangir -emit-cir -o %t.cir -Wall -Werror2// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s3// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512fp16 -fclangir -emit-llvm -o %t.ll -Wall -Werror4// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s5 6// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512fp16 -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG7// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512fp16 -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG8 9#include <immintrin.h>10 11__m128h test_mm_undefined_ph(void) {12 // CIR-LABEL: _mm_undefined_ph13 // CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<2 x !cir.double>14 // CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<2 x !cir.double> -> !cir.vector<8 x !cir.f16>15 // CIR: cir.return %{{.*}} : !cir.vector<8 x !cir.f16>16 17 // CIR-LABEL: cir.func {{.*}}test_mm_undefined_ph18 // CIR: call @_mm_undefined_ph19 20 // LLVM-LABEL: @test_mm_undefined_ph21 // LLVM: store <8 x half> zeroinitializer, ptr %[[A:.*]], align 1622 // LLVM: %{{.*}} = load <8 x half>, ptr %[[A]], align 1623 // LLVM: ret <8 x half> %{{.*}}24 25 // OGCG-LABEL: test_mm_undefined_ph26 // OGCG: ret <8 x half> zeroinitializer27 return _mm_undefined_ph();28}29 30__m256h test_mm256_undefined_ph(void) {31 // CIR-LABEL: _mm256_undefined_ph32 // CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<4 x !cir.double>33 // CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<4 x !cir.double> -> !cir.vector<16 x !cir.f16>34 // CIR: cir.return %{{.*}} : !cir.vector<16 x !cir.f16>35 36 // CIR-LABEL: cir.func {{.*}}test_mm256_undefined_ph37 // CIR: call @_mm256_undefined_ph38 39 // LLVM-LABEL: @test_mm256_undefined_ph40 // LLVM: store <16 x half> zeroinitializer, ptr %[[A:.*]], align 3241 // LLVM: %{{.*}} = load <16 x half>, ptr %[[A]], align 3242 // LLVM: ret <16 x half> %{{.*}}43 44 // OGCG-LABEL: test_mm256_undefined_ph45 // OGCG: ret <16 x half> zeroinitializer46 return _mm256_undefined_ph();47}48 49__m512h test_mm512_undefined_ph(void) {50 // CIR-LABEL: _mm512_undefined_ph51 // CIR: %[[A:.*]] = cir.const #cir.zero : !cir.vector<8 x !cir.double>52 // CIR: %{{.*}} = cir.cast bitcast %[[A]] : !cir.vector<8 x !cir.double> -> !cir.vector<32 x !cir.f16>53 // CIR: cir.return %{{.*}} : !cir.vector<32 x !cir.f16>54 55 // CIR-LABEL: cir.func {{.*}}test_mm512_undefined_ph56 // CIR: call @_mm512_undefined_ph57 58 // LLVM-LABEL: @test_mm512_undefined_ph59 // LLVM: store <32 x half> zeroinitializer, ptr %[[A:.*]], align 6460 // LLVM: %{{.*}} = load <32 x half>, ptr %[[A]], align 6461 // LLVM: ret <32 x half> %{{.*}}62 63 // OGCG-LABEL: test_mm512_undefined_ph64 // OGCG: ret <32 x half> zeroinitializer65 return _mm512_undefined_ph();66}