================ @@ -0,0 +1,766 @@ +/*===-------------- acev1intrin.h - ACEV1 intrinsics -*- C/C++ -*------------=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + *===------------------------------------------------------------------------=== + */ + +#ifndef __IMMINTRIN_H +#error "Never use <acev1intrin.h> directly; include <immintrin.h> instead." +#endif /* __IMMINTRIN_H */ + +#ifndef __ACEV1INTRIN_H +#define __ACEV1INTRIN_H +#ifdef __x86_64__ + +/* Define the default attributes for the functions in this file. */ +#define __DEFAULT_FN_ATTRS_ACE \ + __attribute__((__always_inline__, __nodebug__, __target__("acev1"))) + +/// Load tile configuration from a 64-byte memory location. For ACE +/// (Palette 2), the palette_id byte must be 2. Unlike AMX (Palette 1), +/// ACE tiles have fixed dimensions of 16 rows × 64 bytes, so per-tile +/// row/column configuration bytes are ignored. If palette_id is zero, +/// tiles return to init state and are zeroed. Invalid configurations +/// result in #GP fault. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the <c> LDTILECFG </c> instruction. +/// +/// \param __config +/// A pointer to 64-byte tile configuration (use __ace_tile_config). +static __inline__ void __DEFAULT_FN_ATTRS_ACE +_tile_ace_loadconfig(const void *__config) { + __builtin_ia32_tile_loadconfig(__config); +} + +/// Store the current tile configuration to a 64-byte memory location. +/// For ACE (Palette 2), the stored palette_id will be 2 and per-tile +/// configuration bytes reflect the fixed 16×64 dimensions. If tiles +/// are not configured, all zeroes are stored. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the <c> STTILECFG </c> instruction. +/// +/// \param __config +/// A pointer to 64-byte tile configuration buffer. +static __inline__ void __DEFAULT_FN_ATTRS_ACE +_tile_ace_storeconfig(void *__config) { + __builtin_ia32_tile_storeconfig(__config); +} + +/// Release the tile configuration to return to init state, releasing +/// all tile storage. After this, tiles must be reconfigured with +/// _tile_ace_loadconfig before use. +/// +/// \headerfile <immintrin.h> +/// +/// This intrinsic corresponds to the <c> TILERELEASE </c> instruction. +static __inline__ void __DEFAULT_FN_ATTRS_ACE _tile_ace_release(void) { ---------------- mahesh-attarde wrote:
Nit: clang-format is generally unappealing to intrinsic headers. https://github.com/llvm/llvm-project/pull/208408 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
