Lines Matching refs:mce
141 static IRExpr* expr2vbits ( struct _MCEnv* mce, IRExpr* e );
142 static IRTemp findShadowTmpB ( struct _MCEnv* mce, IRTemp orig );
250 static IRTemp newTemp ( MCEnv* mce, IRType ty, TempKind kind ) in newTemp() argument
254 IRTemp tmp = newIRTemp(mce->sb->tyenv, ty); in newTemp()
258 newIx = VG_(addToXA)( mce->tmpMap, &ent ); in newTemp()
266 static IRTemp findShadowTmpV ( MCEnv* mce, IRTemp orig ) in findShadowTmpV() argument
271 ent = (TempMapEnt*)VG_(indexXA)( mce->tmpMap, (Word)orig ); in findShadowTmpV()
275 = newTemp( mce, shadowTypeV(mce->sb->tyenv->types[orig]), VSh ); in findShadowTmpV()
278 ent = (TempMapEnt*)VG_(indexXA)( mce->tmpMap, (Word)orig ); in findShadowTmpV()
296 static void newShadowTmpV ( MCEnv* mce, IRTemp orig ) in newShadowTmpV() argument
301 ent = (TempMapEnt*)VG_(indexXA)( mce->tmpMap, (Word)orig ); in newShadowTmpV()
305 = newTemp( mce, shadowTypeV(mce->sb->tyenv->types[orig]), VSh ); in newShadowTmpV()
308 ent = (TempMapEnt*)VG_(indexXA)( mce->tmpMap, (Word)orig ); in newShadowTmpV()
330 static Bool isOriginalAtom ( MCEnv* mce, IRAtom* a1 ) in isOriginalAtom() argument
335 TempMapEnt* ent = VG_(indexXA)( mce->tmpMap, a1->Iex.RdTmp.tmp ); in isOriginalAtom()
343 static Bool isShadowAtom ( MCEnv* mce, IRAtom* a1 ) in isShadowAtom() argument
348 TempMapEnt* ent = VG_(indexXA)( mce->tmpMap, a1->Iex.RdTmp.tmp ); in isShadowAtom()
420 static inline void stmt ( HChar cat, MCEnv* mce, IRStmt* st ) { in stmt() argument
421 if (mce->trace) { in stmt()
426 addStmtToIRSB(mce->sb, st); in stmt()
431 void assign ( HChar cat, MCEnv* mce, IRTemp tmp, IRExpr* expr ) { in assign() argument
432 stmt(cat, mce, IRStmt_WrTmp(tmp,expr)); in assign()
456 static IRAtom* assignNew ( HChar cat, MCEnv* mce, IRType ty, IRExpr* e ) in assignNew() argument
460 IRType tyE = typeOfIRExpr(mce->sb->tyenv, e); in assignNew()
471 t = newTemp(mce, ty, k); in assignNew()
472 assign(cat, mce, t, e); in assignNew()
498 static IRAtom* mkDifD8 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkDifD8() argument
499 tl_assert(isShadowAtom(mce,a1)); in mkDifD8()
500 tl_assert(isShadowAtom(mce,a2)); in mkDifD8()
501 return assignNew('V', mce, Ity_I8, binop(Iop_And8, a1, a2)); in mkDifD8()
504 static IRAtom* mkDifD16 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkDifD16() argument
505 tl_assert(isShadowAtom(mce,a1)); in mkDifD16()
506 tl_assert(isShadowAtom(mce,a2)); in mkDifD16()
507 return assignNew('V', mce, Ity_I16, binop(Iop_And16, a1, a2)); in mkDifD16()
510 static IRAtom* mkDifD32 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkDifD32() argument
511 tl_assert(isShadowAtom(mce,a1)); in mkDifD32()
512 tl_assert(isShadowAtom(mce,a2)); in mkDifD32()
513 return assignNew('V', mce, Ity_I32, binop(Iop_And32, a1, a2)); in mkDifD32()
516 static IRAtom* mkDifD64 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkDifD64() argument
517 tl_assert(isShadowAtom(mce,a1)); in mkDifD64()
518 tl_assert(isShadowAtom(mce,a2)); in mkDifD64()
519 return assignNew('V', mce, Ity_I64, binop(Iop_And64, a1, a2)); in mkDifD64()
522 static IRAtom* mkDifDV128 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkDifDV128() argument
523 tl_assert(isShadowAtom(mce,a1)); in mkDifDV128()
524 tl_assert(isShadowAtom(mce,a2)); in mkDifDV128()
525 return assignNew('V', mce, Ity_V128, binop(Iop_AndV128, a1, a2)); in mkDifDV128()
528 static IRAtom* mkDifDV256 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkDifDV256() argument
529 tl_assert(isShadowAtom(mce,a1)); in mkDifDV256()
530 tl_assert(isShadowAtom(mce,a2)); in mkDifDV256()
531 return assignNew('V', mce, Ity_V256, binop(Iop_AndV256, a1, a2)); in mkDifDV256()
536 static IRAtom* mkUifU8 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifU8() argument
537 tl_assert(isShadowAtom(mce,a1)); in mkUifU8()
538 tl_assert(isShadowAtom(mce,a2)); in mkUifU8()
539 return assignNew('V', mce, Ity_I8, binop(Iop_Or8, a1, a2)); in mkUifU8()
542 static IRAtom* mkUifU16 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifU16() argument
543 tl_assert(isShadowAtom(mce,a1)); in mkUifU16()
544 tl_assert(isShadowAtom(mce,a2)); in mkUifU16()
545 return assignNew('V', mce, Ity_I16, binop(Iop_Or16, a1, a2)); in mkUifU16()
548 static IRAtom* mkUifU32 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifU32() argument
549 tl_assert(isShadowAtom(mce,a1)); in mkUifU32()
550 tl_assert(isShadowAtom(mce,a2)); in mkUifU32()
551 return assignNew('V', mce, Ity_I32, binop(Iop_Or32, a1, a2)); in mkUifU32()
554 static IRAtom* mkUifU64 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifU64() argument
555 tl_assert(isShadowAtom(mce,a1)); in mkUifU64()
556 tl_assert(isShadowAtom(mce,a2)); in mkUifU64()
557 return assignNew('V', mce, Ity_I64, binop(Iop_Or64, a1, a2)); in mkUifU64()
560 static IRAtom* mkUifU128 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifU128() argument
562 tl_assert(isShadowAtom(mce,a1)); in mkUifU128()
563 tl_assert(isShadowAtom(mce,a2)); in mkUifU128()
564 tmp1 = assignNew('V', mce, Ity_I64, unop(Iop_128to64, a1)); in mkUifU128()
565 tmp2 = assignNew('V', mce, Ity_I64, unop(Iop_128HIto64, a1)); in mkUifU128()
566 tmp3 = assignNew('V', mce, Ity_I64, unop(Iop_128to64, a2)); in mkUifU128()
567 tmp4 = assignNew('V', mce, Ity_I64, unop(Iop_128HIto64, a2)); in mkUifU128()
568 tmp5 = assignNew('V', mce, Ity_I64, binop(Iop_Or64, tmp1, tmp3)); in mkUifU128()
569 tmp6 = assignNew('V', mce, Ity_I64, binop(Iop_Or64, tmp2, tmp4)); in mkUifU128()
571 return assignNew('V', mce, Ity_I128, binop(Iop_64HLto128, tmp6, tmp5)); in mkUifU128()
574 static IRAtom* mkUifUV128 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifUV128() argument
575 tl_assert(isShadowAtom(mce,a1)); in mkUifUV128()
576 tl_assert(isShadowAtom(mce,a2)); in mkUifUV128()
577 return assignNew('V', mce, Ity_V128, binop(Iop_OrV128, a1, a2)); in mkUifUV128()
580 static IRAtom* mkUifUV256 ( MCEnv* mce, IRAtom* a1, IRAtom* a2 ) { in mkUifUV256() argument
581 tl_assert(isShadowAtom(mce,a1)); in mkUifUV256()
582 tl_assert(isShadowAtom(mce,a2)); in mkUifUV256()
583 return assignNew('V', mce, Ity_V256, binop(Iop_OrV256, a1, a2)); in mkUifUV256()
586 static IRAtom* mkUifU ( MCEnv* mce, IRType vty, IRAtom* a1, IRAtom* a2 ) { in mkUifU() argument
588 case Ity_I8: return mkUifU8(mce, a1, a2); in mkUifU()
589 case Ity_I16: return mkUifU16(mce, a1, a2); in mkUifU()
590 case Ity_I32: return mkUifU32(mce, a1, a2); in mkUifU()
591 case Ity_I64: return mkUifU64(mce, a1, a2); in mkUifU()
592 case Ity_I128: return mkUifU128(mce, a1, a2); in mkUifU()
593 case Ity_V128: return mkUifUV128(mce, a1, a2); in mkUifU()
594 case Ity_V256: return mkUifUV256(mce, a1, a2); in mkUifU()
603 static IRAtom* mkLeft8 ( MCEnv* mce, IRAtom* a1 ) { in mkLeft8() argument
604 tl_assert(isShadowAtom(mce,a1)); in mkLeft8()
605 return assignNew('V', mce, Ity_I8, unop(Iop_Left8, a1)); in mkLeft8()
608 static IRAtom* mkLeft16 ( MCEnv* mce, IRAtom* a1 ) { in mkLeft16() argument
609 tl_assert(isShadowAtom(mce,a1)); in mkLeft16()
610 return assignNew('V', mce, Ity_I16, unop(Iop_Left16, a1)); in mkLeft16()
613 static IRAtom* mkLeft32 ( MCEnv* mce, IRAtom* a1 ) { in mkLeft32() argument
614 tl_assert(isShadowAtom(mce,a1)); in mkLeft32()
615 return assignNew('V', mce, Ity_I32, unop(Iop_Left32, a1)); in mkLeft32()
618 static IRAtom* mkLeft64 ( MCEnv* mce, IRAtom* a1 ) { in mkLeft64() argument
619 tl_assert(isShadowAtom(mce,a1)); in mkLeft64()
620 return assignNew('V', mce, Ity_I64, unop(Iop_Left64, a1)); in mkLeft64()
628 static IRAtom* mkImproveAND8 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveAND8() argument
630 tl_assert(isOriginalAtom(mce, data)); in mkImproveAND8()
631 tl_assert(isShadowAtom(mce, vbits)); in mkImproveAND8()
633 return assignNew('V', mce, Ity_I8, binop(Iop_Or8, data, vbits)); in mkImproveAND8()
636 static IRAtom* mkImproveAND16 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveAND16() argument
638 tl_assert(isOriginalAtom(mce, data)); in mkImproveAND16()
639 tl_assert(isShadowAtom(mce, vbits)); in mkImproveAND16()
641 return assignNew('V', mce, Ity_I16, binop(Iop_Or16, data, vbits)); in mkImproveAND16()
644 static IRAtom* mkImproveAND32 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveAND32() argument
646 tl_assert(isOriginalAtom(mce, data)); in mkImproveAND32()
647 tl_assert(isShadowAtom(mce, vbits)); in mkImproveAND32()
649 return assignNew('V', mce, Ity_I32, binop(Iop_Or32, data, vbits)); in mkImproveAND32()
652 static IRAtom* mkImproveAND64 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveAND64() argument
654 tl_assert(isOriginalAtom(mce, data)); in mkImproveAND64()
655 tl_assert(isShadowAtom(mce, vbits)); in mkImproveAND64()
657 return assignNew('V', mce, Ity_I64, binop(Iop_Or64, data, vbits)); in mkImproveAND64()
660 static IRAtom* mkImproveANDV128 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveANDV128() argument
662 tl_assert(isOriginalAtom(mce, data)); in mkImproveANDV128()
663 tl_assert(isShadowAtom(mce, vbits)); in mkImproveANDV128()
665 return assignNew('V', mce, Ity_V128, binop(Iop_OrV128, data, vbits)); in mkImproveANDV128()
668 static IRAtom* mkImproveANDV256 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveANDV256() argument
670 tl_assert(isOriginalAtom(mce, data)); in mkImproveANDV256()
671 tl_assert(isShadowAtom(mce, vbits)); in mkImproveANDV256()
673 return assignNew('V', mce, Ity_V256, binop(Iop_OrV256, data, vbits)); in mkImproveANDV256()
679 static IRAtom* mkImproveOR8 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveOR8() argument
681 tl_assert(isOriginalAtom(mce, data)); in mkImproveOR8()
682 tl_assert(isShadowAtom(mce, vbits)); in mkImproveOR8()
685 'V', mce, Ity_I8, in mkImproveOR8()
687 assignNew('V', mce, Ity_I8, unop(Iop_Not8, data)), in mkImproveOR8()
691 static IRAtom* mkImproveOR16 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveOR16() argument
693 tl_assert(isOriginalAtom(mce, data)); in mkImproveOR16()
694 tl_assert(isShadowAtom(mce, vbits)); in mkImproveOR16()
697 'V', mce, Ity_I16, in mkImproveOR16()
699 assignNew('V', mce, Ity_I16, unop(Iop_Not16, data)), in mkImproveOR16()
703 static IRAtom* mkImproveOR32 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveOR32() argument
705 tl_assert(isOriginalAtom(mce, data)); in mkImproveOR32()
706 tl_assert(isShadowAtom(mce, vbits)); in mkImproveOR32()
709 'V', mce, Ity_I32, in mkImproveOR32()
711 assignNew('V', mce, Ity_I32, unop(Iop_Not32, data)), in mkImproveOR32()
715 static IRAtom* mkImproveOR64 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveOR64() argument
717 tl_assert(isOriginalAtom(mce, data)); in mkImproveOR64()
718 tl_assert(isShadowAtom(mce, vbits)); in mkImproveOR64()
721 'V', mce, Ity_I64, in mkImproveOR64()
723 assignNew('V', mce, Ity_I64, unop(Iop_Not64, data)), in mkImproveOR64()
727 static IRAtom* mkImproveORV128 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveORV128() argument
729 tl_assert(isOriginalAtom(mce, data)); in mkImproveORV128()
730 tl_assert(isShadowAtom(mce, vbits)); in mkImproveORV128()
733 'V', mce, Ity_V128, in mkImproveORV128()
735 assignNew('V', mce, Ity_V128, unop(Iop_NotV128, data)), in mkImproveORV128()
739 static IRAtom* mkImproveORV256 ( MCEnv* mce, IRAtom* data, IRAtom* vbits ) in mkImproveORV256() argument
741 tl_assert(isOriginalAtom(mce, data)); in mkImproveORV256()
742 tl_assert(isShadowAtom(mce, vbits)); in mkImproveORV256()
745 'V', mce, Ity_V256, in mkImproveORV256()
747 assignNew('V', mce, Ity_V256, unop(Iop_NotV256, data)), in mkImproveORV256()
757 static IRAtom* mkPCastTo( MCEnv* mce, IRType dst_ty, IRAtom* vbits ) in mkPCastTo() argument
763 tl_assert(isShadowAtom(mce,vbits)); in mkPCastTo()
764 src_ty = typeOfIRExpr(mce->sb->tyenv, vbits); in mkPCastTo()
768 return assignNew('V', mce, Ity_I32, unop(Iop_CmpwNEZ32, vbits)); in mkPCastTo()
771 return assignNew('V', mce, Ity_I64, unop(Iop_CmpwNEZ64, vbits)); in mkPCastTo()
775 IRAtom* tmp = assignNew('V', mce, Ity_I32, unop(Iop_CmpwNEZ32, vbits)); in mkPCastTo()
776 return assignNew('V', mce, Ity_I64, binop(Iop_32HLto64, tmp, tmp)); in mkPCastTo()
781 IRAtom* tmp = assignNew('V', mce, Ity_I32, unop(Iop_CmpwNEZ32, vbits)); in mkPCastTo()
782 tmp = assignNew('V', mce, Ity_I64, binop(Iop_32HLto64, tmp, tmp)); in mkPCastTo()
783 return assignNew('V', mce, Ity_V128, binop(Iop_64HLtoV128, tmp, tmp)); in mkPCastTo()
788 IRAtom* tmp = assignNew('V', mce, Ity_I32, unop(Iop_CmpwNEZ32, vbits)); in mkPCastTo()
789 tmp = assignNew('V', mce, Ity_I64, binop(Iop_32HLto64, tmp, tmp)); in mkPCastTo()
790 tmp = assignNew('V', mce, Ity_V128, binop(Iop_64HLtoV128, tmp, tmp)); in mkPCastTo()
791 return assignNew('V', mce, Ity_V256, binop(Iop_V128HLtoV256, tmp, tmp)); in mkPCastTo()
797 IRAtom* tmp = assignNew('V', mce, Ity_I64, unop(Iop_CmpwNEZ64, vbits)); in mkPCastTo()
798 return assignNew('V', mce, Ity_I32, unop(Iop_64to32, tmp)); in mkPCastTo()
808 = assignNew('V', mce, Ity_V128, in mkPCastTo()
814 = mkUifUV128(mce, hi64hi64, vbits); in mkPCastTo()
817 = assignNew('V', mce, Ity_I64, unop(Iop_V128to64, lohi64)); in mkPCastTo()
822 = assignNew('V', mce, Ity_I64, unop(Iop_CmpwNEZ64, lo64)); in mkPCastTo()
834 tmp1 = assignNew('V', mce, Ity_I1, unop(Iop_CmpNEZ8, vbits)); in mkPCastTo()
837 tmp1 = assignNew('V', mce, Ity_I1, unop(Iop_CmpNEZ16, vbits)); in mkPCastTo()
840 tmp1 = assignNew('V', mce, Ity_I1, unop(Iop_CmpNEZ32, vbits)); in mkPCastTo()
843 tmp1 = assignNew('V', mce, Ity_I1, unop(Iop_CmpNEZ64, vbits)); in mkPCastTo()
848 IRAtom* tmp2 = assignNew('V', mce, Ity_I64, unop(Iop_128HIto64, vbits)); in mkPCastTo()
849 IRAtom* tmp3 = assignNew('V', mce, Ity_I64, unop(Iop_128to64, vbits)); in mkPCastTo()
850 IRAtom* tmp4 = assignNew('V', mce, Ity_I64, binop(Iop_Or64, tmp2, tmp3)); in mkPCastTo()
851 tmp1 = assignNew('V', mce, Ity_I1, in mkPCastTo()
865 return assignNew('V', mce, Ity_I8, unop(Iop_1Sto8, tmp1)); in mkPCastTo()
867 return assignNew('V', mce, Ity_I16, unop(Iop_1Sto16, tmp1)); in mkPCastTo()
869 return assignNew('V', mce, Ity_I32, unop(Iop_1Sto32, tmp1)); in mkPCastTo()
871 return assignNew('V', mce, Ity_I64, unop(Iop_1Sto64, tmp1)); in mkPCastTo()
873 tmp1 = assignNew('V', mce, Ity_I64, unop(Iop_1Sto64, tmp1)); in mkPCastTo()
874 tmp1 = assignNew('V', mce, Ity_V128, binop(Iop_64HLtoV128, tmp1, tmp1)); in mkPCastTo()
877 tmp1 = assignNew('V', mce, Ity_I64, unop(Iop_1Sto64, tmp1)); in mkPCastTo()
878 tmp1 = assignNew('V', mce, Ity_I128, binop(Iop_64HLto128, tmp1, tmp1)); in mkPCastTo()
881 tmp1 = assignNew('V', mce, Ity_I64, unop(Iop_1Sto64, tmp1)); in mkPCastTo()
882 tmp1 = assignNew('V', mce, Ity_V128, binop(Iop_64HLtoV128, in mkPCastTo()
884 tmp1 = assignNew('V', mce, Ity_V256, binop(Iop_V128HLtoV256, in mkPCastTo()
897 static IRAtom* mkPCastXXtoXXlsb ( MCEnv* mce, IRAtom* varg, IRType ty ) in mkPCastXXtoXXlsb() argument
903 IRAtom* pcdTo64 = mkPCastTo(mce, Ity_I64, varg128); in mkPCastXXtoXXlsb()
907 = assignNew('V', mce, Ity_I64, binop(Iop_And64, pcdTo64, mkU64(1))); in mkPCastXXtoXXlsb()
913 = assignNew('V', mce, Ity_V128, binop(Iop_64HLtoV128, d64, d63pc)); in mkPCastXXtoXXlsb()
919 IRAtom* pcd = mkPCastTo(mce, Ity_I64, varg); in mkPCastXXtoXXlsb()
922 = assignNew('V', mce, Ity_I64, binop(Iop_And64, pcd, mkU64(1))); in mkPCastXXtoXXlsb()
972 static IRAtom* expensiveCmpEQorNE ( MCEnv* mce, in expensiveCmpEQorNE() argument
981 tl_assert(isShadowAtom(mce,vxx)); in expensiveCmpEQorNE()
982 tl_assert(isShadowAtom(mce,vyy)); in expensiveCmpEQorNE()
983 tl_assert(isOriginalAtom(mce,xx)); in expensiveCmpEQorNE()
984 tl_assert(isOriginalAtom(mce,yy)); in expensiveCmpEQorNE()
1021 = mkPCastTo(mce,ty, in expensiveCmpEQorNE()
1022 assignNew('V', mce, ty, binop(opUIFU, vxx, vyy))); in expensiveCmpEQorNE()
1026 'V', mce,ty, in expensiveCmpEQorNE()
1028 assignNew('V', mce,ty, binop(opOR, vxx, vyy)), in expensiveCmpEQorNE()
1030 'V', mce,ty, in expensiveCmpEQorNE()
1032 assignNew('V', mce,ty, binop(opXOR, xx, yy)))))); in expensiveCmpEQorNE()
1035 = mkPCastTo( mce,ty, in expensiveCmpEQorNE()
1036 assignNew('V', mce,Ity_I1, binop(opCMP, vec, top))); in expensiveCmpEQorNE()
1039 = assignNew( 'V', mce,ty, binop(opDIFD, naive, improvement_term) ); in expensiveCmpEQorNE()
1042 = mkPCastTo( mce, Ity_I1, improved ); in expensiveCmpEQorNE()
1093 static IRAtom* doCmpORD ( MCEnv* mce, in doCmpORD() argument
1112 tl_assert(isShadowAtom(mce,xxhash)); in doCmpORD()
1113 tl_assert(isShadowAtom(mce,yyhash)); in doCmpORD()
1114 tl_assert(isOriginalAtom(mce,xx)); in doCmpORD()
1115 tl_assert(isOriginalAtom(mce,yy)); in doCmpORD()
1135 'V', mce,ty, in doCmpORD()
1138 mkPCastTo(mce,ty, xxhash), in doCmpORD()
1142 'V', mce,ty, in doCmpORD()
1146 'V', mce,ty, in doCmpORD()
1157 mkPCastTo( mce,ty, in doCmpORD()
1158 mkUifU(mce,ty, xxhash,yyhash)), in doCmpORD()
1169 static IRAtom* schemeE ( MCEnv* mce, IRExpr* e ); /* fwds */
1177 static void setHelperAnns ( MCEnv* mce, IRDirty* di ) { in setHelperAnns() argument
1180 di->fxState[0].offset = mce->layout->offset_SP; in setHelperAnns()
1181 di->fxState[0].size = mce->layout->sizeof_SP; in setHelperAnns()
1185 di->fxState[1].offset = mce->layout->offset_IP; in setHelperAnns()
1186 di->fxState[1].size = mce->layout->sizeof_IP; in setHelperAnns()
1211 static void complainIfUndefined ( MCEnv* mce, IRAtom* atom, IRExpr *guard ) in complainIfUndefined() argument
1229 tl_assert(isOriginalAtom(mce, guard)); in complainIfUndefined()
1235 tl_assert(isOriginalAtom(mce, atom)); in complainIfUndefined()
1236 vatom = expr2vbits( mce, atom ); in complainIfUndefined()
1237 tl_assert(isShadowAtom(mce, vatom)); in complainIfUndefined()
1240 ty = typeOfIRExpr(mce->sb->tyenv, vatom); in complainIfUndefined()
1245 cond = mkPCastTo( mce, Ity_I1, vatom ); in complainIfUndefined()
1252 origin = schemeE( mce, atom ); in complainIfUndefined()
1253 if (mce->hWordTy == Ity_I64) { in complainIfUndefined()
1254 origin = assignNew( 'B', mce, Ity_I64, unop(Iop_32Uto64, origin) ); in complainIfUndefined()
1350 IRAtom *g1 = assignNew('V', mce, Ity_I32, unop(Iop_1Uto32, di->guard)); in complainIfUndefined()
1351 IRAtom *g2 = assignNew('V', mce, Ity_I32, unop(Iop_1Uto32, guard)); in complainIfUndefined()
1352 IRAtom *e = assignNew('V', mce, Ity_I32, binop(Iop_And32, g1, g2)); in complainIfUndefined()
1353 di->guard = assignNew('V', mce, Ity_I1, unop(Iop_32to1, e)); in complainIfUndefined()
1356 setHelperAnns( mce, di ); in complainIfUndefined()
1357 stmt( 'V', mce, IRStmt_Dirty(di)); in complainIfUndefined()
1370 newShadowTmpV(mce, atom->Iex.RdTmp.tmp); in complainIfUndefined()
1371 assign('V', mce, findShadowTmpV(mce, atom->Iex.RdTmp.tmp), in complainIfUndefined()
1377 IRTemp old_tmpV = findShadowTmpV(mce, atom->Iex.RdTmp.tmp); in complainIfUndefined()
1378 newShadowTmpV(mce, atom->Iex.RdTmp.tmp); in complainIfUndefined()
1380 = assignNew('V', mce, shadowTypeV(ty), in complainIfUndefined()
1383 assign('V', mce, findShadowTmpV(mce, atom->Iex.RdTmp.tmp), new_tmpV); in complainIfUndefined()
1398 static Bool isAlwaysDefd ( MCEnv* mce, Int offset, Int size ) in isAlwaysDefd() argument
1406 for (i = 0; i < mce->layout->n_alwaysDefd; i++) { in isAlwaysDefd()
1407 minoffD = mce->layout->alwaysDefd[i].offset; in isAlwaysDefd()
1408 maxoffD = minoffD + mce->layout->alwaysDefd[i].size - 1; in isAlwaysDefd()
1431 void do_shadow_PUT ( MCEnv* mce, Int offset, in do_shadow_PUT() argument
1444 tl_assert(isOriginalAtom(mce, atom)); in do_shadow_PUT()
1445 vatom = expr2vbits( mce, atom ); in do_shadow_PUT()
1448 tl_assert(isShadowAtom(mce, vatom)); in do_shadow_PUT()
1451 ty = typeOfIRExpr(mce->sb->tyenv, vatom); in do_shadow_PUT()
1454 if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) { in do_shadow_PUT()
1465 cond = assignNew('V', mce, Ity_I1, guard); in do_shadow_PUT()
1466 iffalse = assignNew('V', mce, ty, in do_shadow_PUT()
1467 IRExpr_Get(offset + mce->layout->total_sizeB, ty)); in do_shadow_PUT()
1468 vatom = assignNew('V', mce, ty, IRExpr_ITE(cond, vatom, iffalse)); in do_shadow_PUT()
1470 stmt( 'V', mce, IRStmt_Put( offset + mce->layout->total_sizeB, vatom )); in do_shadow_PUT()
1479 void do_shadow_PUTI ( MCEnv* mce, IRPutI *puti) in do_shadow_PUTI() argument
1495 tl_assert(isOriginalAtom(mce,atom)); in do_shadow_PUTI()
1496 vatom = expr2vbits( mce, atom ); in do_shadow_PUTI()
1502 tl_assert(isOriginalAtom(mce,ix)); in do_shadow_PUTI()
1503 complainIfUndefined(mce, ix, NULL); in do_shadow_PUTI()
1504 if (isAlwaysDefd(mce, descr->base, arrSize)) { in do_shadow_PUTI()
1512 = mkIRRegArray( descr->base + mce->layout->total_sizeB, in do_shadow_PUTI()
1514 stmt( 'V', mce, IRStmt_PutI( mkIRPutI(new_descr, ix, bias, vatom) )); in do_shadow_PUTI()
1523 IRExpr* shadow_GET ( MCEnv* mce, Int offset, IRType ty ) in shadow_GET() argument
1528 if (isAlwaysDefd(mce, offset, sizeofIRType(ty))) { in shadow_GET()
1535 return IRExpr_Get( offset + mce->layout->total_sizeB, tyS ); in shadow_GET()
1544 IRExpr* shadow_GETI ( MCEnv* mce, in shadow_GETI() argument
1551 tl_assert(isOriginalAtom(mce,ix)); in shadow_GETI()
1552 complainIfUndefined(mce, ix, NULL); in shadow_GETI()
1553 if (isAlwaysDefd(mce, descr->base, arrSize)) { in shadow_GETI()
1560 = mkIRRegArray( descr->base + mce->layout->total_sizeB, in shadow_GETI()
1576 IRAtom* mkLazy2 ( MCEnv* mce, IRType finalVty, IRAtom* va1, IRAtom* va2 ) in mkLazy2() argument
1579 IRType t1 = typeOfIRExpr(mce->sb->tyenv, va1); in mkLazy2()
1580 IRType t2 = typeOfIRExpr(mce->sb->tyenv, va2); in mkLazy2()
1581 tl_assert(isShadowAtom(mce,va1)); in mkLazy2()
1582 tl_assert(isShadowAtom(mce,va2)); in mkLazy2()
1591 at = mkUifU(mce, Ity_I64, va1, va2); in mkLazy2()
1592 at = mkPCastTo(mce, Ity_I64, at); in mkLazy2()
1599 at = mkUifU(mce, Ity_I64, va1, va2); in mkLazy2()
1600 at = mkPCastTo(mce, Ity_I32, at); in mkLazy2()
1615 at = mkPCastTo(mce, Ity_I32, va1); in mkLazy2()
1616 at = mkUifU(mce, Ity_I32, at, mkPCastTo(mce, Ity_I32, va2)); in mkLazy2()
1617 at = mkPCastTo(mce, finalVty, at); in mkLazy2()
1624 IRAtom* mkLazy3 ( MCEnv* mce, IRType finalVty, in mkLazy3() argument
1628 IRType t1 = typeOfIRExpr(mce->sb->tyenv, va1); in mkLazy3()
1629 IRType t2 = typeOfIRExpr(mce->sb->tyenv, va2); in mkLazy3()
1630 IRType t3 = typeOfIRExpr(mce->sb->tyenv, va3); in mkLazy3()
1631 tl_assert(isShadowAtom(mce,va1)); in mkLazy3()
1632 tl_assert(isShadowAtom(mce,va2)); in mkLazy3()
1633 tl_assert(isShadowAtom(mce,va3)); in mkLazy3()
1647 at = mkPCastTo(mce, Ity_I64, va1); in mkLazy3()
1649 at = mkUifU(mce, Ity_I64, at, va2); in mkLazy3()
1650 at = mkUifU(mce, Ity_I64, at, va3); in mkLazy3()
1652 at = mkPCastTo(mce, Ity_I64, at); in mkLazy3()
1664 IRAtom* at1 = mkPCastTo(mce, Ity_I64, va1); in mkLazy3()
1665 IRAtom* at2 = mkPCastTo(mce, Ity_I64, va2); in mkLazy3()
1666 at = mkUifU(mce, Ity_I64, at1, at2); // UifU(PCast(va1), PCast(va2)) in mkLazy3()
1667 at = mkUifU(mce, Ity_I64, at, va3); in mkLazy3()
1669 at = mkPCastTo(mce, Ity_I64, at); in mkLazy3()
1677 at = mkPCastTo(mce, Ity_I64, va1); in mkLazy3()
1678 at = mkUifU(mce, Ity_I64, at, va2); in mkLazy3()
1679 at = mkUifU(mce, Ity_I64, at, va3); in mkLazy3()
1680 at = mkPCastTo(mce, Ity_I32, at); in mkLazy3()
1690 at = mkUifU(mce, Ity_I32, at, va2); in mkLazy3()
1691 at = mkUifU(mce, Ity_I32, at, va3); in mkLazy3()
1692 at = mkPCastTo(mce, Ity_I32, at); in mkLazy3()
1704 at = mkPCastTo(mce, Ity_I128, va1); in mkLazy3()
1706 at = mkUifU(mce, Ity_I128, at, va2); in mkLazy3()
1707 at = mkUifU(mce, Ity_I128, at, va3); in mkLazy3()
1709 at = mkPCastTo(mce, Ity_I128, at); in mkLazy3()
1722 IRAtom* at1 = mkPCastTo(mce, Ity_I64, va1); in mkLazy3()
1723 IRAtom* at2 = mkPCastTo(mce, Ity_I64, va2); in mkLazy3()
1724 IRAtom* at3 = mkPCastTo(mce, Ity_I64, va3); in mkLazy3()
1726 at = mkUifU(mce, Ity_I64, at1, at2); // UifU(PCast(va1), PCast(va2)) in mkLazy3()
1727 at = mkUifU(mce, Ity_I64, at, at3); // ... `UifU` PCast(va3) in mkLazy3()
1729 at = mkPCastTo(mce, Ity_I128, at); in mkLazy3()
1758 IRAtom* mkLazy4 ( MCEnv* mce, IRType finalVty, in mkLazy4() argument
1762 IRType t1 = typeOfIRExpr(mce->sb->tyenv, va1); in mkLazy4()
1763 IRType t2 = typeOfIRExpr(mce->sb->tyenv, va2); in mkLazy4()
1764 IRType t3 = typeOfIRExpr(mce->sb->tyenv, va3); in mkLazy4()
1765 IRType t4 = typeOfIRExpr(mce->sb->tyenv, va4); in mkLazy4()
1766 tl_assert(isShadowAtom(mce,va1)); in mkLazy4()
1767 tl_assert(isShadowAtom(mce,va2)); in mkLazy4()
1768 tl_assert(isShadowAtom(mce,va3)); in mkLazy4()
1769 tl_assert(isShadowAtom(mce,va4)); in mkLazy4()
1783 at = mkPCastTo(mce, Ity_I64, va1); in mkLazy4()
1785 at = mkUifU(mce, Ity_I64, at, va2); in mkLazy4()
1786 at = mkUifU(mce, Ity_I64, at, va3); in mkLazy4()
1787 at = mkUifU(mce, Ity_I64, at, va4); in mkLazy4()
1789 at = mkPCastTo(mce, Ity_I64, at); in mkLazy4()
1799 at = mkUifU(mce, Ity_I32, at, va2); in mkLazy4()
1800 at = mkUifU(mce, Ity_I32, at, va3); in mkLazy4()
1801 at = mkUifU(mce, Ity_I32, at, va4); in mkLazy4()
1802 at = mkPCastTo(mce, Ity_I32, at); in mkLazy4()
1830 IRAtom* mkLazyN ( MCEnv* mce, in mkLazyN() argument
1844 tl_assert(isOriginalAtom(mce, exprvec[i])); in mkLazyN()
1847 if (typeOfIRExpr(mce->sb->tyenv, exprvec[i]) != Ity_I64) in mkLazyN()
1856 tl_assert(isOriginalAtom(mce, exprvec[i])); in mkLazyN()
1866 here = mkPCastTo( mce, mergeTy, expr2vbits(mce, exprvec[i]) ); in mkLazyN()
1868 ? mkUifU64(mce, here, curr) in mkLazyN()
1869 : mkUifU32(mce, here, curr); in mkLazyN()
1872 return mkPCastTo(mce, finalVtype, curr ); in mkLazyN()
1882 IRAtom* expensiveAddSub ( MCEnv* mce, in expensiveAddSub() argument
1891 tl_assert(isShadowAtom(mce,qaa)); in expensiveAddSub()
1892 tl_assert(isShadowAtom(mce,qbb)); in expensiveAddSub()
1893 tl_assert(isOriginalAtom(mce,aa)); in expensiveAddSub()
1894 tl_assert(isOriginalAtom(mce,bb)); in expensiveAddSub()
1920 a_min = assignNew('V', mce,ty, in expensiveAddSub()
1922 assignNew('V', mce,ty, unop(opNOT, qaa)))); in expensiveAddSub()
1925 b_min = assignNew('V', mce,ty, in expensiveAddSub()
1927 assignNew('V', mce,ty, unop(opNOT, qbb)))); in expensiveAddSub()
1930 a_max = assignNew('V', mce,ty, binop(opOR, aa, qaa)); in expensiveAddSub()
1933 b_max = assignNew('V', mce,ty, binop(opOR, bb, qbb)); in expensiveAddSub()
1938 assignNew('V', mce,ty, in expensiveAddSub()
1940 assignNew('V', mce,ty, binop(opOR, qaa, qbb)), in expensiveAddSub()
1941 assignNew('V', mce,ty, in expensiveAddSub()
1943 assignNew('V', mce,ty, binop(opADD, a_min, b_min)), in expensiveAddSub()
1944 assignNew('V', mce,ty, binop(opADD, a_max, b_max)) in expensiveAddSub()
1952 assignNew('V', mce,ty, in expensiveAddSub()
1954 assignNew('V', mce,ty, binop(opOR, qaa, qbb)), in expensiveAddSub()
1955 assignNew('V', mce,ty, in expensiveAddSub()
1957 assignNew('V', mce,ty, binop(opSUB, a_min, b_max)), in expensiveAddSub()
1958 assignNew('V', mce,ty, binop(opSUB, a_max, b_min)) in expensiveAddSub()
1969 IRAtom* expensiveCountTrailingZeroes ( MCEnv* mce, IROp czop, in expensiveCountTrailingZeroes() argument
1976 tl_assert(isShadowAtom(mce,vatom)); in expensiveCountTrailingZeroes()
1977 tl_assert(isOriginalAtom(mce,atom)); in expensiveCountTrailingZeroes()
2004 improver = assignNew('V', mce,ty, in expensiveCountTrailingZeroes()
2007 assignNew('V', mce, ty, in expensiveCountTrailingZeroes()
2014 improved = assignNew('V', mce, ty, in expensiveCountTrailingZeroes()
2018 return mkPCastTo(mce, ty, improved); in expensiveCountTrailingZeroes()
2045 static IRAtom* scalarShift ( MCEnv* mce, in scalarShift() argument
2051 tl_assert(isShadowAtom(mce,qaa)); in scalarShift()
2052 tl_assert(isShadowAtom(mce,qbb)); in scalarShift()
2053 tl_assert(isOriginalAtom(mce,aa)); in scalarShift()
2054 tl_assert(isOriginalAtom(mce,bb)); in scalarShift()
2059 'V', mce, ty, in scalarShift()
2060 mkUifU( mce, ty, in scalarShift()
2061 assignNew('V', mce, ty, binop(original_op, qaa, bb)), in scalarShift()
2062 mkPCastTo(mce, ty, qbb) in scalarShift()
2074 static IRAtom* mkPCast8x16 ( MCEnv* mce, IRAtom* at ) in mkPCast8x16() argument
2076 return assignNew('V', mce, Ity_V128, unop(Iop_CmpNEZ8x16, at)); in mkPCast8x16()
2079 static IRAtom* mkPCast16x8 ( MCEnv* mce, IRAtom* at ) in mkPCast16x8() argument
2081 return assignNew('V', mce, Ity_V128, unop(Iop_CmpNEZ16x8, at)); in mkPCast16x8()
2084 static IRAtom* mkPCast32x4 ( MCEnv* mce, IRAtom* at ) in mkPCast32x4() argument
2086 return assignNew('V', mce, Ity_V128, unop(Iop_CmpNEZ32x4, at)); in mkPCast32x4()
2089 static IRAtom* mkPCast64x2 ( MCEnv* mce, IRAtom* at ) in mkPCast64x2() argument
2091 return assignNew('V', mce, Ity_V128, unop(Iop_CmpNEZ64x2, at)); in mkPCast64x2()
2094 static IRAtom* mkPCast64x4 ( MCEnv* mce, IRAtom* at ) in mkPCast64x4() argument
2096 return assignNew('V', mce, Ity_V256, unop(Iop_CmpNEZ64x4, at)); in mkPCast64x4()
2099 static IRAtom* mkPCast32x8 ( MCEnv* mce, IRAtom* at ) in mkPCast32x8() argument
2101 return assignNew('V', mce, Ity_V256, unop(Iop_CmpNEZ32x8, at)); in mkPCast32x8()
2104 static IRAtom* mkPCast32x2 ( MCEnv* mce, IRAtom* at ) in mkPCast32x2() argument
2106 return assignNew('V', mce, Ity_I64, unop(Iop_CmpNEZ32x2, at)); in mkPCast32x2()
2109 static IRAtom* mkPCast16x16 ( MCEnv* mce, IRAtom* at ) in mkPCast16x16() argument
2111 return assignNew('V', mce, Ity_V256, unop(Iop_CmpNEZ16x16, at)); in mkPCast16x16()
2114 static IRAtom* mkPCast16x4 ( MCEnv* mce, IRAtom* at ) in mkPCast16x4() argument
2116 return assignNew('V', mce, Ity_I64, unop(Iop_CmpNEZ16x4, at)); in mkPCast16x4()
2119 static IRAtom* mkPCast8x32 ( MCEnv* mce, IRAtom* at ) in mkPCast8x32() argument
2121 return assignNew('V', mce, Ity_V256, unop(Iop_CmpNEZ8x32, at)); in mkPCast8x32()
2124 static IRAtom* mkPCast8x8 ( MCEnv* mce, IRAtom* at ) in mkPCast8x8() argument
2126 return assignNew('V', mce, Ity_I64, unop(Iop_CmpNEZ8x8, at)); in mkPCast8x8()
2129 static IRAtom* mkPCast16x2 ( MCEnv* mce, IRAtom* at ) in mkPCast16x2() argument
2131 return assignNew('V', mce, Ity_I32, unop(Iop_CmpNEZ16x2, at)); in mkPCast16x2()
2134 static IRAtom* mkPCast8x4 ( MCEnv* mce, IRAtom* at ) in mkPCast8x4() argument
2136 return assignNew('V', mce, Ity_I32, unop(Iop_CmpNEZ8x4, at)); in mkPCast8x4()
2177 IRAtom* binary32Fx4 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary32Fx4() argument
2180 tl_assert(isShadowAtom(mce, vatomX)); in binary32Fx4()
2181 tl_assert(isShadowAtom(mce, vatomY)); in binary32Fx4()
2182 at = mkUifUV128(mce, vatomX, vatomY); in binary32Fx4()
2183 at = assignNew('V', mce, Ity_V128, mkPCast32x4(mce, at)); in binary32Fx4()
2188 IRAtom* unary32Fx4 ( MCEnv* mce, IRAtom* vatomX ) in unary32Fx4() argument
2191 tl_assert(isShadowAtom(mce, vatomX)); in unary32Fx4()
2192 at = assignNew('V', mce, Ity_V128, mkPCast32x4(mce, vatomX)); in unary32Fx4()
2197 IRAtom* binary32F0x4 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary32F0x4() argument
2200 tl_assert(isShadowAtom(mce, vatomX)); in binary32F0x4()
2201 tl_assert(isShadowAtom(mce, vatomY)); in binary32F0x4()
2202 at = mkUifUV128(mce, vatomX, vatomY); in binary32F0x4()
2203 at = assignNew('V', mce, Ity_I32, unop(Iop_V128to32, at)); in binary32F0x4()
2204 at = mkPCastTo(mce, Ity_I32, at); in binary32F0x4()
2205 at = assignNew('V', mce, Ity_V128, binop(Iop_SetV128lo32, vatomX, at)); in binary32F0x4()
2210 IRAtom* unary32F0x4 ( MCEnv* mce, IRAtom* vatomX ) in unary32F0x4() argument
2213 tl_assert(isShadowAtom(mce, vatomX)); in unary32F0x4()
2214 at = assignNew('V', mce, Ity_I32, unop(Iop_V128to32, vatomX)); in unary32F0x4()
2215 at = mkPCastTo(mce, Ity_I32, at); in unary32F0x4()
2216 at = assignNew('V', mce, Ity_V128, binop(Iop_SetV128lo32, vatomX, at)); in unary32F0x4()
2223 IRAtom* binary64Fx2 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary64Fx2() argument
2226 tl_assert(isShadowAtom(mce, vatomX)); in binary64Fx2()
2227 tl_assert(isShadowAtom(mce, vatomY)); in binary64Fx2()
2228 at = mkUifUV128(mce, vatomX, vatomY); in binary64Fx2()
2229 at = assignNew('V', mce, Ity_V128, mkPCast64x2(mce, at)); in binary64Fx2()
2234 IRAtom* unary64Fx2 ( MCEnv* mce, IRAtom* vatomX ) in unary64Fx2() argument
2237 tl_assert(isShadowAtom(mce, vatomX)); in unary64Fx2()
2238 at = assignNew('V', mce, Ity_V128, mkPCast64x2(mce, vatomX)); in unary64Fx2()
2243 IRAtom* binary64F0x2 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary64F0x2() argument
2246 tl_assert(isShadowAtom(mce, vatomX)); in binary64F0x2()
2247 tl_assert(isShadowAtom(mce, vatomY)); in binary64F0x2()
2248 at = mkUifUV128(mce, vatomX, vatomY); in binary64F0x2()
2249 at = assignNew('V', mce, Ity_I64, unop(Iop_V128to64, at)); in binary64F0x2()
2250 at = mkPCastTo(mce, Ity_I64, at); in binary64F0x2()
2251 at = assignNew('V', mce, Ity_V128, binop(Iop_SetV128lo64, vatomX, at)); in binary64F0x2()
2256 IRAtom* unary64F0x2 ( MCEnv* mce, IRAtom* vatomX ) in unary64F0x2() argument
2259 tl_assert(isShadowAtom(mce, vatomX)); in unary64F0x2()
2260 at = assignNew('V', mce, Ity_I64, unop(Iop_V128to64, vatomX)); in unary64F0x2()
2261 at = mkPCastTo(mce, Ity_I64, at); in unary64F0x2()
2262 at = assignNew('V', mce, Ity_V128, binop(Iop_SetV128lo64, vatomX, at)); in unary64F0x2()
2269 IRAtom* binary32Fx2 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary32Fx2() argument
2272 tl_assert(isShadowAtom(mce, vatomX)); in binary32Fx2()
2273 tl_assert(isShadowAtom(mce, vatomY)); in binary32Fx2()
2274 at = mkUifU64(mce, vatomX, vatomY); in binary32Fx2()
2275 at = assignNew('V', mce, Ity_I64, mkPCast32x2(mce, at)); in binary32Fx2()
2280 IRAtom* unary32Fx2 ( MCEnv* mce, IRAtom* vatomX ) in unary32Fx2() argument
2283 tl_assert(isShadowAtom(mce, vatomX)); in unary32Fx2()
2284 at = assignNew('V', mce, Ity_I64, mkPCast32x2(mce, vatomX)); in unary32Fx2()
2291 IRAtom* binary64Fx4 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary64Fx4() argument
2294 tl_assert(isShadowAtom(mce, vatomX)); in binary64Fx4()
2295 tl_assert(isShadowAtom(mce, vatomY)); in binary64Fx4()
2296 at = mkUifUV256(mce, vatomX, vatomY); in binary64Fx4()
2297 at = assignNew('V', mce, Ity_V256, mkPCast64x4(mce, at)); in binary64Fx4()
2302 IRAtom* unary64Fx4 ( MCEnv* mce, IRAtom* vatomX ) in unary64Fx4() argument
2305 tl_assert(isShadowAtom(mce, vatomX)); in unary64Fx4()
2306 at = assignNew('V', mce, Ity_V256, mkPCast64x4(mce, vatomX)); in unary64Fx4()
2313 IRAtom* binary32Fx8 ( MCEnv* mce, IRAtom* vatomX, IRAtom* vatomY ) in binary32Fx8() argument
2316 tl_assert(isShadowAtom(mce, vatomX)); in binary32Fx8()
2317 tl_assert(isShadowAtom(mce, vatomY)); in binary32Fx8()
2318 at = mkUifUV256(mce, vatomX, vatomY); in binary32Fx8()
2319 at = assignNew('V', mce, Ity_V256, mkPCast32x8(mce, at)); in binary32Fx8()
2324 IRAtom* unary32Fx8 ( MCEnv* mce, IRAtom* vatomX ) in unary32Fx8() argument
2327 tl_assert(isShadowAtom(mce, vatomX)); in unary32Fx8()
2328 at = assignNew('V', mce, Ity_V256, mkPCast32x8(mce, vatomX)); in unary32Fx8()
2335 IRAtom* binary64Fx2_w_rm ( MCEnv* mce, IRAtom* vRM, in binary64Fx2_w_rm() argument
2344 IRAtom* t1 = binary64Fx2(mce, vatomX, vatomY); in binary64Fx2_w_rm()
2346 IRAtom* t2 = mkPCastTo(mce, Ity_V128, vRM); in binary64Fx2_w_rm()
2348 t1 = mkUifUV128(mce, t1, t2); in binary64Fx2_w_rm()
2355 IRAtom* binary32Fx4_w_rm ( MCEnv* mce, IRAtom* vRM, in binary32Fx4_w_rm() argument
2358 IRAtom* t1 = binary32Fx4(mce, vatomX, vatomY); in binary32Fx4_w_rm()
2360 IRAtom* t2 = mkPCastTo(mce, Ity_V128, vRM); in binary32Fx4_w_rm()
2362 t1 = mkUifUV128(mce, t1, t2); in binary32Fx4_w_rm()
2369 IRAtom* binary64Fx4_w_rm ( MCEnv* mce, IRAtom* vRM, in binary64Fx4_w_rm() argument
2372 IRAtom* t1 = binary64Fx4(mce, vatomX, vatomY); in binary64Fx4_w_rm()
2374 IRAtom* t2 = mkPCastTo(mce, Ity_V256, vRM); in binary64Fx4_w_rm()
2376 t1 = mkUifUV256(mce, t1, t2); in binary64Fx4_w_rm()
2383 IRAtom* binary32Fx8_w_rm ( MCEnv* mce, IRAtom* vRM, in binary32Fx8_w_rm() argument
2386 IRAtom* t1 = binary32Fx8(mce, vatomX, vatomY); in binary32Fx8_w_rm()
2388 IRAtom* t2 = mkPCastTo(mce, Ity_V256, vRM); in binary32Fx8_w_rm()
2390 t1 = mkUifUV256(mce, t1, t2); in binary32Fx8_w_rm()
2397 IRAtom* unary64Fx2_w_rm ( MCEnv* mce, IRAtom* vRM, IRAtom* vatomX ) in unary64Fx2_w_rm() argument
2401 IRAtom* t1 = unary64Fx2(mce, vatomX); in unary64Fx2_w_rm()
2403 IRAtom* t2 = mkPCastTo(mce, Ity_V128, vRM); in unary64Fx2_w_rm()
2405 t1 = mkUifUV128(mce, t1, t2); in unary64Fx2_w_rm()
2412 IRAtom* unary32Fx4_w_rm ( MCEnv* mce, IRAtom* vRM, IRAtom* vatomX ) in unary32Fx4_w_rm() argument
2415 IRAtom* t1 = unary32Fx4(mce, vatomX); in unary32Fx4_w_rm()
2417 IRAtom* t2 = mkPCastTo(mce, Ity_V128, vRM); in unary32Fx4_w_rm()
2419 t1 = mkUifUV128(mce, t1, t2); in unary32Fx4_w_rm()
2514 IRAtom* vectorNarrowBinV128 ( MCEnv* mce, IROp narrow_op, in vectorNarrowBinV128() argument
2531 tl_assert(isShadowAtom(mce,vatom1)); in vectorNarrowBinV128()
2532 tl_assert(isShadowAtom(mce,vatom2)); in vectorNarrowBinV128()
2533 at1 = assignNew('V', mce, Ity_V128, pcast(mce, vatom1)); in vectorNarrowBinV128()
2534 at2 = assignNew('V', mce, Ity_V128, pcast(mce, vatom2)); in vectorNarrowBinV128()
2535 at3 = assignNew('V', mce, Ity_V128, binop(vanilla_narrow, at1, at2)); in vectorNarrowBinV128()
2540 IRAtom* vectorNarrowBin64 ( MCEnv* mce, IROp narrow_op, in vectorNarrowBin64() argument
2552 tl_assert(isShadowAtom(mce,vatom1)); in vectorNarrowBin64()
2553 tl_assert(isShadowAtom(mce,vatom2)); in vectorNarrowBin64()
2554 at1 = assignNew('V', mce, Ity_I64, pcast(mce, vatom1)); in vectorNarrowBin64()
2555 at2 = assignNew('V', mce, Ity_I64, pcast(mce, vatom2)); in vectorNarrowBin64()
2556 at3 = assignNew('V', mce, Ity_I64, binop(vanilla_narrow, at1, at2)); in vectorNarrowBin64()
2561 IRAtom* vectorNarrowUnV128 ( MCEnv* mce, IROp narrow_op, in vectorNarrowUnV128() argument
2566 tl_assert(isShadowAtom(mce,vatom1)); in vectorNarrowUnV128()
2573 at1 = assignNew('V', mce, Ity_I64, unop(narrow_op, vatom1)); in vectorNarrowUnV128()
2593 at1 = assignNew('V', mce, Ity_V128, pcast(mce, vatom1)); in vectorNarrowUnV128()
2594 at2 = assignNew('V', mce, Ity_I64, unop(vanilla_narrow, at1)); in vectorNarrowUnV128()
2599 IRAtom* vectorWidenI64 ( MCEnv* mce, IROp longen_op, in vectorWidenI64() argument
2613 tl_assert(isShadowAtom(mce,vatom1)); in vectorWidenI64()
2614 at1 = assignNew('V', mce, Ity_V128, unop(longen_op, vatom1)); in vectorWidenI64()
2615 at2 = assignNew('V', mce, Ity_V128, pcast(mce, at1)); in vectorWidenI64()
2627 IRAtom* binary8Ix32 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary8Ix32() argument
2630 at = mkUifUV256(mce, vatom1, vatom2); in binary8Ix32()
2631 at = mkPCast8x32(mce, at); in binary8Ix32()
2636 IRAtom* binary16Ix16 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary16Ix16() argument
2639 at = mkUifUV256(mce, vatom1, vatom2); in binary16Ix16()
2640 at = mkPCast16x16(mce, at); in binary16Ix16()
2645 IRAtom* binary32Ix8 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary32Ix8() argument
2648 at = mkUifUV256(mce, vatom1, vatom2); in binary32Ix8()
2649 at = mkPCast32x8(mce, at); in binary32Ix8()
2654 IRAtom* binary64Ix4 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary64Ix4() argument
2657 at = mkUifUV256(mce, vatom1, vatom2); in binary64Ix4()
2658 at = mkPCast64x4(mce, at); in binary64Ix4()
2665 IRAtom* binary8Ix16 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary8Ix16() argument
2668 at = mkUifUV128(mce, vatom1, vatom2); in binary8Ix16()
2669 at = mkPCast8x16(mce, at); in binary8Ix16()
2674 IRAtom* binary16Ix8 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary16Ix8() argument
2677 at = mkUifUV128(mce, vatom1, vatom2); in binary16Ix8()
2678 at = mkPCast16x8(mce, at); in binary16Ix8()
2683 IRAtom* binary32Ix4 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary32Ix4() argument
2686 at = mkUifUV128(mce, vatom1, vatom2); in binary32Ix4()
2687 at = mkPCast32x4(mce, at); in binary32Ix4()
2692 IRAtom* binary64Ix2 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary64Ix2() argument
2695 at = mkUifUV128(mce, vatom1, vatom2); in binary64Ix2()
2696 at = mkPCast64x2(mce, at); in binary64Ix2()
2703 IRAtom* binary8Ix8 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary8Ix8() argument
2706 at = mkUifU64(mce, vatom1, vatom2); in binary8Ix8()
2707 at = mkPCast8x8(mce, at); in binary8Ix8()
2712 IRAtom* binary16Ix4 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary16Ix4() argument
2715 at = mkUifU64(mce, vatom1, vatom2); in binary16Ix4()
2716 at = mkPCast16x4(mce, at); in binary16Ix4()
2721 IRAtom* binary32Ix2 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary32Ix2() argument
2724 at = mkUifU64(mce, vatom1, vatom2); in binary32Ix2()
2725 at = mkPCast32x2(mce, at); in binary32Ix2()
2730 IRAtom* binary64Ix1 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary64Ix1() argument
2733 at = mkUifU64(mce, vatom1, vatom2); in binary64Ix1()
2734 at = mkPCastTo(mce, Ity_I64, at); in binary64Ix1()
2741 IRAtom* binary8Ix4 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary8Ix4() argument
2744 at = mkUifU32(mce, vatom1, vatom2); in binary8Ix4()
2745 at = mkPCast8x4(mce, at); in binary8Ix4()
2750 IRAtom* binary16Ix2 ( MCEnv* mce, IRAtom* vatom1, IRAtom* vatom2 ) in binary16Ix2() argument
2753 at = mkUifU32(mce, vatom1, vatom2); in binary16Ix2()
2754 at = mkPCast16x2(mce, at); in binary16Ix2()
2764 IRAtom* expr2vbits_Qop ( MCEnv* mce, in expr2vbits_Qop() argument
2769 IRAtom* vatom1 = expr2vbits( mce, atom1 ); in expr2vbits_Qop()
2770 IRAtom* vatom2 = expr2vbits( mce, atom2 ); in expr2vbits_Qop()
2771 IRAtom* vatom3 = expr2vbits( mce, atom3 ); in expr2vbits_Qop()
2772 IRAtom* vatom4 = expr2vbits( mce, atom4 ); in expr2vbits_Qop()
2774 tl_assert(isOriginalAtom(mce,atom1)); in expr2vbits_Qop()
2775 tl_assert(isOriginalAtom(mce,atom2)); in expr2vbits_Qop()
2776 tl_assert(isOriginalAtom(mce,atom3)); in expr2vbits_Qop()
2777 tl_assert(isOriginalAtom(mce,atom4)); in expr2vbits_Qop()
2778 tl_assert(isShadowAtom(mce,vatom1)); in expr2vbits_Qop()
2779 tl_assert(isShadowAtom(mce,vatom2)); in expr2vbits_Qop()
2780 tl_assert(isShadowAtom(mce,vatom3)); in expr2vbits_Qop()
2781 tl_assert(isShadowAtom(mce,vatom4)); in expr2vbits_Qop()
2792 return mkLazy4(mce, Ity_I64, vatom1, vatom2, vatom3, vatom4); in expr2vbits_Qop()
2797 return mkLazy4(mce, Ity_I32, vatom1, vatom2, vatom3, vatom4); in expr2vbits_Qop()
2801 return assignNew('V', mce, Ity_V256, in expr2vbits_Qop()
2812 IRAtom* expr2vbits_Triop ( MCEnv* mce, in expr2vbits_Triop() argument
2816 IRAtom* vatom1 = expr2vbits( mce, atom1 ); in expr2vbits_Triop()
2817 IRAtom* vatom2 = expr2vbits( mce, atom2 ); in expr2vbits_Triop()
2818 IRAtom* vatom3 = expr2vbits( mce, atom3 ); in expr2vbits_Triop()
2820 tl_assert(isOriginalAtom(mce,atom1)); in expr2vbits_Triop()
2821 tl_assert(isOriginalAtom(mce,atom2)); in expr2vbits_Triop()
2822 tl_assert(isOriginalAtom(mce,atom3)); in expr2vbits_Triop()
2823 tl_assert(isShadowAtom(mce,vatom1)); in expr2vbits_Triop()
2824 tl_assert(isShadowAtom(mce,vatom2)); in expr2vbits_Triop()
2825 tl_assert(isShadowAtom(mce,vatom3)); in expr2vbits_Triop()
2840 return mkLazy3(mce, Ity_I128, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2861 return mkLazy3(mce, Ity_I64, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2865 return mkLazy3(mce, Ity_I32, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2871 return mkLazy3(mce, Ity_I32, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2874 return mkLazy3(mce, Ity_I64, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2877 return mkLazy3(mce, Ity_I128, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2880 complainIfUndefined(mce, atom3, NULL); in expr2vbits_Triop()
2881 return assignNew('V', mce, Ity_V128, triop(op, vatom1, vatom2, atom3)); in expr2vbits_Triop()
2884 complainIfUndefined(mce, atom3, NULL); in expr2vbits_Triop()
2885 return assignNew('V', mce, Ity_I64, triop(op, vatom1, vatom2, atom3)); in expr2vbits_Triop()
2889 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Triop()
2890 return assignNew('V', mce, Ity_I64, triop(op, vatom1, atom2, vatom3)); in expr2vbits_Triop()
2894 complainIfUndefined(mce, atom3, NULL); in expr2vbits_Triop()
2895 return assignNew('V', mce, Ity_V128, triop(op, vatom1, vatom2, atom3)); in expr2vbits_Triop()
2902 return binary64Fx2_w_rm(mce, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2908 return binary32Fx4_w_rm(mce, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2914 return binary64Fx4_w_rm(mce, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2920 return binary32Fx8_w_rm(mce, vatom1, vatom2, vatom3); in expr2vbits_Triop()
2930 IRAtom* expr2vbits_Binop ( MCEnv* mce, in expr2vbits_Binop() argument
2939 IRAtom* vatom1 = expr2vbits( mce, atom1 ); in expr2vbits_Binop()
2940 IRAtom* vatom2 = expr2vbits( mce, atom2 ); in expr2vbits_Binop()
2942 tl_assert(isOriginalAtom(mce,atom1)); in expr2vbits_Binop()
2943 tl_assert(isOriginalAtom(mce,atom2)); in expr2vbits_Binop()
2944 tl_assert(isShadowAtom(mce,vatom1)); in expr2vbits_Binop()
2945 tl_assert(isShadowAtom(mce,vatom2)); in expr2vbits_Binop()
2962 return binary16Ix2(mce, vatom1, vatom2); in expr2vbits_Binop()
2974 return binary8Ix4(mce, vatom1, vatom2); in expr2vbits_Binop()
2988 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
2989 return assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2)); in expr2vbits_Binop()
2994 return vectorNarrowBin64(mce, op, vatom1, vatom2); in expr2vbits_Binop()
3014 return binary8Ix8(mce, vatom1, vatom2); in expr2vbits_Binop()
3037 return binary16Ix4(mce, vatom1, vatom2); in expr2vbits_Binop()
3057 return binary32Ix2(mce, vatom1, vatom2); in expr2vbits_Binop()
3066 return binary64Ix1(mce, vatom1, vatom2); in expr2vbits_Binop()
3071 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3072 return mkPCast8x8(mce, vatom1); in expr2vbits_Binop()
3077 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3078 return mkPCast16x4(mce, vatom1); in expr2vbits_Binop()
3083 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3084 return mkPCast32x2(mce, vatom1); in expr2vbits_Binop()
3089 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3090 return mkPCast32x2(mce, vatom1); in expr2vbits_Binop()
3098 return assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3100 mkPCast32x2(mce, vatom1), in expr2vbits_Binop()
3101 mkPCast32x2(mce, vatom2))); in expr2vbits_Binop()
3107 return assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3109 mkPCast16x4(mce, vatom1), in expr2vbits_Binop()
3110 mkPCast16x4(mce, vatom2))); in expr2vbits_Binop()
3116 return assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3118 mkPCast8x8(mce, vatom1), in expr2vbits_Binop()
3119 mkPCast8x8(mce, vatom2))); in expr2vbits_Binop()
3123 return mkPCast32x2(mce, in expr2vbits_Binop()
3124 assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3126 mkPCast32x2(mce, vatom1), in expr2vbits_Binop()
3127 mkPCast32x2(mce, vatom2)))); in expr2vbits_Binop()
3130 return mkPCast16x4(mce, in expr2vbits_Binop()
3131 assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3132 binop(op, mkPCast16x4(mce, vatom1), in expr2vbits_Binop()
3133 mkPCast16x4(mce, vatom2)))); in expr2vbits_Binop()
3136 return mkPCast8x8(mce, in expr2vbits_Binop()
3137 assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3138 binop(op, mkPCast8x8(mce, vatom1), in expr2vbits_Binop()
3139 mkPCast8x8(mce, vatom2)))); in expr2vbits_Binop()
3145 return mkUifU64(mce, in expr2vbits_Binop()
3146 assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3147 mkPCast8x8(mce,vatom2) in expr2vbits_Binop()
3154 return mkUifU64(mce, in expr2vbits_Binop()
3155 assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3156 mkPCast16x4(mce,vatom2) in expr2vbits_Binop()
3163 return mkUifU64(mce, in expr2vbits_Binop()
3164 assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3165 mkPCast32x2(mce,vatom2) in expr2vbits_Binop()
3183 return assignNew('V', mce, Ity_I64, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3186 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3187 return assignNew('V', mce, Ity_I8, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3189 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3190 return assignNew('V', mce, Ity_I16, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3192 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3193 return assignNew('V', mce, Ity_I32, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3200 mce, in expr2vbits_Binop()
3201 assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3202 mkPCast8x8(mce, vatom2) in expr2vbits_Binop()
3208 return unary32Fx4_w_rm(mce, vatom1, vatom2); in expr2vbits_Binop()
3210 return unary64Fx2_w_rm(mce, vatom1, vatom2); in expr2vbits_Binop()
3227 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3228 return assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3245 return mkUifUV128(mce, in expr2vbits_Binop()
3246 assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3247 mkPCast8x16(mce,vatom2) in expr2vbits_Binop()
3257 return mkUifUV128(mce, in expr2vbits_Binop()
3258 assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3259 mkPCast16x8(mce,vatom2) in expr2vbits_Binop()
3269 return mkUifUV128(mce, in expr2vbits_Binop()
3270 assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3271 mkPCast32x4(mce,vatom2) in expr2vbits_Binop()
3281 return mkUifUV128(mce, in expr2vbits_Binop()
3282 assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3283 mkPCast64x2(mce,vatom2) in expr2vbits_Binop()
3293 return binary8Ix16(mce, vatom1, vatom2); in expr2vbits_Binop()
3296 return binary16Ix8(mce, vatom1, vatom2); in expr2vbits_Binop()
3299 return binary32Ix4(mce, vatom1, vatom2); in expr2vbits_Binop()
3302 return binary64Ix2(mce, vatom1, vatom2); in expr2vbits_Binop()
3308 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3309 return mkPCast32x4(mce, vatom1); in expr2vbits_Binop()
3315 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3316 return mkPCast32x2(mce, vatom1); in expr2vbits_Binop()
3340 return binary8Ix16(mce, vatom1, vatom2); in expr2vbits_Binop()
3367 return binary16Ix8(mce, vatom1, vatom2); in expr2vbits_Binop()
3392 return binary32Ix4(mce, vatom1, vatom2); in expr2vbits_Binop()
3416 return binary64Ix2(mce, vatom1, vatom2); in expr2vbits_Binop()
3426 return vectorNarrowBinV128(mce, op, vatom1, vatom2); in expr2vbits_Binop()
3436 return binary64Fx2(mce, vatom1, vatom2); in expr2vbits_Binop()
3448 return binary64F0x2(mce, vatom1, vatom2); in expr2vbits_Binop()
3460 return binary32Fx4(mce, vatom1, vatom2); in expr2vbits_Binop()
3472 return binary32Fx2(mce, vatom1, vatom2); in expr2vbits_Binop()
3484 return binary32F0x4(mce, vatom1, vatom2); in expr2vbits_Binop()
3489 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3490 return mkPCast8x16(mce, vatom1); in expr2vbits_Binop()
3495 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3496 return mkPCast16x8(mce, vatom1); in expr2vbits_Binop()
3501 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3502 return mkPCast32x4(mce, vatom1); in expr2vbits_Binop()
3507 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3508 return mkPCast32x4(mce, vatom1); in expr2vbits_Binop()
3570 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3573 = fnPessim(mce, vatom1); in expr2vbits_Binop()
3576 = assignNew('V', mce, Ity_I64, unop(opNarrow, shV)); in expr2vbits_Binop()
3578 IRAtom* qV = mkPCastXXtoXXlsb(mce, shVnarrowed, Ity_I64); in expr2vbits_Binop()
3580 return assignNew('V', mce, Ity_V128, in expr2vbits_Binop()
3587 return vectorWidenI64(mce, Iop_Widen32Sto64x2, in expr2vbits_Binop()
3588 mkUifU64(mce, vatom1, vatom2)); in expr2vbits_Binop()
3593 return vectorWidenI64(mce, Iop_Widen16Sto32x4, in expr2vbits_Binop()
3594 mkUifU64(mce, vatom1, vatom2)); in expr2vbits_Binop()
3599 return vectorWidenI64(mce, Iop_Widen8Sto16x8, in expr2vbits_Binop()
3600 mkUifU64(mce, vatom1, vatom2)); in expr2vbits_Binop()
3603 return mkPCast32x4(mce, in expr2vbits_Binop()
3604 assignNew('V', mce, Ity_V128, binop(op, mkPCast32x4(mce, vatom1), in expr2vbits_Binop()
3605 mkPCast32x4(mce, vatom2)))); in expr2vbits_Binop()
3608 return mkPCast16x8(mce, in expr2vbits_Binop()
3609 assignNew('V', mce, Ity_V128, binop(op, mkPCast16x8(mce, vatom1), in expr2vbits_Binop()
3610 mkPCast16x8(mce, vatom2)))); in expr2vbits_Binop()
3613 return mkPCast8x16(mce, in expr2vbits_Binop()
3614 assignNew('V', mce, Ity_V128, binop(op, mkPCast8x16(mce, vatom1), in expr2vbits_Binop()
3615 mkPCast8x16(mce, vatom2)))); in expr2vbits_Binop()
3641 return assignNew('V', mce, Ity_V128, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3644 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3645 return assignNew('V', mce, Ity_I8, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3647 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3648 return assignNew('V', mce, Ity_I16, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3650 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3651 return assignNew('V', mce, Ity_I32, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3653 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3654 return assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3661 mce, in expr2vbits_Binop()
3662 assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3663 mkPCast8x16(mce, vatom2) in expr2vbits_Binop()
3667 mce, in expr2vbits_Binop()
3668 assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)), in expr2vbits_Binop()
3669 mkPCast32x4(mce, vatom2) in expr2vbits_Binop()
3682 at = binary16Ix8(mce,vatom1,vatom2); in expr2vbits_Binop()
3683 at = assignNew('V', mce, Ity_V128, binop(Iop_ShlN32x4, at, mkU8(16))); in expr2vbits_Binop()
3684 at = assignNew('V', mce, Ity_V128, binop(Iop_SarN32x4, at, mkU8(16))); in expr2vbits_Binop()
3692 at = binary8Ix16(mce,vatom1,vatom2); in expr2vbits_Binop()
3693 at = assignNew('V', mce, Ity_V128, binop(Iop_ShlN16x8, at, mkU8(8))); in expr2vbits_Binop()
3694 at = assignNew('V', mce, Ity_V128, binop(Iop_SarN16x8, at, mkU8(8))); in expr2vbits_Binop()
3702 at = binary32Ix4(mce,vatom1,vatom2); in expr2vbits_Binop()
3703 at = assignNew('V', mce, Ity_V128, binop(Iop_ShlN64x2, at, mkU8(32))); in expr2vbits_Binop()
3704 at = assignNew('V', mce, Ity_V128, binop(Iop_SarN64x2, at, mkU8(32))); in expr2vbits_Binop()
3715 return assignNew('V', mce, Ity_V128, in expr2vbits_Binop()
3723 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3724 return assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3729 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
3730 return assignNew('V', mce, Ity_V128, binop(op, vatom1, atom2)); in expr2vbits_Binop()
3734 return assignNew('V', mce, Ity_I128, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3740 return binary64Fx4(mce, vatom1, vatom2); in expr2vbits_Binop()
3744 return binary32Fx8(mce, vatom1, vatom2); in expr2vbits_Binop()
3748 return assignNew('V', mce, Ity_V256, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3755 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3759 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3774 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3780 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3786 return mkLazy2(mce, Ity_I128, vatom1, vatom2); in expr2vbits_Binop()
3790 return mkLazy2(mce, Ity_I128, vatom1, vatom2); in expr2vbits_Binop()
3797 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3806 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3815 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3824 return mkLazy2(mce, Ity_I128, vatom1, vatom2); in expr2vbits_Binop()
3830 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3834 return mkLazy2(mce, Ity_I128, vatom1, vatom2); in expr2vbits_Binop()
3841 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3846 return mkLazy2(mce, Ity_I16, vatom1, vatom2); in expr2vbits_Binop()
3853 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3861 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3865 return assignNew('V', mce, Ity_I128, in expr2vbits_Binop()
3875 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3879 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3883 return mkLazy2(mce, Ity_I16, vatom1, vatom2); in expr2vbits_Binop()
3887 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3891 return mkLazy2(mce, Ity_I128, vatom1, vatom2); in expr2vbits_Binop()
3900 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3906 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3910 return mkLazy2(mce, Ity_I128, vatom1, vatom2); in expr2vbits_Binop()
3913 return assignNew('V', mce, Ity_I16, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3915 return assignNew('V', mce, Ity_I32, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3917 return assignNew('V', mce, Ity_I64, binop(op, vatom1, vatom2)); in expr2vbits_Binop()
3922 IRAtom* vLo64 = mkLeft64(mce, mkUifU64(mce, vatom1,vatom2)); in expr2vbits_Binop()
3923 IRAtom* vHi64 = mkPCastTo(mce, Ity_I64, vLo64); in expr2vbits_Binop()
3924 return assignNew('V', mce, Ity_I128, in expr2vbits_Binop()
3930 IRAtom* vLo32 = mkLeft32(mce, mkUifU32(mce, vatom1,vatom2)); in expr2vbits_Binop()
3931 IRAtom* vHi32 = mkPCastTo(mce, Ity_I32, vLo32); in expr2vbits_Binop()
3932 return assignNew('V', mce, Ity_I64, in expr2vbits_Binop()
3938 IRAtom* vLo16 = mkLeft16(mce, mkUifU16(mce, vatom1,vatom2)); in expr2vbits_Binop()
3939 IRAtom* vHi16 = mkPCastTo(mce, Ity_I16, vLo16); in expr2vbits_Binop()
3940 return assignNew('V', mce, Ity_I32, in expr2vbits_Binop()
3946 IRAtom* vLo8 = mkLeft8(mce, mkUifU8(mce, vatom1,vatom2)); in expr2vbits_Binop()
3947 IRAtom* vHi8 = mkPCastTo(mce, Ity_I8, vLo8); in expr2vbits_Binop()
3948 return assignNew('V', mce, Ity_I16, binop(Iop_8HLto16, vHi8, vLo8)); in expr2vbits_Binop()
3958 return mkLazy2(mce, Ity_I32, vatom1, vatom2); in expr2vbits_Binop()
3964 return mkLazy2(mce, Ity_I64, vatom1, vatom2); in expr2vbits_Binop()
3967 if (mce->bogusLiterals || mce->useLLVMworkarounds) in expr2vbits_Binop()
3968 return expensiveAddSub(mce,True,Ity_I32, in expr2vbits_Binop()
3973 if (mce->bogusLiterals) in expr2vbits_Binop()
3974 return expensiveAddSub(mce,False,Ity_I32, in expr2vbits_Binop()
3981 return mkLeft32(mce, mkUifU32(mce, vatom1,vatom2)); in expr2vbits_Binop()
3987 return doCmpORD(mce, op, vatom1,vatom2, atom1,atom2); in expr2vbits_Binop()
3990 if (mce->bogusLiterals || mce->useLLVMworkarounds) in expr2vbits_Binop()
3991 return expensiveAddSub(mce,True,Ity_I64, in expr2vbits_Binop()
3996 if (mce->bogusLiterals) in expr2vbits_Binop()
3997 return expensiveAddSub(mce,False,Ity_I64, in expr2vbits_Binop()
4004 return mkLeft64(mce, mkUifU64(mce, vatom1,vatom2)); in expr2vbits_Binop()
4009 return mkLeft16(mce, mkUifU16(mce, vatom1,vatom2)); in expr2vbits_Binop()
4014 return mkLeft8(mce, mkUifU8(mce, vatom1,vatom2)); in expr2vbits_Binop()
4018 if (mce->bogusLiterals) in expr2vbits_Binop()
4025 return expensiveCmpEQorNE(mce,Ity_I64, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4030 return mkPCastTo(mce, Ity_I1, mkUifU64(mce, vatom1,vatom2)); in expr2vbits_Binop()
4034 if (mce->bogusLiterals) in expr2vbits_Binop()
4041 return expensiveCmpEQorNE(mce,Ity_I32, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4046 return mkPCastTo(mce, Ity_I1, mkUifU32(mce, vatom1,vatom2)); in expr2vbits_Binop()
4049 return mkPCastTo(mce, Ity_I1, mkUifU16(mce, vatom1,vatom2)); in expr2vbits_Binop()
4052 return expensiveCmpEQorNE(mce,Ity_I16, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4055 return mkPCastTo(mce, Ity_I1, mkUifU8(mce, vatom1,vatom2)); in expr2vbits_Binop()
4063 return assignNew('V', mce, Ity_I1, definedOfType(Ity_I1)); in expr2vbits_Binop()
4066 return scalarShift( mce, Ity_I64, op, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4069 return scalarShift( mce, Ity_I32, op, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4072 return scalarShift( mce, Ity_I16, op, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4075 return scalarShift( mce, Ity_I8, op, vatom1,vatom2, atom1,atom2 ); in expr2vbits_Binop()
4118 'V', mce, in expr2vbits_Binop()
4120 difd(mce, uifu(mce, vatom1, vatom2), in expr2vbits_Binop()
4121 difd(mce, improve(mce, atom1, vatom1), in expr2vbits_Binop()
4122 improve(mce, atom2, vatom2) ) ) ); in expr2vbits_Binop()
4125 return mkUifU8(mce, vatom1, vatom2); in expr2vbits_Binop()
4127 return mkUifU16(mce, vatom1, vatom2); in expr2vbits_Binop()
4129 return mkUifU32(mce, vatom1, vatom2); in expr2vbits_Binop()
4131 return mkUifU64(mce, vatom1, vatom2); in expr2vbits_Binop()
4133 return mkUifUV128(mce, vatom1, vatom2); in expr2vbits_Binop()
4135 return mkUifUV256(mce, vatom1, vatom2); in expr2vbits_Binop()
4150 complainIfUndefined(mce, atom2, NULL); in expr2vbits_Binop()
4151 return assignNew('V', mce, Ity_V256, binop(op, vatom1, atom2)); in expr2vbits_Binop()
4166 return binary8Ix32(mce, vatom1, vatom2); in expr2vbits_Binop()
4184 return binary16Ix16(mce, vatom1, vatom2); in expr2vbits_Binop()
4195 return binary32Ix8(mce, vatom1, vatom2); in expr2vbits_Binop()
4201 return binary64Ix4(mce, vatom1, vatom2); in expr2vbits_Binop()
4208 mce, in expr2vbits_Binop()
4209 assignNew('V', mce, Ity_V256, binop(op, vatom1, atom2)), in expr2vbits_Binop()
4210 mkPCast32x8(mce, vatom2) in expr2vbits_Binop()
4265 IRAtom* shV = binaryNIxM(mce, vatom1, vatom2); in expr2vbits_Binop()
4267 IRAtom* qV = mkPCastXXtoXXlsb(mce, shV, Ity_V128); in expr2vbits_Binop()
4269 return assignNew('V', mce, Ity_V256, in expr2vbits_Binop()
4281 IRExpr* expr2vbits_Unop ( MCEnv* mce, IROp op, IRAtom* atom ) in expr2vbits_Unop() argument
4288 IRAtom* vatom = expr2vbits( mce, atom ); in expr2vbits_Unop()
4289 tl_assert(isOriginalAtom(mce,atom)); in expr2vbits_Unop()
4296 return unary64Fx2(mce, vatom); in expr2vbits_Unop()
4299 return unary64F0x2(mce, vatom); in expr2vbits_Unop()
4304 return unary32Fx8(mce, vatom); in expr2vbits_Unop()
4307 return unary64Fx4(mce, vatom); in expr2vbits_Unop()
4322 return unary32Fx4(mce, vatom); in expr2vbits_Unop()
4331 return unary32Fx2(mce, vatom); in expr2vbits_Unop()
4336 return unary32F0x4(mce, vatom); in expr2vbits_Unop()
4355 return assignNew('V', mce, Ity_V128, unop(op, vatom)); in expr2vbits_Unop()
4359 return assignNew('V', mce, Ity_I64, unop(Iop_128HIto64, vatom)); in expr2vbits_Unop()
4362 return assignNew('V', mce, Ity_I64, unop(Iop_128to64, vatom)); in expr2vbits_Unop()
4366 return mkPCastTo(mce, Ity_I128, vatom); in expr2vbits_Unop()
4378 return mkPCastTo(mce, Ity_I128, vatom); in expr2vbits_Unop()
4401 return mkPCastTo(mce, Ity_I64, vatom); in expr2vbits_Unop()
4404 return mkPCastTo(mce, Ity_I128, vatom); in expr2vbits_Unop()
4411 return mkPCastTo(mce, Ity_I32, vatom); in expr2vbits_Unop()
4415 return expensiveCountTrailingZeroes(mce, op, atom, vatom); in expr2vbits_Unop()
4440 return assignNew('V', mce, Ity_I64, unop(op, vatom)); in expr2vbits_Unop()
4451 return assignNew('V', mce, Ity_I32, unop(op, vatom)); in expr2vbits_Unop()
4459 return assignNew('V', mce, Ity_I16, unop(op, vatom)); in expr2vbits_Unop()
4468 return assignNew('V', mce, Ity_I8, unop(op, vatom)); in expr2vbits_Unop()
4471 return assignNew('V', mce, Ity_I1, unop(Iop_32to1, vatom)); in expr2vbits_Unop()
4474 return assignNew('V', mce, Ity_I1, unop(Iop_64to1, vatom)); in expr2vbits_Unop()
4496 return mkPCast8x8(mce, vatom); in expr2vbits_Unop()
4503 return mkPCast8x16(mce, vatom); in expr2vbits_Unop()
4509 return mkPCast16x4(mce, vatom); in expr2vbits_Unop()
4515 return mkPCast16x8(mce, vatom); in expr2vbits_Unop()
4523 return mkPCast32x2(mce, vatom); in expr2vbits_Unop()
4532 return mkPCast32x4(mce, vatom); in expr2vbits_Unop()
4535 return mkPCastTo(mce, Ity_I32, vatom); in expr2vbits_Unop()
4538 return mkPCastTo(mce, Ity_I64, vatom); in expr2vbits_Unop()
4544 return mkPCast64x2(mce, vatom); in expr2vbits_Unop()
4547 return assignNew('V', mce, Ity_V128, unop(op, vatom)); in expr2vbits_Unop()
4561 return vectorNarrowUnV128(mce, op, vatom); in expr2vbits_Unop()
4569 return vectorWidenI64(mce, op, vatom); in expr2vbits_Unop()
4573 return mkPCastTo(mce, Ity_I64, in expr2vbits_Unop()
4574 assignNew('V', mce, Ity_I64, unop(op, mkPCast32x2(mce, vatom)))); in expr2vbits_Unop()
4578 return mkPCast32x2(mce, in expr2vbits_Unop()
4579 assignNew('V', mce, Ity_I64, unop(op, mkPCast16x4(mce, vatom)))); in expr2vbits_Unop()
4583 return mkPCast16x4(mce, in expr2vbits_Unop()
4584 assignNew('V', mce, Ity_I64, unop(op, mkPCast8x8(mce, vatom)))); in expr2vbits_Unop()
4588 return mkPCast64x2(mce, in expr2vbits_Unop()
4589 assignNew('V', mce, Ity_V128, unop(op, mkPCast32x4(mce, vatom)))); in expr2vbits_Unop()
4593 return mkPCast32x4(mce, in expr2vbits_Unop()
4594 assignNew('V', mce, Ity_V128, unop(op, mkPCast16x8(mce, vatom)))); in expr2vbits_Unop()
4598 return mkPCast16x8(mce, in expr2vbits_Unop()
4599 assignNew('V', mce, Ity_V128, unop(op, mkPCast8x16(mce, vatom)))); in expr2vbits_Unop()
4624 IRAtom* expr2vbits_Load_WRK ( MCEnv* mce, in expr2vbits_Load_WRK() argument
4628 tl_assert(isOriginalAtom(mce,addr)); in expr2vbits_Load_WRK()
4633 complainIfUndefined( mce, addr, guard ); in expr2vbits_Load_WRK()
4705 IRType tyAddr = mce->hWordTy; in expr2vbits_Load_WRK()
4709 addrAct = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBias) ); in expr2vbits_Load_WRK()
4714 IRTemp datavbits = newTemp(mce, ty, VSh); in expr2vbits_Load_WRK()
4730 setHelperAnns( mce, di ); in expr2vbits_Load_WRK()
4739 stmt( 'V', mce, IRStmt_Dirty(di) ); in expr2vbits_Load_WRK()
4758 IRAtom* expr2vbits_Load ( MCEnv* mce, in expr2vbits_Load() argument
4771 return expr2vbits_Load_WRK(mce, end, ty, addr, bias, guard); in expr2vbits_Load()
4791 IRAtom* expr2vbits_Load_guarded_General ( MCEnv* mce, in expr2vbits_Load_guarded_General() argument
4815 = assignNew('V', mce, ty, in expr2vbits_Load_guarded_General()
4816 expr2vbits_Load(mce, end, ty, addr, bias, guard)); in expr2vbits_Load_guarded_General()
4828 : assignNew('V', mce, tyWide, unop(vwiden, iftrue1)); in expr2vbits_Load_guarded_General()
4838 return assignNew('V', mce, tyWide, IRExpr_ITE(cond, iftrue2, iffalse)); in expr2vbits_Load_guarded_General()
4849 IRAtom* expr2vbits_Load_guarded_Simple ( MCEnv* mce, in expr2vbits_Load_guarded_Simple() argument
4855 mce, end, ty, addr, bias, guard, Iop_INVALID, definedOfType(ty) in expr2vbits_Load_guarded_Simple()
4861 IRAtom* expr2vbits_ITE ( MCEnv* mce, in expr2vbits_ITE() argument
4871 tl_assert(isOriginalAtom(mce, cond)); in expr2vbits_ITE()
4872 tl_assert(isOriginalAtom(mce, iftrue)); in expr2vbits_ITE()
4873 tl_assert(isOriginalAtom(mce, iffalse)); in expr2vbits_ITE()
4875 vbitsC = expr2vbits(mce, cond); in expr2vbits_ITE()
4876 vbits1 = expr2vbits(mce, iftrue); in expr2vbits_ITE()
4877 vbits0 = expr2vbits(mce, iffalse); in expr2vbits_ITE()
4878 ty = typeOfIRExpr(mce->sb->tyenv, vbits0); in expr2vbits_ITE()
4881 mkUifU(mce, ty, assignNew('V', mce, ty, in expr2vbits_ITE()
4883 mkPCastTo(mce, ty, vbitsC) ); in expr2vbits_ITE()
4889 IRExpr* expr2vbits ( MCEnv* mce, IRExpr* e ) in expr2vbits() argument
4894 return shadow_GET( mce, e->Iex.Get.offset, e->Iex.Get.ty ); in expr2vbits()
4897 return shadow_GETI( mce, e->Iex.GetI.descr, in expr2vbits()
4901 return IRExpr_RdTmp( findShadowTmpV(mce, e->Iex.RdTmp.tmp) ); in expr2vbits()
4904 return definedOfType(shadowTypeV(typeOfIRExpr(mce->sb->tyenv, e))); in expr2vbits()
4908 mce, in expr2vbits()
4916 mce, in expr2vbits()
4924 mce, in expr2vbits()
4930 return expr2vbits_Unop( mce, e->Iex.Unop.op, e->Iex.Unop.arg ); in expr2vbits()
4933 return expr2vbits_Load( mce, e->Iex.Load.end, in expr2vbits()
4939 return mkLazyN( mce, e->Iex.CCall.args, in expr2vbits()
4944 return expr2vbits_ITE( mce, e->Iex.ITE.cond, e->Iex.ITE.iftrue, in expr2vbits()
4962 IRExpr* zwidenToHostWord ( MCEnv* mce, IRAtom* vatom ) in zwidenToHostWord() argument
4967 tl_assert(isShadowAtom(mce,vatom)); in zwidenToHostWord()
4969 ty = typeOfIRExpr(mce->sb->tyenv, vatom); in zwidenToHostWord()
4970 tyH = mce->hWordTy; in zwidenToHostWord()
4977 return assignNew('V', mce, tyH, unop(Iop_16Uto32, vatom)); in zwidenToHostWord()
4979 return assignNew('V', mce, tyH, unop(Iop_8Uto32, vatom)); in zwidenToHostWord()
4987 return assignNew('V', mce, tyH, unop(Iop_32Uto64, vatom)); in zwidenToHostWord()
4989 return assignNew('V', mce, tyH, unop(Iop_32Uto64, in zwidenToHostWord()
4990 assignNew('V', mce, Ity_I32, unop(Iop_16Uto32, vatom)))); in zwidenToHostWord()
4992 return assignNew('V', mce, tyH, unop(Iop_32Uto64, in zwidenToHostWord()
4993 assignNew('V', mce, Ity_I32, unop(Iop_8Uto32, vatom)))); in zwidenToHostWord()
5018 void do_shadow_Store ( MCEnv* mce, in do_shadow_Store() argument
5030 tyAddr = mce->hWordTy; in do_shadow_Store()
5037 tl_assert(isOriginalAtom(mce, data)); in do_shadow_Store()
5039 vdata = expr2vbits( mce, data ); in do_shadow_Store()
5044 tl_assert(isOriginalAtom(mce,addr)); in do_shadow_Store()
5045 tl_assert(isShadowAtom(mce,vdata)); in do_shadow_Store()
5048 tl_assert(isOriginalAtom(mce, guard)); in do_shadow_Store()
5049 tl_assert(typeOfIRExpr(mce->sb->tyenv, guard) == Ity_I1); in do_shadow_Store()
5052 ty = typeOfIRExpr(mce->sb->tyenv, vdata); in do_shadow_Store()
5075 complainIfUndefined( mce, addr, guard ); in do_shadow_Store()
5138 addrQ0 = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBiasQ0) ); in do_shadow_Store()
5139 vdataQ0 = assignNew('V', mce, Ity_I64, unop(Iop_V256to64_0, vdata)); in do_shadow_Store()
5147 addrQ1 = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBiasQ1) ); in do_shadow_Store()
5148 vdataQ1 = assignNew('V', mce, Ity_I64, unop(Iop_V256to64_1, vdata)); in do_shadow_Store()
5156 addrQ2 = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBiasQ2) ); in do_shadow_Store()
5157 vdataQ2 = assignNew('V', mce, Ity_I64, unop(Iop_V256to64_2, vdata)); in do_shadow_Store()
5165 addrQ3 = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBiasQ3) ); in do_shadow_Store()
5166 vdataQ3 = assignNew('V', mce, Ity_I64, unop(Iop_V256to64_3, vdata)); in do_shadow_Store()
5176 setHelperAnns( mce, diQ0 ); in do_shadow_Store()
5177 setHelperAnns( mce, diQ1 ); in do_shadow_Store()
5178 setHelperAnns( mce, diQ2 ); in do_shadow_Store()
5179 setHelperAnns( mce, diQ3 ); in do_shadow_Store()
5180 stmt( 'V', mce, IRStmt_Dirty(diQ0) ); in do_shadow_Store()
5181 stmt( 'V', mce, IRStmt_Dirty(diQ1) ); in do_shadow_Store()
5182 stmt( 'V', mce, IRStmt_Dirty(diQ2) ); in do_shadow_Store()
5183 stmt( 'V', mce, IRStmt_Dirty(diQ3) ); in do_shadow_Store()
5207 addrLo64 = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBiasLo64) ); in do_shadow_Store()
5208 vdataLo64 = assignNew('V', mce, Ity_I64, unop(Iop_V128to64, vdata)); in do_shadow_Store()
5215 addrHi64 = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBiasHi64) ); in do_shadow_Store()
5216 vdataHi64 = assignNew('V', mce, Ity_I64, unop(Iop_V128HIto64, vdata)); in do_shadow_Store()
5224 setHelperAnns( mce, diLo64 ); in do_shadow_Store()
5225 setHelperAnns( mce, diHi64 ); in do_shadow_Store()
5226 stmt( 'V', mce, IRStmt_Dirty(diLo64) ); in do_shadow_Store()
5227 stmt( 'V', mce, IRStmt_Dirty(diHi64) ); in do_shadow_Store()
5240 addrAct = assignNew('V', mce, tyAddr, binop(mkAdd, addr, eBias)); in do_shadow_Store()
5257 zwidenToHostWord( mce, vdata )) in do_shadow_Store()
5261 setHelperAnns( mce, di ); in do_shadow_Store()
5262 stmt( 'V', mce, IRStmt_Dirty(di) ); in do_shadow_Store()
5284 void do_shadow_Dirty ( MCEnv* mce, IRDirty* d ) in do_shadow_Dirty() argument
5302 complainIfUndefined(mce, d->guard, NULL); in do_shadow_Dirty()
5315 here = mkPCastTo( mce, Ity_I32, expr2vbits(mce, arg) ); in do_shadow_Dirty()
5316 curr = mkUifU32(mce, here, curr); in do_shadow_Dirty()
5332 if (isAlwaysDefd(mce, gOff, gSz)) { in do_shadow_Dirty()
5354 cond = assignNew('V', mce, Ity_I1, d->guard); in do_shadow_Dirty()
5355 iftrue = assignNew('V', mce, tySrc, shadow_GET(mce, gOff, tySrc)); in do_shadow_Dirty()
5356 iffalse = assignNew('V', mce, tySrc, definedOfType(tySrc)); in do_shadow_Dirty()
5357 src = assignNew('V', mce, tySrc, in do_shadow_Dirty()
5360 here = mkPCastTo( mce, Ity_I32, src ); in do_shadow_Dirty()
5361 curr = mkUifU32(mce, here, curr); in do_shadow_Dirty()
5378 complainIfUndefined(mce, d->mAddr, d->guard); in do_shadow_Dirty()
5380 tyAddr = typeOfIRExpr(mce->sb->tyenv, d->mAddr); in do_shadow_Dirty()
5382 tl_assert(tyAddr == mce->hWordTy); /* not really right */ in do_shadow_Dirty()
5394 mce, Ity_I32, in do_shadow_Dirty()
5396 mce, end, Ity_I32, d->mAddr, d->mSize - toDo, d->guard ) in do_shadow_Dirty()
5398 curr = mkUifU32(mce, here, curr); in do_shadow_Dirty()
5404 mce, Ity_I32, in do_shadow_Dirty()
5406 mce, end, Ity_I16, d->mAddr, d->mSize - toDo, d->guard ) in do_shadow_Dirty()
5408 curr = mkUifU32(mce, here, curr); in do_shadow_Dirty()
5414 mce, Ity_I32, in do_shadow_Dirty()
5416 mce, end, Ity_I8, d->mAddr, d->mSize - toDo, d->guard ) in do_shadow_Dirty()
5418 curr = mkUifU32(mce, here, curr); in do_shadow_Dirty()
5430 dst = findShadowTmpV(mce, d->tmp); in do_shadow_Dirty()
5431 tyDst = typeOfIRTemp(mce->sb->tyenv, d->tmp); in do_shadow_Dirty()
5432 assign( 'V', mce, dst, mkPCastTo( mce, tyDst, curr) ); in do_shadow_Dirty()
5447 if (isAlwaysDefd(mce, gOff, gSz)) in do_shadow_Dirty()
5460 do_shadow_PUT( mce, gOff, in do_shadow_Dirty()
5462 mkPCastTo( mce, tyDst, curr ), d->guard ); in do_shadow_Dirty()
5475 do_shadow_Store( mce, end, d->mAddr, d->mSize - toDo, in do_shadow_Dirty()
5477 mkPCastTo( mce, Ity_I32, curr ), in do_shadow_Dirty()
5483 do_shadow_Store( mce, end, d->mAddr, d->mSize - toDo, in do_shadow_Dirty()
5485 mkPCastTo( mce, Ity_I16, curr ), in do_shadow_Dirty()
5491 do_shadow_Store( mce, end, d->mAddr, d->mSize - toDo, in do_shadow_Dirty()
5493 mkPCastTo( mce, Ity_I8, curr ), in do_shadow_Dirty()
5512 void do_AbiHint ( MCEnv* mce, IRExpr* base, Int len, IRExpr* nia ) in do_AbiHint() argument
5529 stmt( 'V', mce, IRStmt_Dirty(di) ); in do_AbiHint()
5536 static IRAtom* gen_load_b ( MCEnv* mce, Int szB,
5538 static IRAtom* gen_maxU32 ( MCEnv* mce, IRAtom* b1, IRAtom* b2 );
5539 static void gen_store_b ( MCEnv* mce, Int szB,
5543 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas );
5544 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas );
5571 MCEnv* mce, in bind_shadow_tmp_to_orig() argument
5574 tl_assert(isOriginalAtom(mce, orig)); in bind_shadow_tmp_to_orig()
5575 tl_assert(isShadowAtom(mce, shadow)); in bind_shadow_tmp_to_orig()
5583 assign('V', mce, findShadowTmpV(mce,orig->Iex.RdTmp.tmp), in bind_shadow_tmp_to_orig()
5587 assign('B', mce, findShadowTmpB(mce,orig->Iex.RdTmp.tmp), in bind_shadow_tmp_to_orig()
5598 void do_shadow_CAS ( MCEnv* mce, IRCAS* cas ) in do_shadow_CAS() argument
5724 do_shadow_CAS_single( mce, cas ); in do_shadow_CAS()
5726 do_shadow_CAS_double( mce, cas ); in do_shadow_CAS()
5731 static void do_shadow_CAS_single ( MCEnv* mce, IRCAS* cas ) in do_shadow_CAS_single() argument
5747 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo); in do_shadow_CAS_single()
5757 tl_assert(isOriginalAtom(mce, cas->dataLo)); in do_shadow_CAS_single()
5759 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo)); in do_shadow_CAS_single()
5760 tl_assert(isShadowAtom(mce, vdataLo)); in do_shadow_CAS_single()
5763 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo)); in do_shadow_CAS_single()
5764 tl_assert(isShadowAtom(mce, bdataLo)); in do_shadow_CAS_single()
5768 tl_assert(isOriginalAtom(mce, cas->expdLo)); in do_shadow_CAS_single()
5770 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo)); in do_shadow_CAS_single()
5771 tl_assert(isShadowAtom(mce, vexpdLo)); in do_shadow_CAS_single()
5774 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo)); in do_shadow_CAS_single()
5775 tl_assert(isShadowAtom(mce, bexpdLo)); in do_shadow_CAS_single()
5783 'V', mce, elemTy, in do_shadow_CAS_single()
5785 mce, in do_shadow_CAS_single()
5789 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo); in do_shadow_CAS_single()
5792 = assignNew('B', mce, Ity_I32, in do_shadow_CAS_single()
5793 gen_load_b(mce, elemSzB, cas->addr, 0/*addr bias*/)); in do_shadow_CAS_single()
5794 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo); in do_shadow_CAS_single()
5798 stmt( 'C', mce, IRStmt_CAS(cas) ); in do_shadow_CAS_single()
5805 = assignNew('C', mce, Ity_I1, in do_shadow_CAS_single()
5810 do_shadow_Store( mce, cas->end, cas->addr, 0/*bias*/, in do_shadow_CAS_single()
5814 gen_store_b( mce, elemSzB, cas->addr, 0/*offset*/, in do_shadow_CAS_single()
5821 static void do_shadow_CAS_double ( MCEnv* mce, IRCAS* cas ) in do_shadow_CAS_double() argument
5841 elemTy = typeOfIRExpr(mce->sb->tyenv, cas->expdLo); in do_shadow_CAS_double()
5864 tl_assert(isOriginalAtom(mce, cas->dataHi)); in do_shadow_CAS_double()
5865 tl_assert(isOriginalAtom(mce, cas->dataLo)); in do_shadow_CAS_double()
5867 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataHi)); in do_shadow_CAS_double()
5869 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->dataLo)); in do_shadow_CAS_double()
5870 tl_assert(isShadowAtom(mce, vdataHi)); in do_shadow_CAS_double()
5871 tl_assert(isShadowAtom(mce, vdataLo)); in do_shadow_CAS_double()
5874 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataHi)); in do_shadow_CAS_double()
5876 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->dataLo)); in do_shadow_CAS_double()
5877 tl_assert(isShadowAtom(mce, bdataHi)); in do_shadow_CAS_double()
5878 tl_assert(isShadowAtom(mce, bdataLo)); in do_shadow_CAS_double()
5882 tl_assert(isOriginalAtom(mce, cas->expdHi)); in do_shadow_CAS_double()
5883 tl_assert(isOriginalAtom(mce, cas->expdLo)); in do_shadow_CAS_double()
5885 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdHi)); in do_shadow_CAS_double()
5887 = assignNew('V', mce, elemTy, expr2vbits(mce, cas->expdLo)); in do_shadow_CAS_double()
5888 tl_assert(isShadowAtom(mce, vexpdHi)); in do_shadow_CAS_double()
5889 tl_assert(isShadowAtom(mce, vexpdLo)); in do_shadow_CAS_double()
5892 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdHi)); in do_shadow_CAS_double()
5894 = assignNew('B', mce, Ity_I32, schemeE(mce, cas->expdLo)); in do_shadow_CAS_double()
5895 tl_assert(isShadowAtom(mce, bexpdHi)); in do_shadow_CAS_double()
5896 tl_assert(isShadowAtom(mce, bexpdLo)); in do_shadow_CAS_double()
5912 'V', mce, elemTy, in do_shadow_CAS_double()
5914 mce, in do_shadow_CAS_double()
5920 'V', mce, elemTy, in do_shadow_CAS_double()
5922 mce, in do_shadow_CAS_double()
5926 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldHi), voldHi); in do_shadow_CAS_double()
5927 bind_shadow_tmp_to_orig('V', mce, mkexpr(cas->oldLo), voldLo); in do_shadow_CAS_double()
5930 = assignNew('B', mce, Ity_I32, in do_shadow_CAS_double()
5931 gen_load_b(mce, elemSzB, cas->addr, in do_shadow_CAS_double()
5934 = assignNew('B', mce, Ity_I32, in do_shadow_CAS_double()
5935 gen_load_b(mce, elemSzB, cas->addr, in do_shadow_CAS_double()
5937 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldHi), boldHi); in do_shadow_CAS_double()
5938 bind_shadow_tmp_to_orig('B', mce, mkexpr(cas->oldLo), boldLo); in do_shadow_CAS_double()
5942 stmt( 'C', mce, IRStmt_CAS(cas) ); in do_shadow_CAS_double()
5954 xHi = assignNew('C', mce, elemTy, in do_shadow_CAS_double()
5956 xLo = assignNew('C', mce, elemTy, in do_shadow_CAS_double()
5958 xHL = assignNew('C', mce, elemTy, in do_shadow_CAS_double()
5961 = assignNew('C', mce, Ity_I1, in do_shadow_CAS_double()
5966 do_shadow_Store( mce, cas->end, cas->addr, memOffsHi/*bias*/, in do_shadow_CAS_double()
5969 do_shadow_Store( mce, cas->end, cas->addr, memOffsLo/*bias*/, in do_shadow_CAS_double()
5973 gen_store_b( mce, elemSzB, cas->addr, memOffsHi/*offset*/, in do_shadow_CAS_double()
5976 gen_store_b( mce, elemSzB, cas->addr, memOffsLo/*offset*/, in do_shadow_CAS_double()
5985 static void do_shadow_LLSC ( MCEnv* mce, in do_shadow_LLSC() argument
5995 IRType resTy = typeOfIRTemp(mce->sb->tyenv, stResult); in do_shadow_LLSC()
5996 IRTemp resTmp = findShadowTmpV(mce, stResult); in do_shadow_LLSC()
6009 assign( 'V', mce, resTmp, in do_shadow_LLSC()
6011 mce, stEnd, resTy, stAddr, 0/*addr bias*/, in do_shadow_LLSC()
6016 IRType dataTy = typeOfIRExpr(mce->sb->tyenv, in do_shadow_LLSC()
6020 do_shadow_Store( mce, stEnd, in do_shadow_LLSC()
6041 assign( 'V', mce, resTmp, definedOfType(resTy) ); in do_shadow_LLSC()
6048 static void do_shadow_StoreG ( MCEnv* mce, IRStoreG* sg ) in do_shadow_StoreG() argument
6050 complainIfUndefined(mce, sg->guard, NULL); in do_shadow_StoreG()
6054 do_shadow_Store( mce, sg->end, in do_shadow_StoreG()
6061 static void do_shadow_LoadG ( MCEnv* mce, IRLoadG* lg ) in do_shadow_LoadG() argument
6063 complainIfUndefined(mce, lg->guard, NULL); in do_shadow_LoadG()
6091 = expr2vbits( mce, lg->alt ); in do_shadow_LoadG()
6093 = expr2vbits_Load_guarded_General(mce, lg->end, loadedTy, in do_shadow_LoadG()
6097 assign( 'V', mce, findShadowTmpV(mce, lg->dst), vbits_final ); in do_shadow_LoadG()
6105 static void schemeS ( MCEnv* mce, IRStmt* st );
6261 MCEnv mce; in MC_() local
6287 VG_(memset)(&mce, 0, sizeof(mce)); in MC_()
6288 mce.sb = sb_out; in MC_()
6289 mce.trace = verboze; in MC_()
6290 mce.layout = layout; in MC_()
6291 mce.hWordTy = hWordTy; in MC_()
6292 mce.bogusLiterals = False; in MC_()
6303 mce.useLLVMworkarounds = False; in MC_()
6305 mce.useLLVMworkarounds = True; in MC_()
6308 mce.tmpMap = VG_(newXA)( VG_(malloc), "mc.MC_(instrument).1", VG_(free), in MC_()
6310 VG_(hintSizeXA) (mce.tmpMap, sb_in->tyenv->types_used); in MC_()
6316 VG_(addToXA)( mce.tmpMap, &ent ); in MC_()
6318 tl_assert( VG_(sizeXA)( mce.tmpMap ) == sb_in->tyenv->types_used ); in MC_()
6323 mce.bogusLiterals = True; in MC_()
6347 mce.bogusLiterals = bogus; in MC_()
6352 tl_assert(mce.sb == sb_out); in MC_()
6353 tl_assert(mce.sb != sb_in); in MC_()
6362 stmt( 'C', &mce, sb_in->stmts[i] ); in MC_()
6393 IRTemp tmp_v = findShadowTmpV(&mce, tmp_o); in MC_()
6395 assign( 'V', &mce, tmp_v, definedOfType( ty_v ) ); in MC_()
6397 IRTemp tmp_b = findShadowTmpB(&mce, tmp_o); in MC_()
6399 assign( 'B', &mce, tmp_b, mkU32(0)/* UNKNOWN ORIGIN */); in MC_()
6430 schemeS( &mce, st ); in MC_()
6438 assign( 'V', &mce, findShadowTmpV(&mce, st->Ist.WrTmp.tmp), in MC_()
6439 expr2vbits( &mce, st->Ist.WrTmp.data) ); in MC_()
6443 do_shadow_PUT( &mce, in MC_()
6450 do_shadow_PUTI( &mce, st->Ist.PutI.details); in MC_()
6454 do_shadow_Store( &mce, st->Ist.Store.end, in MC_()
6462 do_shadow_StoreG( &mce, st->Ist.StoreG.details ); in MC_()
6466 do_shadow_LoadG( &mce, st->Ist.LoadG.details ); in MC_()
6470 complainIfUndefined( &mce, st->Ist.Exit.guard, NULL ); in MC_()
6481 do_shadow_Dirty( &mce, st->Ist.Dirty.details ); in MC_()
6485 do_AbiHint( &mce, st->Ist.AbiHint.base, in MC_()
6491 do_shadow_CAS( &mce, st->Ist.CAS.details ); in MC_()
6501 do_shadow_LLSC( &mce, in MC_()
6529 stmt('C', &mce, st); in MC_()
6541 complainIfUndefined( &mce, sb_in->next, NULL ); in MC_()
6554 tl_assert( VG_(sizeXA)( mce.tmpMap ) == mce.sb->tyenv->types_used ); in MC_()
6555 VG_(deleteXA)( mce.tmpMap ); in MC_()
6557 tl_assert(mce.sb == sb_out); in MC_()
6713 static IRTemp findShadowTmpB ( MCEnv* mce, IRTemp orig ) in findShadowTmpB() argument
6718 ent = (TempMapEnt*)VG_(indexXA)( mce->tmpMap, (Word)orig ); in findShadowTmpB()
6722 = newTemp( mce, Ity_I32, BSh ); in findShadowTmpB()
6725 ent = (TempMapEnt*)VG_(indexXA)( mce->tmpMap, (Word)orig ); in findShadowTmpB()
6733 static IRAtom* gen_maxU32 ( MCEnv* mce, IRAtom* b1, IRAtom* b2 ) in gen_maxU32() argument
6735 return assignNew( 'B', mce, Ity_I32, binop(Iop_Max32U, b1, b2) ); in gen_maxU32()
6747 static IRAtom* gen_guarded_load_b ( MCEnv* mce, Int szB, in gen_guarded_load_b() argument
6755 IRType aTy = typeOfIRExpr( mce->sb->tyenv, baseaddr ); in gen_guarded_load_b()
6761 ea = assignNew( 'B', mce, aTy, binop(opAdd, ea, off)); in gen_guarded_load_b()
6763 bTmp = newTemp(mce, mce->hWordTy, BSh); in gen_guarded_load_b()
6803 stmt( 'B', mce, IRStmt_Dirty(di) ); in gen_guarded_load_b()
6804 if (mce->hWordTy == Ity_I64) { in gen_guarded_load_b()
6806 IRTemp bTmp32 = newTemp(mce, Ity_I32, BSh); in gen_guarded_load_b()
6807 assign( 'B', mce, bTmp32, unop(Iop_64to32, mkexpr(bTmp)) ); in gen_guarded_load_b()
6820 static IRAtom* gen_load_b ( MCEnv* mce, Int szB, IRAtom* baseaddr, in gen_load_b() argument
6823 return gen_guarded_load_b(mce, szB, baseaddr, offset, NULL/*guard*/); in gen_load_b()
6835 IRAtom* expr2ori_Load_guarded_General ( MCEnv* mce, in expr2ori_Load_guarded_General() argument
6845 = assignNew('B', mce, Ity_I32, in expr2ori_Load_guarded_General()
6846 gen_guarded_load_b(mce, sizeofIRType(ty), in expr2ori_Load_guarded_General()
6857 return assignNew('B', mce, Ity_I32, IRExpr_ITE(cond, iftrue, iffalse)); in expr2ori_Load_guarded_General()
6863 static void gen_store_b ( MCEnv* mce, Int szB, in gen_store_b() argument
6870 IRType aTy = typeOfIRExpr( mce->sb->tyenv, baseaddr ); in gen_store_b()
6874 tl_assert(isOriginalAtom(mce, guard)); in gen_store_b()
6875 tl_assert(typeOfIRExpr(mce->sb->tyenv, guard) == Ity_I1); in gen_store_b()
6880 ea = assignNew( 'B', mce, aTy, binop(opAdd, ea, off)); in gen_store_b()
6882 if (mce->hWordTy == Ity_I64) in gen_store_b()
6883 dataB = assignNew( 'B', mce, Ity_I64, unop(Iop_32Uto64, dataB)); in gen_store_b()
6914 stmt( 'B', mce, IRStmt_Dirty(di) ); in gen_store_b()
6917 static IRAtom* narrowTo32 ( MCEnv* mce, IRAtom* e ) { in narrowTo32() argument
6918 IRType eTy = typeOfIRExpr(mce->sb->tyenv, e); in narrowTo32()
6920 return assignNew( 'B', mce, Ity_I32, unop(Iop_64to32, e) ); in narrowTo32()
6926 static IRAtom* zWidenFrom32 ( MCEnv* mce, IRType dstTy, IRAtom* e ) { in zWidenFrom32() argument
6927 IRType eTy = typeOfIRExpr(mce->sb->tyenv, e); in zWidenFrom32()
6930 return assignNew( 'B', mce, Ity_I64, unop(Iop_32Uto64, e) ); in zWidenFrom32()
6935 static IRAtom* schemeE ( MCEnv* mce, IRExpr* e ) in schemeE() argument
6953 descr_b = mkIRRegArray( descr->base + 2*mce->layout->total_sizeB, in schemeE()
6961 t1 = assignNew( 'B', mce, equivIntTy, in schemeE()
6964 t2 = narrowTo32( mce, t1 ); in schemeE()
6965 t3 = schemeE( mce, e->Iex.GetI.ix ); in schemeE()
6966 t4 = gen_maxU32( mce, t2, t3 ); in schemeE()
6976 tl_assert(isOriginalAtom(mce, args[i])); in schemeE()
6987 here = schemeE( mce, args[i] ); in schemeE()
6988 curr = gen_maxU32( mce, curr, here ); in schemeE()
6999 tl_assert(mce->hWordTy == Ity_I32 || mce->hWordTy == Ity_I64); in schemeE()
7000 return gen_load_b( mce, dszB, e->Iex.Load.addr, 0 ); in schemeE()
7003 IRAtom* b1 = schemeE( mce, e->Iex.ITE.cond ); in schemeE()
7004 IRAtom* b3 = schemeE( mce, e->Iex.ITE.iftrue ); in schemeE()
7005 IRAtom* b2 = schemeE( mce, e->Iex.ITE.iffalse ); in schemeE()
7006 return gen_maxU32( mce, b1, gen_maxU32( mce, b2, b3 )); in schemeE()
7009 IRAtom* b1 = schemeE( mce, e->Iex.Qop.details->arg1 ); in schemeE()
7010 IRAtom* b2 = schemeE( mce, e->Iex.Qop.details->arg2 ); in schemeE()
7011 IRAtom* b3 = schemeE( mce, e->Iex.Qop.details->arg3 ); in schemeE()
7012 IRAtom* b4 = schemeE( mce, e->Iex.Qop.details->arg4 ); in schemeE()
7013 return gen_maxU32( mce, gen_maxU32( mce, b1, b2 ), in schemeE()
7014 gen_maxU32( mce, b3, b4 ) ); in schemeE()
7017 IRAtom* b1 = schemeE( mce, e->Iex.Triop.details->arg1 ); in schemeE()
7018 IRAtom* b2 = schemeE( mce, e->Iex.Triop.details->arg2 ); in schemeE()
7019 IRAtom* b3 = schemeE( mce, e->Iex.Triop.details->arg3 ); in schemeE()
7020 return gen_maxU32( mce, b1, gen_maxU32( mce, b2, b3 ) ); in schemeE()
7033 IRAtom* b1 = schemeE( mce, e->Iex.Binop.arg1 ); in schemeE()
7034 IRAtom* b2 = schemeE( mce, e->Iex.Binop.arg2 ); in schemeE()
7035 return gen_maxU32( mce, b1, b2 ); in schemeE()
7042 IRAtom* b1 = schemeE( mce, e->Iex.Unop.arg ); in schemeE()
7048 return mkexpr( findShadowTmpB( mce, e->Iex.RdTmp.tmp )); in schemeE()
7055 && b_offset <= mce->layout->total_sizeB -4); in schemeE()
7058 return IRExpr_Get( b_offset + 2*mce->layout->total_sizeB, in schemeE()
7071 static void do_origins_Dirty ( MCEnv* mce, IRDirty* d ) in do_origins_Dirty() argument
7079 curr = schemeE( mce, d->guard ); in do_origins_Dirty()
7091 here = schemeE( mce, arg ); in do_origins_Dirty()
7092 curr = gen_maxU32( mce, curr, here ); in do_origins_Dirty()
7108 if (isAlwaysDefd(mce, gOff, gSz)) { in do_origins_Dirty()
7131 cond = assignNew( 'B', mce, Ity_I1, d->guard); in do_origins_Dirty()
7133 iftrue = assignNew( 'B', mce, Ity_I32, in do_origins_Dirty()
7135 + 2*mce->layout->total_sizeB, in do_origins_Dirty()
7137 here = assignNew( 'B', mce, Ity_I32, in do_origins_Dirty()
7139 curr = gen_maxU32( mce, curr, here ); in do_origins_Dirty()
7155 here = schemeE( mce, d->mAddr ); in do_origins_Dirty()
7156 curr = gen_maxU32( mce, curr, here ); in do_origins_Dirty()
7167 here = gen_guarded_load_b( mce, 4, d->mAddr, d->mSize - toDo, in do_origins_Dirty()
7169 curr = gen_maxU32( mce, curr, here ); in do_origins_Dirty()
7174 here = gen_guarded_load_b( mce, 2, d->mAddr, d->mSize - toDo, in do_origins_Dirty()
7176 curr = gen_maxU32( mce, curr, here ); in do_origins_Dirty()
7181 here = gen_guarded_load_b( mce, 1, d->mAddr, d->mSize - toDo, in do_origins_Dirty()
7183 curr = gen_maxU32( mce, curr, here ); in do_origins_Dirty()
7195 dst = findShadowTmpB(mce, d->tmp); in do_origins_Dirty()
7196 assign( 'V', mce, dst, curr ); in do_origins_Dirty()
7211 if (isAlwaysDefd(mce, gOff, gSz)) in do_origins_Dirty()
7230 cond = assignNew('B', mce, Ity_I1, in do_origins_Dirty()
7232 iffalse = assignNew('B', mce, Ity_I32, in do_origins_Dirty()
7234 2*mce->layout->total_sizeB, in do_origins_Dirty()
7236 curr = assignNew('V', mce, Ity_I32, in do_origins_Dirty()
7239 stmt( 'B', mce, IRStmt_Put(b_offset in do_origins_Dirty()
7240 + 2*mce->layout->total_sizeB, in do_origins_Dirty()
7255 gen_store_b( mce, 4, d->mAddr, d->mSize - toDo, curr, in do_origins_Dirty()
7261 gen_store_b( mce, 2, d->mAddr, d->mSize - toDo, curr, in do_origins_Dirty()
7267 gen_store_b( mce, 1, d->mAddr, d->mSize - toDo, curr, in do_origins_Dirty()
7277 static void do_origins_Store_guarded ( MCEnv* mce, in do_origins_Store_guarded() argument
7290 dszB = sizeofIRType( typeOfIRExpr(mce->sb->tyenv, stData ) ); in do_origins_Store_guarded()
7291 dataB = schemeE( mce, stData ); in do_origins_Store_guarded()
7292 gen_store_b( mce, dszB, stAddr, 0/*offset*/, dataB, guard ); in do_origins_Store_guarded()
7297 static void do_origins_Store_plain ( MCEnv* mce, in do_origins_Store_plain() argument
7302 do_origins_Store_guarded ( mce, stEnd, stAddr, stData, in do_origins_Store_plain()
7309 static void do_origins_StoreG ( MCEnv* mce, IRStoreG* sg ) in do_origins_StoreG() argument
7311 do_origins_Store_guarded( mce, sg->end, sg->addr, in do_origins_StoreG()
7315 static void do_origins_LoadG ( MCEnv* mce, IRLoadG* lg ) in do_origins_LoadG() argument
7329 = schemeE( mce,lg->alt ); in do_origins_LoadG()
7331 = expr2ori_Load_guarded_General(mce, loadedTy, in do_origins_LoadG()
7335 assign( 'B', mce, findShadowTmpB(mce, lg->dst), ori_final ); in do_origins_LoadG()
7339 static void schemeS ( MCEnv* mce, IRStmt* st ) in schemeS() argument
7367 = mkIRRegArray( descr->base + 2*mce->layout->total_sizeB, in schemeS()
7372 t1 = schemeE( mce, puti->data ); in schemeS()
7373 t2 = schemeE( mce, puti->ix ); in schemeS()
7374 t3 = gen_maxU32( mce, t1, t2 ); in schemeS()
7375 t4 = zWidenFrom32( mce, equivIntTy, t3 ); in schemeS()
7376 stmt( 'B', mce, IRStmt_PutI( mkIRPutI(descr_b, puti->ix, in schemeS()
7382 do_origins_Dirty( mce, st->Ist.Dirty.details ); in schemeS()
7386 do_origins_Store_plain( mce, st->Ist.Store.end, in schemeS()
7392 do_origins_StoreG( mce, st->Ist.StoreG.details ); in schemeS()
7396 do_origins_LoadG( mce, st->Ist.LoadG.details ); in schemeS()
7407 = typeOfIRTemp(mce->sb->tyenv, st->Ist.LLSC.result); in schemeS()
7412 assign( 'B', mce, findShadowTmpB(mce, st->Ist.LLSC.result), in schemeS()
7413 schemeE(mce, vanillaLoad)); in schemeS()
7416 do_origins_Store_plain( mce, st->Ist.LLSC.end, in schemeS()
7423 assign( 'B', mce, findShadowTmpB(mce, st->Ist.LLSC.result), in schemeS()
7433 sizeofIRType(typeOfIRExpr(mce->sb->tyenv, st->Ist.Put.data)) in schemeS()
7437 stmt( 'B', mce, IRStmt_Put(b_offset + 2*mce->layout->total_sizeB, in schemeS()
7438 schemeE( mce, st->Ist.Put.data )) ); in schemeS()
7444 assign( 'B', mce, findShadowTmpB(mce, st->Ist.WrTmp.tmp), in schemeS()
7445 schemeE(mce, st->Ist.WrTmp.data) ); in schemeS()