util: Add a helpful macro for merging two tokens to m5ops.h.
authorGabe Black <gabeblack@google.com>
Fri, 27 Mar 2020 08:46:11 +0000 (01:46 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 28 Apr 2020 01:07:43 +0000 (01:07 +0000)
I've needed this type of macro often when writing code which uses the
M5OP_FOREACH macro, and so rather than re-write it each time, lets just
put a version here. This is such a common type of macro to need that
you'd think it would be part of a standard header somewhere, but to my
knowledge it isn't.

Change-Id: I0df0d9d2fd7ce1b9e6c355d6e4db197ccfff7c35
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27239
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
include/gem5/asm/generic/m5ops.h

index fc56e595941dd1146859a50edecde7aff03ec691..f1755961f0f4a1353c8df68821ae11856d5b7ff9 100644 (file)
     M5OP(m5_se_page_fault, M5OP_SE_PAGE_FAULT)                  \
     M5OP(m5_dist_toggle_sync, M5OP_DIST_TOGGLE_SYNC)
 
+#define M5OP_MERGE_TOKENS_I(a, b) a##b
+#define M5OP_MERGE_TOKENS(a, b) M5OP_MERGE_TOKENS_I(a, b)
+
 #endif //  __GEM5_ASM_GENERIC_M5OPS_H__