Browse Source

Use precompiled headers to speed up compilation

pull/2/head
Andrew Waterman 12 years ago
parent
commit
43615c60e7
  1. 1
      .gitignore
  2. 8
      Makefile.in
  3. 1
      hwacha/decode_hwacha.h
  4. 6
      hwacha/hwacha.mk.in
  5. 10
      hwacha/insn_template_hwacha.cc
  6. 5
      hwacha/insn_template_hwacha.h
  7. 11
      hwacha/insn_template_hwacha_ut.cc
  8. 6
      hwacha/insn_template_hwacha_ut.h
  9. 8
      riscv/insn_template.cc
  10. 5
      riscv/insn_template.h
  11. 4
      riscv/riscv.mk.in

1
.gitignore

@ -1,3 +1,4 @@
build/
*.gch
autom4te.cache/
.*.swp

8
Makefile.in

@ -184,16 +184,20 @@ _$(1).cc :
# Build the object files for this subproject
$(2)_pch := $$(patsubst %.h, %.h.gch, $$($(2)_precompiled_hdrs))
$(2)_objs := $$(patsubst %.cc, %.o, $$($(2)_srcs))
$(2)_c_objs := $$(patsubst %.c, %.o, $$($(2)_c_srcs))
$(2)_deps := $$(patsubst %.o, %.d, $$($(2)_objs))
$(2)_c_deps := $$(patsubst %.o, %.d, $$($(2)_c_objs))
$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs)
$$($(2)_pch) : %.h.gch : %.h
$(COMPILE) $$<
$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs) $$($(2)_pch)
$(COMPILE) -c $$<
$$($(2)_c_objs) : %.o : %.c $$($(2)_gen_hdrs)
$(COMPILE_C) -c $$<
$(2)_junk += $$($(2)_objs) $$($(2)_c_objs) $$($(2)_deps) $$($(2)_c_deps) $$($(2)_gen_hdrs)
$(2)_junk += $$(addprefix $(src_dir)/$(1)/, $$($(2)_pch)) \
$$($(2)_objs) $$($(2)_c_objs) $$($(2)_deps) $$($(2)_c_deps) $$($(2)_gen_hdrs)
# Reverse the dependency list so that a given subproject only depends on
# subprojects listed to its right. This is the correct order for linking

1
hwacha/decode_hwacha.h

@ -3,6 +3,7 @@
#include "hwacha.h"
#include "hwacha_xcpt.h"
#include "mmu.h"
#define XS1 (xs1)
#define XS2 (xs2)

6
hwacha/hwacha.mk.in

@ -11,6 +11,12 @@ hwacha_hdrs = \
decode_hwacha_ut.h \
opcodes_hwacha.h \
opcodes_hwacha_ut.h \
insn_template_hwacha.h \
insn_template_hwacha_ut.h \
hwacha_precompiled_hdrs = \
insn_template_hwacha.h \
insn_template_hwacha_ut.h \
hwacha_srcs = \
hwacha.cc \

10
hwacha/insn_template_hwacha.cc

@ -1,13 +1,5 @@
// See LICENSE for license details.
#include "config.h"
#include "processor.h"
#include "mmu.h"
#include "hwacha.h"
#include "decode_hwacha.h"
#include "encodings_hwacha.h"
#include "rocc.h"
#include <assert.h>
#include "insn_template_hwacha.h"
reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
{

5
hwacha/insn_template_hwacha.h

@ -0,0 +1,5 @@
#include "hwacha.h"
#include "decode_hwacha.h"
#include "encodings_hwacha.h"
#include "rocc.h"
#include <assert.h>

11
hwacha/insn_template_hwacha_ut.cc

@ -1,14 +1,5 @@
// See LICENSE for license details.
#include "config.h"
#include "processor.h"
#include "mmu.h"
#include "softfloat.h"
#include "platform.h" // softfloat isNaNF32UI, etc.
#include "internals.h" // ditto
#include "hwacha.h"
#include "decode_hwacha_ut.h"
#include <assert.h>
#include "insn_template_hwacha_ut.h"
reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
{

6
hwacha/insn_template_hwacha_ut.h

@ -0,0 +1,6 @@
#include "hwacha.h"
#include "decode_hwacha_ut.h"
#include "softfloat.h"
#include "platform.h" // softfloat isNaNF32UI, etc.
#include "internals.h" // ditto
#include <assert.h>

8
riscv/insn_template.cc

@ -1,12 +1,6 @@
// See LICENSE for license details.
#include "processor.h"
#include "config.h"
#include "mmu.h"
#include "softfloat.h"
#include "platform.h" // softfloat isNaNF32UI, etc.
#include "internals.h" // ditto
#include <assert.h>
#include "insn_template.h"
reg_t rv32_NAME(processor_t* p, insn_t insn, reg_t pc)
{

5
riscv/insn_template.h

@ -0,0 +1,5 @@
#include "mmu.h"
#include "softfloat.h"
#include "platform.h" // softfloat isNaNF32UI, etc.
#include "internals.h" // ditto
#include <assert.h>

4
riscv/riscv.mk.in

@ -20,6 +20,10 @@ riscv_hdrs = \
extension.h \
rocc.h \
dummy-rocc.h \
insn_template.h \
riscv_precompiled_hdrs = \
insn_template.h \
riscv_srcs = \
htif.cc \

Loading…
Cancel
Save