Lines Matching defs:cas
124 Ist_Store, IRLoadG, IRStoreG, LLSC, CAS and Dirty memory
5259 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas );
5260 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas );
5314 void do_shadow_CAS ( MCEnv* mce, IRCAS* cas )
5327 5. the CAS itself
5393 The "atomically" is the CAS bit. The scheme is always the same:
5418 read that; but then in the gap between the read and the CAS, a
5420 the location. Then the CAS in this thread will fail and we will
5439 if (cas->oldHi == IRTemp_INVALID) {
5440 do_shadow_CAS_single( mce, cas );
5442 do_shadow_CAS_double( mce, cas );
5447 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas )
5458 /* single CAS */
5459 tl_assert(cas->oldHi == IRTemp_INVALID);
5460 tl_assert(cas->expdHi == NULL);
5461 tl_assert(cas->dataHi == NULL);
5463 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
5473 tl_assert(isOriginalAtom(mce, cas->dataLo));
5475 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
5479 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
5484 tl_assert(isOriginalAtom(mce, cas->expdLo));
5486 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
5490 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
5502 cas->end, elemTy, cas->addr, 0/*Addr bias*/,
5505 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
5509 gen_load_b(mce, elemSzB, cas->addr, 0/*addr bias*/));
5510 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
5513 /* 5. the CAS itself */
5514 stmt( 'C', mce, IRStmt_CAS(cas) );
5522 binop(opCasCmpEQ, cas->expdLo, mkexpr(cas->oldLo)));
5526 do_shadow_Store( mce, cas->end, cas->addr, 0/*bias*/,
5530 gen_store_b( mce, elemSzB, cas->addr, 0/*offset*/,
5537 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas )
5552 /* double CAS */
5553 tl_assert(cas->oldHi != IRTemp_INVALID);
5554 tl_assert(cas->expdHi != NULL);
5555 tl_assert(cas->dataHi != NULL);
5557 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo);
5580 tl_assert(isOriginalAtom(mce, cas->dataHi));
5581 tl_assert(isOriginalAtom(mce, cas->dataLo));
5583 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataHi));
5585 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo));
5590 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataHi));
5592 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo));
5598 tl_assert(isOriginalAtom(mce, cas->expdHi));
5599 tl_assert(isOriginalAtom(mce, cas->expdLo));
5601 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdHi));
5603 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo));
5608 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdHi));
5610 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo));
5618 if (cas->end == Iend_LE) {
5622 tl_assert(cas->end == Iend_BE);
5631 cas->end, elemTy, cas->addr, memOffsHi/*Addr bias*/,
5639 cas->end, elemTy, cas->addr, memOffsLo/*Addr bias*/,
5642 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldHi), voldHi);
5643 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo);
5647 gen_load_b(mce, elemSzB, cas->addr,
5651 gen_load_b(mce, elemSzB, cas->addr,
5653 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldHi), boldHi);
5654 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo);
5657 /* 5. the CAS itself */
5658 stmt( 'C', mce, IRStmt_CAS(cas) );
5671 binop(opXor, cas->expdHi, mkexpr(cas->oldHi)));
5673 binop(opXor, cas->expdLo, mkexpr(cas->oldLo)));
5682 do_shadow_Store( mce, cas->end, cas->addr, memOffsHi/*bias*/,
5685 do_shadow_Store( mce, cas->end, cas->addr, memOffsLo/*bias*/,
5689 gen_store_b( mce, elemSzB, cas->addr, memOffsHi/*offset*/,
5692 gen_store_b( mce, elemSzB, cas->addr, memOffsLo/*offset*/,
5862 IRCAS* cas;
5945 cas = st->Ist.CAS.details;
5946 return isBogusAtom(cas->addr)
5947 || (cas->expdHi ? isBogusAtom(cas->expdHi) : False)
5948 || isBogusAtom(cas->expdLo)
5949 || (cas->dataHi ? isBogusAtom(cas->dataHi) : False)
5950 || isBogusAtom(cas->dataLo);
6202 do_shadow_CAS( &mce, st->Ist.CAS.details );
6203 /* Note, do_shadow_CAS copies the CAS itself to the output