2 Copyright (c) 2002-2009 Tampere University.
4 This file is part of TTA-Based Codesign Environment (TCE).
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
25 * @file MoveElement.icc
27 * Inline definitions of MoveElement class.
29 * @author Jussi Nykänen 2003 (nykanen-no.spam-cs.tut.fi)
30 * @author Mikael Lepistö 18.12.2003 (tmlepist-no.spam-cs.tut.fi)
31 * @note reviewed 21 October 2003 by ml, jn, rm, pj
33 * @note rating: yellow
39 * Returns true if move is emptyed.
41 * @return True if move is empty.
44MoveElement::isEmpty() const {
50 * Sets emptiness status of move.
52 * @param flag Status to set.
55MoveElement::setEmpty(bool flag) {
65MoveElement::bus() const {
70 * Sets the bus identification code.
72 * @param aBus The bus identification code to set.
75MoveElement::setBus(HalfWord aBus) {
80 * Returns source type.
82 * If source type is MVS_IMM it means that source refers to immediate
83 * element inside current instruction. Immediate element, which is
84 * may be determined by value of sourceUnit() and sourceIndex(). Referred
85 * Corresponding ImmediateElement, which has same values in destinationUnit()
86 * and destinationIndex() fields.
88 * @return The source type.
90inline MoveElement::FieldType
91MoveElement::sourceType() const {
96 * Returns destination type.
98 * @return The destination type.
100inline MoveElement::FieldType
101MoveElement::destinationType() const {
102 return destinationType_;
106 * Sets the type of the move source.
108 * @param aType The type of the source.
111MoveElement::setSourceType(FieldType aType) {
116 * Sets the type of the move destination.
118 * @param aType The type of the destination.
121MoveElement::setDestinationType(FieldType aType) {
122 destinationType_ = aType;
126 * Returns the source register file or unit.
130 * @return The source register file or unit.
133MoveElement::sourceUnit() const {
138 * Sets source register file or unit.
142 * @param aSourceUnit The source register file or unit.
145MoveElement::setSourceUnit(HalfWord aSourceUnit) {
146 sourceUnit_ = aSourceUnit;
150 * Returns source register index.
154 * @return The source register index.
157MoveElement::sourceIndex() const {
162 * Sets source register index.
166 * @param aSourceIndex The source register index.
169MoveElement::setSourceIndex(HalfWord aSourceIndex) {
170 sourceIndex_ = aSourceIndex;
174 * Returns destination register file or unit.
176 * @return The destination register file or unit.
179MoveElement::destinationUnit() const {
180 return destinationUnit_;
184 * Sets destination register file or unit.
186 * @param aDestinationUnit The destination register file or unit.
189MoveElement::setDestinationUnit(HalfWord aDestinationUnit) {
190 destinationUnit_ = aDestinationUnit;
194 * Returns destination register index.
196 * @return The destination register index.
199MoveElement::destinationIndex() const {
200 return destinationIndex_;
204 * Sets destination register index.
206 * @param aDestinationIndex The destination register index.
209MoveElement::setDestinationIndex(HalfWord aDestinationIndex) {
210 destinationIndex_ = aDestinationIndex;
214 * Returns true if guard of instruction is enabled.
216 * @return True if guard is enabled.
219MoveElement::isGuarded() const {
225 * Sets guard enabled status of move.
227 * @param flag Status to set.
230MoveElement::setGuarded(bool flag) {
235 * Returns true if guard of move is inverted.
237 * @return True if guard is inverted.
240MoveElement::isGuardInverted() const {
241 return isGuardInverted_;
245 * Sets inversion of guard register.
247 * @param flag Status to set.
250MoveElement::setGuardInverted(bool flag) {
251 isGuardInverted_ = flag;
255 * Returns type of referred guard register or port.
257 * @return Type of guard.
259inline MoveElement::FieldType
260MoveElement::guardType() const {
265 * Sets type of referred guard register or port.
267 * @param gType Type of guard.
270MoveElement::setGuardType(FieldType gType) {
275 * Returns the guard register file id
277 * @return The guard register file id.
280MoveElement::guardUnit() const {
285 * Sets guard register file id.
287 * @param aGuard The guard register file id.
290MoveElement::setGuardUnit(HalfWord aGuardUnit) {
291 guardUnit_ = aGuardUnit;
295 * Returns guard register index.
297 * @return The guard register index.
300MoveElement::guardIndex() const {
305 * Sets guard register index.
307 * @param aGuardIndex The guard register index.
310MoveElement::setGuardIndex(HalfWord aGuardIndex) {
311 guardIndex_ = aGuardIndex;