pred_inst.hh (6306:fe1004d455b2) pred_inst.hh (7099:1949ba4db2cf)
1/* Copyright (c) 2007-2008 The Florida State University
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 37 unchanged lines hidden (view full) ---

46 */
47class PredOp : public ArmStaticInst
48{
49 protected:
50
51 ConditionCode condCode;
52
53 /// Constructor
1/* Copyright (c) 2007-2008 The Florida State University
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 37 unchanged lines hidden (view full) ---

46 */
47class PredOp : public ArmStaticInst
48{
49 protected:
50
51 ConditionCode condCode;
52
53 /// Constructor
54 PredOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
54 PredOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
55 ArmStaticInst(mnem, _machInst, __opClass),
56 condCode((ConditionCode)(unsigned)machInst.condCode)
57 {
58 }
59};
60
61/**
62 * Base class for predicated immediate operations.
63 */
64class PredImmOp : public PredOp
65{
66 protected:
67
68 uint32_t imm;
69 uint32_t rotate;
70 uint32_t rotated_imm;
71 uint32_t rotated_carry;
72
73 /// Constructor
55 ArmStaticInst(mnem, _machInst, __opClass),
56 condCode((ConditionCode)(unsigned)machInst.condCode)
57 {
58 }
59};
60
61/**
62 * Base class for predicated immediate operations.
63 */
64class PredImmOp : public PredOp
65{
66 protected:
67
68 uint32_t imm;
69 uint32_t rotate;
70 uint32_t rotated_imm;
71 uint32_t rotated_carry;
72
73 /// Constructor
74 PredImmOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
74 PredImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
75 PredOp(mnem, _machInst, __opClass),
76 imm(machInst.imm), rotate(machInst.rotate << 1),
77 rotated_imm(0), rotated_carry(0)
78 {
79 rotated_imm = rotate_imm(imm, rotate);
80 if (rotate != 0)
81 rotated_carry = (rotated_imm >> 31) & 1;
82 }

--- 7 unchanged lines hidden (view full) ---

90class PredIntOp : public PredOp
91{
92 protected:
93
94 uint32_t shift_size;
95 uint32_t shift;
96
97 /// Constructor
75 PredOp(mnem, _machInst, __opClass),
76 imm(machInst.imm), rotate(machInst.rotate << 1),
77 rotated_imm(0), rotated_carry(0)
78 {
79 rotated_imm = rotate_imm(imm, rotate);
80 if (rotate != 0)
81 rotated_carry = (rotated_imm >> 31) & 1;
82 }

--- 7 unchanged lines hidden (view full) ---

90class PredIntOp : public PredOp
91{
92 protected:
93
94 uint32_t shift_size;
95 uint32_t shift;
96
97 /// Constructor
98 PredIntOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
98 PredIntOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
99 PredOp(mnem, _machInst, __opClass),
100 shift_size(machInst.shiftSize), shift(machInst.shift)
101 {
102 }
103
104 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
105};
106
107/**
108 * Base class for predicated macro-operations.
109 */
110class PredMacroOp : public PredOp
111{
112 protected:
113
114 uint32_t numMicroops;
115 StaticInstPtr * microOps;
116
117 /// Constructor
99 PredOp(mnem, _machInst, __opClass),
100 shift_size(machInst.shiftSize), shift(machInst.shift)
101 {
102 }
103
104 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
105};
106
107/**
108 * Base class for predicated macro-operations.
109 */
110class PredMacroOp : public PredOp
111{
112 protected:
113
114 uint32_t numMicroops;
115 StaticInstPtr * microOps;
116
117 /// Constructor
118 PredMacroOp(const char *mnem, MachInst _machInst, OpClass __opClass) :
118 PredMacroOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
119 PredOp(mnem, _machInst, __opClass),
120 numMicroops(0)
121 {
122 // We rely on the subclasses of this object to handle the
123 // initialization of the micro-operations, since they are
124 // all of variable length
125 flags[IsMacroop] = true;
126 }

--- 15 unchanged lines hidden (view full) ---

142};
143
144/**
145 * Base class for predicated micro-operations.
146 */
147class PredMicroop : public PredOp
148{
149 /// Constructor
119 PredOp(mnem, _machInst, __opClass),
120 numMicroops(0)
121 {
122 // We rely on the subclasses of this object to handle the
123 // initialization of the micro-operations, since they are
124 // all of variable length
125 flags[IsMacroop] = true;
126 }

--- 15 unchanged lines hidden (view full) ---

142};
143
144/**
145 * Base class for predicated micro-operations.
146 */
147class PredMicroop : public PredOp
148{
149 /// Constructor
150 PredMicroop(const char *mnem, MachInst _machInst, OpClass __opClass) :
150 PredMicroop(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
151 PredOp(mnem, _machInst, __opClass)
152 {
153 flags[IsMicroop] = true;
154 }
155};
156}
157
158#endif //__ARCH_ARM_INSTS_PREDINST_HH__
151 PredOp(mnem, _machInst, __opClass)
152 {
153 flags[IsMicroop] = true;
154 }
155};
156}
157
158#endif //__ARCH_ARM_INSTS_PREDINST_HH__