gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
utility.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2005 The Regents of The University of Michigan
3  * Copyright (c) 2007 MIPS Technologies, Inc.
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
9  * notice, this list of conditions and the following disclaimer;
10  * redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution;
13  * neither the name of the copyright holders nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __ARCH_MIPS_UTILITY_HH__
31 #define __ARCH_MIPS_UTILITY_HH__
32 
33 #include "arch/mips/page_size.hh"
34 #include "arch/mips/regs/misc.hh"
35 #include "arch/mips/types.hh"
36 #include "base/logging.hh"
37 #include "base/types.hh"
38 #include "cpu/static_inst.hh"
39 #include "cpu/thread_context.hh"
40 
41 namespace gem5
42 {
43 
44 class ThreadContext;
45 
46 namespace MipsISA {
47 
49 //
50 // Floating Point Utility Functions
51 //
52 uint64_t fpConvert(ConvertType cvt_type, double fp_val);
53 double roundFP(double val, int digits);
54 double truncFP(double val);
55 
56 bool getCondCode(uint32_t fcsr, int cc);
57 uint32_t genCCVector(uint32_t fcsr, int num, uint32_t cc_val);
58 uint32_t genInvalidVector(uint32_t fcsr);
59 
60 bool isNan(void *val_ptr, int size);
61 bool isQnan(void *val_ptr, int size);
62 bool isSnan(void *val_ptr, int size);
63 
65 //
66 // Translation stuff
67 //
68 inline Addr
70 {
71  return addr & ~(PageBytes - 1);
72 }
73 
74 inline Addr
76 {
77  return (addr + PageBytes - 1) & ~(PageBytes - 1);
78 }
79 
80 } // namespace MipsISA
81 } // namespace gem5
82 
83 #endif
gem5::MipsISA::genCCVector
uint32_t genCCVector(uint32_t fcsr, int cc_num, uint32_t cc_val)
Definition: utility.cc:120
misc.hh
types.hh
gem5::MipsISA::truncFP
double truncFP(double val)
Definition: utility.cc:105
gem5::MipsISA::fpConvert
uint64_t fpConvert(ConvertType cvt_type, double fp_val)
Definition: utility.cc:50
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:776
gem5::MipsISA::PageBytes
const Addr PageBytes
Definition: page_size.hh:42
page_size.hh
gem5::MipsISA::genInvalidVector
uint32_t genInvalidVector(uint32_t fcsr_bits)
Definition: utility.cc:132
gem5::MipsISA::isQnan
bool isQnan(void *val_ptr, int size)
Definition: utility.cc:169
static_inst.hh
gem5::MipsISA::roundFP
double roundFP(double val, int digits)
Definition: utility.cc:94
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::MipsISA::getCondCode
bool getCondCode(uint32_t fcsr, int cc_idx)
Definition: utility.cc:112
types.hh
gem5::MipsISA::ConvertType
ConvertType
Definition: types.hh:46
gem5::MipsISA::isNan
bool isNan(void *val_ptr, int size)
Definition: utility.cc:146
gem5::MipsISA::RoundPage
Addr RoundPage(Addr addr)
Definition: utility.hh:75
logging.hh
gem5::MipsISA::isSnan
bool isSnan(void *val_ptr, int size)
Definition: utility.cc:191
gem5::MipsISA::TruncPage
Addr TruncPage(Addr addr)
Definition: utility.hh:69
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
thread_context.hh
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Sun Jul 30 2023 01:56:50 for gem5 by doxygen 1.8.17