microregop.cc (5077:4c25f95fa600) microregop.cc (5083:49559a8060e8)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

88 flags |= (flagMask & (EZFBit | ZFBit));
89 if(flagMask & SFBit && findNegative(dataSize*8, _dest))
90 flags |= SFBit;
91 if(flagMask & OFBit && findOverflow(dataSize*8, _dest, _src1, _src2))
92 flags |= OFBit;
93 return flags;
94 }
95
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

88 flags |= (flagMask & (EZFBit | ZFBit));
89 if(flagMask & SFBit && findNegative(dataSize*8, _dest))
90 flags |= SFBit;
91 if(flagMask & OFBit && findOverflow(dataSize*8, _dest, _src1, _src2))
92 flags |= OFBit;
93 return flags;
94 }
95
96 bool RegOpBase::checkCondition(uint64_t flags) const
97 {
98 CCFlagBits ccflags = flags;
99 switch(ext)
100 {
101 case ConditionTests::True:
102 return true;
103 case ConditionTests::ECF:
104 return ccflags.ECF;
105 case ConditionTests::EZF:
106 return ccflags.EZF;
107 case ConditionTests::SZnZF:
108 return !(!ccflags.EZF & ccflags.ZF);
109 case ConditionTests::MSTRZ:
110 panic("This condition is not implemented!");
111 case ConditionTests::STRZ:
112 panic("This condition is not implemented!");
113 case ConditionTests::MSTRC:
114 panic("This condition is not implemented!");
115 case ConditionTests::STRZnEZF:
116 return !ccflags.EZF & ccflags.ZF;
117 //And no interrupts or debug traps are waiting
118 case ConditionTests::OF:
119 return ccflags.OF;
120 case ConditionTests::CF:
121 return ccflags.CF;
122 case ConditionTests::ZF:
123 return ccflags.ZF;
124 case ConditionTests::CvZF:
125 return ccflags.CF | ccflags.ZF;
126 case ConditionTests::SF:
127 return ccflags.SF;
128 case ConditionTests::PF:
129 return ccflags.PF;
130 case ConditionTests::SxOF:
131 return ccflags.SF ^ ccflags.OF;
132 case ConditionTests::SxOvZF:
133 return ccflags.SF ^ ccflags.OF | ccflags.ZF;
134 case ConditionTests::False:
135 return false;
136 case ConditionTests::NotECF:
137 return !ccflags.ECF;
138 case ConditionTests::NotEZF:
139 return !ccflags.EZF;
140 case ConditionTests::NotSZnZF:
141 return !ccflags.EZF & ccflags.ZF;
142 case ConditionTests::NotMSTRZ:
143 panic("This condition is not implemented!");
144 case ConditionTests::NotSTRZ:
145 panic("This condition is not implemented!");
146 case ConditionTests::NotMSTRC:
147 panic("This condition is not implemented!");
148 case ConditionTests::STRnZnEZF:
149 return !ccflags.EZF & !ccflags.ZF;
150 //And no interrupts or debug traps are waiting
151 case ConditionTests::NotOF:
152 return !ccflags.OF;
153 case ConditionTests::NotCF:
154 return !ccflags.CF;
155 case ConditionTests::NotZF:
156 return !ccflags.ZF;
157 case ConditionTests::NotCvZF:
158 return !(ccflags.CF | ccflags.ZF);
159 case ConditionTests::NotSF:
160 return !ccflags.SF;
161 case ConditionTests::NotPF:
162 return !ccflags.PF;
163 case ConditionTests::NotSxOF:
164 return !(ccflags.SF ^ ccflags.OF);
165 case ConditionTests::NotSxOvZF:
166 return !(ccflags.SF ^ ccflags.OF | ccflags.ZF);
167 }
168 panic("Unknown condition: %d\n", ext);
169 return true;
170 }
171
172 std::string RegOp::generateDisassembly(Addr pc,
173 const SymbolTable *symtab) const
174 {
175 std::stringstream response;
176
177 printMnemonic(response, instMnem, mnemonic);
178 printDestReg(response, 0, dataSize);
179 response << ", ";

--- 19 unchanged lines hidden ---
96 std::string RegOp::generateDisassembly(Addr pc,
97 const SymbolTable *symtab) const
98 {
99 std::stringstream response;
100
101 printMnemonic(response, instMnem, mnemonic);
102 printDestReg(response, 0, dataSize);
103 response << ", ";

--- 19 unchanged lines hidden ---