summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjon <jonrevold@gmail.com>2020-04-08 11:56:32 +0200
committerjon <jonrevold@gmail.com>2020-04-08 11:56:32 +0200
commitcc43d1b239570a32ef2a3f4eb40bf9fbad9c3c52 (patch)
treef72374dc5bcba2935c38bebdf638cca2af9cc099
parentbecba8a6ce4f06849d507a87006d1f2dad5bc741 (diff)
downloadct_sequence-cc43d1b239570a32ef2a3f4eb40bf9fbad9c3c52.tar.gz
voRK
-rw-r--r--makefile2
-rw-r--r--src/a3.c30
2 files changed, 27 insertions, 5 deletions
diff --git a/makefile b/makefile
index 3423546..ed04db5 100644
--- a/makefile
+++ b/makefile
@@ -8,7 +8,7 @@ lib_dir := lib
src_dir := src
CFLAGS := -std=c11 -fdata-sections -ffunction-sections -D_POSIX_C_SOURCE=200809L
-CFLAGS += -pedantic -Wall -Wextra -Wcast-qual -Wstrict-aliasing -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wvla -Wno-parentheses -Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -Wno-unused-label
+CFLAGS += -pedantic -Wall -Wextra -Wcast-qual -Wstrict-aliasing -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wvla -Wno-parentheses -Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -Wno-unused-label -Wno-format
LDFLAGS := -Wl,--gc-sections
LDLIBS :=
ARFLAGS := -rcs
diff --git a/src/a3.c b/src/a3.c
index 265b0de..1cfe7c1 100644
--- a/src/a3.c
+++ b/src/a3.c
@@ -28,7 +28,7 @@ static uint8_t *m;
static uint8_t *m_32ik; //TMP
static size_t m24_n;
static size_t m32_n;
-static size_t m32_off;
+static uint32_t m32_off;
static void inner (uint32_t x);
static void inner_bias(uint32_t x);
@@ -92,6 +92,7 @@ static void inner(uint32_t x){
}
static void inner_bias(uint32_t x){
+ /*
uint32_t r;
//if(t >= CROSSOVER){
@@ -112,11 +113,32 @@ static void inner_bias(uint32_t x){
memcpy(p,&x,M24_SIZE);
t = (x-r) & 0x00FFFFFF;
}
+ */
+
+ uint32_t r;
+ uint8_t *p;
+ uint32_t m_sel;
+ uint32_t m_size;
+ uint32_t m_off;
+ uint32_t r_zero;
+ uint32_t t_mask;
+
+ m_sel = ((int32_t)t-CROSSOVER)>>31; //FFFFetc.. if t < CROSSOVER
+ m_size = (m_sel & M24_SIZE) | (~m_sel & M32_SIZE);
+ m_off = ~m_sel & m32_off;
+ m_off += m_size*t;
+ p = m+m_off;
+ r = 0;
+
+ //TODO: get rid of memcpy
+ memcpy(r,p,m_size);
+ memcpy(p,&x,m_size);
+
+ t_mask = 0x00FFFFFF | ~m_sel;
+ r_zero = ((int32_t)r-1)>>31;
- return;
- uint32_t c24;
+
- c24 = ((int32_t)t-CROSSOVER)>>31; //FFFFetc.. if t < CROSSOVER
}