aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-02 02:00:09 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-02 02:19:50 -0500
commit431d8a2ca40e21b1f0ff61b6283e57fe32e12168 (patch)
treef5311e79adf8e23c5340be6375a0984881bdc7ea /sim/ppc
parent5f7e03a6bb13bc14be42297d9fc798d01c0a47f0 (diff)
downloadfsf-binutils-gdb-431d8a2ca40e21b1f0ff61b6283e57fe32e12168.zip
fsf-binutils-gdb-431d8a2ca40e21b1f0ff61b6283e57fe32e12168.tar.gz
fsf-binutils-gdb-431d8a2ca40e21b1f0ff61b6283e57fe32e12168.tar.bz2
sim: ppc: hoist igen execution to top-level
Invoke ppc's igen from the top-level like we do for all other ports.
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/Makefile.in63
-rw-r--r--sim/ppc/local.mk63
2 files changed, 64 insertions, 62 deletions
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 220e4b8..5717ddc 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -86,29 +86,6 @@ NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(INCLUDES) $(SIM_FP
LIBS = $(COMMON_LIBS) @LIBS@ $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
-IGEN_OPCODE_RULES = @sim_ppc_opcode@
-IGEN_DECODE_MECHANISM = @sim_ppc_decode_mechanism@
-IGEN_DUPLICATE = @sim_ppc_dup@
-IGEN_JUMP = @sim_ppc_jump@
-IGEN_FILTER = @sim_ppc_filter@
-IGEN_ICACHE = @sim_ppc_icache@
-IGEN_SMP = @sim_ppc_igen_smp@
-IGEN_LINE_NR = @sim_ppc_line_nr@
-
-IGEN_FLAGS = \
- $(IGEN_DECODE_MECHANISM) \
- $(IGEN_DUPLICATE) \
- $(IGEN_JUMP) \
- $(IGEN_FILTER) \
- $(IGEN_ICACHE) \
- $(IGEN_SMP) \
- $(IGEN_LINE_NR)
-
-# igen leaks memory, and therefore makes AddressSanitizer unhappy. Disable
-# leak detection while running it.
-
-IGEN = ASAN_OPTIONS=detect_leaks=0 ./igen
-
.NOEXPORT:
MAKEOVERRIDES=
@@ -268,9 +245,6 @@ IDECODE_EXPRESSION_H = \
IDECODE_FIELDS_H = \
idecode_fields.h
-IGEN_H = \
- igen.h
-
INLINE_H = \
inline.h
@@ -388,13 +362,6 @@ INLINE = \
inline.c
BUILT_SRC_WO_CONFIG = \
- icache.h icache.c \
- support.h support.c \
- idecode.h idecode.c \
- semantics.h semantics.c \
- itable.h itable.c \
- model.h model.c \
- support.h support.c \
pk.h \
hw.h hw.c
@@ -489,7 +456,7 @@ PACKAGE_SRC = pk_disklabel.c
PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
-$(TARGETLIB): tmp-igen tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ)
+$(TARGETLIB): tmp-hw defines.h $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
@@ -560,33 +527,7 @@ sim-fpu.o: $(srcdir)/../common/sim-fpu.c
# Rebuild options whenever something changes so the date/time is up to date.
options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) ../config.status Makefile
- $(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_ppc_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' $(srcdir)/options.c
-
-#
-# Rules to create the built c source code files
-#
-
-tmp-igen: igen $(srcdir)/powerpc.igen $(srcdir)/altivec.igen $(srcdir)/e500.igen $(IGEN_OPCODE_RULES) $(srcroot)/move-if-change
- $(ECHO_GEN) $(IGEN) $(IGEN_FLAGS) \
- -o $(srcdir)/$(IGEN_OPCODE_RULES) \
- -I $(srcdir) -i $(srcdir)/powerpc.igen \
- -n icache.h -hc icache.h \
- -n icache.c -c icache.c \
- -n semantics.h -hs semantics.h \
- -n semantics.c -s semantics.c \
- -n idecode.h -hd idecode.h \
- -n idecode.c -d idecode.c \
- -n itable.h -ht itable.h \
- -n itable.c -t itable.c \
- -n model.h -hm model.h \
- -n model.c -m model.c \
- -n support.h -hf support.h \
- -n support.c -f support.c
- $(SILENCE) touch $@
-
-$(TARGETLIB): tmp-igen
-itable.h itable.c icache.h icache.c idecode.h idecode.c semantics.h semantics.c model.h model.c support.h support.c: tmp-igen
-
+ $(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_ppc_opcode@"' '-DIGEN_FLAGS="$(ppc_IGEN_FLAGS)"' $(srcdir)/options.c
# real hardware
hw.c hw.h: tmp-hw; @true
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index e2d6197..8b5a165 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -74,9 +74,68 @@ EXTRA_LIBRARIES += %D%/libigen.a
%C%_igen_SOURCES = %D%/igen.c
%C%_igen_LDADD = %D%/libigen.a
+# igen leaks memory, and therefore makes AddressSanitizer unhappy. Disable
+# leak detection while running it.
PPC_IGEN = %D%/igen$(EXEEXT)
+PPC_IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(PPC_IGEN) $(%C%_IGEN_FLAGS)
+
+%C%_IGEN_FLAGS = \
+ @sim_ppc_decode_mechanism@ \
+ @sim_ppc_dup@ \
+ @sim_ppc_jump@ \
+ @sim_ppc_filter@ \
+ @sim_ppc_icache@ \
+ @sim_ppc_igen_smp@ \
+ @sim_ppc_line_nr@
+
+## List all generated headers to help Automake dependency tracking.
+BUILT_SOURCES += \
+ %D%/icache.h \
+ %D%/idecode.h \
+ %D%/semantics.h \
+ %D%/model.h \
+ %D%/support.h \
+ %D%/itable.h
+%C%_BUILT_SRC_FROM_IGEN = \
+ %D%/icache.h \
+ %D%/icache.c \
+ %D%/idecode.h \
+ %D%/idecode.c \
+ %D%/semantics.h \
+ %D%/semantics.c \
+ %D%/model.h \
+ %D%/model.c \
+ %D%/support.h \
+ %D%/support.c \
+ %D%/itable.h \
+ %D%/itable.c
+%C%_BUILD_OUTPUTS = \
+ $(%C%_BUILT_SRC_FROM_IGEN) \
+ %D%/stamp-igen
+
+SIM_ALL_RECURSIVE_DEPS += %D%/stamp-igen
+$(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen
+
+%C%_IGEN_OPCODE_RULES = %D%/@sim_ppc_opcode@
+%D%/stamp-igen: %D%/powerpc.igen %D%/altivec.igen %D%/e500.igen $(%C%_IGEN_OPCODE_RULES) $(PPC_IGEN)
+ $(AM_V_GEN)$(PPC_IGEN_RUN) \
+ -o $(srcdir)/$(%C%_IGEN_OPCODE_RULES) \
+ -I $(srcdir)/%D% -i $(srcdir)/%D%/powerpc.igen \
+ -n icache.h -hc %D%/icache.h \
+ -n icache.c -c %D%/icache.c \
+ -n semantics.h -hs %D%/semantics.h \
+ -n semantics.c -s %D%/semantics.c \
+ -n idecode.h -hd %D%/idecode.h \
+ -n idecode.c -d %D%/idecode.c \
+ -n itable.h -ht %D%/itable.h \
+ -n itable.c -t %D%/itable.c \
+ -n model.h -hm %D%/model.h \
+ -n model.c -m %D%/model.c \
+ -n support.h -hf %D%/support.h \
+ -n support.c -f %D%/support.c
+ $(AM_V_at)touch $@
-SIM_ALL_RECURSIVE_DEPS += $(PPC_IGEN)
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
## These rules are copied from automake, but tweaked to use FOR_BUILD variables.
%D%/libigen.a: $(%C%_libigen_a_OBJECTS) $(%C%_libigen_a_DEPENDENCIES) $(EXTRA_%C%_libigen_a_DEPENDENCIES) %D%/$(am__dirstamp)
@@ -116,5 +175,7 @@ $(%C%_libigen_a_OBJECTS) $(%C%_igen_OBJECTS): %D%/%.o: %D%/%.c
EXTRA_PROGRAMS += $(%C%_IGEN_TOOLS)
MOSTLYCLEANFILES += $(%C%_IGEN_TOOLS) %D%/libigen.a
+IGEN_OPCODE_RULES = @sim_ppc_opcode@
+
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN