Home | History | Annotate | Download | only in memcheck

Lines Matching refs:CAS

131    Ist_Store, IRLoadG, IRStoreG, LLSC, CAS and Dirty memory
5539 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas );
5540 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas );
5594 void do_shadow_CAS ( MCEnv* mce, IRCAS* cas )
5607 5. the CAS itself
5673 The "atomically" is the CAS bit. The scheme is always the same:
5698 read that; but then in the gap between the read and the CAS, a
5700 the location. Then the CAS in this thread will fail and we will
5719 if (cas->oldHi == IRTemp_INVALID) {
5720 do_shadow_CAS_single( mce, cas );
5722 do_shadow_CAS_double( mce, cas );
5727 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas )
5738 /* single CAS */
5739 tl_assert(cas->oldHi == IRTemp_INVALID);
5740 tl_assert(cas->expdHi == NULL);
5741 tl_assert(cas->dataHi == NULL);
5743 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
5753 cas->dataLo));
5755 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
5759 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
5764 tl_assert(isOriginalAtom(mce, cas->expdLo));
5766 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
5770 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
5782 cas->end, elemTy, cas->addr, 0/*Addr bias*/,
5785 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
5789 gen_load_b(mce, elemSzB, cas->addr, 0/*addr bias*/));
5790 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
5793 /* 5. the CAS itself */
5794 stmt( 'C', mce, IRStmt_CAS(cas) );
5802 binop(opCasCmpEQ, cas->expdLo, mkexpr(cas->oldLo)));
5806 do_shadow_Store( mce, cas->end, cas->addr, 0/*bias*/,
5810 gen_store_b( mce, elemSzB, cas->addr, 0/*offset*/,
5817 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas )
5832 /* double CAS */
5833 tl_assert(cas->oldHi != IRTemp_INVALID);
5834 tl_assert(cas->expdHi != NULL);
5835 tl_assert(cas->dataHi != NULL);
5837 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
5860 tl_assert(isOriginalAtom(mce, cas->dataHi));
5861 tl_assert(isOriginalAtom(mce, cas->dataLo));
5863 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataHi));
5865 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
5870 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataHi));
5872 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
5878 tl_assert(isOriginalAtom(mce, cas->expdHi));
5879 tl_assert(isOriginalAtom(mce, cas->expdLo));
5881 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdHi));
5883 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
5888 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdHi));
5890 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
5898 if (cas->end == Iend_LE) {
5902 tl_assert(cas->end == Iend_BE);
5911 cas->end, elemTy, cas->addr, memOffsHi/*Addr bias*/,
5919 cas->end, elemTy, cas->addr, memOffsLo/*Addr bias*/,
5922 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldHi), voldHi);
5923 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
5927 gen_load_b(mce, elemSzB, cas->addr,
5931 gen_load_b(mce, elemSzB, cas->addr,
5933 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldHi), boldHi);
5934 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
5937 /* 5. the CAS itself */
5938 stmt( 'C', mce, IRStmt_CAS(cas) );
5951 binop(opXor, cas->expdHi, mkexpr(cas->oldHi)));
5953 binop(opXor, cas->expdLo, mkexpr(cas->oldLo)));
5962 do_shadow_Store( mce, cas->end, cas->addr, memOffsHi/*bias*/,
5965 do_shadow_Store( mce, cas->end, cas->addr, memOffsLo/*bias*/,
5969 gen_store_b( mce, elemSzB, cas->addr, memOffsHi/*offset*/,
5972 gen_store_b( mce, elemSzB, cas->addr, memOffsLo/*offset*/,
6144 IRCAS* cas;
6227 cas = st->Ist.CAS.details;
6228 return isBogusAtom(cas->addr)
6229 || (cas->expdHi ? isBogusAtom(cas->expdHi) : False)
6230 || isBogusAtom(cas->expdLo)
6231 || (cas->dataHi ? isBogusAtom(cas->dataHi) : False)
6232 || isBogusAtom(cas->dataLo);
6484 do_shadow_CAS( &mce, st->Ist.CAS.details );
6485 /* Note, do_shadow_CAS copies the CAS itself to the output