@@ -43,11 +43,11 @@ def NEAR_FAR_RET_LIKE_PREAMBLE(near_descr, near_section, far_descr, far_section)
4343 selected (see [%{ near_section } ]).
4444"""
4545
46- def ins_arith (abstract_name : str , mnemonic :str , hasOut2 = False ):
46+ def ins_arith (abstract_name : str , mnemonic :str , hasOut2 = False , commutes = False ):
4747 return Instruction (
4848 mnemonic = mnemonic ,
4949 abstract_name = abstract_name ,
50- modifiers = [Modifier .Swap , Modifier .SetFlags ],
50+ modifiers = ( [Modifier .Swap ] if not commutes else []) + [ Modifier .SetFlags ],
5151 in1 = In .Any ,
5252 in2 = In .Reg ,
5353 out1 = Out .Any ,
@@ -83,9 +83,9 @@ def ins_affected(ins:Instruction):
8383 return ins_affected_args (ins .in1 , ins .out1 , ins .setFlags ())
8484
8585
86- def descr_ins_generic_bitwise (abstract_name : str , mnemonic :str , summary : Optional [str ] = None , semantic : Optional [str ] = None , usage : Optional [str ] = None ):
86+ def descr_ins_generic_bitwise (abstract_name : str , mnemonic :str , commutes = False , summary : Optional [str ] = None , semantic : Optional [str ] = None , usage : Optional [str ] = None ):
8787 return InstructionDoc (
88- ins = ins_arith (abstract_name , mnemonic ),
88+ ins = ins_arith (abstract_name , mnemonic , commutes = commutes ),
8989
9090 summary = f"""
9191Bitwise { mnemonic .upper ()} of two 256-bit numbers.
0 commit comments