//Register a comparison opcode (CMP or CMN) which does not allow the S bit and does //not modify a destination register. internal void RegisterDataOpAWC_CMP(DataOpAWCOperation opHandler, uint base_opcode, string basename) { DataOpBuilderAWC b = new DataOpBuilderAWCCMP(); b.opcode = base_opcode; b.name = basename; b.opHandler = opHandler; b.owner = this; b.StartBuild(); }
/************* FUNCTIONS TO CREATE AND REGISTER DATA OPS *************/ //Register an arithmetic opcode which allows the S bit. internal void RegisterDataOpAWC(DataOpAWCOperation opHandler, uint base_opcode, string basename) { #if DEBUG if ((base_opcode & s_mask) != 0) { throw new Exception("base_opcode and s_mask not disjoint registering " + basename); } #endif DataOpBuilderAWC b = new DataOpBuilderAWC(); b.opcode = base_opcode; b.name = basename; b.opHandler = opHandler; b.owner = this; b.StartBuild(); }
internal InstructionFunc GenerateAWCDataOp(DataOpEvaluateOperand2Func EvaluateOperand2, DataOpAWCOperation AWCOp, DataOpSaveResultFunc SaveResult, DataOpHandleSetFlagsAWCFunc SetFlags) { return(delegate(uint opcode) { uint Rd = ((opcode & rd_mask) >> 12); uint Rn = ((opcode & rn_mask) >> 16); uint a = get_reg(Rn); bool shift_carry = false; uint b = EvaluateOperand2(opcode, ref shift_carry); AWCResult awcResult = AWCOp(a, b); SaveResult(Rd, awcResult.result); SetFlags(opcode, Rd, awcResult); return 1; }); }