1 /* intrinsics.def
-- Definitions for D compiler intrinsics.
2 Copyright (C
) 2014-2018 Free Software Foundation
, Inc.
4 GCC is free software
; you can redistribute it and
/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation
; either version
3, or (at your option
)
9 GCC is distributed in the hope that it will be useful
,
10 but WITHOUT ANY WARRANTY
; without even the implied warranty of
11 MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with GCC
; see the file COPYING3. If not see
16 <http
://www.gnu.org
/licenses
/>.
*/
18 /* DEF_D_INTRINSIC (CODE
, ALIAS
, NAME
, MODULE, DECO
, CTFE
)
19 CODE The enum code used to refer to this intrinsic.
20 ALIAS The enum code used to reference the function DECL_FUNCTION_CODE
,
21 if there are multiple modules or decos for a single intrinsic
,
22 they would all refer to this code.
23 NAME The name of this intrinsic as a string.
24 MODULE The name of the module which the intrinsic belongs to as a string.
25 DECO The function signature decoration of the intrinsic.
26 CTFE True if the function is only handled as a built
-in during CTFE
,
27 otherwise the runtime implementation is used.
29 Used for declaring internally recognized functions that either map to a
30 GCC builtin
, or are specially handled by the compiler.
*/
32 /* A D built
-in that has no runtime implementation.
*/
33 #define
DEF_D_BUILTIN(C
, A
, N
, M
, D
) \
34 DEF_D_INTRINSIC (C
, A
, N
, M
, D
, false
)
36 /* A D built
-in that is specially recognized only during CTFE.
*/
37 #define
DEF_CTFE_BUILTIN(C
, A
, N
, M
, D
) \
38 DEF_D_INTRINSIC (C
, A
, N
, M
, D
, true
)
40 DEF_D_BUILTIN (NONE
, NONE
, 0, 0, 0)
42 /* core.bitop intrinsics.
*/
44 DEF_D_BUILTIN (BSF
, BSF
, "bsf", "core.bitop", "FNaNbNiNfkZi")
45 DEF_D_BUILTIN (BSR
, BSR
, "bsr", "core.bitop", "FNaNbNiNfkZi")
46 DEF_D_BUILTIN (BT
, BT
, "bt", "core.bitop", "FNaNbNixPkkZi")
47 DEF_D_BUILTIN (BTC
, BTC
, "btc", "core.bitop", "FNaNbNiPkkZi")
48 DEF_D_BUILTIN (BTR
, BTR
, "btr", "core.bitop", "FNaNbNiPkkZi")
49 DEF_D_BUILTIN (BTS
, BTS
, "bts", "core.bitop", "FNaNbNiPkkZi")
50 DEF_D_BUILTIN (BSF64
, BSF
, "bsf", "core.bitop", "FNaNbNiNfmZi")
51 DEF_D_BUILTIN (BSR64
, BSR
, "bsr", "core.bitop", "FNaNbNiNfmZi")
52 DEF_D_BUILTIN (BT64
, BT
, "bt", "core.bitop", "FNaNbNixPmmZi")
53 DEF_D_BUILTIN (BTC64
, BTC
, "btc", "core.bitop", "FNaNbNiPmmZi")
54 DEF_D_BUILTIN (BTR64
, BTR
, "btr", "core.bitop", "FNaNbNiPmmZi")
55 DEF_D_BUILTIN (BTS64
, BTS
, "bts", "core.bitop", "FNaNbNiPmmZi")
56 DEF_D_BUILTIN (BSWAP
, BSWAP
, "bswap", "core.bitop", "FNaNbNiNfkZk")
57 DEF_D_BUILTIN (BSWAP64
, BSWAP
, "bswap", "core.bitop", "FNaNbNiNfmZm")
58 DEF_D_BUILTIN (POPCNT
, POPCNT
, "popcnt", "core.bitop", "FNaNbNiNfkZi")
59 DEF_D_BUILTIN (POPCNT64
, POPCNT
, "popcnt", "core.bitop", "FNaNbNiNfmZi")
60 DEF_D_BUILTIN (VLOAD
, VLOAD
, "volatileLoad", "core.bitop", "FNbNiNfPhZh")
61 DEF_D_BUILTIN (VLOAD16
, VLOAD
, "volatileLoad", "core.bitop", "FNbNiNfPtZt")
62 DEF_D_BUILTIN (VLOAD32
, VLOAD
, "volatileLoad", "core.bitop", "FNbNiNfPkZk")
63 DEF_D_BUILTIN (VLOAD64
, VLOAD
, "volatileLoad", "core.bitop", "FNbNiNfPmZm")
64 DEF_D_BUILTIN (VSTORE
, VSTORE
, "volatileStore", "core.bitop", "FNbNiNfPhhZv")
65 DEF_D_BUILTIN (VSTORE16
, VSTORE
, "volatileStore", "core.bitop", "FNbNiNfPttZv")
66 DEF_D_BUILTIN (VSTORE32
, VSTORE
, "volatileStore", "core.bitop", "FNbNiNfPkkZv")
67 DEF_D_BUILTIN (VSTORE64
, VSTORE
, "volatileStore", "core.bitop", "FNbNiNfPmmZv")
69 /* core.checkedint intrinsics.
*/
71 DEF_D_BUILTIN (ADDS
, ADDS
, "adds", "core.checkedint", "FNaNbNiNfiiKbZi")
72 DEF_D_BUILTIN (ADDSL
, ADDS
, "adds", "core.checkedint", "FNaNbNiNfllKbZl")
73 DEF_D_BUILTIN (ADDU
, ADDS
, "addu", "core.checkedint", "FNaNbNiNfkkKbZk")
74 DEF_D_BUILTIN (ADDUL
, ADDS
, "addu", "core.checkedint", "FNaNbNiNfmmKbZm")
75 DEF_D_BUILTIN (SUBS
, SUBS
, "subs", "core.checkedint", "FNaNbNiNfiiKbZi")
76 DEF_D_BUILTIN (SUBSL
, SUBS
, "subs", "core.checkedint", "FNaNbNiNfllKbZl")
77 DEF_D_BUILTIN (SUBU
, SUBS
, "subu", "core.checkedint", "FNaNbNiNfkkKbZk")
78 DEF_D_BUILTIN (SUBUL
, SUBS
, "subu", "core.checkedint", "FNaNbNiNfmmKbZm")
79 DEF_D_BUILTIN (MULS
, MULS
, "muls", "core.checkedint", "FNaNbNiNfiiKbZi")
80 DEF_D_BUILTIN (MULSL
, MULS
, "muls", "core.checkedint", "FNaNbNiNfllKbZl")
81 DEF_D_BUILTIN (MULU
, MULS
, "mulu", "core.checkedint", "FNaNbNiNfkkKbZk")
82 DEF_D_BUILTIN (MULUI
, MULS
, "mulu", "core.checkedint", "FNaNbNiNfmkKbZm")
83 DEF_D_BUILTIN (MULUL
, MULS
, "mulu", "core.checkedint", "FNaNbNiNfmmKbZm")
84 DEF_D_BUILTIN (NEGS
, NEGS
, "negs", "core.checkedint", "FNaNbNiNfiKbZi")
85 DEF_D_BUILTIN (NEGSL
, NEGS
, "negs", "core.checkedint", "FNaNbNiNflKbZl")
87 /* core.math intrinsics.
*/
89 DEF_D_BUILTIN (COS
, COS
, "cos", "core.math", "FNaNbNiNfeZe")
90 DEF_D_BUILTIN (FABS
, FABS
, "fabs", "core.math", "FNaNbNiNfeZe")
91 DEF_D_BUILTIN (LDEXP
, LDEXP
, "ldexp", "core.math", "FNaNbNiNfeiZe")
92 DEF_D_BUILTIN (RINT
, RINT
, "rint", "core.math", "FNaNbNiNfeZe")
93 DEF_D_BUILTIN (RNDTOL
, RNDTOL
, "rndtol", "core.math", "FNaNbNiNfeZl")
94 DEF_D_BUILTIN (SIN
, SIN
, "sin", "core.math", "FNaNbNiNfeZe")
95 DEF_D_BUILTIN (SQRTF
, SQRTF
, "sqrt", "core.math", "FNaNbNiNffZf")
96 DEF_D_BUILTIN (SQRT
, SQRT
, "sqrt", "core.math", "FNaNbNiNfdZd")
97 DEF_D_BUILTIN (SQRTL
, SQRTL
, "sqrt", "core.math", "FNaNbNiNfeZe")
99 /* std.math intrinsics.
*/
101 DEF_D_BUILTIN (STD_COS
, COS
, "cos", "std.math", "FNaNbNiNfeZe")
102 DEF_D_BUILTIN (STD_FABS
, FABS
, "fabs", "std.math", "FNaNbNiNfeZe")
103 DEF_D_BUILTIN (STD_LDEXP
, LDEXP
, "ldexp", "std.math", "FNaNbNiNfeiZe")
104 DEF_D_BUILTIN (STD_RINT
, RINT
, "rint", "std.math", "FNaNbNiNfeZe")
105 DEF_D_BUILTIN (STD_RNDTOL
, RNDTOL
, "rndtol", "std.math", "FNaNbNiNfeZl")
106 DEF_D_BUILTIN (STD_SIN
, SIN
, "sin", "std.math", "FNaNbNiNfeZe")
107 DEF_D_BUILTIN (STD_SQRTF
, SQRTF
, "sqrt", "std.math", "FNaNbNiNffZf")
108 DEF_D_BUILTIN (STD_SQRT
, SQRT
, "sqrt", "std.math", "FNaNbNiNfdZd")
109 DEF_D_BUILTIN (STD_SQRTL
, SQRTL
, "sqrt", "std.math", "FNaNbNiNfeZe")
111 DEF_CTFE_BUILTIN (TAN
, TAN
, "tan", "std.math", "FNaNbNiNeeZe")
112 DEF_CTFE_BUILTIN (ISNAN
, ISNAN
, "isNaN", "std.math", "FNaNbNiNeI1XZb")
113 DEF_CTFE_BUILTIN (ISINFINITY
, ISINFINITY
, "isInfinity", "std.math",
115 DEF_CTFE_BUILTIN (ISFINITE
, ISFINITE
, "isFinite", "std.math", "FNaNbNiNeI1XZb")
117 DEF_CTFE_BUILTIN (EXP
, EXP
, "exp", "std.math", "FNaNbNiNeeZe")
118 DEF_CTFE_BUILTIN (EXPM1
, EXPM1
, "expm1", "std.math", "FNaNbNiNeeZe")
119 DEF_CTFE_BUILTIN (EXP2
, EXP2
, "exp2", "std.math", "FNaNbNiNeeZe")
121 DEF_CTFE_BUILTIN (LOG
, LOG
, "log", "std.math", "FNaNbNiNfeZe")
122 DEF_CTFE_BUILTIN (LOG2
, LOG2
, "log2", "std.math", "FNaNbNiNfeZe")
123 DEF_CTFE_BUILTIN (LOG10
, LOG10
, "log10", "std.math", "FNaNbNiNfeZe")
125 DEF_CTFE_BUILTIN (ROUND
, ROUND
, "round", "std.math", "FNbNiNeeZe")
126 DEF_CTFE_BUILTIN (FLOORF
, FLOORF
, "floor", "std.math", "FNaNbNiNefZf")
127 DEF_CTFE_BUILTIN (FLOOR
, FLOOR
, "floor", "std.math", "FNaNbNiNedZd")
128 DEF_CTFE_BUILTIN (FLOORL
, FLOORL
, "floor", "std.math", "FNaNbNiNeeZe")
129 DEF_CTFE_BUILTIN (CEILF
, CEILF
, "ceil", "std.math", "FNaNbNiNefZf")
130 DEF_CTFE_BUILTIN (CEIL
, CEIL
, "ceil", "std.math", "FNaNbNiNedZd")
131 DEF_CTFE_BUILTIN (CEILL
, CEILL
, "ceil", "std.math", "FNaNbNiNeeZe")
133 DEF_CTFE_BUILTIN (TRUNC, TRUNC, "trunc", "std.math", "FNbNiNeeZe")
134 DEF_CTFE_BUILTIN (FMIN
, FMIN
, "fmin", "std.math", "FNaNbNiNfeeZe")
135 DEF_CTFE_BUILTIN (FMAX
, FMAX
, "fmax", "std.math", "FNaNbNiNfeeZe")
136 DEF_CTFE_BUILTIN (COPYSIGN
, COPYSIGN
, "copysign", "std.math",
137 "FNaNbNiNeI1RI1XZI1R")
138 DEF_CTFE_BUILTIN (COPYSIGNI
, COPYSIGN
, "copysign", "std.math",
139 "FNaNbNiNeI1XI1RZI1R")
141 DEF_CTFE_BUILTIN (POW
, POW
, "pow", "std.math", "FNaNbNiNeI1FI1GZ@")
142 DEF_CTFE_BUILTIN (FMA
, FMA
, "fma", "std.math", "FNaNbNiNfeeeZe")
144 /* core.stdc.stdarg intrinsics.
*/
146 DEF_D_BUILTIN (VA_ARG
, VA_ARG
, "va_arg", "core.stdc.stdarg",
148 DEF_D_BUILTIN (C_VA_ARG
, C_VA_ARG
, "va_arg", "core.stdc.stdarg",
150 DEF_D_BUILTIN (VASTART
, VASTART
, "va_start", "core.stdc.stdarg",
154 #undef DEF_CTFE_BUILTIN