From 95c08c59e7a95b819de9206c038fe34e4b28afec Mon Sep 17 00:00:00 2001 From: Avril Date: Thu, 2 Dec 2021 23:31:01 +0000 Subject: [PATCH] day2: start part2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for day2's current commit: Small blessing − 小吉 --- day2/Makefile | 3 +-- day2/include/result.h | 3 +++ day2/src/p1.c | 13 +++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/day2/Makefile b/day2/Makefile index fa5f0cf..125d6f4 100644 --- a/day2/Makefile +++ b/day2/Makefile @@ -14,8 +14,7 @@ INPUT_DEST=src/input.c COMMON_FLAGS+= -W -Wall -fno-strict-aliasing $(addprefix -I,$(INCLUDE)) COMMON_FLAGS+=-msse -msse2 -msse3 -COMMON_FLAGS+=-D_PART1 -#-D_PART2 +COMMON_FLAGS+=-D_PART1 -D_PART2 OPT_FLAGS?= -march=native -fgraphite -fopenmp -floop-parallelize-all -ftree-parallelize-loops=4 \ -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block \ diff --git a/day2/include/result.h b/day2/include/result.h index 5fb5e72..c95f2ae 100644 --- a/day2/include/result.h +++ b/day2/include/result.h @@ -11,6 +11,9 @@ typedef int64_t result_t; #define SUM_FIELDS 3 +// Processing for p1 and p2, will be defined in p1.c, and maybe p2.c? +struct proc; + struct psum { union { struct { result_t forward, up, down; }; diff --git a/day2/src/p1.c b/day2/src/p1.c index 3158bee..b1b2a52 100644 --- a/day2/src/p1.c +++ b/day2/src/p1.c @@ -10,10 +10,15 @@ #define RIMAX_STR (64 - sizeof(size_t)) struct proc { - result_t mv; - off_t field; - -// void* jmp; + union { + struct { + result_t mv; + off_t field; + }; + struct { + //TODO: part2 shit + } aimed; + }; }; #define _LIT_MV_FORWARD "forward"