Deleted Added
sdiff udiff text old ( 12105:742d80361989 ) new ( 12106:7784fac1b159 )
full compact
1/*
2 * Copyright (c) 2011, 2016 ARM Limited
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

47
48#include <vector>
49
50#include "arch/types.hh"
51#include "base/types.hh"
52#include "cpu/inst_seq.hh"
53#include "sim/faults.hh"
54
55// Typedef for physical register index type. Although the Impl would be the
56// most likely location for this, there are a few classes that need this
57// typedef yet are not templated on the Impl. For now it will be defined here.
58typedef short int PhysRegIndex;
59// Physical register ID
60// Associate a physical register index to a register class and
61// so it is easy to track which type of register are used.
62// A flat index is also provided for when it is useful to have a unified
63// indexing (for the dependency graph and the scoreboard for example)
64struct PhysRegId {
65 RegClass regClass;
66 PhysRegIndex regIdx;
67 PhysRegIndex flatIdx;
68 PhysRegId(RegClass _regClass, PhysRegIndex _regIdx,
69 PhysRegIndex _flatIdx)
70 : regClass(_regClass), regIdx(_regIdx), flatIdx(_flatIdx)
71 {}
72
73 bool operator==(const PhysRegId& that) const {
74 return regClass == that.regClass && regIdx == that.regIdx;
75 }
76
77 bool operator!=(const PhysRegId& that) const {
78 return !(*this==that);
79 }
80
81 bool isZeroReg() const
82 {
83 return (regIdx == TheISA::ZeroReg &&
84 (regClass == IntRegClass ||
85 (THE_ISA == ALPHA_ISA && regClass == FloatRegClass)));
86 }
87
88 /** @return true if it is an integer physical register. */
89 bool isIntPhysReg() const { return regClass == IntRegClass; }
90
91 /** @return true if it is a floating-point physical register. */
92 bool isFloatPhysReg() const { return regClass == FloatRegClass; }
93
94 /** @Return true if it is a condition-code physical register. */
95 bool isCCPhysReg() const { return regClass == CCRegClass; }
96
97 /**
98 * Returns true if this register is always associated to the same
99 * architectural register.
100 */
101 bool isFixedMapping() const
102 {
103 return regClass == MiscRegClass;
104 }
105};
106
107// PhysRegIds only need to be created once and then we can use the following
108// to work with them
109typedef const PhysRegId* PhysRegIdPtr;
110
111/** Struct that defines the information passed from fetch to decode. */
112template<class Impl>

--- 176 unchanged lines hidden ---