microop.cc (5083:49559a8060e8) microop.cc (5138:069bbeae1ef8)
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 *

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

64 bool X86MicroopBase::checkCondition(uint64_t flags, int condition) const
65 {
66 CCFlagBits ccflags = flags;
67 switch(condition)
68 {
69 case ConditionTests::True:
70 return true;
71 case ConditionTests::ECF:
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 *

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

64 bool X86MicroopBase::checkCondition(uint64_t flags, int condition) const
65 {
66 CCFlagBits ccflags = flags;
67 switch(condition)
68 {
69 case ConditionTests::True:
70 return true;
71 case ConditionTests::ECF:
72 return ccflags.ECF;
72 return ccflags.ecf;
73 case ConditionTests::EZF:
73 case ConditionTests::EZF:
74 return ccflags.EZF;
74 return ccflags.ezf;
75 case ConditionTests::SZnZF:
75 case ConditionTests::SZnZF:
76 return !(!ccflags.EZF & ccflags.ZF);
76 return !(!ccflags.ezf & ccflags.zf);
77 case ConditionTests::MSTRZ:
78 panic("This condition is not implemented!");
79 case ConditionTests::STRZ:
80 panic("This condition is not implemented!");
81 case ConditionTests::MSTRC:
82 panic("This condition is not implemented!");
83 case ConditionTests::STRZnEZF:
77 case ConditionTests::MSTRZ:
78 panic("This condition is not implemented!");
79 case ConditionTests::STRZ:
80 panic("This condition is not implemented!");
81 case ConditionTests::MSTRC:
82 panic("This condition is not implemented!");
83 case ConditionTests::STRZnEZF:
84 return !ccflags.EZF & ccflags.ZF;
84 return !ccflags.ezf & ccflags.zf;
85 //And no interrupts or debug traps are waiting
86 case ConditionTests::OF:
85 //And no interrupts or debug traps are waiting
86 case ConditionTests::OF:
87 return ccflags.OF;
87 return ccflags.of;
88 case ConditionTests::CF:
88 case ConditionTests::CF:
89 return ccflags.CF;
89 return ccflags.cf;
90 case ConditionTests::ZF:
90 case ConditionTests::ZF:
91 return ccflags.ZF;
91 return ccflags.zf;
92 case ConditionTests::CvZF:
92 case ConditionTests::CvZF:
93 return ccflags.CF | ccflags.ZF;
93 return ccflags.cf | ccflags.zf;
94 case ConditionTests::SF:
94 case ConditionTests::SF:
95 return ccflags.SF;
95 return ccflags.sf;
96 case ConditionTests::PF:
96 case ConditionTests::PF:
97 return ccflags.PF;
97 return ccflags.pf;
98 case ConditionTests::SxOF:
98 case ConditionTests::SxOF:
99 return ccflags.SF ^ ccflags.OF;
99 return ccflags.sf ^ ccflags.of;
100 case ConditionTests::SxOvZF:
100 case ConditionTests::SxOvZF:
101 return ccflags.SF ^ ccflags.OF | ccflags.ZF;
101 return ccflags.sf ^ ccflags.of | ccflags.zf;
102 case ConditionTests::False:
103 return false;
104 case ConditionTests::NotECF:
102 case ConditionTests::False:
103 return false;
104 case ConditionTests::NotECF:
105 return !ccflags.ECF;
105 return !ccflags.ecf;
106 case ConditionTests::NotEZF:
106 case ConditionTests::NotEZF:
107 return !ccflags.EZF;
107 return !ccflags.ezf;
108 case ConditionTests::NotSZnZF:
108 case ConditionTests::NotSZnZF:
109 return !ccflags.EZF & ccflags.ZF;
109 return !ccflags.ezf & ccflags.zf;
110 case ConditionTests::NotMSTRZ:
111 panic("This condition is not implemented!");
112 case ConditionTests::NotSTRZ:
113 panic("This condition is not implemented!");
114 case ConditionTests::NotMSTRC:
115 panic("This condition is not implemented!");
116 case ConditionTests::STRnZnEZF:
110 case ConditionTests::NotMSTRZ:
111 panic("This condition is not implemented!");
112 case ConditionTests::NotSTRZ:
113 panic("This condition is not implemented!");
114 case ConditionTests::NotMSTRC:
115 panic("This condition is not implemented!");
116 case ConditionTests::STRnZnEZF:
117 return !ccflags.EZF & !ccflags.ZF;
117 return !ccflags.ezf & !ccflags.zf;
118 //And no interrupts or debug traps are waiting
119 case ConditionTests::NotOF:
118 //And no interrupts or debug traps are waiting
119 case ConditionTests::NotOF:
120 return !ccflags.OF;
120 return !ccflags.of;
121 case ConditionTests::NotCF:
121 case ConditionTests::NotCF:
122 return !ccflags.CF;
122 return !ccflags.cf;
123 case ConditionTests::NotZF:
123 case ConditionTests::NotZF:
124 return !ccflags.ZF;
124 return !ccflags.zf;
125 case ConditionTests::NotCvZF:
125 case ConditionTests::NotCvZF:
126 return !(ccflags.CF | ccflags.ZF);
126 return !(ccflags.cf | ccflags.zf);
127 case ConditionTests::NotSF:
127 case ConditionTests::NotSF:
128 return !ccflags.SF;
128 return !ccflags.sf;
129 case ConditionTests::NotPF:
129 case ConditionTests::NotPF:
130 return !ccflags.PF;
130 return !ccflags.pf;
131 case ConditionTests::NotSxOF:
131 case ConditionTests::NotSxOF:
132 return !(ccflags.SF ^ ccflags.OF);
132 return !(ccflags.sf ^ ccflags.of);
133 case ConditionTests::NotSxOvZF:
133 case ConditionTests::NotSxOvZF:
134 return !(ccflags.SF ^ ccflags.OF | ccflags.ZF);
134 return !(ccflags.sf ^ ccflags.of | ccflags.zf);
135 }
136 panic("Unknown condition: %d\n", condition);
137 return true;
138 }
139}
135 }
136 panic("Unknown condition: %d\n", condition);
137 return true;
138 }
139}