Re: [SLOF PATCH 1/2] fbuffer: Improve invert-region helper

2015-07-28 Thread Thomas Huth
Hi Segher, On 28/07/15 19:04, Segher Boessenkool wrote: > On Tue, Jul 28, 2015 at 12:19:54PM +0200, Thomas Huth wrote: >> : invert-region ( addr len -- ) >> - 0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop >> -; >> - >> -: invert-region-x ( addr len -- ) >> - /x / 0 ?DO dup dup rx@ -1 xor s

Re: [SLOF PATCH 1/2] fbuffer: Improve invert-region helper

2015-07-28 Thread Segher Boessenkool
On Tue, Jul 28, 2015 at 12:19:54PM +0200, Thomas Huth wrote: > : invert-region ( addr len -- ) > - 0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP drop > -; > - > -: invert-region-x ( addr len -- ) > - /x / 0 ?DO dup dup rx@ -1 xor swap rx! xa1+ LOOP drop > + 2dup or 7 and CASE > + 0 OF 3 rsh

[SLOF PATCH 1/2] fbuffer: Improve invert-region helper

2015-07-28 Thread Thomas Huth
The introduction of invert-region already speeded up the cursor drawing very much. But there is still space for improvement: So far invert-region is accessing the memory only byte by byte, but with some additional logic that checks the alignment of the address and the length of the area, we can als