Exemplo n.º 1
0
	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);
	}
Exemplo n.º 2
0
	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);
	}
Exemplo n.º 3
0
	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);
	}
Exemplo n.º 4
0
	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);
	}
Exemplo n.º 5
0
	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);
	}
Exemplo n.º 6
0
	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);
	}
Exemplo n.º 7
0
	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);
	}
Exemplo n.º 8
0
	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);
	}
Exemplo n.º 9
0
	InstructionRulePOPC(): InstructionRule("POPC", 0, true, false)
	{
		hpBinaryStringToOpcode8("0010 000000 1110 000000 000000 0000000000000000000000 0000000000 101010", OpcodeWord0, OpcodeWord1);
		SetOperands(3,
					&OPRRegister0,
					&OPRLOP1,
					&OPRLOP2);
	}
Exemplo n.º 10
0
	InstructionRuleFADD32I() : InstructionRule("FADD32I", 1, true, false)
	{
		hpBinaryStringToOpcode8("0100 000000111000000000000000000000000000000000000000000000010100", OpcodeWord0, OpcodeWord1);
		SetOperands(3, 
					&OPRRegister0,
					&OPRFADD32IReg1,
					&OPR32I);
		ModifierGroups[0].Initialize(true, 1, &MRFADD32IFTZ);
	}
Exemplo n.º 11
0
	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);
	}
Exemplo n.º 12
0
	InstructionRuleISCADD(): InstructionRule("ISCADD", 0, true, false)
	{
		hpBinaryStringToOpcode8("1100 0 00000 1110 000000 000000 0000000000000000000000 0000000000 000010", OpcodeWord0, OpcodeWord1);
		SetOperands(4,
					&OPRRegisterWithCCAt16,
					&OPRISCADDReg1,
					&OPRISCADDAllowNegative,
					&OPRISCADDShift);
	}
Exemplo n.º 13
0
	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);
	}
Exemplo n.º 14
0
	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);
	}
Exemplo n.º 15
0
	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);
	}
Exemplo n.º 16
0
	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);
	}
Exemplo n.º 17
0
	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);
	}
Exemplo n.º 18
0
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);
}
Exemplo n.º 19
0
	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);
	}
Exemplo n.º 20
0
	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);
	}
Exemplo n.º 21
0
	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);
	}
Exemplo n.º 22
0
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);
}
Exemplo n.º 23
0
	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);
					
	}
Exemplo n.º 24
0
	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);

	}
Exemplo n.º 25
0
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);
}
Exemplo n.º 26
0
	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);
	}
Exemplo n.º 27
0
	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);
	}
Exemplo n.º 28
0
	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);
	}
Exemplo n.º 29
0
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();
}
Exemplo n.º 30
0
	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);
	}