@@ -2697,34 +2697,28 @@ EMITTER_OPCODE_TABLE(OPCODE_AND, AND_I8, AND_I16, AND_I32, AND_I64, AND_V128);
2697
2697
template <typename SEQ, typename REG, typename ARGS>
2698
2698
void EmitAndNotXX (X64Emitter& e, const ARGS& i) {
2699
2699
if (i.src1 .is_constant ) {
2700
- if (i.src2 .is_constant ) {
2701
- // Both constants.
2702
- e.mov (i.dest , i.src1 .constant () & ~i.src2 .constant ());
2703
- } else {
2704
- // src1 constant.
2705
-
2706
- // `and` instruction only supports up to 32-bit immediate constants
2707
- // 64-bit constants will need a temp register
2708
- if (i.dest .reg ().getBit () == 64 ) {
2709
- auto temp = GetTempReg<typename decltype (i.src1 )::reg_type>(e);
2710
- e.mov (temp, i.src1 .constant ());
2711
-
2712
- if (e.IsFeatureEnabled (kX64EmitBMI1 )) {
2713
- if (i.dest .reg ().getBit () == 64 ) {
2714
- e.andn (i.dest .reg ().cvt64 (), i.src2 .reg ().cvt64 (), temp.cvt64 ());
2715
- } else {
2716
- e.andn (i.dest .reg ().cvt32 (), i.src2 .reg ().cvt32 (), temp.cvt32 ());
2717
- }
2700
+ // src1 constant.
2701
+ // `and` instruction only supports up to 32-bit immediate constants
2702
+ // 64-bit constants will need a temp register
2703
+ if (i.dest .reg ().getBit () == 64 ) {
2704
+ auto temp = GetTempReg<typename decltype (i.src1 )::reg_type>(e);
2705
+ e.mov (temp, i.src1 .constant ());
2706
+
2707
+ if (e.IsFeatureEnabled (kX64EmitBMI1 )) {
2708
+ if (i.dest .reg ().getBit () == 64 ) {
2709
+ e.andn (i.dest .reg ().cvt64 (), i.src2 .reg ().cvt64 (), temp.cvt64 ());
2718
2710
} else {
2719
- e.mov (i.dest , i.src2 );
2720
- e.not_ (i.dest );
2721
- e.and_ (i.dest , temp);
2711
+ e.andn (i.dest .reg ().cvt32 (), i.src2 .reg ().cvt32 (), temp.cvt32 ());
2722
2712
}
2723
2713
} else {
2724
2714
e.mov (i.dest , i.src2 );
2725
2715
e.not_ (i.dest );
2726
- e.and_ (i.dest , uint32_t (i. src1 . constant ()) );
2716
+ e.and_ (i.dest , temp );
2727
2717
}
2718
+ } else {
2719
+ e.mov (i.dest , i.src2 );
2720
+ e.not_ (i.dest );
2721
+ e.and_ (i.dest , uint32_t (i.src1 .constant ()));
2728
2722
}
2729
2723
} else if (i.src2 .is_constant ) {
2730
2724
// src2 constant.
0 commit comments