Add negation for second operand in DPR instructions w/ S
This commit is contained in:
parent
cc62168d43
commit
dd472117aa
@ -203,6 +203,9 @@ static void executeDPRegister(Machine *state, a64inst_instruction *inst) {
|
||||
// Apply shift to value held in second register
|
||||
a64inst_DPRegister_ArithmLogicData *arithmLogicData = &inst->data.DPRegisterData.processOpData.arithmLogicData;
|
||||
uint8_t shiftAmount = arithmLogicData->shiftAmount;
|
||||
if (arithmLogicData->negShiftedSrc2) {
|
||||
src2Val = ~src2Val;
|
||||
}
|
||||
switch(arithmLogicData->shiftType) {
|
||||
|
||||
case a64inst_LSL:
|
||||
@ -214,7 +217,11 @@ static void executeDPRegister(Machine *state, a64inst_instruction *inst) {
|
||||
break;
|
||||
|
||||
case a64inst_ASR:
|
||||
src2Val = truncateValue((int64_t)src2Val >> shiftAmount, regType);
|
||||
if (regType == a64inst_X) {
|
||||
src2Val = truncateValue((int64_t)src2Val >> shiftAmount, regType);
|
||||
} else {
|
||||
src2Val = truncateValue((int32_t)src2Val >> shiftAmount, regType);
|
||||
}
|
||||
break;
|
||||
|
||||
case a64inst_ROR:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user