Home | History | Annotate | Download | only in memcheck

Lines Matching refs:CAS

131    Ist_Store, IRLoadG, IRStoreG, LLSC, CAS and Dirty memory
5543 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas );
5544 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas );
5598 void do_shadow_CAS ( MCEnv* mce, IRCAS* cas )
5611 5. the CAS itself
5677 The "atomically" is the CAS bit. The scheme is always the same:
5702 read that; but then in the gap between the read and the CAS, a
5704 the location. Then the CAS in this thread will fail and we will
5723 if (cas->oldHi == IRTemp_INVALID) {
5724 do_shadow_CAS_single( mce, cas );
5726 do_shadow_CAS_double( mce, cas );
5731 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas )
5742 /* single CAS */
5743 tl_assert(cas->oldHi == IRTemp_INVALID);
5744 tl_assert(cas->expdHi == NULL);
5745 tl_assert(cas->dataHi == NULL);
5747 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
5757 tl_assert(isOriginalAtom(mce, cas->dataLo));
5759 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
5763 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
5768 tl_assert(isOriginalAtom(mce, cas->expdLo));
5770 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
5774 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
5786 cas->end, elemTy, cas->addr, 0/*Addr bias*/,
5789 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
5793 gen_load_b(mce, elemSzB, cas->addr, 0/*addr bias*/));
5794 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
5797 /* 5. the CAS itself */
5798 stmt( 'C', mce, IRStmt_CAS(cas) );
5806 binop(opCasCmpEQ, cas->expdLo, mkexpr(cas->oldLo)));
5810 do_shadow_Store( mce, cas->end, cas->addr, 0/*bias*/,
5814 gen_store_b( mce, elemSzB, cas->addr, 0/*offset*/,
5821 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas )
5836 /* double CAS */
5837 tl_assert(cas->oldHi != IRTemp_INVALID);
5838 tl_assert(cas->expdHi != NULL);
5839 tl_assert(cas->dataHi != NULL);
5841 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
5864 tl_assert(isOriginalAtom(mce, cas->dataHi));
5865 tl_assert(isOriginalAtom(mce, cas->dataLo));
5867 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataHi));
5869 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
5874 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataHi));
5876 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
5882 tl_assert(isOriginalAtom(mce, cas->expdHi));
5883 tl_assert(isOriginalAtom(mce, cas->expdLo));
5885 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdHi));
5887 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
5892 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdHi));
5894 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
5902 if (cas->end == Iend_LE) {
5906 tl_assert(cas->end == Iend_BE);
5915 cas->end, elemTy, cas->addr, memOffsHi/*Addr bias*/,
5923 cas->end, elemTy, cas->addr, memOffsLo/*Addr bias*/,
5926 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldHi), voldHi);
5927 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
5931 gen_load_b(mce, elemSzB, cas->addr,
5935 gen_load_b(mce, elemSzB, cas->addr,
5937 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldHi), boldHi);
5938 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
5941 /* 5. the CAS itself */
5942 stmt( 'C', mce, IRStmt_CAS(cas) );
5955 binop(opXor, cas->expdHi, mkexpr(cas->oldHi)));
5957 binop(opXor, cas->expdLo, mkexpr(cas->oldLo)));
5966 do_shadow_Store( mce, cas->end, cas->addr, memOffsHi/*bias*/,
5969 do_shadow_Store( mce, cas->end, cas->addr, memOffsLo/*bias*/,
5973 gen_store_b( mce, elemSzB, cas->addr, memOffsHi/*offset*/,
5976 gen_store_b( mce, elemSzB, cas->addr, memOffsLo/*offset*/,
6149 IRCAS* cas;
6232 cas = st->Ist.CAS.details;
6233 return isBogusAtom(cas->addr)
6234 || (cas->expdHi ? isBogusAtom(cas->expdHi) : False)
6235 || isBogusAtom(cas->expdLo)
6236 || (cas->dataHi ? isBogusAtom(cas->dataHi) : False)
6237 || isBogusAtom(cas->dataLo);
6491 do_shadow_CAS( &mce, st->Ist.CAS.details );
6492 /* Note, do_shadow_CAS copies the CAS itself to the output