Deleted Added
sdiff udiff text old ( 9531:1114ead790eb ) new ( 9913:7f43babfde6a )
full compact
1/*
2 * Copyright (c) 2010-2012 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

42 */
43
44#include <list>
45
46#include "arch/isa_traits.hh"
47#include "arch/registers.hh"
48#include "config/the_isa.hh"
49#include "cpu/o3/rename.hh"
50#include "debug/Activity.hh"
51#include "debug/Rename.hh"
52#include "debug/O3PipeView.hh"
53#include "params/DerivO3CPU.hh"
54
55using namespace std;
56
57template <class Impl>

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

943 unsigned num_src_regs = inst->numSrcRegs();
944
945 // Get the architectual register numbers from the source and
946 // destination operands, and redirect them to the right register.
947 // Will need to mark dependencies though.
948 for (int src_idx = 0; src_idx < num_src_regs; src_idx++) {
949 RegIndex src_reg = inst->srcRegIdx(src_idx);
950 RegIndex flat_src_reg = src_reg;
951 if (src_reg < TheISA::FP_Base_DepTag) {
952 flat_src_reg = inst->tcBase()->flattenIntIndex(src_reg);
953 DPRINTF(Rename, "Flattening index %d to %d.\n",
954 (int)src_reg, (int)flat_src_reg);
955 } else if (src_reg < TheISA::Ctrl_Base_DepTag) {
956 src_reg = src_reg - TheISA::FP_Base_DepTag;
957 flat_src_reg = inst->tcBase()->flattenFloatIndex(src_reg);
958 DPRINTF(Rename, "Flattening index %d to %d.\n",
959 (int)src_reg, (int)flat_src_reg);
960 flat_src_reg += TheISA::NumIntRegs;
961 } else if (src_reg < TheISA::Max_DepTag) {
962 flat_src_reg = src_reg - TheISA::Ctrl_Base_DepTag +
963 TheISA::NumFloatRegs + TheISA::NumIntRegs;
964 DPRINTF(Rename, "Adjusting reg index from %d to %d.\n",
965 src_reg, flat_src_reg);
966 } else {
967 panic("Reg index is out of bound: %d.", src_reg);
968 }
969
970 // Look up the source registers to get the phys. register they've
971 // been renamed to, and set the sources to those registers.
972 PhysRegIndex renamed_reg = renameMap[tid]->lookup(flat_src_reg);
973
974 DPRINTF(Rename, "[tid:%u]: Looking up arch reg %i, got "

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

1000 typename RenameMap::RenameInfo rename_result;
1001
1002 unsigned num_dest_regs = inst->numDestRegs();
1003
1004 // Rename the destination registers.
1005 for (int dest_idx = 0; dest_idx < num_dest_regs; dest_idx++) {
1006 RegIndex dest_reg = inst->destRegIdx(dest_idx);
1007 RegIndex flat_dest_reg = dest_reg;
1008 if (dest_reg < TheISA::FP_Base_DepTag) {
1009 // Integer registers are flattened.
1010 flat_dest_reg = inst->tcBase()->flattenIntIndex(dest_reg);
1011 DPRINTF(Rename, "Flattening index %d to %d.\n",
1012 (int)dest_reg, (int)flat_dest_reg);
1013 } else if (dest_reg < TheISA::Ctrl_Base_DepTag) {
1014 dest_reg = dest_reg - TheISA::FP_Base_DepTag;
1015 flat_dest_reg = inst->tcBase()->flattenFloatIndex(dest_reg);
1016 DPRINTF(Rename, "Flattening index %d to %d.\n",
1017 (int)dest_reg, (int)flat_dest_reg);
1018 flat_dest_reg += TheISA::NumIntRegs;
1019 } else if (dest_reg < TheISA::Max_DepTag) {
1020 // Floating point and Miscellaneous registers need their indexes
1021 // adjusted to account for the expanded number of flattened int regs.
1022 flat_dest_reg = dest_reg - TheISA::Ctrl_Base_DepTag +
1023 TheISA::NumIntRegs + TheISA::NumFloatRegs;
1024 DPRINTF(Rename, "Adjusting reg index from %d to %d.\n",
1025 dest_reg, flat_dest_reg);
1026 } else {
1027 panic("Reg index is out of bound: %d.", dest_reg);
1028 }
1029
1030 inst->flattenDestReg(dest_idx, flat_dest_reg);
1031
1032 // Get the physical register that the destination will be
1033 // renamed to.
1034 rename_result = renameMap[tid]->rename(flat_dest_reg);
1035
1036 //Mark Scoreboard entry as not ready
1037 if (dest_reg < TheISA::Ctrl_Base_DepTag)
1038 scoreboard->unsetReg(rename_result.first);
1039
1040 DPRINTF(Rename, "[tid:%u]: Renaming arch reg %i to physical "
1041 "reg %i.\n", tid, (int)flat_dest_reg,
1042 (int)rename_result.first);
1043
1044 // Record the rename information so that a history can be kept.
1045 RenameHistory hb_entry(inst->seqNum, flat_dest_reg,

--- 318 unchanged lines hidden ---