]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
iselExpr64: Handle 64-bit literals
authorJulian Seward <jseward@acm.org>
Thu, 19 Aug 2004 17:15:49 +0000 (17:15 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 19 Aug 2004 17:15:49 +0000 (17:15 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@181

VEX/priv/host-x86/isel.c

index f97248db45a47fd5d856c7939eb222bdf5c783ab..5902f73bc6d4e86287d7a0c4fcc1a261ff89ccda 100644 (file)
@@ -810,6 +810,20 @@ static void iselIntExpr64 ( HReg* rHi, HReg* rLo, ISelEnv* env, IRExpr* e )
    vassert(e);
    vassert(typeOfIRExpr(env->type_env,e) == Ity_I64);
 
+   if (e->tag == Iex_Const) {
+      ULong w64 = e->Iex.Const.con->Ico.U64;
+      UInt  wHi = ((UInt)(w64 >> 32)) & 0xFFFFFFFF;
+      UInt  wLo = ((UInt)w64) & 0xFFFFFFFF;
+      HReg  tLo = newVRegI(env);
+      HReg  tHi = newVRegI(env);
+      vassert(e->Iex.Const.con->tag == Ico_U64);
+      addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wHi), tHi));
+      addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wLo), tLo));
+      *rHi = tHi;
+      *rLo = tLo;
+      return;
+   }
+
    /* read 64-bit IRTemp */
    if (e->tag == Iex_Tmp) {
       lookupIRTemp64( rHi, rLo, env, e->Iex.Tmp.tmp);