2 // Originator: thor@math.tu-berlin.de
5 // { dg-options "-O3 -funroll-loops -mtune=k6 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } }
8 // This used to fail to assemble because of an out-of-range 'loop' instructions.
16 class EBCOTLut : public JKeeper {
17 unsigned char a1[1<<8];
18 unsigned char a2[1<<9];
19 unsigned char a3[1<<9];
25 EBCOTLut::EBCOTLut(void)
27 unsigned char inter[36]; // intermediate lookup table;
33 a1[i | (1<<7)] = 8<<1;
34 a1[i | (1<<6)] = 8<<1;
36 for(i=0;i < ((1<<9)-1);i++) {
37 int ds = (i>>0) & 0x01; // significance of DOWN
38 int us = (i>>1) & 0x01; // significance of UP
39 int rs = (i>>2) & 0x01; // significance of RIGHT
40 int ls = (i>>3) & 0x01; // significance of LEFT
41 int dn = (i>>5) & 0x01; // sign of DOWN
42 int un = (i>>6) & 0x01; // sign of UP
43 int rn = (i>>7) & 0x01; // sign of RIGHT
44 int ln = (i>>8) & 0x01; // sign of LEFT
45 int h,v; // h and v as in the VM description
47 h = ls*(1-ln*2) + rs*(1-2*rn);
48 v = us*(1-un*2) + ds*(1-2*dn);
49 h = (h >= -1)?(h):(-1);
50 v = (v >= -1)?(v):(-1);
53 a2[i] = inter[((h+1)<<3) | (v+1)];
54 a3[i] = inter[((h+1)<<3) | (v+1)] & (unsigned char)(~1);
56 for(i=0;i< 1<<9; i++) {
57 a4[i] = 2*(i-(1<<(9-1)))*(i-(1<<(9-1))) -
59 (2*(i-(1<<(9-2)))*(i-(1<<(9-2)))):
60 (2*(i-(3<<(9-2)))*(i-(3<<(9-2)))));