]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
A few more bits and pieces of amd64 instruction support.
authorJulian Seward <jseward@acm.org>
Sat, 5 Feb 2005 18:24:47 +0000 (18:24 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 5 Feb 2005 18:24:47 +0000 (18:24 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@852

VEX/priv/guest-amd64/toIR.c
VEX/priv/host-amd64/hdefs.c
VEX/priv/host-amd64/isel.c

index 41554e01706a7654b7f81370105e696fd56c9114..a86aeb0dcf027e0f76fa030b94f233c2b4297f24 100644 (file)
@@ -12481,13 +12481,13 @@ DisResult disInstr ( /*IN*/  Bool       resteerOK,
          DIP("j%s-32 0x%llx\n", name_AMD64Condcode(opc - 0x80), d64);
          break;
 
-//..       /* =-=-=-=-=-=-=-=-=- RDTSC -=-=-=-=-=-=-=-=-=-=-= */
-//.. 
-//..       case 0x31: /* RDTSC */
-//..          if (0) vex_printf("vex x86->IR: kludged rdtsc\n");
-//..          putIReg(4, R_EAX, mkU32(0));
-//..          putIReg(4, R_EDX, mkU32(0));
-//.. 
+      /* =-=-=-=-=-=-=-=-=- RDTSC -=-=-=-=-=-=-=-=-=-=-= */
+
+      case 0x31: /* RDTSC */
+         if (1) vex_printf("vex amd64->IR: kludged rdtsc\n");
+         putIRegR( PFX_EMPTY, 4, R_RAX, mkU32(0));
+         putIRegR( PFX_EMPTY, 4, R_RDX, mkU32(0));
+
 //.. //--          t1 = newTemp(cb);
 //.. //--          t2 = newTemp(cb);
 //.. //--          t3 = newTemp(cb);
@@ -12508,9 +12508,9 @@ DisResult disInstr ( /*IN*/  Bool       resteerOK,
 //.. //--          uInstr1(cb, POP,   4, TempReg, t3);
 //.. //--          uInstr2(cb, PUT,   4, TempReg, t3, ArchReg, R_EAX);
 //.. //--          uInstr0(cb, CALLM_E, 0);
-//..          DIP("rdtsc\n");
-//..          break;
-//.. 
+         DIP("rdtsc\n");
+         break;
+
 //..       /* =-=-=-=-=-=-=-=-=- PUSH/POP Sreg =-=-=-=-=-=-=-=-=-= */
 //.. 
 //..       case 0xA1: /* POP %FS */
index 4e140eb1d26ee71708212d7a9a9976efbac1b3d9..b11f6706bf06c97b08a4154f8bebd3bc482b1df4 100644 (file)
@@ -2149,7 +2149,8 @@ vassert(0);
                              i->Ain.Alu64R.dst);
             goto done;
          case Armi_Mem:
-vassert(0);
+            *p++ = rexAMode_M( i->Ain.Alu64R.dst,
+                               i->Ain.Alu64R.src->Armi.Mem.am);
             *p++ = opc;
             p = doAMode_M(p, i->Ain.Alu64R.dst,
                              i->Ain.Alu64R.src->Armi.Mem.am);
index 2a90b1d25636a2a98b54d5a625b86742e7143ae1..e82de7d731aecaee0ef7dc59747325bb8a1a6490 100644 (file)
@@ -771,8 +771,8 @@ static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e )
             aluOp = Aalu_SUB; break;
          case Iop_And8: case Iop_And16: case Iop_And32: case Iop_And64: 
             aluOp = Aalu_AND; break;
-//..          case Iop_Or8: case Iop_Or16: case Iop_Or32:  
-//..             aluOp = Xalu_OR; break;
+         case Iop_Or8: case Iop_Or16: case Iop_Or32: case Iop_Or64: 
+            aluOp = Aalu_OR; break;
 //..          case Iop_Xor8: case Iop_Xor16: case Iop_Xor32: 
 //..             aluOp = Xalu_XOR; break;
 //..          case Iop_Mul16: case Iop_Mul32: 
@@ -3231,11 +3231,11 @@ static void iselStmt ( ISelEnv* env, IRStmt* stmt )
       IRType tyd = typeOfIRExpr(env->type_env, stmt->Ist.STle.data);
       vassert(tya == Ity_I64);
       am = iselIntExpr_AMode(env, stmt->Ist.STle.addr);
-//..       if (tyd == Ity_I32) {
-//..          X86RI* ri = iselIntExpr_RI(env, stmt->Ist.STle.data);
-//..          addInstr(env, X86Instr_Alu32M(Xalu_MOV,ri,am));
-//..          return;
-//..       }
+      if (tyd == Ity_I64) {
+         AMD64RI* ri = iselIntExpr_RI(env, stmt->Ist.STle.data);
+         addInstr(env, AMD64Instr_Alu64M(Aalu_MOV,ri,am));
+         return;
+      }
       if (tyd == Ity_I8 || tyd == Ity_I16 || tyd == Ity_I32) {
          HReg r = iselIntExpr_R(env, stmt->Ist.STle.data);
          addInstr(env, AMD64Instr_Store(tyd==Ity_I8 ? 1 : (tyd==Ity_I16 ? 2 : 4),