25 lines · plain
1// REQUIRES: target=x86{{.*}}2 3// RUN: mlir-opt %s \4// RUN: -convert-vector-to-llvm="enable-x86vector" -convert-to-llvm \5// RUN: -reconcile-unrealized-casts | \6// RUN: mlir-translate --mlir-to-llvmir | \7// RUN: llc -mcpu=sapphirerapids | \8// RUN: FileCheck %s9 10func.func @avx512bf16_cvt_packed_f32_to_bf16_256(11 %a: vector<8xf32>) -> vector<8xbf16> {12 %0 = x86vector.avx512.cvt.packed.f32_to_bf16 %a : vector<8xf32> -> vector<8xbf16>13 return %0 : vector<8xbf16>14}15// CHECK-LABEL: avx512bf16_cvt_packed_f32_to_bf16_256:16// CHECK: vcvtneps2bf16{{.*}}%xmm17 18func.func @avx512bf16_cvt_packed_f32_to_bf16_512(19 %a: vector<16xf32>) -> vector<16xbf16> {20 %0 = x86vector.avx512.cvt.packed.f32_to_bf16 %a : vector<16xf32> -> vector<16xbf16>21 return %0 : vector<16xbf16>22}23// CHECK-LABEL: avx512bf16_cvt_packed_f32_to_bf16_512:24// CHECK: vcvtneps2bf16{{.*}}%ymm25