1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated 11 * unmodified and in its entirety in all distributions of the software, 12 * modified or unmodified, in source code or in binary form. 13 * 14 * Copyright (c) 2007-2008 The Florida State University |
15 * All rights reserved. 16 * 17 * Redistribution and use in source and binary forms, with or without 18 * modification, are permitted provided that the following conditions are 19 * met: redistributions of source code must retain the above copyright 20 * notice, this list of conditions and the following disclaimer; 21 * redistributions in binary form must reproduce the above copyright 22 * notice, this list of conditions and the following disclaimer in the --- 46 unchanged lines hidden (view full) --- 69 condCode((ConditionCode)(unsigned)machInst.condCode) 70 { 71 } 72}; 73 74/** 75 * Base class for predicated immediate operations. 76 */ |
77class PredImmOpBase : public PredOp |
78{ 79 protected: 80 81 uint32_t imm; |
82 uint32_t rotated_imm; 83 uint32_t rotated_carry; 84 85 /// Constructor |
86 PredImmOpBase(const char *mnem, ExtMachInst _machInst, OpClass __opClass) : 87 PredOp(mnem, _machInst, __opClass), 88 imm(machInst.imm), rotated_imm(0), rotated_carry(0) 89 { 90 } 91 92 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const; 93}; 94 95/** 96 * Base class for regular predicated immediate operations. 97 */ 98class PredImmOp : public PredImmOpBase 99{ 100 protected: 101 102 uint32_t rotate; 103 104 /// Constructor |
105 PredImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) : |
106 PredImmOpBase(mnem, _machInst, __opClass), 107 rotate(machInst.rotate << 1) |
108 { 109 rotated_imm = rotate_imm(imm, rotate); 110 if (rotate != 0) |
111 rotated_carry = bits(rotated_imm, 31); |
112 } |
113}; |
114 |
115/** 116 * Base class for modified predicated immediate operations. 117 */ 118class PredModImmOp : public PredImmOpBase 119{ 120 protected: 121 122 uint8_t ctrlImm; 123 uint8_t dataImm; 124 125 126 /// Constructor 127 PredModImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) : 128 PredImmOpBase(mnem, _machInst, __opClass), 129 ctrlImm(bits(machInst.instBits, 26) << 3 | 130 bits(machInst.instBits, 14, 12)), 131 dataImm(bits(machInst.instBits, 7, 0)) 132 { 133 rotated_imm = modified_imm(ctrlImm, dataImm); 134 rotated_carry = bits(rotated_imm, 31); 135 } |
136}; 137 138/** 139 * Base class for predicated integer operations. 140 */ 141class PredIntOp : public PredOp 142{ 143 protected: --- 66 unchanged lines hidden --- |