]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fill in some more bits to do with t-chaining for ppc64
authorJulian Seward <jseward@acm.org>
Fri, 20 Apr 2012 02:18:31 +0000 (02:18 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 20 Apr 2012 02:18:31 +0000 (02:18 +0000)
(still doesn't work) (VEX side)

git-svn-id: svn://svn.valgrind.org/vex/branches/TCHAIN@2290

VEX/priv/host_ppc_defs.c
VEX/priv/host_ppc_isel.c
VEX/priv/main_main.c

index c56f8a1e3e0c0286e46e82aff50180eb96eb6b6b..5e8399025d449c3c030315582b7d13c9a109c0c7 100644 (file)
@@ -3545,7 +3545,7 @@ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc,
       /* Fix up the conditional jump, if there was one. */
       if (i->Pin.XDirect.cond.test != Pct_ALWAYS) {
          Int delta = p - ptmp;
-         vassert(delta >= 16 && delta <= 32 && 0 == (delta & 3));
+         vassert(delta >= 16 && delta <= 64 && 0 == (delta & 3));
          /* bc !ct,cf,delta */
          mkFormB(ptmp, invertCondTest(i->Pin.XDirect.cond.test),
                  i->Pin.XDirect.cond.flag, (delta>>2), 0, 0);
@@ -4656,7 +4656,7 @@ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc,
    /*NOTREACHED*/
    
   done:
-   vassert(p - &buf[0] <= 32);
+   vassert(p - &buf[0] <= 64);
    return p - &buf[0];
 }
 
index 04b88126a6b94de399298a0ec049a199e8542fd9..2778dc7c11270b2a53588f00e481eaf47e32f159 100644 (file)
@@ -4719,15 +4719,15 @@ static void iselNext ( ISelEnv* env,
 /*---------------------------------------------------------*/
 
 /* Translate an entire SB to ppc code. */
-HInstrArray* iselSB_PPC           ( IRSB* bb, 
-                                    VexArch      arch_host,
-                                    VexArchInfo* archinfo_host,
-                                    VexAbiInfo*  vbi,
-                                    Int offs_Host_EvC_Counter,
-                                    Int offs_Host_EvC_FailAddr,
-                                    Bool chainingAllowed,
-                                    Bool addProfInc,
-                                    Addr64 max_ga )
+HInstrArray* iselSB_PPC ( IRSB* bb, 
+                          VexArch      arch_host,
+                          VexArchInfo* archinfo_host,
+                          VexAbiInfo*  vbi,
+                          Int offs_Host_EvC_Counter,
+                          Int offs_Host_EvC_FailAddr,
+                          Bool chainingAllowed,
+                          Bool addProfInc,
+                          Addr64 max_ga )
 {
    Int       i, j;
    HReg      hregLo, hregMedLo, hregMedHi, hregHi;
@@ -4740,7 +4740,7 @@ HInstrArray* iselSB_PPC           ( IRSB* bb,
 
    vassert(arch_host == VexArchPPC32 || arch_host == VexArchPPC64);
    mode64 = arch_host == VexArchPPC64;
-   if (mode64) vassert(max_ga <= 0xFFFFFFFFULL);
+   if (!mode64) vassert(max_ga <= 0xFFFFFFFFULL);
 
    /* do some sanity checks */
    mask32 = VEX_HWCAPS_PPC32_F | VEX_HWCAPS_PPC32_V
index 460f443d462a37c5feda545e2435e15dda600d88..feaf45958956ac84957c0f0104e27f770b7bfbcb 100644 (file)
@@ -334,7 +334,7 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta )
          host_word_type    = Ity_I32;
          vassert(are_valid_hwcaps(VexArchPPC32, vta->archinfo_host.hwcaps));
          break;
-#if 0
+
       case VexArchPPC64:
          mode64      = True;
          getAllocableRegs_PPC ( &n_available_real_regs,
@@ -347,16 +347,14 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta )
          ppInstr     = (void(*)(HInstr*, Bool)) ppPPCInstr;
          ppReg       = (void(*)(HReg)) ppHRegPPC;
          iselSB      = iselSB_PPC;
-         emit        = (Int(*)(UChar*,Int,HInstr*,Bool,void*,void*))
+         emit        = (Int(*)(Bool*,UChar*,Int,HInstr*,Bool,
+                               void*,void*,void*,void*))
                        emit_PPCInstr;
          host_is_bigendian = True;
          host_word_type    = Ity_I64;
          vassert(are_valid_hwcaps(VexArchPPC64, vta->archinfo_host.hwcaps));
-         /* return-to-dispatcher scheme */
-         vassert(vta->dispatch_unassisted == NULL);
-         vassert(vta->dispatch_assisted == NULL);
          break;
-#endif
+
       case VexArchS390X:
          mode64      = True;
          getAllocableRegs_S390 ( &n_available_real_regs,
@@ -462,16 +460,20 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta )
          vassert(sizeof( ((VexGuestPPC32State*)0)->guest_TILEN   ) == 4);
          vassert(sizeof( ((VexGuestPPC32State*)0)->guest_NRADDR  ) == 4);
          break;
-#if 0
+
       case VexArchPPC64:
-         preciseMemExnsFn = guest_ppc64_state_requires_precise_mem_exns;
-         disInstrFn       = disInstr_PPC;
-         specHelper       = guest_ppc64_spechelper;
-         guest_sizeB      = sizeof(VexGuestPPC64State);
-         guest_word_type  = Ity_I64;
-         guest_layout     = &ppc64Guest_layout;
-         offB_TISTART     = offsetof(VexGuestPPC64State,guest_TISTART);
-         offB_TILEN       = offsetof(VexGuestPPC64State,guest_TILEN);
+         preciseMemExnsFn       = guest_ppc64_state_requires_precise_mem_exns;
+         disInstrFn             = disInstr_PPC;
+         specHelper             = guest_ppc64_spechelper;
+         guest_sizeB            = sizeof(VexGuestPPC64State);
+         guest_word_type        = Ity_I64;
+         guest_layout           = &ppc64Guest_layout;
+         offB_TISTART           = offsetof(VexGuestPPC64State,guest_TISTART);
+         offB_TILEN             = offsetof(VexGuestPPC64State,guest_TILEN);
+         offB_GUEST_IP          = offsetof(VexGuestPPC64State,guest_CIA);
+         szB_GUEST_IP           = sizeof( ((VexGuestPPC64State*)0)->guest_CIA );
+         offB_HOST_EvC_COUNTER  = offsetof(VexGuestPPC64State,host_EvC_COUNTER);
+         offB_HOST_EvC_FAILADDR = offsetof(VexGuestPPC64State,host_EvC_FAILADDR);
          vassert(are_valid_hwcaps(VexArchPPC64, vta->archinfo_guest.hwcaps));
          vassert(0 == sizeof(VexGuestPPC64State) % 16);
          vassert(sizeof( ((VexGuestPPC64State*)0)->guest_TISTART    ) == 8);
@@ -479,7 +481,7 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta )
          vassert(sizeof( ((VexGuestPPC64State*)0)->guest_NRADDR     ) == 8);
          vassert(sizeof( ((VexGuestPPC64State*)0)->guest_NRADDR_GPR2) == 8);
          break;
-#endif
+
       case VexArchS390X:
          preciseMemExnsFn = guest_s390x_state_requires_precise_mem_exns;
          disInstrFn       = disInstr_S390;