mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
target-alpha: Implement missing MVI instructions.
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
91a7593526
commit
13e4df99ce
3 changed files with 231 additions and 30 deletions
|
@ -277,6 +277,174 @@ uint64_t helper_cmpbge (uint64_t op1, uint64_t op2)
|
|||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_minub8 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
uint8_t opa, opb, opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
opa = op1 >> (i * 8);
|
||||
opb = op2 >> (i * 8);
|
||||
opr = opa < opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 8);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_minsb8 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
int8_t opa, opb;
|
||||
uint8_t opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
opa = op1 >> (i * 8);
|
||||
opb = op2 >> (i * 8);
|
||||
opr = opa < opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 8);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_minuw4 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
uint16_t opa, opb, opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
opa = op1 >> (i * 16);
|
||||
opb = op2 >> (i * 16);
|
||||
opr = opa < opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 16);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_minsw4 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
int16_t opa, opb;
|
||||
uint16_t opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
opa = op1 >> (i * 16);
|
||||
opb = op2 >> (i * 16);
|
||||
opr = opa < opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 16);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_maxub8 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
uint8_t opa, opb, opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
opa = op1 >> (i * 8);
|
||||
opb = op2 >> (i * 8);
|
||||
opr = opa > opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 8);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_maxsb8 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
int8_t opa, opb;
|
||||
uint8_t opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
opa = op1 >> (i * 8);
|
||||
opb = op2 >> (i * 8);
|
||||
opr = opa > opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 8);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_maxuw4 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
uint16_t opa, opb, opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
opa = op1 >> (i * 16);
|
||||
opb = op2 >> (i * 16);
|
||||
opr = opa > opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 16);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_maxsw4 (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
int16_t opa, opb;
|
||||
uint16_t opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
opa = op1 >> (i * 16);
|
||||
opb = op2 >> (i * 16);
|
||||
opr = opa > opb ? opa : opb;
|
||||
res |= (uint64_t)opr << (i * 16);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_perr (uint64_t op1, uint64_t op2)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
uint8_t opa, opb, opr;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
opa = op1 >> (i * 8);
|
||||
opb = op2 >> (i * 8);
|
||||
if (opa >= opb)
|
||||
opr = opa - opb;
|
||||
else
|
||||
opr = opb - opa;
|
||||
res += opr;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t helper_pklb (uint64_t op1)
|
||||
{
|
||||
return (op1 & 0xff) | ((op1 >> 24) & 0xff00);
|
||||
}
|
||||
|
||||
uint64_t helper_pkwb (uint64_t op1)
|
||||
{
|
||||
return ((op1 & 0xff)
|
||||
| ((op1 >> 8) & 0xff00)
|
||||
| ((op1 >> 16) & 0xff0000)
|
||||
| ((op1 >> 24) & 0xff000000));
|
||||
}
|
||||
|
||||
uint64_t helper_unpkbl (uint64_t op1)
|
||||
{
|
||||
return (op1 & 0xff) | ((op1 & 0xff00) << 24);
|
||||
}
|
||||
|
||||
uint64_t helper_unpkbw (uint64_t op1)
|
||||
{
|
||||
return ((op1 & 0xff)
|
||||
| ((op1 & 0xff00) << 8)
|
||||
| ((op1 & 0xff0000) << 16)
|
||||
| ((op1 & 0xff000000) << 24));
|
||||
}
|
||||
|
||||
/* Floating point helpers */
|
||||
|
||||
/* F floating (VAX) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue