ia32-64/x86/ldtilecfg.html
2025-07-08 02:23:29 -03:00

182 lines
6.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:x86="http://www.felixcloutier.com/x86"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="style.css"></link><title>LDTILECFG
— Load Tile Configuration</title></head><body><header><nav><ul><li><a href='index.html'>Index</a></li><li>December 2023</li></ul></nav></header><h1>LDTILECFG
— Load Tile Configuration</h1>
<table>
<tr>
<th>Opcode/Instruction</th>
<th>Op/En</th>
<th>64/32 bit Mode Support</th>
<th>CPUID Feature Flag</th>
<th>Description</th></tr>
<tr>
<td>VEX.128.NP.0F38.W0 49 !(11):000:bbb LDTILECFG m512</td>
<td>A</td>
<td>V/N.E.</td>
<td>AMX-TILE</td>
<td>Load tile configuration as specified in m512.</td></tr></table>
<h2 id="instruction-operand-encoding">Instruction Operand Encoding<a class="anchor" href="#instruction-operand-encoding">
</a></h2>
<table>
<tr>
<th>Op/En</th>
<th>Tuple</th>
<th>Operand 1</th>
<th>Operand 2</th>
<th>Operand 3</th>
<th>Operand 4</th></tr>
<tr>
<td>A</td>
<td>N/A</td>
<td>ModRM:r/m (r)</td>
<td>N/A</td>
<td>N/A</td>
<td>N/A</td></tr></table>
<h3 id="description">Description<a class="anchor" href="#description">
</a></h3>
<p>The LDTILECFG instruction takes an operand containing a pointer to a 64-byte memory location containing the description of the tiles to be supported. In order to configure the tiles, the AMX-TILE bit in CPUID must be set and the operating system has to have enabled the tiles architecture.</p>
<p>The memory area contains the palette and describes how many tiles are being used and defines each tile in terms of rows and column bytes. Requests must be compatible with the restrictions provided by CPUID; see <a href='cpuid.html#tbl-3-10'>Table 3-10</a> below.</p>
<figure id="tbl-3-10">
<table>
<tr>
<th>Byte(s)</th>
<th>Field Name</th>
<th>Description</th></tr>
<tr>
<td>0</td>
<td>palette</td>
<td>Palette selects the supported configuration of the tiles that will be used.</td></tr>
<tr>
<td>1</td>
<td>start_row</td>
<td>start_row is used for storing the restart values for interrupted operations.</td></tr>
<tr>
<td>2-15</td>
<td>reserved, must be zero</td>
<td></td></tr>
<tr>
<td>16-17</td>
<td>tile0.colsb</td>
<td>Tile 0 bytes per row.</td></tr>
<tr>
<td>18-19</td>
<td>tile1.colsb</td>
<td>Tile 1 bytes per row.</td></tr>
<tr>
<td>20-21</td>
<td>tile2.colsb</td>
<td>Tile 2 bytes per row.</td></tr>
<tr>
<td>...</td>
<td>(sequence continues)</td>
<td></td></tr>
<tr>
<td>30-31</td>
<td>tile7.colsb</td>
<td>Tile 7 bytes per row.</td></tr>
<tr>
<td>32-47</td>
<td>reserved, must be zero</td>
<td></td></tr>
<tr>
<td>48</td>
<td>tile0.rows</td>
<td>Tile 0 rows.</td></tr>
<tr>
<td>49</td>
<td>tile1.rows</td>
<td>Tile 1 rows.</td></tr>
<tr>
<td>50</td>
<td>tile2.rows</td>
<td>Tile 2 rows.</td></tr>
<tr>
<td>...</td>
<td>(sequence continues)</td>
<td></td></tr>
<tr>
<td>55</td>
<td>tile7.rows</td>
<td>Tile 7 rows.</td></tr>
<tr>
<td>56-63</td>
<td>reserved, must be zero</td>
<td></td></tr></table>
<figcaption><a href='cpuid.html#tbl-3-10'>Table 3-10</a>. Memory Area Layout</figcaption></figure>
<p>If a tile row and column pair is not used to specify tile parameters, they must have the value zero. All enabled tiles (based on the palette) must be configured. Specifying tile parameters for more tiles than the implementation limit or the palette limit results in a #GP fault.</p>
<p>If the palette_id is zero, that signifies the INIT state for both TILECFG and TILEDATA. Tiles are zeroed in the INIT state. The only legal non-INIT value for palette_id is 1.</p>
<p>Any attempt to execute the LDTILECFG instruction inside an Intel TSX transaction will result in a transaction abort.</p>
<h3 id="operation">Operation<a class="anchor" href="#operation">
</a></h3>
<h4 id="ldtilecfg-mem">LDTILECFG mem<a class="anchor" href="#ldtilecfg-mem">
</a></h4>
<pre>error := False
buf := read_memory(mem, 64)
temp_tilecfg.palette_id := buf.byte[0]
if temp_tilecfg.palette_id &gt; max_palette:
error := True
if not xcr0_supports_palette(temp_tilecfg.palette_id):
error := True
if temp_tilecfg.palette_id !=0:
temp_tilecfg.start_row := buf.byte[1]
if buf.byte[2..15] is nonzero:
error := True
p := 16
# configure columns
for n in 0 ... palette_table[temp_tilecfg.palette_id].max_names-1:
temp_tilecfg.t[n].colsb:= buf.word[p/2]
p := p + 2
if temp_tilecfg.t[n].colsb &gt; palette_table[temp_tilecfg.palette_id].bytes_per_row:
error := True
if nonzero(buf[p...47]):
error := True
# configure rows
p := 48
for n in 0 ... palette_table[temp_tilecfg.palette_id].max_names-1:
temp_tilecfg.t[n].rows:= buf.byte[p]
if temp_tilecfg.t[n].rows &gt; palette_table[temp_tilecfg.palette_id].max_rows:
error := True
p := p + 1
if nonzero(buf[p...63]):
error := True
# validate each tile's row &amp; col configs are reasonable and enable the valid tiles
for n in 0 ... palette_table[temp_tilecfg.palette_id].max_names-1:
if temp_tilecfg.t[n].rows !=0 and temp_tilecfg.t[n].colsb != 0:
temp_tilecfg.t[n].valid := 1
elif temp_tilecfg.t[n].rows == 0 and temp_tilecfg.t[n].colsb == 0:
temp_tilecfg.t[n].valid := 0
else:
error := True// one of rows or colsbwas 0 but not both.
if error:
#GP
elif temp_tilecfg.palette_id == 0:
TILES_CONFIGURED := 0// init state
tilecfg := 0// equivalent to 64B of zeros
zero_all_tile_data()
else:
tilecfg := temp_tilecfg
zero_all_tile_data()
TILES_CONFIGURED := 1
</pre>
<h3 id="intel-c-c++-compiler-intrinsic-equivalent">Intel C/C++ Compiler Intrinsic Equivalent<a class="anchor" href="#intel-c-c++-compiler-intrinsic-equivalent">
</a></h3>
<pre>LDTILECFG void _tile_loadconfig(const void *);
</pre>
<h3 id="flags-affected">Flags Affected<a class="anchor" href="#flags-affected">
</a></h3>
<p>None.</p>
<h3 class="exceptions" id="exceptions">Exceptions<a class="anchor" href="#exceptions">
</a></h3>
<p>AMX-E1; see Section 2.10, “Intel® AMX Instruction Exception Classes,” for details.</p><footer><p>
This UNOFFICIAL, mechanically-separated, non-verified reference is provided for convenience, but it may be
inc<span style="opacity: 0.2">omp</span>lete or b<sub>r</sub>oke<sub>n</sub> in various obvious or non-obvious
ways. Refer to <a href="https://software.intel.com/en-us/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4">Intel® 64 and IA-32 Architectures Software Developers Manual</a> for anything serious.
</p></footer></body></html>