InstructionRuleFSETP(): InstructionRule("FSETP", 2, true, false) { hpBinaryStringToOpcode8("0000 000000 1110 111 000 000000 0000000000000000000000 0 1110 000000 00100", OpcodeWord0, OpcodeWord1); SetOperands(5, &OPRPredicate0, &OPRPredicate1, &OPRFADD32IReg1, &OPRFADDCompositeWithOperator, &OPRPredicate2); ModifierGroups[0].Initialize(false, 14, &MRSETPComparisonLT, &MRSETPComparisonEQ, &MRSETPComparisonLE, &MRSETPComparisonGT, &MRSETPComparisonNE, &MRSETPComparisonGE, &MRSETPComparisonNUM, &MRSETPComparisonNAN, &MRSETPComparisonLTU, &MRSETPComparisonEQU, &MRSETPComparisonLEU, &MRSETPComparisonGTU, &MRSETPComparisonNEU, &MRSETPComparisonGEU); ModifierGroups[1].Initialize(true, 3, &MRSETPLogicAND, &MRSETPLogicOR, &MRSETPLogicXOR); }
InstructionRuleI2I(): InstructionRule("I2I", 4, true, false) { hpBinaryStringToOpcode8("0010 000000 1110 000000 010010 0000000000000000000000 0000000000 111000", OpcodeWord0, OpcodeWord1); SetOperands(2, &OPRRegister0, &OPRI2I); ModifierGroups[0].Initialize(true, 8, &MRF2IDestU8, &MRF2IDestU16, &MRF2IDestU32, &MRF2IDestU64, &MRF2IDestS8, &MRF2IDestS16, &MRF2IDestS32, &MRF2IDestS64); ModifierGroups[1].Initialize(true, 8, &MRI2FSourceU8, &MRI2FSourceU16, &MRI2FSourceU32, &MRI2FSourceU64, &MRI2FSourceS8, &MRI2FSourceS16, &MRI2FSourceS32, &MRI2FSourceS64); ModifierGroups[2].Initialize(true, 1, &MRFMULSAT); ModifierGroups[3].Initialize(true, 1, &MRS); }
InstructionRuleVADD(): InstructionRule("VADD", 6, true, false) { hpBinaryStringToOpcode8("0010 011000 1110 000000 000000 0000000110000000 1001100 000000 111 000011", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegisterWithCCAt16, &OPRRegister1ForVADD, &OPRCompositeForVADD, &OPRRegister3ForCMP); ModifierGroups[0].Initialize(true, 1, &MRVADD_UD); ModifierGroups[1].Initialize(true, 6, &MRVADD_Op1_U8, &MRVADD_Op1_U16, &MRVADD_Op1_U32, &MRVADD_Op1_S8, &MRVADD_Op1_S16, &MRVADD_Op1_S32); ModifierGroups[2].Initialize(true, 6, &MRVADD_Op2_U8, &MRVADD_Op2_U16, &MRVADD_Op2_U32, &MRVADD_Op2_S8, &MRVADD_Op2_S16, &MRVADD_Op2_S32); ModifierGroups[3].Initialize(true, 1, &MRVADD_SAT); ModifierGroups[4].Initialize(true, 7, &MRVADD_SecOp_MRG_16H, &MRVADD_SecOp_MRG_16L, &MRVADD_SecOp_MRG_8B0, &MRVADD_SecOp_MRG_8B2, &MRVADD_SecOp_ACC, &MRVADD_SecOp_MAX, &MRVADD_SecOp_MIN); ModifierGroups[5].Initialize(true, 1, &MRS); }
InstructionRuleDSETP(): InstructionRule("DSETP", 2, true, false) { hpBinaryStringToOpcode8("1000 000000 1110 111 000 000000 0000000000000000000000 0 1110 000000 11000", OpcodeWord0, OpcodeWord1); SetOperands(5, &OPRPredicate0, &OPRPredicate1, &OPRRegister1ForDoubleWith2OP, &OPRCompositeForDoubleWith2OP, &OPRPredicate2); ModifierGroups[0].Initialize(false, 14, &MRSETPComparisonLT, &MRSETPComparisonEQ, &MRSETPComparisonLE, &MRSETPComparisonGT, &MRSETPComparisonNE, &MRSETPComparisonGE, &MRSETPComparisonNUM, &MRSETPComparisonNAN, &MRSETPComparisonLTU, &MRSETPComparisonEQU, &MRSETPComparisonLEU, &MRSETPComparisonGTU, &MRSETPComparisonNEU, &MRSETPComparisonGEU); ModifierGroups[1].Initialize(true, 3, &MRSETPLogicAND, &MRSETPLogicOR, &MRSETPLogicXOR); }
InstructionRuleF2F(): InstructionRule("F2F", 6, true, false) { hpBinaryStringToOpcode8("0010 000000 1110 000000 010010 0000000000000000000000 0000000000 001000", OpcodeWord0, OpcodeWord1); SetOperands(2, &OPRRegister0, &OPRF2I); ModifierGroups[0].Initialize(true, 1, &MRF2IFTZ); ModifierGroups[1].Initialize(true, 3, &MRI2FDestF16, &MRI2FDestF32, &MRI2FDestF64); ModifierGroups[2].Initialize(true, 3, &MRF2ISourceF16, &MRF2ISourceF32, &MRF2ISourceF64); ModifierGroups[3].Initialize(true, 8, &MRF2FPASS, &MRF2FROUND, &MRF2FFLOOR, &MRF2FCEIL, &MRF2FTRUNC, &MRF2FRM, &MRF2FRP, &MRF2FRZ); ModifierGroups[4].Initialize(true, 1, &MRFMULSAT); ModifierGroups[5].Initialize(true, 1, &MRS); }
InstructionRuleFCMP(): InstructionRule("FCMP", 2, true, false) { hpBinaryStringToOpcode8("0000 000000 1110 000000 000000 0000000000000000000000 0 000000 0000 11100", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegister0, &OPRRegister1, &OPRFMULStyle, &OPRRegister3ForCMP); ModifierGroups[0].Initialize(false, 14, &MRSETPComparisonLT, &MRSETPComparisonEQ, &MRSETPComparisonLE, &MRSETPComparisonGT, &MRSETPComparisonNE, &MRSETPComparisonGE, &MRSETPComparisonNUM, &MRSETPComparisonNAN, &MRSETPComparisonLTU, &MRSETPComparisonEQU, &MRSETPComparisonLEU, &MRSETPComparisonGTU, &MRSETPComparisonNEU, &MRSETPComparisonGEU); ModifierGroups[1].Initialize(true, 1, &MRFADD32IFTZ); }
InstructionRuleFSET(): InstructionRule("FSET", 4, true, false) { hpBinaryStringToOpcode8("0000 000000 1110 000 000 000000 0000000000000000000000 0 1110 000000 01000", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegister0, &OPRRegister1, &OPRRegister2, &OPRPredicate2); ModifierGroups[0].Initialize(true, 1, &MRFSETBF); ModifierGroups[1].Initialize(false, 14, &MRSETPComparisonLT, &MRSETPComparisonEQ, &MRSETPComparisonLE, &MRSETPComparisonGT, &MRSETPComparisonNE, &MRSETPComparisonGE, &MRSETPComparisonNUM, &MRSETPComparisonNAN, &MRSETPComparisonLTU, &MRSETPComparisonEQU, &MRSETPComparisonLEU, &MRSETPComparisonGTU, &MRSETPComparisonNEU, &MRSETPComparisonGEU); ModifierGroups[2].Initialize(true, 1, &MRFSETPFTZ); ModifierGroups[3].Initialize(true, 3, &MRSETPLogicAND, &MRSETPLogicOR, &MRSETPLogicXOR); }
InstructionRuleI2F(): InstructionRule("I2F", 4, true, false) { hpBinaryStringToOpcode8("0010 000001111000000001001000000000000000000000000000000000011000", OpcodeWord0, OpcodeWord1); SetOperands(2, &OPRRegister0, &OPRI2F); ModifierGroups[0].Initialize(true, 3, &MRI2FDestF16, &MRI2FDestF32, &MRI2FDestF64); ModifierGroups[1].Initialize(true, 8, &MRI2FSourceU8, &MRI2FSourceU16, &MRI2FSourceU32, &MRI2FSourceU64, &MRI2FSourceS8, &MRI2FSourceS16, &MRI2FSourceS32, &MRI2FSourceS64); ModifierGroups[2].Initialize(true, 3, &MRI2FRM, &MRI2FRP, &MRI2FRZ); ModifierGroups[3].Initialize(true, 1, &MRS); }
InstructionRulePOPC(): InstructionRule("POPC", 0, true, false) { hpBinaryStringToOpcode8("0010 000000 1110 000000 000000 0000000000000000000000 0000000000 101010", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegister0, &OPRLOP1, &OPRLOP2); }
InstructionRuleFADD32I() : InstructionRule("FADD32I", 1, true, false) { hpBinaryStringToOpcode8("0100 000000111000000000000000000000000000000000000000000000010100", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegister0, &OPRFADD32IReg1, &OPR32I); ModifierGroups[0].Initialize(true, 1, &MRFADD32IFTZ); }
InstructionRuleDMUL(): InstructionRule("DMUL", 1, true, false) { hpBinaryStringToOpcode8("1000 000000 1110 000000 000000 0000000000000000000000 0000000000 001010", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegister0ForDouble, &OPRRegister1ForDouble, &OPRCompositeForDoubleWith1OP); ModifierGroups[0].Initialize(true, 3, &MRFMULRP, &MRFMULRM, &MRFMULRZ); }
InstructionRuleISCADD(): InstructionRule("ISCADD", 0, true, false) { hpBinaryStringToOpcode8("1100 0 00000 1110 000000 000000 0000000000000000000000 0000000000 000010", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegisterWithCCAt16, &OPRISCADDReg1, &OPRISCADDAllowNegative, &OPRISCADDShift); }
InstructionRuleDMNMX() : InstructionRule("DMNMX", 0, true, false) { hpBinaryStringToOpcode8("1000 0000 0011 1000 0000 0000 0000 0000 0000 0000 0000 0000 0111 0000 0001 0000", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegister0, &OPRRegister1, &OPRRegister2, &OPRPredicate2); }
InstructionRuleRRO() : InstructionRule("RRO", 1, true, false) { hpBinaryStringToOpcode8("0000 0000 0011 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0110", OpcodeWord0, OpcodeWord1); SetOperands(2, &OPRRegister0, &OPRRegister2); ModifierGroups[0].Initialize(false, 2, &MRRROSINCOS, &MRRROEX2); }
InstructionRuleFMNMX() : InstructionRule("FMNMX", 1, true, false) { hpBinaryStringToOpcode8("0000 0000 0011 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegister0, &OPRFADD32IReg1, &OPRFADDCompositeWithOperator, &OPRPredicate2); ModifierGroups[0].Initialize(true, 1, &MRFADD32IFTZ); }
InstructionRuleIADD() : InstructionRule("IADD", 2, true, false) { hpBinaryStringToOpcode8("1100000000111000000000000000000000000000000000000000000000010010", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegisterWithCCAt16, &OPRIMADReg1, &OPRIADDStyle); ModifierGroups[0].Initialize(true, 1, &MRIADD32ISAT); ModifierGroups[1].Initialize(true, 1, &MRIADD32IX); }
INstructionRuleIADD32I(): InstructionRule("IADD32I", 2, true, false) { hpBinaryStringToOpcode8("0100000000111000000000000000000000000000000000000000000000010000", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegisterWithCC4IADD32I, &OPRRegister1, &OPR32I); ModifierGroups[0].Initialize(true, 1, &MRIADD32ISAT); ModifierGroups[1].Initialize(true, 1, &MRIADD32IX); }
ExpressionNode *OperatorNode::SetOperand(unsigned num, const Expression &e) const { assert((_type == EXPR_FUNCTION || _type == EXPR_PREDICATE || _type == EXPR_EQUALITY || _type == EXPR_DISEQUALITY || _type == EXPR_AND || _type == EXPR_OR) && 0 <= num && num < GetArity()); std::vector<Expression> new_operands = _operands; new_operands[num] = e; return SetOperands(new_operands); }
InstructionRuleIMUL32I() : InstructionRule("IMUL32I", 3, true, false) { hpBinaryStringToOpcode8("0100 010100 1110 000000 000000 00000000000000000000000000000000 0 01000", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegisterWithCC4IADD32I, //different cc pos &OPRRegister1, &OPR32I); ModifierGroups[0].Initialize(true, 2, &MRIMUL0U32, &MRIMUL0S32); ModifierGroups[1].Initialize(true, 2, &MRIMUL1U32, &MRIMUL1S32); ModifierGroups[2].Initialize(true, 1, &MRIMULHI); }
InstructionRuleIMUL(): InstructionRule("IMUL", 3, true, false) { hpBinaryStringToOpcode8("1100010100111000000000000000000000000000000000000000000000001010", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegisterWithCCAt16, &OPRRegister1, &OPRIMULStyle); ModifierGroups[0].Initialize(true, 2, &MRIMUL0U32, &MRIMUL0S32); ModifierGroups[1].Initialize(true, 2, &MRIMUL1U32, &MRIMUL1S32); ModifierGroups[2].Initialize(true, 1, &MRIMULHI); }
InstructionRuleFMUL(): InstructionRule("FMUL", 3, true, false) { hpBinaryStringToOpcode8("0000 000000111000000000000000000000000000000000000000000000011010", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegister0, &OPRRegister1, &OPRFMULAllowNegative); ModifierGroups[0].Initialize(true, 1, &MRFMUL32IFTZ); ModifierGroups[1].Initialize(true, 3, &MRFMULRP, &MRFMULRM, &MRFMULRZ); ModifierGroups[2].Initialize(true, 1, &MRFMULSAT); }
ExpressionNode * OperatorNode::SelectOperands(const std::vector<unsigned> &indices) const { std::vector<Expression> new_operands; for (unsigned i = 0; i < GetArity(); i++) { for (unsigned j = 0; j < indices.size(); j++) if (j == i) new_operands.push_back(_operands[i]); } return SetOperands(new_operands); }
InstructionRuleFMUL32I(): InstructionRule("FMUL32I", 3, true, false) { hpBinaryStringToOpcode8("0100 000000 1110 000000 000000 00000000000000000000000000000000 001100", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegister0, &OPRRegister1, &OPR32I); ModifierGroups[0].Initialize(true, 1, &MRFMUL32IFTZ); ModifierGroups[1].Initialize(true, 1, &MRFMULSAT); ModifierGroups[2].Initialize(true, 1, &MRS); }
InstructionRuleFADD() : InstructionRule("FADD", 3, true, false) { hpBinaryStringToOpcode8("0000 000000111000000000000000000000000000000000000000000000001010", OpcodeWord0, OpcodeWord1); SetOperands(3, &OPRRegister0, &OPRFADD32IReg1, &OPRFADDCompositeWithOperator); ModifierGroups[0].Initialize(true, 1, &MRFADD32IFTZ); ModifierGroups[1].Initialize(true, 3, &MRFMULRP, &MRFMULRM, &MRFMULRZ); ModifierGroups[2].Initialize(true, 1, &MRFADDSAT); }
ExpressionNode *OperatorNode::RemoveOperand(unsigned num) const { assert((_type == EXPR_FUNCTION || _type == EXPR_PREDICATE || _type == EXPR_AND || _type == EXPR_OR) && 0 <= num && num < GetArity()); std::vector<Expression> new_operands = _operands; new_operands.erase(new_operands.begin() + num); assert(_operands.size() - 1 == new_operands.size()); return SetOperands(new_operands); }
InstructionRuleFFMA(): InstructionRule("FFMA", 4, true, false) { hpBinaryStringToOpcode8("0000 000000111000000000000000000000000000000000000000000000001100", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegister0, &OPRRegister1, &OPRFFMAAllowNegative, &OPRMAD3); ModifierGroups[0].Initialize(true, 1, &MRFMUL32IFTZ); ModifierGroups[1].Initialize(true, 3, &MRFMULRP, &MRFMULRM, &MRFMULRZ); ModifierGroups[2].Initialize(true, 1, &MRFMULSAT); ModifierGroups[3].Initialize(true, 1, &MRS); }
InstructionRuleCCTLL(): InstructionRule("CCTLL", 1, true, false) { hpBinaryStringToOpcode8("1010 000000 1110 000000 000000 000000000000000000000000 00000000 001011", OpcodeWord0, OpcodeWord1); SetOperands(2, &OPRRegister0, &OPRGlobalMemoryWithImmediate24); ModifierGroups[0].Initialize(false, 8, &MRCCTLOp2QRY1, &MRCCTLOp2PF1, &MRCCTLOp2PF1_5, &MRCCTLOp2PR2, &MRCCTLOp2WB, &MRCCTLOp2IV, &MRCCTLOp2IVALL, &MRCCTLOp2RS); }
InstructionRuleMUFU(): InstructionRule("MUFU", 2, true, false) { hpBinaryStringToOpcode8("0000 000000 1110 000000 000000 0000 0000000000000000000000000000 010011", OpcodeWord0, OpcodeWord1); SetOperands(2, &OPRRegister0, &OPRFADD32IReg1); ModifierGroups[0].Initialize(false, 8, &MRMUFUCOS, &MRMUFUSIN, &MRMUFUEX2, &MRMUFULG2, &MRMUFURCP, &MRMUFURSQ, &MRMUFURCP64H, &MRMUFURSQ64H); ModifierGroups[1].Initialize(true, 1, &MRFADD32IFTZ); }
ExpressionNode *OperatorNode::CannonizeOperandsOrder() { if (IsAND() || IsOR() || GetType() == EXPR_EQUALITY || GetType() == EXPR_DISEQUALITY || GetType() == EXPR_ARRAY_PARTIAL_EQUALITY) { std::vector<Expression> new_operands = GetOperands(); std::vector<Expression>::iterator i, iend = new_operands.end(); for (i = new_operands.begin(); i != iend; i++) i->CannonizeOperandsOrder(); if (!IsOR()) sort(new_operands.begin(), new_operands.end(), Expression::_PTR_LT); return SetOperands(new_operands); } return Clone(); }
InstructionRuleICMP(): InstructionRule("ICMP", 2, true, false) { hpBinaryStringToOpcode8("1100 010000 1110 000000 000000 0000000000000000000000 0 000000 000 001100", OpcodeWord0, OpcodeWord1); SetOperands(4, &OPRRegister0, &OPRRegister1, &OPRIMULStyle, &OPRRegister3ForCMP); ModifierGroups[0].Initialize(false, 6, &MRSETPComparisonLT, &MRSETPComparisonEQ, &MRSETPComparisonLE, &MRSETPComparisonGT, &MRSETPComparisonNE, &MRSETPComparisonGE); ModifierGroups[1].Initialize(true, 1, &MRIMUL1U32); }