Skip to content
Snippets Groups Projects
Commit 19aeebcc authored by John Romein's avatar John Romein
Browse files

BugID: 225

NrValidSamplesPerIntegration is now always unsigned short, as specified in
DH_Visibilities.
parent 1062e8cd
No related branches found
No related tags found
No related merge requests found
...@@ -1070,6 +1070,13 @@ _clear_correlation: ...@@ -1070,6 +1070,13 @@ _clear_correlation:
blr # polarizations blr # polarizations
#define SIZEOF_NR_VALID_SAMPLES 2
#if SIZEOF_NR_VALID_SAMPLES != 1 && SIZEOF_NR_VALID_SAMPLES != 2 && SIZEOF_NR_VALID_SAMPLES != 4
#error Unsupported SIZEOF_NR_VALID_SAMPLES
#endif
.align 5 .align 5
.global _weigh_visibilities .global _weigh_visibilities
_weigh_visibilities: _weigh_visibilities:
...@@ -1079,24 +1086,18 @@ _weigh_visibilities: ...@@ -1079,24 +1086,18 @@ _weigh_visibilities:
mtctr 6 mtctr 6
li 8,8 li 8,8
#if NR_SAMPLES_PER_INTEGRATION < 256 li 7,SIZEOF_NR_VALID_SAMPLES
li 7,1
#elif NR_SAMPLES_PER_INTEGRATION < 65536
li 7,2
#else
li 7,4
#endif
sub 3,3,8 sub 3,3,8
sub 4,4,7 sub 4,4,7
mr 6,3 mr 6,3
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
lbzux 9,4,7 lbzux 9,4,7
lbzux 10,4,7 lbzux 10,4,7
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
lhzux 9,4,7 lhzux 9,4,7
lhzux 10,4,7 lhzux 10,4,7
#else #elif SIZEOF_NR_VALID_SAMPLES == 4
lwzux 9,4,7 lwzux 9,4,7
lwzux 10,4,7 lwzux 10,4,7
#endif #endif
...@@ -1120,9 +1121,9 @@ loop5: ...@@ -1120,9 +1121,9 @@ loop5:
fxpmul 2,8,2 fxpmul 2,8,2
fxpmul 3,8,3 fxpmul 3,8,3
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
lbzux 9,4,7 lbzux 9,4,7
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
lhzux 9,4,7 lhzux 9,4,7
#else #else
lwzux 9,4,7 lwzux 9,4,7
...@@ -1145,11 +1146,11 @@ loop5: ...@@ -1145,11 +1146,11 @@ loop5:
lfpsux 3,3,8 lfpsux 3,3,8
fxpmul 7,8,7 fxpmul 7,8,7
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
lbzux 10,4,7 lbzux 10,4,7
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
lhzux 10,4,7 lhzux 10,4,7
#else #elif SIZEOF_NR_VALID_SAMPLES == 4
lwzux 10,4,7 lwzux 10,4,7
#endif #endif
...@@ -1179,16 +1180,14 @@ _post_process_visibilities: ...@@ -1179,16 +1180,14 @@ _post_process_visibilities:
li 0,0 li 0,0
li 8,8 li 8,8
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
lbz 11,0(4) # load nrValidSamples lbz 11,0(4) # load nrValidSamples
li 9,1 #elif SIZEOF_NR_VALID_SAMPLES == 2
#elif NR_SAMPLES_PER_INTEGRATION < 65536
lhz 11,0(4) lhz 11,0(4)
li 9,2 #elif SIZEOF_NR_VALID_SAMPLES == 4
#else
lwz 11,0(4) lwz 11,0(4)
li 9,4
#endif #endif
li 9,SIZEOF_NR_VALID_SAMPLES
li 10,4 li 10,4
lfsx 18,0,6 # load threshold lfsx 18,0,6 # load threshold
addi 7,3,-8 addi 7,3,-8
...@@ -1200,11 +1199,11 @@ _post_process_visibilities: ...@@ -1200,11 +1199,11 @@ _post_process_visibilities:
loop6: loop6:
slwi. 12,11,2 # if 4*nrValidSamples == 0, jump to invalid_2 slwi. 12,11,2 # if 4*nrValidSamples == 0, jump to invalid_2
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
lbzux 11,4,9 # load nrValidSamples lbzux 11,4,9 # load nrValidSamples
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
lhzux 11,4,9 lhzux 11,4,9
#else #elif SIZEOF_NR_VALID_SAMPLES == 4
lwzux 11,4,9 lwzux 11,4,9
#endif #endif
beq- 0,invalid_2 beq- 0,invalid_2
...@@ -1237,11 +1236,11 @@ loop6: ...@@ -1237,11 +1236,11 @@ loop6:
L7: L7:
slwi. 12,11,2 # if 4*nrValidSamples == 0, jump to invalid_4 slwi. 12,11,2 # if 4*nrValidSamples == 0, jump to invalid_4
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
lbzux 11,4,9 # load nrValidSamples lbzux 11,4,9 # load nrValidSamples
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
lhzux 11,4,9 lhzux 11,4,9
#else #elif SIZEOF_NR_VALID_SAMPLES == 4
lwzux 11,4,9 lwzux 11,4,9
#endif #endif
beq- 0,invalid_4 beq- 0,invalid_4
...@@ -1287,11 +1286,11 @@ end: li 11,16 # restore call-saved registers ...@@ -1287,11 +1286,11 @@ end: li 11,16 # restore call-saved registers
blr blr
invalid_1: invalid_1:
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
stb 0,-1(4) stb 0,-1(4)
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
sth 0,-2(4) sth 0,-2(4)
#else #elif SIZEOF_NR_VALID_SAMPLES == 4
stw 0,-4(4) stw 0,-4(4)
#endif #endif
dcbz 0,7 dcbz 0,7
...@@ -1308,11 +1307,11 @@ invalid_2: ...@@ -1308,11 +1307,11 @@ invalid_2:
b L7 b L7
invalid_3: invalid_3:
#if NR_SAMPLES_PER_INTEGRATION < 256 #if SIZEOF_NR_VALID_SAMPLES == 1
stb 0,-1(4) stb 0,-1(4)
#elif NR_SAMPLES_PER_INTEGRATION < 65536 #elif SIZEOF_NR_VALID_SAMPLES == 2
sth 0,-2(4) sth 0,-2(4)
#else #elif SIZEOF_NR_VALID_SAMPLES == 4
stw 0,-4(4) stw 0,-4(4)
#endif #endif
dcbz 0,7 dcbz 0,7
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment