KawaiiBASIC / classilla

Automatically exported from code.google.com/p/classilla
0 stars 0 forks source link

Implement AltiVec-accelerated IsASCII #182

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the same way as TenFourFox does for nsTextFragment, implement in 
string/src/nsReadableUtils.cpp an AltiVec-based scanner. This can be done as a 
first approximation thus:

        fragmentLength = PRUint32(iter.size_forward());
        const PRUnichar* c = iter.get();
        const PRUnichar* fragmentEnd = c + fragmentLength;

>> AltiVec stride goes here

          // for each character in this chunk...
        while ( c < fragmentEnd )
          if ( *c++ & NOT_ASCII )
            return PR_FALSE;
      }

This is likely to gain a lot of performance win, this call is done a lot!

Original issue reported on code.google.com by classi...@floodgap.com on 18 Jan 2012 at 12:34

GoogleCodeExporter commented 9 years ago
In fact, there are two IsASCIIs and one IsUTF8. We should do all three.

Original comment by classi...@floodgap.com on 18 Jan 2012 at 12:36