Home | History | Annotate | Download | only in memcheck

Lines Matching refs:CAS

4018 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas );
4019 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas );
4073 void do_shadow_CAS ( MCEnv* mce, IRCAS* cas )
4086 5. the CAS itself
4152 The "atomically" is the CAS bit. The scheme is always the same:
4177 read that; but then in the gap between the read and the CAS, a
4179 the location. Then the CAS in this thread will fail and we will
4198 if (cas->oldHi == IRTemp_INVALID) {
4199 do_shadow_CAS_single( mce, cas );
4201 do_shadow_CAS_double( mce, cas );
4206 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas )
4217 /* single CAS */
4218 tl_assert(cas->oldHi == IRTemp_INVALID);
4219 tl_assert(cas->expdHi == NULL);
4220 tl_assert(cas->dataHi == NULL);
4222 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
4232 tl_assert(isOriginalAtom(mce, cas->dataLo));
4234 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
4238 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
4243 tl_assert(isOriginalAtom(mce, cas->expdLo));
4245 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
4249 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
4261 cas->end, elemTy, cas->addr, 0/*Addr bias*/
4263 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
4267 gen_load_b(mce, elemSzB, cas->addr, 0/*addr bias*/));
4268 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
4271 /* 5. the CAS itself */
4272 stmt( 'C', mce, IRStmt_CAS(cas) );
4280 binop(opCasCmpEQ, cas->expdLo, mkexpr(cas->oldLo)));
4284 do_shadow_Store( mce, cas->end, cas->addr, 0/*bias*/,
4288 gen_store_b( mce, elemSzB, cas->addr, 0/*offset*/,
4295 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas )
4310 /* double CAS */
4311 tl_assert(cas->oldHi != IRTemp_INVALID);
4312 tl_assert(cas->expdHi != NULL);
4313 tl_assert(cas->dataHi != NULL);
4315 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
4338 tl_assert(isOriginalAtom(mce, cas->dataHi));
4339 tl_assert(isOriginalAtom(mce, cas->dataLo));
4341 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataHi));
4343 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
4348 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataHi));
4350 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
4356 tl_assert(isOriginalAtom(mce, cas->expdHi));
4357 tl_assert(isOriginalAtom(mce, cas->expdLo));
4359 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdHi));
4361 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
4366 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdHi));
4368 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
4376 if (cas->end == Iend_LE) {
4380 tl_assert(cas->end == Iend_BE);
4389 cas->end, elemTy, cas->addr, memOffsHi/*Addr bias*/
4396 cas->end, elemTy, cas->addr, memOffsLo/*Addr bias*/
4398 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldHi), voldHi);
4399 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
4403 gen_load_b(mce, elemSzB, cas->addr,
4407 gen_load_b(mce, elemSzB, cas->addr,
4409 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldHi), boldHi);
4410 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
4413 /* 5. the CAS itself */
4414 stmt( 'C', mce, IRStmt_CAS(cas) );
4427 binop(opXor, cas->expdHi, mkexpr(cas->oldHi)));
4429 binop(opXor, cas->expdLo, mkexpr(cas->oldLo)));
4438 do_shadow_Store( mce, cas->end, cas->addr, memOffsHi/*bias*/,
4441 do_shadow_Store( mce, cas->end, cas->addr, memOffsLo/*bias*/,
4445 gen_store_b( mce, elemSzB, cas->addr, memOffsHi/*offset*/,
4448 gen_store_b( mce, elemSzB, cas->addr, memOffsLo/*offset*/,
4560 IRCAS* cas;
4628 cas = st->Ist.CAS.details;
4629 return isBogusAtom(cas->addr)
4630 || (cas->expdHi ? isBogusAtom(cas->expdHi) : False)
4631 || isBogusAtom(cas->expdLo)
4632 || (cas->dataHi ? isBogusAtom(cas->dataHi) : False)
4633 || isBogusAtom(cas->dataLo);
4866 do_shadow_CAS( &mce, st->Ist.CAS.details );
4867 /* Note, do_shadow_CAS copies the CAS itself to the output