classilla / classilla

Building a secure browser for classic Mac OS.

Home Page:http://www.classilla.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement AltiVec-accelerated IsASCII

GoogleCodeExporter opened this issue · comments

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

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