build struct for DPRegister arithmetic
This commit is contained in:
parent
cea9590621
commit
664f8e6478
@ -14,6 +14,7 @@ void parseSingleTransfer(a64inst_instruction *instr, char *opcode, char *operand
|
||||
void parseBranch(a64inst_instruction *instr, char* opcode, char *operandList[]);
|
||||
void calcluateAddressFormat(a64inst_instruction *instr, char *operandList[], int numOperands);
|
||||
void parseDPImmediate(a64inst_instruction *inst, char *tokens[], int tokensCount);
|
||||
void parseDPRegister(a64inst_instruction *inst, char *tokens[], int tokensCount);
|
||||
|
||||
/** Constants */
|
||||
static const char *BRANCH_OPCODES[] = {"b", "br", "b.eq", "b.ne", "b.ge", "b.lt", "b.gt", "b.le", "b.al"};
|
||||
@ -144,6 +145,7 @@ void parse_instruction(char asmLine[], a64inst_instruction *instr) {
|
||||
break;
|
||||
case a64inst_DPREGISTER:
|
||||
//generate DP operands;
|
||||
parseDPRegister(instr, tokens, tokensCount);
|
||||
break;
|
||||
case a64inst_DPIMMEDIATE:
|
||||
parseDPImmediate(instr, tokens, tokensCount);
|
||||
@ -330,6 +332,13 @@ void parseDPRegister(a64inst_instruction *inst, char *tokens[], int tokensCount)
|
||||
// Arithmetic
|
||||
data->processOp = indexStringIn(tokens[0], ARITHMETIC_OPCODES, 4);
|
||||
data->processOpData.arithmLogicData.type = 1;
|
||||
if(tokensCount == 5) {
|
||||
//has a shift
|
||||
int numTokens = 0;
|
||||
char **shiftOperands = tokenise(tokens[4], &numTokens);
|
||||
data->processOpData.arithmLogicData.shiftType = indexStringIn(shiftOperands[0], SHIFT_TYPE_OPCODES, 4);
|
||||
data->processOpData.arithmLogicData.shiftAmount = getOperandNumber(shiftOperands[1]);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Logic
|
||||
|
||||
Loading…
Reference in New Issue
Block a user