mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 21:55:34 +08:00
(MMX): added paddb and pslld instructions.
This commit is contained in:
parent
99ae2f3e4e
commit
682be864fa
@ -408,6 +408,16 @@ namespace GameRes.Formats
|
|||||||
|
|
||||||
public static class MMX
|
public static class MMX
|
||||||
{
|
{
|
||||||
|
public static ulong PAddB (ulong x, ulong y)
|
||||||
|
{
|
||||||
|
ulong r = 0;
|
||||||
|
for (ulong mask = 0xFF; mask != 0; mask <<= 8)
|
||||||
|
{
|
||||||
|
r |= ((x & mask) + (y & mask)) & mask;
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
public static ulong PAddW (ulong x, ulong y)
|
public static ulong PAddW (ulong x, ulong y)
|
||||||
{
|
{
|
||||||
ulong mask = 0xffff;
|
ulong mask = 0xffff;
|
||||||
@ -428,6 +438,13 @@ namespace GameRes.Formats
|
|||||||
mask <<= 32;
|
mask <<= 32;
|
||||||
return r | ((x & mask) + (y & mask)) & mask;
|
return r | ((x & mask) + (y & mask)) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ulong PSllD (ulong x, int count)
|
||||||
|
{
|
||||||
|
ulong mask = 0xFFFFFFFFu << count;
|
||||||
|
mask |= mask << 32;
|
||||||
|
return (x << count) & mask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Dump
|
public static class Dump
|
||||||
|
Loading…
Reference in New Issue
Block a user