Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / include / reguse.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: reguse.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
#ifndef _REGUSE_H
#define _REGUSE_H
#include <sys/types.h>
#include "IHASH.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
RUS_NRUS = 5,
/* ru_reg values */
RU_RD = 0,
RU_RS1 = 1,
RU_RS2 = 2,
RU_RS3 = 3,
RU_Q = 4,
RU_SR = 5,
RU_PSR = 6,
RU_TBR = 7,
RU_WIM = 8,
RU_Y = 9,
RU_REG = 0x40,
/* ru_type values */
RU_INT = 0,
RU_FP = 1,
RU_CP = 2
};
typedef struct {
char ru_reg; /* RU_RS1, etc., or RU_REG|reg# */
char ru_type; /* register set, q.v. */
char ru_nregs; /* 0 single, 1 double, 3 quadruple */
char ru_io; /* 0 src, 1 dest */
char ru_imm; /* i_i==0 */
} RegUse;
typedef struct {
char rus_nrus;
RegUse rus_rus[RUS_NRUS];
} RegUses;
extern RegUses ihash_reguses[NIHASH];
RegUses* getRegUses(int ih);
int getRegFieldUse(int ih, int rupos);
int decodeFreg(int reg);
int encodeFreg(int reg);
uint64_t getDefs(unsigned instr, int ih);
uint64_t getUses(unsigned instr, int ih);
uint64_t getFloatDefs(unsigned instr, int ih);
uint64_t getFloatUses(unsigned instr, int ih);
#ifdef __cplusplus
}
#endif
#endif /* _REGUSE_H */