]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rename all the _Bit types to I1 so as to be consistent with all the
authorJulian Seward <jseward@acm.org>
Mon, 15 Nov 2004 15:21:17 +0000 (15:21 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 15 Nov 2004 15:21:17 +0000 (15:21 +0000)
other notation used.

git-svn-id: svn://svn.valgrind.org/vex/trunk@556

VEX/head20041019/memcheck/mc_translate.c
VEX/priv/host-x86/isel.c
VEX/priv/ir/irdefs.c
VEX/priv/ir/iropt.c
VEX/pub/libvex_ir.h
VEX/test_main.c

index f610ca86760e3cebbc2e3fa7433167cb8c16460c..aec5e6d8c42bf51a9d0477506a1decb723c1d13e 100644 (file)
@@ -184,7 +184,7 @@ static Bool sameKindedAtoms ( IRAtom* a1, IRAtom* a2 )
 static IRType shadowType ( IRType ty )
 {
    switch (ty) {
-      case Ity_Bit:
+      case Ity_I1:
       case Ity_I8:
       case Ity_I16:
       case Ity_I32: 
@@ -200,7 +200,7 @@ static IRType shadowType ( IRType ty )
    supplied shadow types (Bit/I8/I16/I32/UI64). */
 static IRExpr* definedOfType ( IRType ty ) {
    switch (ty) {
-      case Ity_Bit: return IRExpr_Const(IRConst_Bit(False));
+      case Ity_I1:  return IRExpr_Const(IRConst_U1(False));
       case Ity_I8:  return IRExpr_Const(IRConst_U8(0));
       case Ity_I16: return IRExpr_Const(IRConst_U16(0));
       case Ity_I32: return IRExpr_Const(IRConst_U32(0));
@@ -412,20 +412,20 @@ static IRAtom* mkPCastTo( MCEnv* mce, IRType dst_ty, IRAtom* vbits )
    IRType  ty   = typeOfIRExpr(mce->bb->tyenv, vbits);
    IRAtom* tmp1 = NULL;
    switch (ty) {
-      case Ity_Bit:
+      case Ity_I1:
          tmp1 = vbits;
          break;
       case Ity_I8: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE8, vbits, mkU8(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE8, vbits, mkU8(0)));
          break;
       case Ity_I16: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE16, vbits, mkU16(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE16, vbits, mkU16(0)));
          break;
       case Ity_I32: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE32, vbits, mkU32(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE32, vbits, mkU32(0)));
          break;
       case Ity_I64: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE64, vbits, mkU64(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE64, vbits, mkU64(0)));
          break;
       default:
          VG_(skin_panic)("mkPCastTo(1)");
@@ -433,7 +433,7 @@ static IRAtom* mkPCastTo( MCEnv* mce, IRType dst_ty, IRAtom* vbits )
    sk_assert(tmp1);
    /* Now widen up to the dst type. */
    switch (dst_ty) {
-      case Ity_Bit:
+      case Ity_I1:
          return tmp1;
       case Ity_I8: 
          return assignNew(mce, Ity_I8, unop(Iop_1Sto8, tmp1));
@@ -494,9 +494,9 @@ static void complainIfUndefined ( MCEnv* mce, IRAtom* atom )
    IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
 
    /* sz is only used for constructing the error message */
-   Int    sz = ty==Ity_Bit ? 0 : sizeofIRType(ty);
+   Int    sz = ty==Ity_I1 ? 0 : sizeofIRType(ty);
 
-   IRAtom* cond = mkPCastTo( mce, Ity_Bit, vatom );
+   IRAtom* cond = mkPCastTo( mce, Ity_I1, vatom );
    /* cond will be 0 if all defined, and 1 if any not defined. */
 
    IRDirty* di;
@@ -602,7 +602,7 @@ void do_shadow_PUT ( MCEnv* mce,  Int offset,
    }
 
    IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) {
       /* later: no ... */
       /* emit code to emit a complaint if any of the vbits are 1. */
@@ -627,7 +627,7 @@ void do_shadow_PUTI ( MCEnv* mce,
    IRType ty   = descr->elemTy;
    IRType tyS  = shadowType(ty);
    Int arrSize = descr->nElems * sizeofIRType(ty);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    sk_assert(isOriginalAtom(mce,ix));
    complainIfUndefined(mce,ix);
    if (isAlwaysDefd(mce, descr->base, arrSize)) {
@@ -652,7 +652,7 @@ static
 IRExpr* shadow_GET ( MCEnv* mce, Int offset, IRType ty )
 {
    IRType tyS = shadowType(ty);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) {
       /* Always defined, return all zeroes of the relevant type */
       return definedOfType(tyS);
@@ -673,7 +673,7 @@ IRExpr* shadow_GETI ( MCEnv* mce, IRArray* descr, IRAtom* ix, Int bias )
    IRType ty   = descr->elemTy;
    IRType tyS  = shadowType(ty);
    Int arrSize = descr->nElems * sizeofIRType(ty);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    sk_assert(isOriginalAtom(mce,ix));
    complainIfUndefined(mce,ix);
    if (isAlwaysDefd(mce, descr->base, arrSize)) {
@@ -908,13 +908,13 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce,
       case Iop_CmpLE32S: case Iop_CmpLE32U: 
       case Iop_CmpLT32U: case Iop_CmpLT32S:
       case Iop_CmpEQ32: case Iop_CmpNE32:
-         return mkPCastTo(mce, Ity_Bit, mkUifU32(mce, vatom1,vatom2));
+         return mkPCastTo(mce, Ity_I1, mkUifU32(mce, vatom1,vatom2));
 
       case Iop_CmpEQ16: case Iop_CmpNE16:
-         return mkPCastTo(mce, Ity_Bit, mkUifU16(mce, vatom1,vatom2));
+         return mkPCastTo(mce, Ity_I1, mkUifU16(mce, vatom1,vatom2));
 
       case Iop_CmpEQ8: case Iop_CmpNE8:
-         return mkPCastTo(mce, Ity_Bit, mkUifU8(mce, vatom1,vatom2));
+         return mkPCastTo(mce, Ity_I1, mkUifU8(mce, vatom1,vatom2));
 
       case Iop_Shl32: case Iop_Shr32: case Iop_Sar32:
          /* Complain if the shift amount is undefined.  Then simply
@@ -1029,7 +1029,7 @@ IRExpr* expr2vbits_Unop ( MCEnv* mce, IROp op, IRAtom* atom )
          return assignNew(mce, Ity_I8, unop(op, vatom));
 
       case Iop_32to1:
-         return assignNew(mce, Ity_Bit, unop(Iop_32to1, vatom));
+         return assignNew(mce, Ity_I1, unop(Iop_32to1, vatom));
 
       case Iop_ReinterpF64asI64:
       case Iop_ReinterpI64asF64:
index 77681c74e40f22dd4e3e75706a5a76da1de515ac..d78b18990f949fe3dd1925c1656114249bcf1098 100644 (file)
@@ -447,8 +447,8 @@ void doHelperCall ( ISelEnv* env,
    cc = Xcc_ALWAYS;
    if (guard) {
       if (guard->tag == Iex_Const 
-          && guard->Iex.Const.con->tag == Ico_Bit
-          && guard->Iex.Const.con->Ico.Bit == True) {
+          && guard->Iex.Const.con->tag == Ico_U1
+          && guard->Iex.Const.con->Ico.U1 == True) {
          /* unconditional -- do nothing */
       } else {
          cc = iselCondCode( env, guard );
@@ -1298,11 +1298,11 @@ static X86CondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e )
    DECLARE_PATTERN(p_1Uto32_then_32to1);
 
    vassert(e);
-   vassert(typeOfIRExpr(env->type_env,e) == Ity_Bit);
+   vassert(typeOfIRExpr(env->type_env,e) == Ity_I1);
 
    /* Constant 1:Bit */
-   if (e->tag == Iex_Const && e->Iex.Const.con->Ico.Bit == True) {
-      vassert(e->Iex.Const.con->tag == Ico_Bit);
+   if (e->tag == Iex_Const && e->Iex.Const.con->Ico.U1 == True) {
+      vassert(e->Iex.Const.con->tag == Ico_U1);
       HReg r = newVRegI(env);
       addInstr(env, X86Instr_Alu32R(Xalu_MOV,X86RMI_Imm(0),r));
       addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(r),r));
@@ -2330,7 +2330,7 @@ static void iselStmt ( ISelEnv* env, IRStmt* stmt )
          addInstr(env, mk_MOVsd_RR(rLo,dstLo) );
          return;
       }
-      if (ty == Ity_Bit) {
+      if (ty == Ity_I1) {
          X86CondCode cond = iselCondCode(env, stmt->Ist.Tmp.data);
          HReg dst = lookupIRTemp(env, tmp);
          addInstr(env, X86Instr_Set32(cond, dst));
@@ -2460,7 +2460,7 @@ HInstrArray* iselBB_X86 ( IRBB* bb )
    for (i = 0; i < env->n_vregmap; i++) {
       hregHI = hreg = INVALID_HREG;
       switch (bb->tyenv->types[i]) {
-         case Ity_Bit:
+         case Ity_I1:
          case Ity_I8:
          case Ity_I16:
          case Ity_I32: hreg   = mkHReg(j++, HRcInt, True); break;
index 7001f31650c39079b328d31f55062a6abea2d9ec..c555609a4a17ad0053ad321ea619e99869b06f88 100644 (file)
@@ -48,7 +48,7 @@ void ppIRType ( IRType ty )
 {
   switch (ty) {
     case Ity_INVALID: vex_printf("Ity_INVALID"); break;
-    case Ity_Bit:     vex_printf( "Bit"); break;
+    case Ity_I1:      vex_printf( "I1");  break;
     case Ity_I8:      vex_printf( "I8");  break;
     case Ity_I16:     vex_printf( "I16"); break;
     case Ity_I32:     vex_printf( "I32"); break;
@@ -63,7 +63,7 @@ void ppIRType ( IRType ty )
 void ppIRConst ( IRConst* con )
 {
    switch (con->tag) {
-      case Ico_Bit:  vex_printf( "%d:Bit",       con->Ico.Bit ? 1 : 0); break;
+      case Ico_U1:   vex_printf( "%d:I1",        con->Ico.U1 ? 1 : 0); break;
       case Ico_U8:   vex_printf( "0x%x:I8",      (UInt)(con->Ico.U8)); break;
       case Ico_U16:  vex_printf( "0x%x:I16",     (UInt)(con->Ico.U16)); break;
       case Ico_U32:  vex_printf( "0x%x:I32",     (UInt)(con->Ico.U32)); break;
@@ -444,11 +444,11 @@ void ppIRBB ( IRBB* bb )
 
 /* Constructors -- IRConst */
 
-IRConst* IRConst_Bit ( Bool bit )
+IRConst* IRConst_U1 ( Bool bit )
 {
    IRConst* c = LibVEX_Alloc(sizeof(IRConst));
-   c->tag     = Ico_Bit;
-   c->Ico.Bit = bit;
+   c->tag     = Ico_U1;
+   c->Ico.U1  = bit;
    /* call me paranoid; I don't care :-) */
    vassert(bit == False || bit == True);
    return c;
@@ -522,7 +522,7 @@ IRArray* mkIRArray ( Int base, IRType elemTy, Int nElems )
    arr->elemTy  = elemTy;
    arr->nElems  = nElems;
    vassert(!(arr->base < 0 || arr->base > 10000 /* somewhat arbitrary */));
-   vassert(!(arr->elemTy == Ity_Bit));
+   vassert(!(arr->elemTy == Ity_I1));
    vassert(!(arr->nElems <= 0 || arr->nElems > 500 /* somewhat arbitrary */));
    return arr;
 }
@@ -787,7 +787,7 @@ IRExpr** dopyIRExprVec ( IRExpr** vec )
 IRConst* dopyIRConst ( IRConst* c )
 {
    switch (c->tag) {
-      case Ico_Bit:  return IRConst_Bit(c->Ico.Bit);
+      case Ico_U1:   return IRConst_U1(c->Ico.U1);
       case Ico_U8:   return IRConst_U8(c->Ico.U8);
       case Ico_U16:  return IRConst_U16(c->Ico.U16);
       case Ico_U32:  return IRConst_U32(c->Ico.U32);
@@ -933,7 +933,7 @@ void typeOfPrimop ( IROp op, IRType* t_dst, IRType* t_arg1, IRType* t_arg2 )
 #  define BINARY(_td,_ta1,_ta2)   \
      *t_dst = (_td); *t_arg1 = (_ta1); *t_arg2 = (_ta2); break
 #  define COMPARISON(_ta)         \
-     *t_dst = Ity_Bit; *t_arg1 = *t_arg2 = (_ta); break;
+     *t_dst = Ity_I1; *t_arg1 = *t_arg2 = (_ta); break;
 
    *t_dst  = Ity_INVALID;
    *t_arg1 = Ity_INVALID;
@@ -1008,13 +1008,13 @@ void typeOfPrimop ( IROp op, IRType* t_dst, IRType* t_arg1, IRType* t_arg2 )
       case Iop_32HLto64:
          BINARY(Ity_I64,Ity_I32,Ity_I32);
 
-      case Iop_Not1:   UNARY(Ity_Bit,Ity_Bit);
-      case Iop_1Uto8:  UNARY(Ity_I8,Ity_Bit);
-      case Iop_1Sto8:  UNARY(Ity_I8,Ity_Bit);
-      case Iop_1Sto16: UNARY(Ity_I16,Ity_Bit);
-      case Iop_1Uto32: case Iop_1Sto32: UNARY(Ity_I32,Ity_Bit);
-      case Iop_1Sto64: UNARY(Ity_I64,Ity_Bit);
-      case Iop_32to1:  UNARY(Ity_Bit,Ity_I32);
+      case Iop_Not1:   UNARY(Ity_I1,Ity_I1);
+      case Iop_1Uto8:  UNARY(Ity_I8,Ity_I1);
+      case Iop_1Sto8:  UNARY(Ity_I8,Ity_I1);
+      case Iop_1Sto16: UNARY(Ity_I16,Ity_I1);
+      case Iop_1Uto32: case Iop_1Sto32: UNARY(Ity_I32,Ity_I1);
+      case Iop_1Sto64: UNARY(Ity_I64,Ity_I1);
+      case Iop_32to1:  UNARY(Ity_I1,Ity_I32);
 
       case Iop_8Uto32: case Iop_8Sto32:
          UNARY(Ity_I32,Ity_I8);
@@ -1129,7 +1129,7 @@ IRType typeOfIRTemp ( IRTypeEnv* env, IRTemp tmp )
 IRType typeOfIRConst ( IRConst* con )
 {
    switch (con->tag) {
-      case Ico_Bit:   return Ity_Bit;
+      case Ico_U1:    return Ity_I1;
       case Ico_U8:    return Ity_I8;
       case Ico_U16:   return Ity_I16;
       case Ico_U32:   return Ity_I32;
@@ -1179,7 +1179,7 @@ IRType typeOfIRExpr ( IRTypeEnv* tyenv, IRExpr* e )
 Bool isPlausibleType ( IRType ty )
 {
    switch (ty) {
-      case Ity_INVALID: case Ity_Bit:
+      case Ity_INVALID: case Ity_I1:
       case Ity_I8: case Ity_I16: case Ity_I32: case Ity_I64: 
       case Ity_F32: case Ity_F64:
          return True;
@@ -1299,7 +1299,7 @@ static Bool saneIRArray ( IRArray* arr )
 {
    if (arr->base < 0 || arr->base > 10000 /* somewhat arbitrary */)
       return False;
-   if (arr->elemTy == Ity_Bit)
+   if (arr->elemTy == Ity_I1)
       return False;
    if (arr->nElems <= 0 || arr->nElems > 500 /* somewhat arbitrary */)
       return False;
@@ -1481,11 +1481,11 @@ void tcExpr ( IRBB* bb, IRStmt* stmt, IRExpr* expr, IRType gWordTy )
                sanityCheckFail(bb,stmt,"Iex.CCall: > 32 args");
             tcExpr(bb,stmt, expr->Iex.CCall.args[i], gWordTy);
          }
-         if (expr->Iex.CCall.retty == Ity_Bit)
-            sanityCheckFail(bb,stmt,"Iex.CCall.retty: cannot return :: Ity_Bit");
+         if (expr->Iex.CCall.retty == Ity_I1)
+            sanityCheckFail(bb,stmt,"Iex.CCall.retty: cannot return :: Ity_I1");
          for (i = 0; expr->Iex.CCall.args[i]; i++)
-            if (typeOfIRExpr(tyenv, expr->Iex.CCall.args[i]) == Ity_Bit)
-               sanityCheckFail(bb,stmt,"Iex.CCall.arg: arg :: Ity_Bit");
+            if (typeOfIRExpr(tyenv, expr->Iex.CCall.args[i]) == Ity_I1)
+               sanityCheckFail(bb,stmt,"Iex.CCall.arg: arg :: Ity_I1");
          break;
       case Iex_Const:
          break;
@@ -1514,14 +1514,14 @@ void tcStmt ( IRBB* bb, IRStmt* stmt, IRType gWordTy )
    switch (stmt->tag) {
       case Ist_Put:
          tcExpr( bb, stmt, stmt->Ist.Put.data, gWordTy );
-         if (typeOfIRExpr(tyenv,stmt->Ist.Put.data) == Ity_Bit)
-            sanityCheckFail(bb,stmt,"IRStmt.Put.data: cannot Put :: Ity_Bit");
+         if (typeOfIRExpr(tyenv,stmt->Ist.Put.data) == Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.Put.data: cannot Put :: Ity_I1");
          break;
       case Ist_PutI:
          tcExpr( bb, stmt, stmt->Ist.PutI.data, gWordTy );
          tcExpr( bb, stmt, stmt->Ist.PutI.ix, gWordTy );
-         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data) == Ity_Bit)
-            sanityCheckFail(bb,stmt,"IRStmt.PutI.data: cannot PutI :: Ity_Bit");
+         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data) == Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.PutI.data: cannot PutI :: Ity_I1");
          if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data) 
              != stmt->Ist.PutI.descr->elemTy)
             sanityCheckFail(bb,stmt,"IRStmt.PutI.data: data ty != elem ty");
@@ -1541,8 +1541,8 @@ void tcStmt ( IRBB* bb, IRStmt* stmt, IRType gWordTy )
          tcExpr( bb, stmt, stmt->Ist.STle.data, gWordTy );
          if (typeOfIRExpr(tyenv, stmt->Ist.STle.addr) != gWordTy)
             sanityCheckFail(bb,stmt,"IRStmt.STle.addr: not :: guest word type");
-         if (typeOfIRExpr(tyenv, stmt->Ist.STle.data) == Ity_Bit)
-            sanityCheckFail(bb,stmt,"IRStmt.STle.data: cannot STle :: Ity_Bit");
+         if (typeOfIRExpr(tyenv, stmt->Ist.STle.data) == Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.STle.data: cannot STle :: Ity_I1");
          break;
       case Ist_Dirty:
          /* Mostly check for various kinds of ill-formed dirty calls. */
@@ -1567,16 +1567,16 @@ void tcStmt ( IRBB* bb, IRStmt* stmt, IRType gWordTy )
          }
          /* check types, minimally */
          if (d->guard == NULL) goto bad_dirty;
-         if (typeOfIRExpr(tyenv, d->guard) != Ity_Bit)
-            sanityCheckFail(bb,stmt,"IRStmt.Dirty.guard not :: Ity_Bit");
+         if (typeOfIRExpr(tyenv, d->guard) != Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.Dirty.guard not :: Ity_I1");
          if (d->tmp != IRTemp_INVALID
-             && typeOfIRTemp(tyenv, d->tmp) == Ity_Bit)
-            sanityCheckFail(bb,stmt,"IRStmt.Dirty.dst :: Ity_Bit");
+             && typeOfIRTemp(tyenv, d->tmp) == Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.Dirty.dst :: Ity_I1");
          for (i = 0; d->args[i] != NULL; i++) {
             if (i >= 32)
                sanityCheckFail(bb,stmt,"IRStmt.Dirty: > 32 args");
-            if (typeOfIRExpr(tyenv, d->args[i]) == Ity_Bit)
-               sanityCheckFail(bb,stmt,"IRStmt.Dirty.arg[i] :: Ity_Bit");
+            if (typeOfIRExpr(tyenv, d->args[i]) == Ity_I1)
+               sanityCheckFail(bb,stmt,"IRStmt.Dirty.arg[i] :: Ity_I1");
          }
          break;
          bad_dirty:
@@ -1584,8 +1584,8 @@ void tcStmt ( IRBB* bb, IRStmt* stmt, IRType gWordTy )
 
       case Ist_Exit:
          tcExpr( bb, stmt, stmt->Ist.Exit.cond, gWordTy );
-         if (typeOfIRExpr(tyenv,stmt->Ist.Exit.cond) != Ity_Bit)
-            sanityCheckFail(bb,stmt,"IRStmt.Exit.cond: not :: Ity_Bit");
+         if (typeOfIRExpr(tyenv,stmt->Ist.Exit.cond) != Ity_I1)
+            sanityCheckFail(bb,stmt,"IRStmt.Exit.cond: not :: Ity_I1");
          if (typeOfIRConst(stmt->Ist.Exit.dst) != gWordTy)
             sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: not :: guest word type");
          break;
@@ -1672,7 +1672,7 @@ Bool eqIRConst ( IRConst* c1, IRConst* c2 )
       return False;
 
    switch (c1->tag) {
-      case Ico_Bit: return (1 & c1->Ico.Bit) == (1 & c2->Ico.Bit);
+      case Ico_U1:  return (1 & c1->Ico.U1) == (1 & c2->Ico.U1);
       case Ico_U8:  return c1->Ico.U8  == c2->Ico.U8;
       case Ico_U16: return c1->Ico.U16 == c2->Ico.U16;
       case Ico_U32: return c1->Ico.U32 == c2->Ico.U32;
@@ -1718,7 +1718,7 @@ IRDirty* unsafeIRDirty_0_N ( Int regparms, Char* name, void* addr,
 {
    IRDirty* d = emptyIRDirty();
    d->cee   = mkIRCallee ( regparms, name, addr );
-   d->guard = IRExpr_Const(IRConst_Bit(True));
+   d->guard = IRExpr_Const(IRConst_U1(True));
    d->args  = args;
    return d;
 }
@@ -1729,7 +1729,7 @@ IRDirty* unsafeIRDirty_1_N ( IRTemp dst,
 {
    IRDirty* d = emptyIRDirty();
    d->cee   = mkIRCallee ( regparms, name, addr );
-   d->guard = IRExpr_Const(IRConst_Bit(True));
+   d->guard = IRExpr_Const(IRConst_U1(True));
    d->args  = args;
    d->tmp   = dst;
    return d;
index 37cf8d1663d185041ee9525d7ec630767a709591..126b1516f44218781dd40c7ce892d39cd83ae0c3 100644 (file)
@@ -387,23 +387,23 @@ static IRExpr* fold_Expr ( IRExpr* e )
       switch (e->Iex.Unop.op) {
          case Iop_1Uto8:
             e2 = IRExpr_Const(IRConst_U8(
-                    e->Iex.Unop.arg->Iex.Const.con->Ico.Bit
+                    e->Iex.Unop.arg->Iex.Const.con->Ico.U1
                     ? 1 : 0));
             break;
          case Iop_1Uto32:
             e2 = IRExpr_Const(IRConst_U32(
-                    e->Iex.Unop.arg->Iex.Const.con->Ico.Bit
+                    e->Iex.Unop.arg->Iex.Const.con->Ico.U1
                     ? 1 : 0));
             break;
 
          case Iop_1Sto32:
             e2 = IRExpr_Const(IRConst_U32(
-                    e->Iex.Unop.arg->Iex.Const.con->Ico.Bit
+                    e->Iex.Unop.arg->Iex.Const.con->Ico.U1
                     ? 0xFFFFFFFF : 0));
             break;
          case Iop_1Sto64:
             e2 = IRExpr_Const(IRConst_U64(
-                    e->Iex.Unop.arg->Iex.Const.con->Ico.Bit
+                    e->Iex.Unop.arg->Iex.Const.con->Ico.U1
                     ? 0xFFFFFFFFFFFFFFFFULL : 0));
             break;
 
@@ -431,7 +431,7 @@ static IRExpr* fold_Expr ( IRExpr* e )
                     0xFF & e->Iex.Unop.arg->Iex.Const.con->Ico.U32));
             break;
          case Iop_32to1:
-            e2 = IRExpr_Const(IRConst_Bit(
+            e2 = IRExpr_Const(IRConst_U1(
                     0==e->Iex.Unop.arg->Iex.Const.con->Ico.U32
                        ? False : True));
             break;
@@ -450,8 +450,8 @@ static IRExpr* fold_Expr ( IRExpr* e )
             break;
 
          case Iop_Not1:
-            e2 = IRExpr_Const(IRConst_Bit(
-                    notBool(e->Iex.Unop.arg->Iex.Const.con->Ico.Bit)));
+            e2 = IRExpr_Const(IRConst_U1(
+                    notBool(e->Iex.Unop.arg->Iex.Const.con->Ico.U1)));
             break;
 
          default: 
@@ -562,46 +562,46 @@ static IRExpr* fold_Expr ( IRExpr* e )
                break;
             }
             case Iop_CmpEQ32:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        (e->Iex.Binop.arg1->Iex.Const.con->Ico.U32
                         == e->Iex.Binop.arg2->Iex.Const.con->Ico.U32)));
                break;
             case Iop_CmpNE32:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        (e->Iex.Binop.arg1->Iex.Const.con->Ico.U32
                         != e->Iex.Binop.arg2->Iex.Const.con->Ico.U32)));
                break;
 
             case Iop_CmpNE64:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        (e->Iex.Binop.arg1->Iex.Const.con->Ico.U64
                         != e->Iex.Binop.arg2->Iex.Const.con->Ico.U64)));
                break;
 
             case Iop_CmpNE8:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        ((0xFF & e->Iex.Binop.arg1->Iex.Const.con->Ico.U8)
                         != (0xFF & e->Iex.Binop.arg2->Iex.Const.con->Ico.U8))));
                break;
 
             case Iop_CmpLE32U:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        ((UInt)(e->Iex.Binop.arg1->Iex.Const.con->Ico.U32)
                         <= (UInt)(e->Iex.Binop.arg2->Iex.Const.con->Ico.U32))));
                break;
             case Iop_CmpLE32S:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        ((Int)(e->Iex.Binop.arg1->Iex.Const.con->Ico.U32)
                         <= (Int)(e->Iex.Binop.arg2->Iex.Const.con->Ico.U32))));
                break;
 
             case Iop_CmpLT32S:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        ((Int)(e->Iex.Binop.arg1->Iex.Const.con->Ico.U32)
                         < (Int)(e->Iex.Binop.arg2->Iex.Const.con->Ico.U32))));
                break;
             case Iop_CmpLT32U:
-               e2 = IRExpr_Const(IRConst_Bit(
+               e2 = IRExpr_Const(IRConst_U1(
                        ((UInt)(e->Iex.Binop.arg1->Iex.Const.con->Ico.U32)
                         < (UInt)(e->Iex.Binop.arg2->Iex.Const.con->Ico.U32))));
                break;
@@ -844,12 +844,12 @@ static IRStmt* subst_and_fold_Stmt ( IRExpr** env, IRStmt* st )
          if (fcond->tag == Iex_Const) {
             /* Interesting.  The condition on this exit has folded down to
                a constant. */
-            vassert(fcond->Iex.Const.con->tag == Ico_Bit);
-            if (fcond->Iex.Const.con->Ico.Bit == False) {
+            vassert(fcond->Iex.Const.con->tag == Ico_U1);
+            if (fcond->Iex.Const.con->Ico.U1 == False) {
                /* exit is never going to happen, so dump the statement. */
                return NULL;
             } else {
-               vassert(fcond->Iex.Const.con->Ico.Bit == True);
+               vassert(fcond->Iex.Const.con->Ico.U1 == True);
                /* Hmmm.  The exit has become unconditional.  Leave it as
                   it is for now, since we'd have to truncate the BB at
                   this point, which is tricky. */
@@ -1031,12 +1031,12 @@ static void addUses_Stmt ( Bool* set, IRStmt* st )
 }
 
 
-/* Is this literally IRExpr_Const(IRConst_Bit(False)) ? */
-static Bool isZeroBit ( IRExpr* e )
+/* Is this literally IRExpr_Const(IRConst_U1(False)) ? */
+static Bool isZeroU1 ( IRExpr* e )
 {
    return e->tag == Iex_Const
-          && e->Iex.Const.con->tag == Ico_Bit
-          && e->Iex.Const.con->Ico.Bit == False;
+          && e->Iex.Const.con->tag == Ico_U1
+          && e->Iex.Const.con->Ico.U1 == False;
 }
 
 
@@ -1078,7 +1078,7 @@ static Bool isZeroBit ( IRExpr* e )
       else
       if (st->tag == Ist_Dirty
           && st->Ist.Dirty.details->guard
-          && isZeroBit(st->Ist.Dirty.details->guard)) {
+          && isZeroU1(st->Ist.Dirty.details->guard)) {
          /* This is a dirty helper which will never get called.  Delete it. */
          bb->stmts[i] = NULL;
        }
index bc58c380afed7eb0482ef9ed19eefc7f029ff8a9..a2628be90c15f7da9f72c4a91ef9e4a658d7aa6b 100644 (file)
@@ -47,7 +47,7 @@
 
 typedef 
    enum { Ity_INVALID=0x10FFF,
-          Ity_Bit=0x11000, 
+          Ity_I1=0x11000, 
           Ity_I8, Ity_I16, Ity_I32, Ity_I64,
           Ity_F32, Ity_F64
    }
@@ -60,7 +60,7 @@ extern Int  sizeofIRType ( IRType );
 /* ------------------ Constants ------------------ */
 
 typedef
-   enum { Ico_Bit=0x12000,
+   enum { Ico_U1=0x12000,
           Ico_U8, Ico_U16, Ico_U32, Ico_U64,
           Ico_F64, /* 64-bit IEEE754 floating */
           Ico_F64i /* 64-bit unsigned int to be interpreted literally
@@ -72,7 +72,7 @@ typedef
    struct _IRConst {
       IRConstTag tag;
       union {
-         Bool   Bit;
+         Bool   U1;
          UChar  U8;
          UShort U16;
          UInt   U32;
@@ -83,7 +83,7 @@ typedef
    }
    IRConst;
 
-extern IRConst* IRConst_Bit  ( Bool );
+extern IRConst* IRConst_U1   ( Bool );
 extern IRConst* IRConst_U8   ( UChar );
 extern IRConst* IRConst_U16  ( UShort );
 extern IRConst* IRConst_U32  ( UInt );
index 6aa4368e3413f717fe7ec8a470109186c3ab0cbe..b33456406b8747d73c1af7256718fa5f5f93a3fd 100644 (file)
@@ -526,7 +526,7 @@ static Bool sameKindedAtoms ( IRAtom* a1, IRAtom* a2 )
 static IRType shadowType ( IRType ty )
 {
    switch (ty) {
-      case Ity_Bit:
+      case Ity_I1:
       case Ity_I8:
       case Ity_I16:
       case Ity_I32: 
@@ -542,7 +542,7 @@ static IRType shadowType ( IRType ty )
    supplied shadow types (Bit/I8/I16/I32/UI64). */
 static IRExpr* definedOfType ( IRType ty ) {
    switch (ty) {
-      case Ity_Bit: return IRExpr_Const(IRConst_Bit(False));
+      case Ity_I1:  return IRExpr_Const(IRConst_U1(False));
       case Ity_I8:  return IRExpr_Const(IRConst_U8(0));
       case Ity_I16: return IRExpr_Const(IRConst_U16(0));
       case Ity_I32: return IRExpr_Const(IRConst_U32(0));
@@ -754,20 +754,20 @@ static IRAtom* mkPCastTo( MCEnv* mce, IRType dst_ty, IRAtom* vbits )
    IRType  ty   = typeOfIRExpr(mce->bb->tyenv, vbits);
    IRAtom* tmp1 = NULL;
    switch (ty) {
-      case Ity_Bit:
+      case Ity_I1:
          tmp1 = vbits;
          break;
       case Ity_I8: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE8, vbits, mkU8(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE8, vbits, mkU8(0)));
          break;
       case Ity_I16: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE16, vbits, mkU16(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE16, vbits, mkU16(0)));
          break;
       case Ity_I32: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE32, vbits, mkU32(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE32, vbits, mkU32(0)));
          break;
       case Ity_I64: 
-         tmp1 = assignNew(mce, Ity_Bit, binop(Iop_CmpNE64, vbits, mkU64(0)));
+         tmp1 = assignNew(mce, Ity_I1, binop(Iop_CmpNE64, vbits, mkU64(0)));
          break;
       default:
          VG_(skin_panic)("mkPCastTo(1)");
@@ -775,7 +775,7 @@ static IRAtom* mkPCastTo( MCEnv* mce, IRType dst_ty, IRAtom* vbits )
    sk_assert(tmp1);
    /* Now widen up to the dst type. */
    switch (dst_ty) {
-      case Ity_Bit:
+      case Ity_I1:
          return tmp1;
       case Ity_I8: 
          return assignNew(mce, Ity_I8, unop(Iop_1Sto8, tmp1));
@@ -836,9 +836,9 @@ static void complainIfUndefined ( MCEnv* mce, IRAtom* atom )
    IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
 
    /* sz is only used for constructing the error message */
-   Int    sz = ty==Ity_Bit ? 0 : sizeofIRType(ty);
+   Int    sz = ty==Ity_I1 ? 0 : sizeofIRType(ty);
 
-   IRAtom* cond = mkPCastTo( mce, Ity_Bit, vatom );
+   IRAtom* cond = mkPCastTo( mce, Ity_I1, vatom );
    /* cond will be 0 if all defined, and 1 if any not defined. */
 
    IRDirty* di;
@@ -944,7 +944,7 @@ void do_shadow_PUT ( MCEnv* mce,  Int offset,
    }
 
    IRType ty = typeOfIRExpr(mce->bb->tyenv, vatom);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) {
       /* later: no ... */
       /* emit code to emit a complaint if any of the vbits are 1. */
@@ -969,7 +969,7 @@ void do_shadow_PUTI ( MCEnv* mce,
    IRType ty   = descr->elemTy;
    IRType tyS  = shadowType(ty);
    Int arrSize = descr->nElems * sizeofIRType(ty);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    sk_assert(isOriginalAtom(mce,ix));
    complainIfUndefined(mce,ix);
    if (isAlwaysDefd(mce, descr->base, arrSize)) {
@@ -994,7 +994,7 @@ static
 IRExpr* shadow_GET ( MCEnv* mce, Int offset, IRType ty )
 {
    IRType tyS = shadowType(ty);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) {
       /* Always defined, return all zeroes of the relevant type */
       return definedOfType(tyS);
@@ -1015,7 +1015,7 @@ IRExpr* shadow_GETI ( MCEnv* mce, IRArray* descr, IRAtom* ix, Int bias )
    IRType ty   = descr->elemTy;
    IRType tyS  = shadowType(ty);
    Int arrSize = descr->nElems * sizeofIRType(ty);
-   sk_assert(ty != Ity_Bit);
+   sk_assert(ty != Ity_I1);
    sk_assert(isOriginalAtom(mce,ix));
    complainIfUndefined(mce,ix);
    if (isAlwaysDefd(mce, descr->base, arrSize)) {
@@ -1250,13 +1250,13 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce,
       case Iop_CmpLE32S: case Iop_CmpLE32U: 
       case Iop_CmpLT32U: case Iop_CmpLT32S:
       case Iop_CmpEQ32: case Iop_CmpNE32:
-         return mkPCastTo(mce, Ity_Bit, mkUifU32(mce, vatom1,vatom2));
+         return mkPCastTo(mce, Ity_I1, mkUifU32(mce, vatom1,vatom2));
 
       case Iop_CmpEQ16: case Iop_CmpNE16:
-         return mkPCastTo(mce, Ity_Bit, mkUifU16(mce, vatom1,vatom2));
+         return mkPCastTo(mce, Ity_I1, mkUifU16(mce, vatom1,vatom2));
 
       case Iop_CmpEQ8: case Iop_CmpNE8:
-         return mkPCastTo(mce, Ity_Bit, mkUifU8(mce, vatom1,vatom2));
+         return mkPCastTo(mce, Ity_I1, mkUifU8(mce, vatom1,vatom2));
 
       case Iop_Shl32: case Iop_Shr32: case Iop_Sar32:
          /* Complain if the shift amount is undefined.  Then simply
@@ -1371,7 +1371,7 @@ IRExpr* expr2vbits_Unop ( MCEnv* mce, IROp op, IRAtom* atom )
          return assignNew(mce, Ity_I8, unop(op, vatom));
 
       case Iop_32to1:
-         return assignNew(mce, Ity_Bit, unop(Iop_32to1, vatom));
+         return assignNew(mce, Ity_I1, unop(Iop_32to1, vatom));
 
       case Iop_ReinterpF64asI64:
       case Iop_ReinterpI64asF64: