diff -ruN cdif-1.0/Makefile cdif-1.0-suifvm/Makefile --- cdif-1.0/Makefile 2004-12-08 10:49:16.000000000 +0200 +++ cdif-1.0-suifvm/Makefile 2005-10-12 13:25:23.936125000 +0300 @@ -49,15 +49,25 @@ # all: cdif tools -src/isa/isa-defines.h: src/isa/replay/replay.def src/isa/replay/gen-replay-defines.cc - @ echo generating replay-defines - @ cd src/isa/replay ; $(CXX) -o gen-replay-defines -static $(WARNINGS) $(EXTRA_FLAGS) gen-replay-defines.cc - @ cd src/isa/replay ; ./gen-replay-defines ../replay-defines +#src/isa/isa-defines.h: src/isa/replay/replay.def src/isa/replay/gen-replay-defines.cc +# @ echo generating replay-defines +# @ cd src/isa/replay ; $(CXX) -o gen-replay-defines -static $(WARNINGS) $(EXTRA_FLAGS) gen-replay-defines.cc +# @ cd src/isa/replay ; ./gen-replay-defines ../replay-defines +# @ echo setting up isa-defines links +# @ cd src/isa ; ln -sf replay-defines.h isa-defines.h +# @ cd src/isa ; ln -sf replay-defines.cc isa-defines.cc +# @ echo compiling isa-defines.cc +# @ $(CXX) $(WARNINGS) $(DEBUG) $(EXTRA_FLAGS) -c src/isa/isa-defines.cc -o src/isa/isa-defines.o + +src/isa/isa-defines.h: src/isa/suifvm/suifvm.def src/isa/suifvm/gen-suifvm-defines.cc + @ echo generating suifvm-defines + @ cd src/isa/suifvm ; $(CXX) -o gen-suifvm-defines -static $(WARNINGS) $(EXTRA_FLAGS) gen-suifvm-defines.cc + @ cd src/isa/suifvm ; ./gen-suifvm-defines ../suifvm-defines @ echo setting up isa-defines links - @ cd src/isa ; ln -sf replay-defines.h isa-defines.h - @ cd src/isa ; ln -sf replay-defines.cc isa-defines.cc + @ cd src/isa ; ln -sf suifvm-defines.h isa-defines.h + @ cd src/isa ; ln -sf suifvm-defines.cc isa-defines.cc @ echo compiling isa-defines.cc - @ $(CXX) $(WARNINGS) $(DEBUG) $(EXTRA_FLAGS) -c src/isa/isa-defines.cc -o src/isa/isa-defines.o + @ $(CXX) $(WARNINGS) $(DEBUG) $(EXTRA_FLAGS) -c src/isa/isa-defines.cc -o src/isa/isa-defines.o tools: idiom-plot idiom-stats @@ -76,10 +86,11 @@ .cc.o: @ echo compiling $*.cc - @ $(CXX) $(WARNINGS) $(DEBUG) $(EXTRA_FLAGS) -c $*.cc -o $@ + @ $(CXX) $(WARNINGS) $(DEBUG) $(EXTRA_FLAGS) -c $*.cc -o $@ clean: - -$(RM) */*/*.o */*.o *.o core */core *~ src/isa/replay/gen-replay-defines cdif idiom-plot idiom-stats src/isa/isa-defines.* src/isa/replay-defines.* +# -$(RM) */*/*.o */*.o *.o core */core *~ src/isa/replay/gen-replay-defines cdif idiom-plot idiom-stats src/isa/isa-defines.* src/isa/replay-defines.* + -$(RM) */*/*.o */*.o *.o core */core *~ src/isa/suifvm/gen-suifvm-defines cdif idiom-plot idiom-stats src/isa/isa-defines.* src/isa/suifvm-defines.* depend: depend.inc makedepend -f depend.inc $(DEPEND_FLAGS) $(INCLUDES) $(SRCS) diff -ruN cdif-1.0/src/isa/isa-defines.cc cdif-1.0-suifvm/src/isa/isa-defines.cc --- cdif-1.0/src/isa/isa-defines.cc 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/isa-defines.cc 2005-10-12 13:26:32.186125000 +0300 @@ -0,0 +1,101 @@ +// This file was automatically generated by gen_suifvm_defines. +// Do not edit manually! + +#include "isa-defines.h" +#include + +using namespace __gnu_cxx; + +namespace __gnu_cxx { + struct char_ptr_eql { + bool operator()(const char *n1, const char *n2) const { + return (!strcmp(n1,n2)); + } + }; +} + +struct opcode_info_t { + bool mem, store, load, ctrl, agen, add, comm; + opcode_info_t(bool m, bool s, bool l, bool ct, bool ag, bool ad, bool co) : + mem(m), store(s), load(l), ctrl(ct), agen(ag), add(ad), comm(co) { } + opcode_info_t() { } +}; + +static hash_map, char_ptr_eql> opcodes; + +void initialize_isa_defines() { + opcodes["uNULL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["NOP"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["ADD"] = opcode_info_t(false, false, false, false, false, true, true); + opcodes["SUB"] = opcode_info_t(false, false, false, false, false, true, false); + opcodes["NEG"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MUL"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["DIV"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["REM"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MOD"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["ABS"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MIN"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MAX"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["NOT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["AND"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["IOR"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["XOR"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["ASR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["LSL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["LSR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["ROT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SEQ"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SNE"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SLE"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["CVT"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["LDA"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["LDC"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["LOD"] = opcode_info_t(true, true, false, false, true, false, false); + opcodes["uSTR"] = opcode_info_t(true, false, true, false, true, false, false); + opcodes["MOV"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["MEMCPY"] = opcode_info_t(true, true, true, false, true, false, false); + opcodes["SELECT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["JMP"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["JMPI"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["CAL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["RET"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["BEQ"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BNE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BGE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BGT"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BLE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BLT"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BTRUE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BFALSE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["ANY"] = opcode_info_t(false, false, false, false, false, false, false); +} + +bool is_mem_op(const char* n) { + return opcodes[n].mem; +} + +bool is_store_op(const char *n) { + return opcodes[n].store; +} + +bool is_load_op(const char *n) { + return opcodes[n].load; +} + +bool is_ctrl_op(const char *n) { + return opcodes[n].ctrl; +} + +bool is_agen_op(const char *n) { + return opcodes[n].agen; +} + +bool is_add_op(const char* n) { + return opcodes[n].add; +} + +bool is_comm_op(const char *n) { + return opcodes[n].comm; +} + diff -ruN cdif-1.0/src/isa/isa-defines.h cdif-1.0-suifvm/src/isa/isa-defines.h --- cdif-1.0/src/isa/isa-defines.h 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/isa-defines.h 2005-10-12 13:26:32.170500000 +0300 @@ -0,0 +1,24 @@ +// This file was automatically generated by gen_suifvm_defines. +// Do not edit manually! + +#ifndef ISA_DEFINES_H +#define ISA_DEFINES_H + +#define ZERO_REG 0 +#define NUM_SRC_REGS 3 +#define MEM_SRC_IDX 2 +#define NUM_DST_REGS 1 +#define MEM_DST_IDX 0 +#define NUM_CST_REGS 1 + +// NOTE: these functions should only called by opcode-interface.h +void initialize_isa_defines(); +bool is_mem_op(const char *name); +bool is_store_op(const char *name); +bool is_load_op(const char *name); +bool is_ctrl_op(const char *name); +bool is_agen_op(const char *name); +bool is_add_op(const char *name); +bool is_comm_op(const char *name); + +#endif // #ifndef ISA_DEFINES_H diff -ruN cdif-1.0/src/isa/replay-defines.cc cdif-1.0-suifvm/src/isa/replay-defines.cc --- cdif-1.0/src/isa/replay-defines.cc 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/replay-defines.cc 2005-10-02 00:41:42.608500000 +0300 @@ -0,0 +1,139 @@ +// This file was automatically generated by gen_replay_defines. +// Do not edit manually! + +#include "isa-defines.h" +#include + +using namespace __gnu_cxx; + +namespace __gnu_cxx { + struct char_ptr_eql { + bool operator()(const char *n1, const char *n2) const { + return (!strcmp(n1,n2)); + } + }; +} + +struct opcode_info_t { + bool mem, store, load, ctrl, agen, add, comm; + opcode_info_t(bool m, bool s, bool l, bool ct, bool ag, bool ad, bool co) : + mem(m), store(s), load(l), ctrl(ct), agen(ag), add(ad), comm(co) { } + opcode_info_t() { } +}; + +static hash_map, char_ptr_eql> opcodes; + +void initialize_isa_defines() { + opcodes["uNULL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uADD"] = opcode_info_t(false, false, false, false, false, true, true); + opcodes["uAND"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uANDN"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uASSTFLG"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["uASSTREG"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["uASSTVAL"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["uBSR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uBSF"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uCOMB"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uDADD"] = opcode_info_t(false, false, false, false, false, true, true); + opcodes["uDIVQ"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uDIVR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uF2XM1"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFABS"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFADD"] = opcode_info_t(false, false, false, false, false, true, true); + opcodes["uFCOM"] = opcode_info_t(false, false, false, false, false, true, false); + opcodes["uFCOS"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFDIV"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFILD"] = opcode_info_t(true, true, false, false, true, false, false); + opcodes["uFIST"] = opcode_info_t(true, false, true, false, true, false, false); + opcodes["uFLD"] = opcode_info_t(true, true, false, false, true, false, false); + opcodes["uFMOV"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFMOVI"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFMUL"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uFNEG"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFPATAN"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFPTAN"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFRNDINT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFSCALE"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFSEL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFSIN"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFSQRT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFST"] = opcode_info_t(true, false, true, false, true, false, false); + opcodes["uFSTCK"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFSUB"] = opcode_info_t(false, false, false, false, false, true, false); + opcodes["uFYL2X"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uFYL2X1"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uHLT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uIDIOM"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uIDIVQ"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uIDIVR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uIGN"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uIMUL"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uIMUL32"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uJ"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["uLD"] = opcode_info_t(true, true, false, false, true, false, false); + opcodes["uLDEIP"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uLEA"] = opcode_info_t(false, false, false, false, true, false, false); + opcodes["uMERGE"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uLDFLG"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uMUL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uNEG"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uNOP"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uNOT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uOR"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uORN"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uPOPC"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uPNT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uRCL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uRCR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uRCL1"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uRCR1"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uROL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uROR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSAR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSELLD"] = opcode_info_t(true, false, true, false, false, false, false); + opcodes["uSELST"] = opcode_info_t(true, false, true, false, false, false, false); + opcodes["uSEL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSETHI"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSET"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSEXT16"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSEXT32"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSEXT8"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSHL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSHLD"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSHR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSHRD"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uSIMD"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["uST"] = opcode_info_t(true, false, true, false, true, false, false); + opcodes["uSUB"] = opcode_info_t(false, false, false, false, false, true, false); + opcodes["uXNOR"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["uXOR"] = opcode_info_t(false, false, false, false, false, false, true); +} + +bool is_mem_op(const char* n) { + return opcodes[n].mem; +} + +bool is_store_op(const char *n) { + return opcodes[n].store; +} + +bool is_load_op(const char *n) { + return opcodes[n].load; +} + +bool is_ctrl_op(const char *n) { + return opcodes[n].ctrl; +} + +bool is_agen_op(const char *n) { + return opcodes[n].agen; +} + +bool is_add_op(const char* n) { + return opcodes[n].add; +} + +bool is_comm_op(const char *n) { + return opcodes[n].comm; +} + diff -ruN cdif-1.0/src/isa/replay-defines.h cdif-1.0-suifvm/src/isa/replay-defines.h --- cdif-1.0/src/isa/replay-defines.h 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/replay-defines.h 2005-10-02 00:41:42.608500000 +0300 @@ -0,0 +1,24 @@ +// This file was automatically generated by gen_replay_defines. +// Do not edit manually! + +#ifndef ISA_DEFINES_H +#define ISA_DEFINES_H + +#define ZERO_REG 0 +#define NUM_SRC_REGS 4 +#define MEM_SRC_IDX 3 +#define NUM_DST_REGS 3 +#define MEM_DST_IDX 2 +#define NUM_CST_REGS 1 + +// NOTE: these functions should only called by opcode-interface.h +void initialize_isa_defines(); +bool is_mem_op(const char *name); +bool is_store_op(const char *name); +bool is_load_op(const char *name); +bool is_ctrl_op(const char *name); +bool is_agen_op(const char *name); +bool is_add_op(const char *name); +bool is_comm_op(const char *name); + +#endif // #ifndef ISA_DEFINES_H diff -ruN cdif-1.0/src/isa/suifvm/gen-suifvm-defines.cc cdif-1.0-suifvm/src/isa/suifvm/gen-suifvm-defines.cc --- cdif-1.0/src/isa/suifvm/gen-suifvm-defines.cc 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/suifvm/gen-suifvm-defines.cc 2005-10-12 13:22:18.233000000 +0300 @@ -0,0 +1,274 @@ +// -*- C++ -*- +/****************************************************************************** + + University of Illinois/NCSA + Open Source License + + Copyright(C) 2003-2004, The Board of Trustees of the + University of Illinois. All rights reserved + + CDIF: Connected Dataflow Idiom Finder + Developed by: + Advanced Computing Systems Group + Center for Reliable and High-Performance Computing + University of Illinois at Urbana-Champaign + + http://www.crhc.uiuc.edu/ACS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +with the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimers. + +Redistributions in binary must reproduce the above copyright notice, this +list of conditions and the following disclaimers in the documentation and/or +other materials provided with the distribution. + +Neither the names of Advanced Computing Systems Group, Center for Reliable +and High-Performance Computing, University of Illinois at Urbana-Champaign, +nor the names of its contributors may be used to endorse or promote products +derived from this Software without specific prior written permission. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +WITH THE SOFTWARE. +******************************************************************************/ + +/****************************************************************************** +File: gen_suifvm_defines.cc +Author: Nikolaos Kavvadias +Description: This file takes suifvm.def and spits out suifvm_defines.h. + This exists so that it is easy to regenerate it for updates + to suifvm.def. +******************************************************************************/ + +#include +#include + +using namespace std; + +#define P_RET (1<<0 ) +#define P_SUIFVM (1<<1 ) +#define P_MEM (1<<2 ) +#define P_COND (1<<3 ) +#define P_CTRL (1<<4 ) +#define P_CMOV (1<<5 ) +#define P_COMM (1<<6 ) +#define P_ASSERT (1<<7 ) +#define P_ICOMP (1<<8 ) +#define P_INDIR (1<<9 ) +#define P_IFLAGS (1<<10) +#define P_REP (1<<11) +#define P_CALL (1<<12) +#define P_LOAD (1<<18) +#define P_STORE (1<<19) + +#define FU_INVALID (1<<1 ) +#define FU_ALU (1<<2 ) +#define FU_COMPLEXALU (1<<3 ) +#define FU_SHIFTER (1<<4 ) +#define FU_BRANCH (1<<5 ) +#define FU_AGEN (1<<6 ) +#define FU_MEMLD (1<<7 ) +#define FU_MEMST (1<<8 ) +#define FU_INTMUL (1<<9 ) +#define FU_INTDIV (1<<10) +#define FU_MISC (1<<11) +#define FU_WTF (1<<23) /* This stands for "Which Type of Functional Unit */ + +enum rp_opcode_e { + uNULL = 0, +#define DEFINST(OP,NAME,FU,TYPE,EXT_TYPE) OP, +#include "suifvm.def" +#undef DEFINST + NUM_UOPS +}; + +const char *uop_str[] = { + "uNULL", +#define DEFINST(OP,NAME,FU,TYPE,EXT_TYPE) NAME, +#include "suifvm.def" +#undef DEFINST +}; + +const int uop_type[] = { + 0, +#define DEFINST(OP,NAME,FU,TYPE,EXT_TYPE) EXT_TYPE, +#include "suifvm.def" +#undef DEFINST +}; + +const int uop_fu[] = { + 0, +#define DEFINST(OP,NAME,FU,TYPE,EXT_TYPE) FU, +#include "suifvm.def" +#undef DEFINST +}; + + +void emit_header(FILE *f) { + fprintf(f, + "// This file was automatically generated by gen_suifvm_defines.\n"\ + "// Do not edit manually!\n"); + fprintf(f, "\n"); + + fprintf(f, "#ifndef ISA_DEFINES_H\n"); + fprintf(f, "#define ISA_DEFINES_H\n"); + fprintf(f, "\n"); + fprintf(f, "#define ZERO_REG 0\n"); + fprintf(f, "#define NUM_SRC_REGS 3\n"); + fprintf(f, "#define MEM_SRC_IDX 2\n"); + fprintf(f, "#define NUM_DST_REGS 1\n"); + fprintf(f, "#define MEM_DST_IDX 0\n"); + fprintf(f, "#define NUM_CST_REGS 1\n"); + fprintf(f, "\n"); + fprintf(f, "// NOTE: these functions should only called by opcode-interface.h\n"); + fprintf(f, "void initialize_isa_defines();\n"); + fprintf(f, "bool is_mem_op(const char *name);\n"); + fprintf(f, "bool is_store_op(const char *name);\n"); + fprintf(f, "bool is_load_op(const char *name);\n"); + fprintf(f, "bool is_ctrl_op(const char *name);\n"); + fprintf(f, "bool is_agen_op(const char *name);\n"); + fprintf(f, "bool is_add_op(const char *name);\n"); + fprintf(f, "bool is_comm_op(const char *name);\n"); + fprintf(f, "\n"); + fprintf(f, "#endif // #ifndef ISA_DEFINES_H\n"); +} + +void emit_impl_start(FILE *f) { + fprintf(f, + "// This file was automatically generated by gen_suifvm_defines.\n"\ + "// Do not edit manually!\n"); + fprintf(f, "\n"); + fprintf(f, "#include \"isa-defines.h\"\n"); + fprintf(f, "#include \n"); + fprintf(f, "\n"); + fprintf(f, "using namespace __gnu_cxx;\n"); + fprintf(f, "\n"); + fprintf(f, "namespace __gnu_cxx {\n"); + fprintf(f, " struct char_ptr_eql {\n"); + fprintf(f, " bool operator()(const char *n1, const char *n2) const {\n"); + fprintf(f, " return (!strcmp(n1,n2));\n"); + fprintf(f, " }\n"); + fprintf(f, " };\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); + fprintf(f, "struct opcode_info_t {\n"); + fprintf(f, " bool mem, store, load, ctrl, agen, add, comm;\n"); + fprintf(f, " opcode_info_t(bool m, bool s, bool l, bool ct, bool ag, bool ad, bool co) : \n"); + fprintf(f, " mem(m), store(s), load(l), ctrl(ct), agen(ag), add(ad), comm(co) { } \n"); + fprintf(f, " opcode_info_t() { }\n"); + fprintf(f, "};\n"); + fprintf(f, "\n"); + fprintf(f, "static hash_map, char_ptr_eql> opcodes;\n"); + fprintf(f, "\n"); +} + +void emit_initialize(FILE *f) { + fprintf(f, "void initialize_isa_defines() {\n"); + for (int i = 0; i < NUM_UOPS; i++) + fprintf(f, " opcodes[\"%s\"] = opcode_info_t(%s, %s, %s, %s, %s, %s, %s); \n", + uop_str[i], + (uop_type[i] & P_MEM) ? "true" : "false", + (uop_type[i] & P_LOAD) ? "true" : "false", + (uop_type[i] & P_STORE) ? "true" : "false", + (uop_type[i] & P_CTRL) ? "true" : "false", + (uop_fu[i] & FU_AGEN) ? "true" : "false", + (i == (int)uADD || i == (int)uSUB) ? "true" : "false", + (uop_type[i] & P_COMM) ? "true" : "false"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_mem(FILE *f) { + fprintf(f, "bool is_mem_op(const char* n) {\n"); + fprintf(f, " return opcodes[n].mem;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_store(FILE *f) { + fprintf(f, "bool is_store_op(const char *n) {\n"); + fprintf(f, " return opcodes[n].store;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_load(FILE *f) { + fprintf(f, "bool is_load_op(const char *n) {\n"); + fprintf(f, " return opcodes[n].load;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_ctrl(FILE *f) { + fprintf(f, "bool is_ctrl_op(const char *n) {\n"); + fprintf(f, " return opcodes[n].ctrl;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_agen(FILE *f) { + fprintf(f, "bool is_agen_op(const char *n) {\n"); + fprintf(f, " return opcodes[n].agen;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_add(FILE *f) { + fprintf(f, "bool is_add_op(const char* n) {\n"); + fprintf(f, " return opcodes[n].add;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +void emit_op_commutative(FILE *f) { + fprintf(f, "bool is_comm_op(const char *n) {\n"); + fprintf(f, " return opcodes[n].comm;\n"); + fprintf(f, "}\n"); + fprintf(f, "\n"); +} + +int +main(int argc, char **argv) { + if (argc != 2) + fprintf(stderr, "gen_suifvm_defines [filename]\n"); + + string header_name(argv[1]); + header_name += ".h"; + + FILE *header = fopen(header_name.c_str(), "w"); + + emit_header(header); + + fclose(header); + + + string impl_name(argv[1]); + impl_name += ".cc"; + + FILE *impl = fopen(impl_name.c_str(), "w"); + + emit_impl_start(impl); + emit_initialize(impl); + emit_op_mem(impl); + emit_op_store(impl); + emit_op_load(impl); + emit_op_ctrl(impl); + emit_op_agen(impl); + emit_op_add(impl); + emit_op_commutative(impl); + + fclose(impl); + + return 0; +} diff -ruN cdif-1.0/src/isa/suifvm/suifvm.def cdif-1.0-suifvm/src/isa/suifvm/suifvm.def --- cdif-1.0/src/isa/suifvm/suifvm.def 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/suifvm/suifvm.def 2005-10-12 13:15:35.436125000 +0300 @@ -0,0 +1,371 @@ +// -*- C++ -*- +/****************************************************************************** + + University of Illinois/NCSA + Open Source License + + Copyright(C) 2003-2004, The Board of Trustees of the + University of Illinois. All rights reserved + + CDIF: Connected Dataflow Idiom Finder + Developed by: + Advanced Computing Systems Group + Center for Reliable and High-Performance Computing + University of Illinois at Urbana-Champaign + + http://www.crhc.uiuc.edu/ACS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +with the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimers. + +Redistributions in binary must reproduce the above copyright notice, this +list of conditions and the following disclaimers in the documentation and/or +other materials provided with the distribution. + +Neither the names of Advanced Computing Systems Group, Center for Reliable +and High-Performance Computing, University of Illinois at Urbana-Champaign, +nor the names of its contributors may be used to endorse or promote products +derived from this Software without specific prior written permission. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +WITH THE SOFTWARE. +******************************************************************************/ + +/****************************************************************************** +File: suifvm.def +Author: Nikolaos Kavvadias +Description: This file defines the execution of the rePLay uops. It does so + in a generic way in order to enable flexibility for uop + implementation. +******************************************************************************/ + + +/*---------------------------------------------------------------------------*/ +DEFINST(uNOP /* micro op definition */, + "NOP" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|0) + +/*---------------------------------------------------------------------------*/ +DEFINST(uADD /* micro op definition */, + "ADD" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSUB /* micro op definition */, + "SUB" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uNEG /* micro op definition */, + "NEG" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uMUL /* micro op definition */, + "MUL" /* string for micro op */, + FU_INTMUL /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM|0) + +/*---------------------------------------------------------------------------*/ +DEFINST(uDIV /* micro op definition */, + "DIV" /* string for micro op */, + FU_INTDIV /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uREM /* micro op definition */, + "REM" /* string for micro op */, + FU_INTDIV /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uMOD /* micro op definition */, + "MOD" /* string for micro op */, + FU_INTDIV /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uABS, + "ABS", + FU_COMPLEXALU, + P_INTEGER, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uMIN, + "MIN", + FU_COMPLEXALU, + P_INTEGER, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uMAX, + "MAX", + FU_COMPLEXALU, + P_INTEGER, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uNOT /* micro op definition */, + "NOT" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uAND /* micro op definition */, + "AND" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uIOR /* micro op definition */, + "IOR" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uXOR /* micro op definition */, + "XOR" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uASR /* micro op definition */, + "ASR" /* string for micro op */, + FU_SHIFTER /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uLSL /* micro op definition */, + "LSL" /* string for micro op */, + FU_SHIFTER /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uLSR /* micro op definition */, + "LSR" /* string for micro op */, + FU_SHIFTER /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uROT /* micro op definition */, + "ROT" /* string for micro op */, + FU_SHIFTER /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSEQ /* micro op definition */, + "SEQ" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSNE /* micro op definition */, + "SNE" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSLT /* micro op definition */, + "SL" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSLE /* micro op definition */, + "SLE" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uCVT /* micro op definition */, + "CVT" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uLDA /* micro op definition */, + "LDA" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uLDC /* micro op definition */, + "LDC" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uLOD /* micro op definition */, + "LOD" /* string for micro op */, + FU_AGEN | FU_MEMLD /* functional unit required */, + P_INTEGER | P_LOAD | P_MEM /* properties */, + P_IFLAGS|P_MEM|P_LOAD) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSTR /* micro op definition */, + "uSTR" /* string for micro op */, + FU_AGEN | FU_MEMST /* functional unit required */, + P_INTEGER | P_STORE | P_MEM /* properties */, + P_IFLAGS|P_MEM|P_STORE) + +/*---------------------------------------------------------------------------*/ +DEFINST(uMOV /* micro op definition */, + "MOV" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_COMM) + +/*---------------------------------------------------------------------------*/ +DEFINST(uMEMCPY /* micro op definition */, + "MEMCPY" /* string for micro op */, + FU_AGEN | FU_MEMLD | FU_MEMST /* functional unit required */, + P_INTEGER | P_LOAD | P_STORE | P_MEM /* properties */, + P_IFLAGS|P_MEM|P_LOAD|P_STORE) + +/*---------------------------------------------------------------------------*/ +DEFINST(uSELECT, + "SELECT", + FU_COMPLEXALU, + P_INTEGER, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +DEFINST(uJMP /* micro op definition */, + "JMP" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL) + +/*---------------------------------------------------------------------------*/ +DEFINST(uJMPI /* micro op definition */, + "JMPI" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL) + +/*---------------------------------------------------------------------------*/ +DEFINST(uCAL /* micro op definition */, + "CAL" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_CALL) + +/*---------------------------------------------------------------------------*/ +DEFINST(uRET /* micro op definition */, + "RET" /* string for micro op */, + FU_ALU /* functional unit required */, + P_INTEGER /* properties */, + P_IFLAGS|P_ICOMP|P_RET) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBEQ /* micro op definition */, + "BEQ" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBNE /* micro op definition */, + "BNE" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBGE /* micro op definition */, + "BGE" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBGT /* micro op definition */, + "BGT" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBLE /* micro op definition */, + "BLE" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBLT /* micro op definition */, + "BLT" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBTRUE /* micro op definition */, + "BTRUE" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uBFALSE /* micro op definition */, + "BFALSE" /* string for micro op */, + FU_BRANCH /* functional unit required */, + P_INTEGER | P_CONTROL /* properties */, + P_IFLAGS|P_CTRL|P_COND) + +/*---------------------------------------------------------------------------*/ +DEFINST(uANY, + "ANY", + FU_MISC, + P_INTEGER, + P_IFLAGS|P_ICOMP) + +/*---------------------------------------------------------------------------*/ +//DEFINST(uHALT /* micro op definition */, +// "HALT" /* string for micro op */, +// FU_WTF /* functional unit required */, +// P_INTEGER /* properties */, +// P_IFLAGS|0) +// + +/*---------------------------------------------------------------------------*/ diff -ruN cdif-1.0/src/isa/suifvm-defines.cc cdif-1.0-suifvm/src/isa/suifvm-defines.cc --- cdif-1.0/src/isa/suifvm-defines.cc 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/suifvm-defines.cc 2005-10-12 13:26:32.186125000 +0300 @@ -0,0 +1,101 @@ +// This file was automatically generated by gen_suifvm_defines. +// Do not edit manually! + +#include "isa-defines.h" +#include + +using namespace __gnu_cxx; + +namespace __gnu_cxx { + struct char_ptr_eql { + bool operator()(const char *n1, const char *n2) const { + return (!strcmp(n1,n2)); + } + }; +} + +struct opcode_info_t { + bool mem, store, load, ctrl, agen, add, comm; + opcode_info_t(bool m, bool s, bool l, bool ct, bool ag, bool ad, bool co) : + mem(m), store(s), load(l), ctrl(ct), agen(ag), add(ad), comm(co) { } + opcode_info_t() { } +}; + +static hash_map, char_ptr_eql> opcodes; + +void initialize_isa_defines() { + opcodes["uNULL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["NOP"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["ADD"] = opcode_info_t(false, false, false, false, false, true, true); + opcodes["SUB"] = opcode_info_t(false, false, false, false, false, true, false); + opcodes["NEG"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MUL"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["DIV"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["REM"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MOD"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["ABS"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MIN"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["MAX"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["NOT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["AND"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["IOR"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["XOR"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["ASR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["LSL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["LSR"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["ROT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SEQ"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SNE"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["SLE"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["CVT"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["LDA"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["LDC"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["LOD"] = opcode_info_t(true, true, false, false, true, false, false); + opcodes["uSTR"] = opcode_info_t(true, false, true, false, true, false, false); + opcodes["MOV"] = opcode_info_t(false, false, false, false, false, false, true); + opcodes["MEMCPY"] = opcode_info_t(true, true, true, false, true, false, false); + opcodes["SELECT"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["JMP"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["JMPI"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["CAL"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["RET"] = opcode_info_t(false, false, false, false, false, false, false); + opcodes["BEQ"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BNE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BGE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BGT"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BLE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BLT"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BTRUE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["BFALSE"] = opcode_info_t(false, false, false, true, false, false, false); + opcodes["ANY"] = opcode_info_t(false, false, false, false, false, false, false); +} + +bool is_mem_op(const char* n) { + return opcodes[n].mem; +} + +bool is_store_op(const char *n) { + return opcodes[n].store; +} + +bool is_load_op(const char *n) { + return opcodes[n].load; +} + +bool is_ctrl_op(const char *n) { + return opcodes[n].ctrl; +} + +bool is_agen_op(const char *n) { + return opcodes[n].agen; +} + +bool is_add_op(const char* n) { + return opcodes[n].add; +} + +bool is_comm_op(const char *n) { + return opcodes[n].comm; +} + diff -ruN cdif-1.0/src/isa/suifvm-defines.h cdif-1.0-suifvm/src/isa/suifvm-defines.h --- cdif-1.0/src/isa/suifvm-defines.h 1970-01-01 02:00:00.000000000 +0200 +++ cdif-1.0-suifvm/src/isa/suifvm-defines.h 2005-10-12 13:26:32.170500000 +0300 @@ -0,0 +1,24 @@ +// This file was automatically generated by gen_suifvm_defines. +// Do not edit manually! + +#ifndef ISA_DEFINES_H +#define ISA_DEFINES_H + +#define ZERO_REG 0 +#define NUM_SRC_REGS 3 +#define MEM_SRC_IDX 2 +#define NUM_DST_REGS 1 +#define MEM_DST_IDX 0 +#define NUM_CST_REGS 1 + +// NOTE: these functions should only called by opcode-interface.h +void initialize_isa_defines(); +bool is_mem_op(const char *name); +bool is_store_op(const char *name); +bool is_load_op(const char *name); +bool is_ctrl_op(const char *name); +bool is_agen_op(const char *name); +bool is_add_op(const char *name); +bool is_comm_op(const char *name); + +#endif // #ifndef ISA_DEFINES_H diff -ruN cdif-1.0/src/util/types.h cdif-1.0-suifvm/src/util/types.h --- cdif-1.0/src/util/types.h 2004-12-08 10:49:16.000000000 +0200 +++ cdif-1.0-suifvm/src/util/types.h 2005-10-12 00:11:02.202250000 +0300 @@ -60,11 +60,13 @@ typedef signed char int8_t; typedef short int16_t; -typedef int int32_t; +//typedef int int32_t; +typedef long int int32_t; typedef long long int64_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; -typedef unsigned int uint32_t; +//typedef unsigned int uint32_t; +typedef unsigned long int uint32_t; typedef unsigned long long uint64_t; /*---------------------------------------------------------------------------*/