1 | //===--- BuiltinsX86_64.def - X86-64 Builtin function database --*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // This file defines the X86-64-specific builtin function database. Users of |
10 | // this file must define the BUILTIN macro to make use of this information. |
11 | // |
12 | //===----------------------------------------------------------------------===// |
13 | |
14 | // The format of this database matches clang/Basic/Builtins.def. |
15 | |
16 | #if defined(BUILTIN) && !defined(TARGET_BUILTIN) |
17 | # define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) |
18 | #endif |
19 | |
20 | #if defined(BUILTIN) && !defined(TARGET_HEADER_BUILTIN) |
21 | # define (ID, TYPE, ATTRS, HEADER, LANG, FEATURE) BUILTIN(ID, TYPE, ATTRS) |
22 | #endif |
23 | |
24 | TARGET_HEADER_BUILTIN(_BitScanForward64, "UcUNi*ULLi" , "nh" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
25 | TARGET_HEADER_BUILTIN(_BitScanReverse64, "UcUNi*ULLi" , "nh" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
26 | |
27 | TARGET_HEADER_BUILTIN(__mulh, "LLiLLiLLi" , "nch" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
28 | TARGET_HEADER_BUILTIN(__umulh, "ULLiULLiULLi" , "nch" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
29 | TARGET_HEADER_BUILTIN(_mul128, "LLiLLiLLiLLi*" , "nch" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
30 | TARGET_HEADER_BUILTIN(_umul128, "ULLiULLiULLiULLi*" , "nch" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
31 | |
32 | TARGET_HEADER_BUILTIN(__faststorefence, "v" , "nh" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
33 | TARGET_HEADER_BUILTIN(__shiftleft128, "ULLiULLiULLiUc" , "nch" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
34 | TARGET_HEADER_BUILTIN(__shiftright128, "ULLiULLiULLiUc" , "nch" , INTRIN_H, ALL_MS_LANGUAGES, "" ) |
35 | |
36 | TARGET_HEADER_BUILTIN(_InterlockedCompareExchange128, "UcLLiD*LLiLLiLLi*" , "nh" , INTRIN_H, ALL_MS_LANGUAGES, "cx16" ) |
37 | |
38 | TARGET_BUILTIN(__builtin_ia32_readeflags_u64, "UOi" , "n" , "" ) |
39 | TARGET_BUILTIN(__builtin_ia32_writeeflags_u64, "vUOi" , "n" , "" ) |
40 | TARGET_BUILTIN(__builtin_ia32_cvtss2si64, "OiV4f" , "ncV:128:" , "sse" ) |
41 | TARGET_BUILTIN(__builtin_ia32_cvttss2si64, "OiV4f" , "ncV:128:" , "sse" ) |
42 | TARGET_BUILTIN(__builtin_ia32_cvtsd2si64, "OiV2d" , "ncV:128:" , "sse2" ) |
43 | TARGET_BUILTIN(__builtin_ia32_cvttsd2si64, "OiV2d" , "ncV:128:" , "sse2" ) |
44 | TARGET_BUILTIN(__builtin_ia32_movnti64, "vOi*Oi" , "n" , "sse2" ) |
45 | TARGET_BUILTIN(__builtin_ia32_vec_set_v2di, "V2OiV2OiOiIi" , "ncV:128:" , "sse4.1" ) |
46 | TARGET_BUILTIN(__builtin_ia32_crc32di, "UOiUOiUOi" , "nc" , "crc32" ) |
47 | TARGET_BUILTIN(__builtin_ia32_vec_ext_v4di, "OiV4OiIi" , "ncV:256:" , "avx" ) |
48 | TARGET_BUILTIN(__builtin_ia32_vec_set_v4di, "V4OiV4OiOiIi" , "ncV:256:" , "avx" ) |
49 | TARGET_BUILTIN(__builtin_ia32_rdfsbase32, "Ui" , "n" , "fsgsbase" ) |
50 | TARGET_BUILTIN(__builtin_ia32_rdfsbase64, "UOi" , "n" , "fsgsbase" ) |
51 | TARGET_BUILTIN(__builtin_ia32_rdgsbase32, "Ui" , "n" , "fsgsbase" ) |
52 | TARGET_BUILTIN(__builtin_ia32_rdgsbase64, "UOi" , "n" , "fsgsbase" ) |
53 | TARGET_BUILTIN(__builtin_ia32_wrfsbase32, "vUi" , "n" , "fsgsbase" ) |
54 | TARGET_BUILTIN(__builtin_ia32_wrfsbase64, "vUOi" , "n" , "fsgsbase" ) |
55 | TARGET_BUILTIN(__builtin_ia32_wrgsbase32, "vUi" , "n" , "fsgsbase" ) |
56 | TARGET_BUILTIN(__builtin_ia32_wrgsbase64, "vUOi" , "n" , "fsgsbase" ) |
57 | TARGET_BUILTIN(__builtin_ia32_fxrstor64, "vv*" , "n" , "fxsr" ) |
58 | TARGET_BUILTIN(__builtin_ia32_fxsave64, "vv*" , "n" , "fxsr" ) |
59 | TARGET_BUILTIN(__builtin_ia32_xsave64, "vv*UOi" , "n" , "xsave" ) |
60 | TARGET_BUILTIN(__builtin_ia32_xrstor64, "vv*UOi" , "n" , "xsave" ) |
61 | TARGET_BUILTIN(__builtin_ia32_xsaveopt64, "vv*UOi" , "n" , "xsaveopt" ) |
62 | TARGET_BUILTIN(__builtin_ia32_xrstors64, "vv*UOi" , "n" , "xsaves" ) |
63 | TARGET_BUILTIN(__builtin_ia32_xsavec64, "vv*UOi" , "n" , "xsavec" ) |
64 | TARGET_BUILTIN(__builtin_ia32_xsaves64, "vv*UOi" , "n" , "xsaves" ) |
65 | TARGET_BUILTIN(__builtin_ia32_incsspq, "vUOi" , "n" , "shstk" ) |
66 | TARGET_BUILTIN(__builtin_ia32_rdsspq, "UOiUOi" , "n" , "shstk" ) |
67 | TARGET_BUILTIN(__builtin_ia32_wrssq, "vUOiv*" , "n" , "shstk" ) |
68 | TARGET_BUILTIN(__builtin_ia32_wrussq, "vUOiv*" , "n" , "shstk" ) |
69 | TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcUOiUOiUOi*" , "n" , "" ) |
70 | TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcUOiUOiUOi*" , "n" , "" ) |
71 | TARGET_BUILTIN(__builtin_ia32_rdrand64_step, "UiUOi*" , "n" , "rdrnd" ) |
72 | TARGET_BUILTIN(__builtin_ia32_rdseed64_step, "UiUOi*" , "n" , "rdseed" ) |
73 | TARGET_BUILTIN(__builtin_ia32_lzcnt_u64, "UOiUOi" , "nc" , "lzcnt" ) |
74 | TARGET_BUILTIN(__builtin_ia32_bextr_u64, "UOiUOiUOi" , "nc" , "bmi" ) |
75 | TARGET_BUILTIN(__builtin_ia32_tzcnt_u64, "UOiUOi" , "nc" , "" ) |
76 | TARGET_BUILTIN(__builtin_ia32_bzhi_di, "UOiUOiUOi" , "nc" , "bmi2" ) |
77 | TARGET_BUILTIN(__builtin_ia32_pdep_di, "UOiUOiUOi" , "nc" , "bmi2" ) |
78 | TARGET_BUILTIN(__builtin_ia32_pext_di, "UOiUOiUOi" , "nc" , "bmi2" ) |
79 | TARGET_BUILTIN(__builtin_ia32_bextri_u64, "UOiUOiIUOi" , "nc" , "tbm" ) |
80 | TARGET_BUILTIN(__builtin_ia32_lwpins64, "UcUOiUiIUi" , "n" , "lwp" ) |
81 | TARGET_BUILTIN(__builtin_ia32_lwpval64, "vUOiUiIUi" , "n" , "lwp" ) |
82 | TARGET_BUILTIN(__builtin_ia32_vcvtsd2si64, "OiV2dIi" , "ncV:128:" , "avx512f" ) |
83 | TARGET_BUILTIN(__builtin_ia32_vcvtsd2usi64, "UOiV2dIi" , "ncV:128:" , "avx512f" ) |
84 | TARGET_BUILTIN(__builtin_ia32_vcvtss2si64, "OiV4fIi" , "ncV:128:" , "avx512f" ) |
85 | TARGET_BUILTIN(__builtin_ia32_vcvtss2usi64, "UOiV4fIi" , "ncV:128:" , "avx512f" ) |
86 | TARGET_BUILTIN(__builtin_ia32_vcvttsd2si64, "OiV2dIi" , "ncV:128:" , "avx512f" ) |
87 | TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi64, "UOiV2dIi" , "ncV:128:" , "avx512f" ) |
88 | TARGET_BUILTIN(__builtin_ia32_vcvttss2si64, "OiV4fIi" , "ncV:128:" , "avx512f" ) |
89 | TARGET_BUILTIN(__builtin_ia32_vcvttss2usi64, "UOiV4fIi" , "ncV:128:" , "avx512f" ) |
90 | TARGET_BUILTIN(__builtin_ia32_cvtsi2sd64, "V2dV2dOiIi" , "ncV:128:" , "avx512f" ) |
91 | TARGET_BUILTIN(__builtin_ia32_cvtsi2ss64, "V4fV4fOiIi" , "ncV:128:" , "avx512f" ) |
92 | TARGET_BUILTIN(__builtin_ia32_cvtusi2sd64, "V2dV2dUOiIi" , "ncV:128:" , "avx512f" ) |
93 | TARGET_BUILTIN(__builtin_ia32_cvtusi2ss64, "V4fV4fUOiIi" , "ncV:128:" , "avx512f" ) |
94 | TARGET_BUILTIN(__builtin_ia32_vcvtsh2si64, "OiV8xIi" , "ncV:128:" , "avx512fp16" ) |
95 | TARGET_BUILTIN(__builtin_ia32_vcvtsh2usi64, "UOiV8xIi" , "ncV:128:" , "avx512fp16" ) |
96 | TARGET_BUILTIN(__builtin_ia32_vcvtusi642sh, "V8xV8xUOiIi" , "ncV:128:" , "avx512fp16" ) |
97 | TARGET_BUILTIN(__builtin_ia32_vcvtsi642sh, "V8xV8xOiIi" , "ncV:128:" , "avx512fp16" ) |
98 | TARGET_BUILTIN(__builtin_ia32_vcvttsh2si64, "OiV8xIi" , "ncV:128:" , "avx512fp16" ) |
99 | TARGET_BUILTIN(__builtin_ia32_vcvttsh2usi64, "UOiV8xIi" , "ncV:128:" , "avx512fp16" ) |
100 | TARGET_BUILTIN(__builtin_ia32_directstore_u64, "vULi*ULi" , "n" , "movdiri" ) |
101 | |
102 | // UINTR |
103 | TARGET_BUILTIN(__builtin_ia32_clui, "v" , "n" , "uintr" ) |
104 | TARGET_BUILTIN(__builtin_ia32_stui, "v" , "n" , "uintr" ) |
105 | TARGET_BUILTIN(__builtin_ia32_testui, "Uc" , "n" , "uintr" ) |
106 | TARGET_BUILTIN(__builtin_ia32_senduipi, "vUWi" , "n" , "uintr" ) |
107 | // USERMSR |
108 | TARGET_BUILTIN(__builtin_ia32_urdmsr, "ULLiULLi" , "n" , "usermsr" ) |
109 | TARGET_BUILTIN(__builtin_ia32_uwrmsr, "vULLiULLi" , "n" , "usermsr" ) |
110 | |
111 | // AMX internal builtin |
112 | TARGET_BUILTIN(__builtin_ia32_tile_loadconfig_internal, "vvC*" , "n" , "amx-tile" ) |
113 | TARGET_BUILTIN(__builtin_ia32_tileloadd64_internal, "V256iUsUsvC*z" , "n" , "amx-tile" ) |
114 | TARGET_BUILTIN(__builtin_ia32_tileloaddt164_internal, "V256iUsUsvC*z" , "n" , "amx-tile" ) |
115 | TARGET_BUILTIN(__builtin_ia32_tdpbssd_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-int8" ) |
116 | TARGET_BUILTIN(__builtin_ia32_tdpbsud_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-int8" ) |
117 | TARGET_BUILTIN(__builtin_ia32_tdpbusd_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-int8" ) |
118 | TARGET_BUILTIN(__builtin_ia32_tdpbuud_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-int8" ) |
119 | TARGET_BUILTIN(__builtin_ia32_tilestored64_internal, "vUsUsv*zV256i" , "n" , "amx-tile" ) |
120 | TARGET_BUILTIN(__builtin_ia32_tilezero_internal, "V256iUsUs" , "n" , "amx-tile" ) |
121 | TARGET_BUILTIN(__builtin_ia32_tdpbf16ps_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-bf16" ) |
122 | TARGET_BUILTIN(__builtin_ia32_tdpfp16ps_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-fp16" ) |
123 | TARGET_BUILTIN(__builtin_ia32_tcmmimfp16ps_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-complex" ) |
124 | TARGET_BUILTIN(__builtin_ia32_tcmmrlfp16ps_internal, "V256iUsUsUsV256iV256iV256i" , "n" , "amx-complex" ) |
125 | // AMX |
126 | TARGET_BUILTIN(__builtin_ia32_tile_loadconfig, "vvC*" , "n" , "amx-tile" ) |
127 | TARGET_BUILTIN(__builtin_ia32_tile_storeconfig, "vvC*" , "n" , "amx-tile" ) |
128 | TARGET_BUILTIN(__builtin_ia32_tilerelease, "v" , "n" , "amx-tile" ) |
129 | TARGET_BUILTIN(__builtin_ia32_tilezero, "vUc" , "n" , "amx-tile" ) |
130 | |
131 | TARGET_BUILTIN(__builtin_ia32_tileloadd64, "vIUcvC*z" , "n" , "amx-tile" ) |
132 | TARGET_BUILTIN(__builtin_ia32_tileloaddt164, "vIUcvC*z" , "n" , "amx-tile" ) |
133 | TARGET_BUILTIN(__builtin_ia32_tilestored64, "vIUcv*z" , "n" , "amx-tile" ) |
134 | |
135 | TARGET_BUILTIN(__builtin_ia32_tdpbssd, "vIUcIUcIUc" , "n" , "amx-int8" ) |
136 | TARGET_BUILTIN(__builtin_ia32_tdpbsud, "vIUcIUcIUc" , "n" , "amx-int8" ) |
137 | TARGET_BUILTIN(__builtin_ia32_tdpbusd, "vIUcIUcIUc" , "n" , "amx-int8" ) |
138 | TARGET_BUILTIN(__builtin_ia32_tdpbuud, "vIUcIUcIUc" , "n" , "amx-int8" ) |
139 | TARGET_BUILTIN(__builtin_ia32_tdpbf16ps, "vIUcIUcIUc" , "n" , "amx-bf16" ) |
140 | TARGET_BUILTIN(__builtin_ia32_ptwrite64, "vUOi" , "n" , "ptwrite" ) |
141 | |
142 | TARGET_BUILTIN(__builtin_ia32_tcmmimfp16ps, "vIUcIUcIUc" , "n" , "amx-complex" ) |
143 | TARGET_BUILTIN(__builtin_ia32_tcmmrlfp16ps, "vIUcIUcIUc" , "n" , "amx-complex" ) |
144 | |
145 | TARGET_BUILTIN(__builtin_ia32_prefetchi, "vvC*Ui" , "nc" , "prefetchi" ) |
146 | TARGET_BUILTIN(__builtin_ia32_cmpccxadd32, "Siv*SiSiIi" , "n" , "cmpccxadd" ) |
147 | TARGET_BUILTIN(__builtin_ia32_cmpccxadd64, "SLLiv*SLLiSLLiIi" , "n" , "cmpccxadd" ) |
148 | |
149 | // AMX_FP16 FP16 |
150 | TARGET_BUILTIN(__builtin_ia32_tdpfp16ps, "vIUcIUcIUc" , "n" , "amx-fp16" ) |
151 | |
152 | // RAO-INT |
153 | TARGET_BUILTIN(__builtin_ia32_aadd64, "vv*SOi" , "n" , "raoint" ) |
154 | TARGET_BUILTIN(__builtin_ia32_aand64, "vv*SOi" , "n" , "raoint" ) |
155 | TARGET_BUILTIN(__builtin_ia32_aor64, "vv*SOi" , "n" , "raoint" ) |
156 | TARGET_BUILTIN(__builtin_ia32_axor64, "vv*SOi" , "n" , "raoint" ) |
157 | |
158 | #undef BUILTIN |
159 | #undef TARGET_BUILTIN |
160 | #undef TARGET_HEADER_BUILTIN |
161 | |