diff --git a/common.mk b/common.mk index 9085aeff9..b90217cb3 100644 --- a/common.mk +++ b/common.mk @@ -14,6 +14,7 @@ PUB_HEADERS = \ pub/libvex_trc_values.h \ pub/libvex_emnote.h \ pub/libvex_guest_x86.h \ + pub/libvex_guest_tilegx.h \ pub/libvex_guest_amd64.h \ pub/libvex_guest_arm.h \ pub/libvex_guest_ppc32.h \ @@ -27,6 +28,7 @@ PUB_HEADERS = \ # when any of them change PRIV_HEADERS = \ priv/host_x86_defs.h \ + priv/host_tilegx_defs.h \ priv/host_amd64_defs.h \ priv/host_arm_defs.h \ priv/host_ppc_defs.h \ @@ -43,6 +45,7 @@ PRIV_HEADERS = \ priv/guest_generic_x87.h \ priv/guest_generic_bb_to_IR.h \ priv/guest_x86_defs.h \ + priv/guest_tilegx_defs.h \ priv/guest_amd64_defs.h \ priv/guest_arm_defs.h \ priv/guest_ppc_defs.h \ @@ -61,7 +64,9 @@ NORMAL_OBJS = \ priv/main_globals.o \ priv/main_util.o \ priv/s390_disasm.o \ + priv/tilegx_disasm.o \ priv/host_x86_defs.o \ + priv/host_tilegx_defs.o \ priv/host_amd64_defs.o \ priv/host_arm_defs.o \ priv/host_arm64_defs.o \ @@ -70,6 +75,7 @@ NORMAL_OBJS = \ priv/host_s390_defs.o \ priv/host_mips_defs.o \ priv/host_x86_isel.o \ + priv/host_tilegx_isel.o \ priv/host_amd64_isel.o \ priv/host_arm_isel.o \ priv/host_arm64_isel.o \ @@ -87,6 +93,7 @@ NORMAL_OBJS = \ priv/guest_generic_x87.o \ priv/guest_generic_bb_to_IR.o \ priv/guest_x86_helpers.o \ + priv/guest_tilegx_helpers.o \ priv/guest_amd64_helpers.o \ priv/guest_arm_helpers.o \ priv/guest_arm64_helpers.o \ @@ -95,6 +102,7 @@ NORMAL_OBJS = \ priv/guest_s390_helpers.o \ priv/guest_mips_helpers.o \ priv/guest_x86_toIR.o \ + priv/guest_tilegx_toIR.o \ priv/guest_amd64_toIR.o \ priv/guest_arm_toIR.o \ priv/guest_arm64_toIR.o \ diff --git a/priv/guest_tilegx_toIR.c b/priv/guest_tilegx_toIR.c index 139cc1c11..e4abb7afb 100644 --- a/priv/guest_tilegx_toIR.c +++ b/priv/guest_tilegx_toIR.c @@ -296,7 +296,7 @@ static DisResult disInstr_TILEGX_WRK ( Bool(*resteerOkFn) (void *, Addr), Bool sigill_diag ) { struct tilegx_decoded_instruction - decoded[TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE]; + decoded[TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE + 1]; ULong cins, opcode = -1, rd, ra, rb, imm = 0; ULong opd[4]; ULong opd_src_map, opd_dst_map, opd_imm_map; @@ -414,7 +414,7 @@ static DisResult disInstr_TILEGX_WRK ( Bool(*resteerOkFn) (void *, Addr), /* To decode the given instruction bundle. */ nr_insn = parse_insn_tilegx((tilegx_bundle_bits)cins, - (ULong)(Addr)code, + (ULong)(Addr)(guest_PC_bbstart + delta), decoded); if (vex_traceflags & VEX_TRACE_FE) @@ -2570,7 +2570,7 @@ disInstr_TILEGX ( IRSB* irsb_IN, irsb = irsb_IN; host_endness = host_endness_IN; guest_PC_curr_instr = (Addr64) guest_IP; - guest_PC_bbstart = (Addr64) toUInt(guest_IP - delta); + guest_PC_bbstart = guest_PC_curr_instr - delta; dres = disInstr_TILEGX_WRK(resteerOkFn, resteerCisOk, callback_opaque, diff --git a/priv/main_main.c b/priv/main_main.c index a69cac66b..7955927b5 100644 --- a/priv/main_main.c +++ b/priv/main_main.c @@ -161,7 +161,7 @@ #define MIPS64ST(f) vassert(0) #endif -#if defined(VGA_tilegx) //|| defined(VEXMULTIARCH) +#if defined(VGA_tilegx) || defined(VEXMULTIARCH) #define TILEGXFN(f) f #define TILEGXST(f) f #else