static_inst.hh (2680:246e7104f744) static_inst.hh (2741:a73a50764b86)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

29 */
30
31#ifndef __CPU_STATIC_INST_HH__
32#define __CPU_STATIC_INST_HH__
33
34#include <bitset>
35#include <string>
36
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

29 */
30
31#ifndef __CPU_STATIC_INST_HH__
32#define __CPU_STATIC_INST_HH__
33
34#include <bitset>
35#include <string>
36
37#include "base/bitfield.hh"
37#include "base/hashmap.hh"
38#include "base/misc.hh"
39#include "base/refcnt.hh"
40#include "cpu/op_class.hh"
41#include "sim/host.hh"
42#include "arch/isa_traits.hh"
43
44// forward declarations

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

406 static void dumpDecodeCacheStats();
407
408 /// Decode a machine instruction.
409 /// @param mach_inst The binary instruction to decode.
410 /// @retval A pointer to the corresponding StaticInst object.
411 //This is defined as inline below.
412 static StaticInstPtr decode(ExtMachInst mach_inst);
413
38#include "base/hashmap.hh"
39#include "base/misc.hh"
40#include "base/refcnt.hh"
41#include "cpu/op_class.hh"
42#include "sim/host.hh"
43#include "arch/isa_traits.hh"
44
45// forward declarations

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

407 static void dumpDecodeCacheStats();
408
409 /// Decode a machine instruction.
410 /// @param mach_inst The binary instruction to decode.
411 /// @retval A pointer to the corresponding StaticInst object.
412 //This is defined as inline below.
413 static StaticInstPtr decode(ExtMachInst mach_inst);
414
414 //MIPS Decoder Debug Functions
415 int getOpcode() { return (machInst & 0xFC000000) >> 26 ; }//31..26
416 int getRs() { return (machInst & 0x03E00000) >> 21; } //25...21
417 int getRt() { return (machInst & 0x001F0000) >> 16; } //20...16
418 int getRd() { return (machInst & 0x0000F800) >> 11; } //15...11
419 int getImm() { return (machInst & 0x0000FFFF); } //15...0
420 int getFunction(){ return (machInst & 0x0000003F); }//5...0
421 int getBranch(){ return (machInst & 0x0000FFFF); }//15...0
422 int getJump(){ return (machInst & 0x03FFFFFF); }//5...0
423 int getHint(){ return (machInst & 0x000007C0) >> 6; } //10...6
415 /// Return opcode of machine instruction
416 uint32_t getOpcode() { return bits(machInst, 31, 26);}
417
418 /// Return name of machine instruction
424 std::string getName() { return mnemonic; }
425};
426
427typedef RefCountingPtr<StaticInstBase> StaticInstBasePtr;
428
429/// Reference-counted pointer to a StaticInst object.
430/// This type should be used instead of "StaticInst *" so that
431/// StaticInst objects can be properly reference-counted.

--- 61 unchanged lines hidden ---
419 std::string getName() { return mnemonic; }
420};
421
422typedef RefCountingPtr<StaticInstBase> StaticInstBasePtr;
423
424/// Reference-counted pointer to a StaticInst object.
425/// This type should be used instead of "StaticInst *" so that
426/// StaticInst objects can be properly reference-counted.

--- 61 unchanged lines hidden ---