DPI arithmetic
This commit is contained in:
parent
3290896f6e
commit
f5dabe26b2
28
src/parser.c
28
src/parser.c
@ -186,6 +186,7 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
|
||||
else {
|
||||
data.regType=1;
|
||||
}
|
||||
// arithmetic
|
||||
// add, adds
|
||||
if (opcode[1] == 'd') {
|
||||
data.DPIOpType = 0;
|
||||
@ -193,10 +194,11 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
|
||||
data.processOpData.arithmData.immediate = getOperandNumber(operandList[2]);
|
||||
if (opcode[-1] == 's') {
|
||||
data.processOpData.arithmData.shiftImmediate = true;
|
||||
|
||||
data.processOp = 1;
|
||||
}
|
||||
else {
|
||||
data.processOpData.arithmData.shiftImmediate = false;
|
||||
data.processOp = 0;
|
||||
}
|
||||
}
|
||||
// cmn
|
||||
@ -205,7 +207,31 @@ void classifyOpcode(char* opcode, a64inst_instruction *instr, char *operandList[
|
||||
data.processOpData.arithmData.src = ZERO_REGISTER;
|
||||
data.processOpData.arithmData.immediate = getOperandNumber(operandList[1]);
|
||||
data.processOpData.arithmData.shiftImmediate = true;
|
||||
data.processOp = 1;
|
||||
}
|
||||
// sub, subs
|
||||
else if (opcode[0] == 's') {
|
||||
data.DPIOpType = 0;
|
||||
data.processOpData.arithmData.src = getOperandNumber(operandList[1]);
|
||||
data.processOpData.arithmData.immediate = getOperandNumber(operandList[2]);
|
||||
if (opcode[-1] == 's') {
|
||||
data.processOpData.arithmData.shiftImmediate = true;
|
||||
data.processOp = 3;
|
||||
}
|
||||
else {
|
||||
data.processOpData.arithmData.shiftImmediate = false;
|
||||
data.processOp = 2;
|
||||
}
|
||||
}
|
||||
// cmp
|
||||
else if (opcode == 'cmp') {
|
||||
data.DPIOpType = 0;
|
||||
data.processOpData.arithmData.src = ZERO_REGISTER;
|
||||
data.processOpData.arithmData.immediate = getOperandNumber(operandList[1]);
|
||||
data.processOpData.arithmData.shiftImmediate = true;
|
||||
data.processOp = 3;
|
||||
}
|
||||
// wide move
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user