fp.isa (12110:c24ee249b8ba) fp.isa (12234:78ece221f9f5)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

37// BasicOperateWithNopCheck.
38//
39
40output exec {{
41 /// Check "FP enabled" machine status bit. Called when executing any FP
42 /// instruction in full-system mode.
43 /// @retval Full-system mode: NoFault if FP is enabled, FenFault
44 /// if not. Non-full-system mode: always returns NoFault.
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

37// BasicOperateWithNopCheck.
38//
39
40output exec {{
41 /// Check "FP enabled" machine status bit. Called when executing any FP
42 /// instruction in full-system mode.
43 /// @retval Full-system mode: NoFault if FP is enabled, FenFault
44 /// if not. Non-full-system mode: always returns NoFault.
45 inline Fault checkFpEnableFault(CPU_EXEC_CONTEXT *xc)
45 inline Fault checkFpEnableFault(ExecContext *xc)
46 {
47 Fault fault = NoFault; // dummy... this ipr access should not fault
48 if (FullSystem && !ICSR_FPE(xc->readMiscReg(IPR_ICSR))) {
49 fault = std::make_shared<FloatEnableFault>();
50 }
51 return fault;
52 }
46 {
47 Fault fault = NoFault; // dummy... this ipr access should not fault
48 if (FullSystem && !ICSR_FPE(xc->readMiscReg(IPR_ICSR))) {
49 fault = std::make_shared<FloatEnableFault>();
50 }
51 return fault;
52 }
53 inline Fault checkVectorEnableFault(CPU_EXEC_CONTEXT *xc) {
53 inline Fault checkVectorEnableFault(ExecContext *xc) {
54 return std::make_shared<VectorEnableFault>();
55 }
56}};
57
58output header {{
59 /**
60 * Base class for general floating-point instructions. Includes
61 * support for various Alpha rounding and trapping modes. Only FP

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

201 { "", "u", "INVTM2", "INVTM3", "INVTM4", "su", "INVTM6", "sui" };
202 const char *AlphaFP::intTrappingModeSuffix[] =
203 { "", "v", "INVTM2", "INVTM3", "INVTM4", "sv", "INVTM6", "svi" };
204}};
205
206// FP instruction class execute method template. Handles non-standard
207// rounding modes.
208def template FloatingPointExecute {{
54 return std::make_shared<VectorEnableFault>();
55 }
56}};
57
58output header {{
59 /**
60 * Base class for general floating-point instructions. Includes
61 * support for various Alpha rounding and trapping modes. Only FP

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

201 { "", "u", "INVTM2", "INVTM3", "INVTM4", "su", "INVTM6", "sui" };
202 const char *AlphaFP::intTrappingModeSuffix[] =
203 { "", "v", "INVTM2", "INVTM3", "INVTM4", "sv", "INVTM6", "svi" };
204}};
205
206// FP instruction class execute method template. Handles non-standard
207// rounding modes.
208def template FloatingPointExecute {{
209 Fault %(class_name)s::execute(CPU_EXEC_CONTEXT *xc,
209 Fault %(class_name)s::execute(ExecContext *xc,
210 Trace::InstRecord *traceData) const
211 {
212 if (trappingMode != Imprecise && !warnedOnTrapping) {
213 warn("%s: non-standard trapping mode not supported",
214 generateDisassembly(0, NULL));
215 warnedOnTrapping = true;
216 }
217

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

245 return fault;
246 }
247}};
248
249// FP instruction class execute method template where no dynamic
250// rounding mode control is needed. Like BasicExecute, but includes
251// check & warning for non-standard trapping mode.
252def template FPFixedRoundingExecute {{
210 Trace::InstRecord *traceData) const
211 {
212 if (trappingMode != Imprecise && !warnedOnTrapping) {
213 warn("%s: non-standard trapping mode not supported",
214 generateDisassembly(0, NULL));
215 warnedOnTrapping = true;
216 }
217

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

245 return fault;
246 }
247}};
248
249// FP instruction class execute method template where no dynamic
250// rounding mode control is needed. Like BasicExecute, but includes
251// check & warning for non-standard trapping mode.
252def template FPFixedRoundingExecute {{
253 Fault %(class_name)s::execute(CPU_EXEC_CONTEXT *xc,
253 Fault %(class_name)s::execute(ExecContext *xc,
254 Trace::InstRecord *traceData) const
255 {
256 if (trappingMode != Imprecise && !warnedOnTrapping) {
257 warn("%s: non-standard trapping mode not supported",
258 generateDisassembly(0, NULL));
259 warnedOnTrapping = true;
260 }
261

--- 47 unchanged lines hidden ---
254 Trace::InstRecord *traceData) const
255 {
256 if (trappingMode != Imprecise && !warnedOnTrapping) {
257 warn("%s: non-standard trapping mode not supported",
258 generateDisassembly(0, NULL));
259 warnedOnTrapping = true;
260 }
261

--- 47 unchanged lines hidden ---