• Home
  • Raw
  • Download

Lines Matching full:i

9 I felt there was room for optimisation. I bashed the code for a few hours
12 Still I was not too happy as I felt there was additional room for improvement.
14 Bad! I was hooked.
15 I decided to annotate my steps in this file. Perhaps it is useful to someone
26 This is done by means of a Hamming code. I'll try to explain it in
27 laymans terms (and apologies to all the pro's in the field in case I do
29 years ago, and I must admit it was not one of my favourites).
31 As I said before the ecc calculation is performed on sectors of 256
88 The story now becomes quite boring. I guess you get the idea.
112 I detected after writing this that ST application note AN1823
114 nicer picture.(but they use line parity as term where I use row parity)
115 Oh well, I'm graphically challenged, so suffer with me for a moment :-)
117 And I could not reuse the ST picture anyway for copyright reasons.
126 for (i = 0; i < 256; i++)
128 if (i & 0x01)
132 if (i & 0x02)
136 if (i & 0x04)
140 if (i & 0x08)
144 if (i & 0x10)
148 if (i & 0x20)
152 if (i & 0x40)
156 if (i & 0x80)
214 int i;
227 for (i = 0; i < 256; i++)
231 if (i & 0x01) rp1 ^= cur; else rp0 ^= cur;
232 if (i & 0x02) rp3 ^= cur; else rp2 ^= cur;
233 if (i & 0x04) rp5 ^= cur; else rp4 ^= cur;
234 if (i & 0x08) rp7 ^= cur; else rp6 ^= cur;
235 if (i & 0x10) rp9 ^= cur; else rp8 ^= cur;
236 if (i & 0x20) rp11 ^= cur; else rp10 ^= cur;
237 if (i & 0x40) rp13 ^= cur; else rp12 ^= cur;
238 if (i & 0x80) rp15 ^= cur; else rp14 ^= cur;
274 I also introduced the parity lookup. I expected this to be the fastest
275 way to calculate the parity, but I will investigate alternatives later
309 And of course the performance might depend on alignment, but I expect
310 that the I/O buffers in the nand driver are aligned properly (and
325 int i;
338 for (i = 0; i < 64; i++)
342 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur;
343 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur;
344 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur;
345 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur;
346 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur;
347 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur;
405 examples I kinda deviated from my regular programming style by allowing
433 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur;
434 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur;
435 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur;
436 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur;
437 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur;
438 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur;
442 if (i & 0x01) rp5 ^= cur;
443 if (i & 0x02) rp7 ^= cur;
444 if (i & 0x04) rp9 ^= cur;
445 if (i & 0x08) rp11 ^= cur;
446 if (i & 0x10) rp13 ^= cur;
447 if (i & 0x20) rp15 ^= cur;
466 or so. I also tried on an eeePC (Celeron, clocked at 900 Mhz). Interesting
472 loop unrolling. This will eliminate a few if statements. I'll try
482 for (i = 0; i < 4; i++)
490 if (i & 0x1) rp13 ^= cur; else rp12 ^= cur;
491 if (i & 0x2) rp15 ^= cur; else rp14 ^= cur;
511 I decided to proceed with a four time unrolled loop anyway. It was my gut
512 feeling that in the next steps I would obtain additional gain from it.
518 eliminate rp5 (or rp4, but I already foresaw another optimisation).
532 Along the line I also removed the initialisation of rp0/1/2/3.
542 However, still I thought there was more. I didn't like all the if
552 for (i = 0; i < 4; i++)
575 if ((i & 0x1) == 0) rp12 ^= tmppar;
576 if ((i & 0x2) == 0) rp14 ^= tmppar;
583 While making the changes I also found that I could exploit that tmppar
586 I removed the rp6 ^= cur; statement and did rp6 ^= tmppar; on next
595 (using time to measure the performance). After this iteration I was back
596 to 0.075 sec. Actually I had to decide to start measuring over 10
625 for (i = 0; i < 4; i++)
650 if ((i & 0x1) == 0) rp12 ^= tmppar;
651 if ((i & 0x2) == 0) rp14 ^= tmppar;
663 Actually this made things worse. Not very much, but I don't want to move
668 more time will help. I'll keep the optimisations from 7 for now.
716 million iterations. So basically I've improved the performance by a
727 For correcting errors I again used the ST application note as a starter,
728 but I also peeked at the existing code.