@@ -20,19 +20,17 @@
/* Pairs of instructions which can be fused. before including this file,
define a macro:
- AARCH64_FUSION_PAIR (name, internal_name, index_bit)
+ AARCH64_FUSION_PAIR (name, internal_name)
Where:
NAME is a string giving a friendly name for the instructions to fuse.
INTERNAL_NAME gives the internal name suitable for appending to
- AARCH64_FUSE_ to give an enum name.
- INDEX_BIT is the bit to set in the bitmask of supported fusion
- operations. */
-
-AARCH64_FUSION_PAIR ("mov+movk", MOV_MOVK, 0)
-AARCH64_FUSION_PAIR ("adrp+add", ADRP_ADD, 1)
-AARCH64_FUSION_PAIR ("movk+movk", MOVK_MOVK, 2)
-AARCH64_FUSION_PAIR ("adrp+ldr", ADRP_LDR, 3)
-AARCH64_FUSION_PAIR ("cmp+branch", CMP_BRANCH, 4)
+ AARCH64_FUSE_ to give an enum name. */
+
+AARCH64_FUSION_PAIR ("mov+movk", MOV_MOVK)
+AARCH64_FUSION_PAIR ("adrp+add", ADRP_ADD)
+AARCH64_FUSION_PAIR ("movk+movk", MOVK_MOVK)
+AARCH64_FUSION_PAIR ("adrp+ldr", ADRP_LDR)
+AARCH64_FUSION_PAIR ("cmp+branch", CMP_BRANCH)
@@ -201,23 +201,24 @@ struct tune_params
unsigned int extra_tuning_flags;
};
-#define AARCH64_FUSION_PAIR(x, name, index) \
- AARCH64_FUSE_##name = (1 << index),
+#define AARCH64_FUSION_PAIR(x, name) \
+ AARCH64_FUSE_##name##_index,
/* Supported fusion operations. */
-enum aarch64_fusion_pairs
+enum aarch64_fusion_pairs_index
{
- AARCH64_FUSE_NOTHING = 0,
#include "aarch64-fusion-pairs.def"
-
-/* Hacky macro to build AARCH64_FUSE_ALL. The sequence below expands
- to:
- AARCH64_FUSE_ALL = 0 | AARCH64_FUSE_index1 | AARCH64_FUSE_index2 ... */
+ AARCH64_FUSE_index_END
+};
#undef AARCH64_FUSION_PAIR
-#define AARCH64_FUSION_PAIR(x, name, y) \
- | AARCH64_FUSE_##name
- AARCH64_FUSE_ALL = 0
+#define AARCH64_FUSION_PAIR(x, name) \
+ AARCH64_FUSE_##name = (1u << AARCH64_FUSE_##name##_index),
+/* Supported fusion operations. */
+enum aarch64_fusion_pairs
+{
+ AARCH64_FUSE_NOTHING = 0,
#include "aarch64-fusion-pairs.def"
+ AARCH64_FUSE_ALL = (1u << AARCH64_FUSE_index_END) - 1
};
#undef AARCH64_FUSION_PAIR
@@ -172,7 +172,7 @@ struct aarch64_flag_desc
unsigned int flag;
};
-#define AARCH64_FUSION_PAIR(name, internal_name, y) \
+#define AARCH64_FUSION_PAIR(name, internal_name) \
{ name, AARCH64_FUSE_##internal_name },
static const struct aarch64_flag_desc aarch64_fusible_pairs[] =
{