/*
toLower in x
Am1 : 'A' - 1
Zp1 : 'Z' + 1
amA : 'a' - 'A'
t0, t1 : temporary register
*/
void toLower(const Xbyak::Xmm& x, const Xbyak::Xmm& Am1
, const Xbyak::Xmm& Zp1, const Xbyak::Xmm& amA
, const Xbyak::Xmm& t0, const Xbyak::Xmm& t1)
{
movdqa(t0, x);
pcmpgtb(t0, Am1); // -1 if c > 'A' - 1
movdqa(t1, Zp1);
pcmpgtb(t1, x); // -1 if 'Z' + 1 > c
Pand(t0, t1); // -1 if [A-Z]
Pand(t0, amA); // 0x20 if c in [A-Z]
paddb(x, t0); // [A-Z] -> [a-z]
}
作成日: 2012-04-13 23:37:00