Deleted Added
sdiff udiff text old ( 12234:78ece221f9f5 ) new ( 12275:4b4dd932c710 )
full compact
1// Copyright (c) 2006-2007 The Regents of The University of Michigan
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

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

23// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26//
27// Authors: Ali Saidi
28// Gabe Black
29// Steve Reinhardt
30
31def template ROrImmDecode {{
32 {
33 return (I ? (SparcStaticInst *)(new %(class_name)sImm(machInst))
34 : (SparcStaticInst *)(new %(class_name)s(machInst)));
35 }
36}};
37
38output header {{

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

116 rString += rOrImmMatch.group("typeQual")
117 iString = rOrImmMatch.group("iNum")
118 orig_code = code
119 code = matcher.sub('Rs' + rString, orig_code)
120 imm_code = matcher.sub('imm', orig_code)
121 return (True, code, imm_code, rString, iString)
122}};
123
124output exec {{
125 /// Check "FP enabled" machine status bit. Called when executing any FP
126 /// instruction.
127 /// @retval Full-system mode: NoFault if FP is enabled, FpDisabled
128 /// if not. Non-full-system mode: always returns NoFault.
129 static inline Fault
130 checkFpEnableFault(ExecContext *xc)
131 {
132 if (FullSystem) {
133 PSTATE pstate = xc->readMiscReg(MISCREG_PSTATE);
134 if (pstate.pef && xc->readMiscReg(MISCREG_FPRS) & 0x4) {
135 return NoFault;
136 } else {
137 return std::make_shared<FpDisabled>();
138 }
139 } else {
140 return NoFault;
141 }
142 }
143
144 static inline Fault
145 checkVecEnableFault(ExecContext *xc)
146 {
147 return std::make_shared<VecDisabled>();
148 }
149}};
150
151