base.isa (7799:5d0f62927d75) | base.isa (8565:d9b69f03e7af) |
---|---|
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 --- 546 unchanged lines hidden (view full) --- 555 } 556 panic("Tried testing condition nonexistant " 557 "condition code %d", condition); 558 } 559}}; 560 561output exec {{ 562 /// Check "FP enabled" machine status bit. Called when executing any FP | 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 --- 546 unchanged lines hidden (view full) --- 555 } 556 panic("Tried testing condition nonexistant " 557 "condition code %d", condition); 558 } 559}}; 560 561output exec {{ 562 /// Check "FP enabled" machine status bit. Called when executing any FP |
563 /// instruction in full-system mode. | 563 /// instruction. |
564 /// @retval Full-system mode: NoFault if FP is enabled, FpDisabled 565 /// if not. Non-full-system mode: always returns NoFault. | 564 /// @retval Full-system mode: NoFault if FP is enabled, FpDisabled 565 /// if not. Non-full-system mode: always returns NoFault. |
566#if FULL_SYSTEM 567 inline Fault | 566 static inline Fault |
568 checkFpEnableFault(%(CPU_exec_context)s *xc) 569 { | 567 checkFpEnableFault(%(CPU_exec_context)s *xc) 568 { |
570 Fault fault = NoFault; // dummy... this ipr access should not fault 571 if (xc->readMiscReg(MISCREG_PSTATE) & PSTATE::pef && 572 xc->readMiscReg(MISCREG_FPRS) & 0x4) { 573 return NoFault; | 569 if (FULL_SYSTEM) { 570 if (xc->readMiscReg(MISCREG_PSTATE) & PSTATE::pef && 571 xc->readMiscReg(MISCREG_FPRS) & 0x4) { 572 return NoFault; 573 } else { 574 return new FpDisabled; 575 } |
574 } else { | 576 } else { |
575 return new FpDisabled; | 577 return NoFault; |
576 } 577 } | 578 } 579 } |
578#else 579 inline Fault 580 checkFpEnableFault(%(CPU_exec_context)s *xc) 581 { 582 return NoFault; 583 } 584#endif | |
585}}; 586 587 | 580}}; 581 582 |