summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjon <jonrevold@gmail.com>2020-04-08 12:12:14 +0200
committerjon <jonrevold@gmail.com>2020-04-08 12:12:14 +0200
commitbc9bdda88b6b064d2377635c9d9151c905dc69f4 (patch)
tree7beb01f63b74c94e8a9f75599ecade4816acc749
parentcc43d1b239570a32ef2a3f4eb40bf9fbad9c3c52 (diff)
downloadct_sequence-bc9bdda88b6b064d2377635c9d9151c905dc69f4.tar.gz
vorks
-rw-r--r--src/a3.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/a3.c b/src/a3.c
index 1cfe7c1..cd5d879 100644
--- a/src/a3.c
+++ b/src/a3.c
@@ -120,8 +120,9 @@ static void inner_bias(uint32_t x){
uint32_t m_sel;
uint32_t m_size;
uint32_t m_off;
- uint32_t r_zero;
- uint32_t t_mask;
+ uint32_t tmask;
+ uint32_t rnzero;
+ uint32_t rxdiff;
m_sel = ((int32_t)t-CROSSOVER)>>31; //FFFFetc.. if t < CROSSOVER
m_size = (m_sel & M24_SIZE) | (~m_sel & M32_SIZE);
@@ -131,11 +132,16 @@ static void inner_bias(uint32_t x){
r = 0;
//TODO: get rid of memcpy
- memcpy(r,p,m_size);
+ memcpy(&r,p,m_size);
memcpy(p,&x,m_size);
- t_mask = 0x00FFFFFF | ~m_sel;
- r_zero = ((int32_t)r-1)>>31;
+ tmask = 0x00FFFFFF | ~m_sel;
+ rnzero = (-(int32_t)r)>>31; //FFFFetc.. if r != 0
+ rxdiff = x-r;
+ rxdiff &= tmask;
+ rxdiff &= m_sel | rnzero; //clear rxdiff if t >= CROSSOVER and r == 0
+ t = rxdiff;
+