dpr multiply
This commit is contained in:
parent
04df4ea795
commit
3104da7f30
13
src/parser.c
13
src/parser.c
@ -25,6 +25,7 @@ static const char *ARITHMETIC_OPCODES[] = {"add", "adds", "sub", "subs"};
|
|||||||
static const char *MULTIPLY_OPCODES[] = {"mul", "madd", "msub", "mneg"};
|
static const char *MULTIPLY_OPCODES[] = {"mul", "madd", "msub", "mneg"};
|
||||||
static const char *SHIFT_TYPE_OPCODES[] = {"lsl", "lsr", "asr", "ror"};
|
static const char *SHIFT_TYPE_OPCODES[] = {"lsl", "lsr", "asr", "ror"};
|
||||||
static const char *LOGIC_OPCODES[] = {"and", "ands", "bic", "bics", "eor", "eon", "orr", "orn"};
|
static const char *LOGIC_OPCODES[] = {"and", "ands", "bic", "bics", "eor", "eon", "orr", "orn"};
|
||||||
|
//static const char *ALIASES[] = {"cmp", "cmn", "neg", "negs", "tst", "mvn", "mov", "mul", "mneg"};
|
||||||
|
|
||||||
a64inst_instruction *parse(char **asmLines, int lineCount) {
|
a64inst_instruction *parse(char **asmLines, int lineCount) {
|
||||||
a64inst_instruction *instructions = malloc(sizeof(a64inst_instruction) * lineCount);
|
a64inst_instruction *instructions = malloc(sizeof(a64inst_instruction) * lineCount);
|
||||||
@ -329,13 +330,13 @@ void parseDPRegister(a64inst_instruction *inst, char *tokens[], int tokensCount)
|
|||||||
// Multiply
|
// Multiply
|
||||||
data->DPROpType = a64inst_DPR_MULTIPLY;
|
data->DPROpType = a64inst_DPR_MULTIPLY;
|
||||||
if (tokensCount >= 5) {
|
if (tokensCount >= 5) {
|
||||||
data->processOpData.multiplydata.summand = getOperandNumber(tokens[4]);
|
data->processOpData.multiplydata.summand = getOperandNumber(tokens[4]);
|
||||||
data->processOpData.multiplydata.negProd = strcmp(tokens[4], "mneg") == 0;
|
data->processOpData.multiplydata.negProd = strcmp(tokens[0], "msub") == 0;
|
||||||
}else {
|
}
|
||||||
data->processOpData.multiplydata.summand = ZERO_REGISTER;
|
else {
|
||||||
data->processOpData.multiplydata.negProd = false;
|
data->processOpData.multiplydata.summand = ZERO_REGISTER;
|
||||||
|
data->processOpData.multiplydata.negProd = strcmp(tokens[0], "mneg") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Arithmetic/Logic
|
// Arithmetic/Logic
|
||||||
data->DPROpType = a64inst_DPR_ARITHMLOGIC;
|
data->DPROpType = a64inst_DPR_ARITHMLOGIC;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user