author Tobias Girstmair Tue, 13 Nov 2018 01:56:21 +0000 (02:56 +0100) committer Tobias Girstmair Tue, 13 Nov 2018 01:56:21 +0000 (02:56 +0100)
 foo.c patch | blob | blame | history

diff --git a/foo.c b/foo.c
--- a/foo.c
+++ b/foo.c
@@ -86,16 +86,25 @@ int main(void) {
MOV     (x, s)
INC     (x)
#define tmp o
MOV     (x, s)
INC     (x)
#define tmp o
-                unsigned short sum = 0;
-                for(int loop = 0; loop < 4; loop ++) {
+                unsigned short sum = 0; //XXX
+                sum >>= 1;
+                sum += x;
+                sum >>= 1;
+                //nop
+                sum >>= 1;
+                sum += x;
+                sum >>= 1;
+                //nop
+                sum >>= 1;
+                sum += x;
+                sum >>= 1;
+                //nop
sum >>= 1;
sum += x;
sum >>= 1;
//nop
sum >>= 1;
sum += x;
sum >>= 1;
//nop
-                }
sum >>= 1;
x = sum;
sum >>= 1;
x = sum;
-
#undef tmp
t = ((i3&0x01)<<13 | i2<<5 | i1>>3) % 3;
#undef tmp
t = ((i3&0x01)<<13 | i2<<5 | i1>>3) % 3;
@@ -107,8 +116,15 @@ int main(void) {
MOV     (x, s)
INC     (x)
#define tmp o
MOV     (x, s)
INC     (x)
#define tmp o
-                sum = 0;
-                for(int loop = 0; loop < 2; loop ++) {
+                sum = 0; //XXX
+                sum >>= 1;
+                sum += x;
+                sum >>= 1;
+                sum += x;
+                sum >>= 1;
+                //nop
+                sum >>= 1;
+                //nop
sum >>= 1;
sum += x;
sum >>= 1;
sum >>= 1;
sum += x;
sum >>= 1;
@@ -117,7 +133,6 @@ int main(void) {
//nop
sum >>= 1;
//nop
//nop
sum >>= 1;
//nop
-                }
sum >>= 1;
x = sum;
#undef tmp
sum >>= 1;
x = sum;
#undef tmp