Commit 7481767e authored by nagayama15's avatar nagayama15

ベンチマーク用プログラムを4種類用意

parent f5292cf0
...@@ -37,36 +37,55 @@ SRCS := \ ...@@ -37,36 +37,55 @@ SRCS := \
zlib/zutil.c zlib/zutil.c
OBJS := ${SRCS:zlib/%.c=${OBJ_DIR}/zlib/%.o} OBJS := ${SRCS:zlib/%.c=${OBJ_DIR}/zlib/%.o}
OBJS_BWM := ${SRCS:zlib/%.c=${OBJ_DIR}/zlib-block-wm/%.o}
OBJS_IWM := ${SRCS:zlib/%.c=${OBJ_DIR}/zlib-inst-wm/%.o}
OBJS_WM := ${SRCS:zlib/%.c=${OBJ_DIR}/zlib-wm/%.o} OBJS_WM := ${SRCS:zlib/%.c=${OBJ_DIR}/zlib-wm/%.o}
.PHONY: all test .PHONY: all test
all: \ all: \
${BIN_DIR}/libz.a \
${BIN_DIR}/libz-wm.a \
${BIN_DIR}/test \ ${BIN_DIR}/test \
${BIN_DIR}/test-block-wm \
${BIN_DIR}/test-inst-wm \
${BIN_DIR}/test-wm ${BIN_DIR}/test-wm
test: \ test: \
${BIN_DIR}/libz.a \
${BIN_DIR}/libz-wm.a \
${BIN_DIR}/test \ ${BIN_DIR}/test \
${BIN_DIR}/test-block-wm \
${BIN_DIR}/test-inst-wm \
${BIN_DIR}/test-wm ${BIN_DIR}/test-wm
${BIN_DIR}/libz.a: ${OBJS} ${BIN_DIR}/libz.a: ${OBJS}
${BIN_DIR}/libz-block-wm.a: ${OBJS_BWM}
${BIN_DIR}/libz-inst-wm.a: ${OBJS_IWM}
${BIN_DIR}/libz-wm.a: ${OBJS_WM} ${BIN_DIR}/libz-wm.a: ${OBJS_WM}
${BIN_DIR}/test: ${OBJ_DIR}/test.o ${BIN_DIR}/libz.a ${BIN_DIR}/test: ${OBJ_DIR}/test.o ${BIN_DIR}/libz.a
${BIN_DIR}/test-block-wm: ${OBJ_DIR}/test.o ${BIN_DIR}/libz-block-wm.a
${BIN_DIR}/test-inst-wm: ${OBJ_DIR}/test.o ${BIN_DIR}/libz-inst-wm.a
${BIN_DIR}/test-wm: ${OBJ_DIR}/test.o ${BIN_DIR}/libz-wm.a ${BIN_DIR}/test-wm: ${OBJ_DIR}/test.o ${BIN_DIR}/libz-wm.a
${OBJ_DIR}/zlib/%.o: zlib/%.c ${OBJ_DIR}/zlib/%.o: zlib/%.c
@mkdir -p ${@D} @mkdir -p ${@D}
${CC} ${CFLAGS} -o $@ -c $< ${CC} ${CFLAGS} -o $@ -c $<
${OBJ_DIR}/zlib-wm/%.o: zlib/%.c ${OBJ_DIR}/zlib-block-wm/%.o: zlib/%.c
@mkdir -p ${@D} @mkdir -p ${@D}
clang ${CFLAGS} -emit-llvm -S -o ${@:.o=.ll} $< clang ${CFLAGS} -emit-llvm -S -o ${@:.o=.ll} $<
opt -load=${ROOT}/bin/src/nykk.so -block-wm -watermark=${WATERMARK} -S -o ${@:%.o=%-block-wm.ll} ${@:.o=.ll} 2> ${@:%.o=%-block-wm.txt} opt -load=${ROOT}/bin/src/nykk.so -block-wm -watermark=${WATERMARK} -S -o ${@:%.o=%-block-wm.ll} ${@:.o=.ll} 2> ${@:%.o=%-block-wm.txt}
opt -load=${ROOT}/bin/src/nykk.so -inst-wm -watermark=${WATERMARK} -S -o ${@:%.o=%-inst-wm.ll} ${@:.o=-block-wm.ll} 2> ${@:%.o=%-inst-wm.txt} clang ${CFLAGS} -o $@ -c ${@:%.o=%-block-wm.ll}
${OBJ_DIR}/zlib-inst-wm/%.o: zlib/%.c
@mkdir -p ${@D}
clang ${CFLAGS} -emit-llvm -S -o ${@:.o=.ll} $<
opt -load=${ROOT}/bin/src/nykk.so -inst-wm -watermark=${WATERMARK} -S -o ${@:%.o=%-inst-wm.ll} ${@:.o=.ll} 2> ${@:%.o=%-inst-wm.txt}
clang ${CFLAGS} -o $@ -c ${@:%.o=%-inst-wm.ll}
${OBJ_DIR}/zlib-wm/%.o: zlib/%.c
@mkdir -p ${@D}
clang ${CFLAGS} -emit-llvm -S -o ${@:.o=.ll} $<
opt -load=${ROOT}/bin/src/nykk.so -block-wm -watermark=${WATERMARK} -S -o ${@:%.o=%-block-wm.ll} ${@:.o=.ll} 2> /dev/null
opt -load=${ROOT}/bin/src/nykk.so -inst-wm -watermark=${WATERMARK} -S -o ${@:%.o=%-inst-wm.ll} ${@:.o=-block-wm.ll} 2> /dev/null
clang ${CFLAGS} -o $@ -c ${@:%.o=%-inst-wm.ll} clang ${CFLAGS} -o $@ -c ${@:%.o=%-inst-wm.ll}
${OBJ_DIR}/test.o: test.cpp ${OBJ_DIR}/test.o: test.cpp
...@@ -75,6 +94,12 @@ ${OBJ_DIR}/test.o: test.cpp ...@@ -75,6 +94,12 @@ ${OBJ_DIR}/test.o: test.cpp
${BIN_DIR}/test: ${BIN_DIR}/test:
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS} ${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
${BIN_DIR}/test-block-wm:
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
${BIN_DIR}/test-inst-wm:
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
${BIN_DIR}/test-wm: ${BIN_DIR}/test-wm:
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS} ${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
......
...@@ -45,7 +45,7 @@ h2() { ...@@ -45,7 +45,7 @@ h2() {
} }
h1 obj/example/8cc/stage1-wm/*-block-wm.txt h1 obj/example/8cc/stage1-wm/*-block-wm.txt
h1 obj/example/zlib/zlib-wm/*-block-wm.txt h1 obj/example/zlib/zlib-block-wm/*-block-wm.txt
h2 obj/example/8cc/stage1-wm/*-inst-wm.txt h2 obj/example/8cc/stage1-wm/*-inst-wm.txt
h2 obj/example/zlib/zlib-wm/*-inst-wm.txt h2 obj/example/zlib/zlib-inst-wm/*-inst-wm.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment