Skip to content

Commit

Permalink
Add old-style inference rules for expr and tile lists
Browse files Browse the repository at this point in the history
Especially for expr lists this is interesting because we want to support
per-REPR templates, and that has just become a bit easier to build.
  • Loading branch information
bdw committed Aug 31, 2017
1 parent 2100f25 commit 892f1ff
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jit-*.bin
# dynasm emitted files
src/jit/x64/emit.c
# jit expression table file
src/jit/core_expr_tables.h
src/jit/x64/tile_tables.h
src/jit/core_templates.h
src/jit/x64/tile_pattern.h

# generated code
tools/lib/MAST/Ops.pm
Expand Down
24 changes: 15 additions & 9 deletions build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ DYNASM = $(MINILUA) 3rdparty/dynasm/dynasm.lua
DYNASM_SCRIPTS = 3rdparty/dynasm/dynasm.lua 3rdparty/dynasm/dasm_x86.lua
DYNASM_HEADERS = 3rdparty/dynasm/dasm_proto.h 3rdparty/dynasm/dasm_x86.h

.SUFFIXES: .c @obj@ .i @asm@ .dasc
.SUFFIXES: .c @obj@ .i @asm@ .dasc .expr .tile

all: moar@exe@ pkgconfig/moar.pc

Expand Down Expand Up @@ -579,24 +579,30 @@ $(MINILUA): 3rdparty/dynasm/minilua.c
$(CC) $(CFLAGS) $(LDFLAGS) 3rdparty/dynasm/minilua.c -o $@ $(LDLIBS)

.dasc.c:
$(MSG) preprocessing $@
$(MSG) preprocessing $<
$(CMD)$(DYNASM) $(DASM_FLAGS) -o $@ $<

.expr.h:
$(MSG) Precompiling templates from $<
$(CMD)$(PERL) -Itools/ tools/expr-template-compiler.pl -o $@ $<

.tile.h:
$(MSG) Building tile tables from $<
$(CMD)$(PERL) -Itools/ tools/tiler-table-generator.pl -o $@ $<

src/jit/x64/emit@obj@: src/jit/x64/emit.c $(DYNASM_HEADERS)

src/jit/x64/emit.c: src/jit/x64/emit.dasc src/jit/x64/tiles.dasc $(MINILUA) $(DYNASM_SCRIPTS)

# Expression list tables
src/jit/core_expr_tables.h: src/jit/core.expr src/jit/macro.expr tools/expr-template-compiler.pl src/core/oplist src/jit/expr_ops.h
$(PERL) -Itools/ tools/expr-template-compiler.pl -o $@ src/jit/core.expr
src/jit/core_templates.h: src/jit/core_templates.expr src/jit/macro.expr tools/expr-template-compiler.pl src/core/oplist src/jit/expr_ops.h

# Architecture-specific tiles
src/jit/x64/tile_tables.h: src/jit/x64/tiles.list tools/tiler-table-generator.pl src/jit/expr_ops.h
$(PERL) -Itools/ tools/tiler-table-generator.pl -o $@ src/jit/x64/tiles.list
src/jit/x64/tile_pattern.h: src/jit/x64/tile_pattern.tile tools/tiler-table-generator.pl src/jit/expr_ops.h

src/jit/expr@obj@: src/jit/core_templates.h
src/jit/tile@obj@: src/jit/x64/tile_pattern.h src/jit/x64/tile_decl.h

src/jit/expr@obj@: src/jit/core_expr_tables.h
# TODO-fix stub
src/jit/tile@obj@: src/jit/x64/tile_tables.h
src/jit/compile@obj@ src/jit/linear_scan@obj@ src/jit/x64/arch@obj@ @jit_obj@: src/jit/internal.h src/jit/x64/arch.h


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/jit/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define MSG(...) CONST_PTR(#__VA_ARGS__)
#define SIZEOF_MEMBER(type, member) sizeof(((type*)0)->member)

#include "core_expr_tables.h"
#include "jit/core_templates.h"


static const MVMJitExprOpInfo expr_op_info[] = {
Expand Down
4 changes: 2 additions & 2 deletions src/jit/tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <math.h>

#if MVM_JIT_ARCH == MVM_JIT_ARCH_X64
#include "x64/tile_decl.h"
#include "x64/tile_tables.h"
#include "jit/x64/tile_decl.h"
#include "jit/x64/tile_pattern.h"
#endif


Expand Down
File renamed without changes.

0 comments on commit 892f1ff

Please sign in to comment.