summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjon <jonrevold@gmail.com>2020-04-08 12:29:09 +0200
committerjon <jonrevold@gmail.com>2020-04-08 12:29:09 +0200
commit210211835da283462f8fab553dee47f40ee612d4 (patch)
tree7db9caf266240c898a427729dde6af72cc2abbbe
parentbc9bdda88b6b064d2377635c9d9151c905dc69f4 (diff)
downloadct_sequence-210211835da283462f8fab553dee47f40ee612d4.tar.gz
vorkk
-rw-r--r--src/a3.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/a3.c b/src/a3.c
index cd5d879..ed76211 100644
--- a/src/a3.c
+++ b/src/a3.c
@@ -116,15 +116,17 @@ static void inner_bias(uint32_t x){
*/
uint32_t r;
+ uint32_t i;
uint8_t *p;
uint32_t m_sel;
uint32_t m_size;
uint32_t m_off;
- uint32_t tmask;
+ uint32_t m_mask;
uint32_t rnzero;
uint32_t rxdiff;
m_sel = ((int32_t)t-CROSSOVER)>>31; //FFFFetc.. if t < CROSSOVER
+ m_mask = 0x00FFFFFF | ~m_sel; //mask bytes used
m_size = (m_sel & M24_SIZE) | (~m_sel & M32_SIZE);
m_off = ~m_sel & m32_off;
m_off += m_size*t;
@@ -132,19 +134,20 @@ static void inner_bias(uint32_t x){
r = 0;
//TODO: get rid of memcpy
- memcpy(&r,p,m_size);
- memcpy(p,&x,m_size);
+ //memcpy(&r,p,m_size);
+
+ memcpy(&r,p,M32_SIZE);
+ i = r;
+ i &= ~m_mask;
+ r &= m_mask;
+ i |= x & m_mask;
+ memcpy(p,&i,M32_SIZE);
+ //memcpy(p,&x,m_size);
- tmask = 0x00FFFFFF | ~m_sel;
rnzero = (-(int32_t)r)>>31; //FFFFetc.. if r != 0
rxdiff = x-r;
- rxdiff &= tmask;
+ rxdiff &= m_mask;
rxdiff &= m_sel | rnzero; //clear rxdiff if t >= CROSSOVER and r == 0
t = rxdiff;
-
-
-
-
-
}