source: Daodan/MSYS2/mingw32/lib/gcc/i686-w64-mingw32/11.2.0/include/amxtileintrin.h

Last change on this file was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 3.1 KB
Line 
1/* Copyright (C) 2020-2021 Free Software Foundation, Inc.
2
3 This file is part of GCC.
4
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
18
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
23
24#if !defined _IMMINTRIN_H_INCLUDED
25#error "Never use <amxtileintrin.h> directly; include <immintrin.h> instead."
26#endif
27
28#ifndef _AMXTILEINTRIN_H_INCLUDED
29#define _AMXTILEINTRIN_H_INCLUDED
30
31#if !defined(__AMX_TILE__)
32#pragma GCC push_options
33#pragma GCC target("amx-tile")
34#define __DISABLE_AMX_TILE__
35#endif /* __AMX_TILE__ */
36
37#if defined(__x86_64__) && defined(__AMX_TILE__)
38extern __inline void
39__attribute__((__gnu_inline__, __always_inline__, __artificial__))
40_tile_loadconfig (const void *__config)
41{
42 __asm__ volatile ("ldtilecfg\t%X0" :: "m" (*((const void **)__config)));
43}
44
45extern __inline void
46__attribute__((__gnu_inline__, __always_inline__, __artificial__))
47_tile_storeconfig (void *__config)
48{
49 __asm__ volatile ("sttilecfg\t%X0" : "=m" (*((void **)__config)));
50}
51
52extern __inline void
53__attribute__((__gnu_inline__, __always_inline__, __artificial__))
54_tile_release (void)
55{
56 __asm__ volatile ("tilerelease" ::);
57}
58
59#define _tile_loadd(dst,base,stride) \
60 _tile_loadd_internal (dst, base, stride)
61
62#define _tile_loadd_internal(dst,base,stride) \
63 __asm__ volatile \
64 ("{tileloadd\t(%0,%1,1), %%tmm"#dst"|tileloadd\t%%tmm"#dst", [%0+%1*1]}" \
65 :: "r" ((const void*) base), "r" ((long) stride))
66
67#define _tile_stream_loadd(dst,base,stride) \
68 _tile_stream_loadd_internal (dst, base, stride)
69
70#define _tile_stream_loadd_internal(dst,base,stride) \
71 __asm__ volatile \
72 ("{tileloaddt1\t(%0,%1,1), %%tmm"#dst"|tileloaddt1\t%%tmm"#dst", [%0+%1*1]}" \
73 :: "r" ((const void*) base), "r" ((long) stride))
74
75#define _tile_stored(dst,base,stride) \
76 _tile_stored_internal (dst, base, stride)
77
78#define _tile_stored_internal(src,base,stride) \
79 __asm__ volatile \
80 ("{tilestored\t%%tmm"#src", (%0,%1,1)|tilestored\t[%0+%1*1], %%tmm"#src"}" \
81 :: "r" ((void*) base), "r" ((long) stride) \
82 : "memory")
83
84#define _tile_zero(dst) \
85 _tile_zero_internal (dst)
86
87#define _tile_zero_internal(dst) \
88 __asm__ volatile \
89 ("tilezero\t%%tmm"#dst ::)
90
91#endif
92
93#ifdef __DISABLE_AMX_TILE__
94#undef __DISABLE_AMX_TILE__
95#pragma GCC pop_options
96#endif /* __DISABLE_AMX_TILE__ */
97
98#endif /* _AMXTILEINTRIN_H_INCLUDED */
Note: See TracBrowser for help on using the repository browser.