codegen: introduce gen_mov and use it instead of explicit coding
[ajla.git] / asm-1.inc
blob0a32416a5d4aec7225223d22f0d0b2d3d249ee68
1 /*
2  * Copyright (C) 2024 Mikulas Patocka
3  *
4  * This file is part of Ajla.
5  *
6  * Ajla is free software: you can redistribute it and/or modify it under the
7  * terms of the GNU General Public License as published by the Free Software
8  * Foundation, either version 3 of the License, or (at your option) any later
9  * version.
10  *
11  * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13  * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * Ajla. If not, see <https://www.gnu.org/licenses/>.
17  */
19 #ifdef ASM_INC_ENUM
20         cat(CPU_FEATURE_,feature_name),
21 #endif
22 #ifdef ASM_INC_NAMES
23         stringify(feature_name),
24 #endif
25 #ifdef ASM_INC_STATIC
26 #if cat(static_test_,feature_name)
27         | (1 << cat(CPU_FEATURE_,feature_name))
28 #else
29         | 0
30 #endif
31 #endif
32 #ifdef ASM_INC_DYNAMIC
33         if (likely(dynamic_test != 0))
34                 cpu_feature_flags |= 1U << cat(CPU_FEATURE_,feature_name);
35 #endif
37 #undef feature_name
38 #undef dynamic_test