View Issue Details

IDProjectCategoryView StatusLast Update
0034799FPCCompilerpublic2019-01-20 20:04
ReporterMarģersAssigned ToFlorian 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Platformamd64OSlinuxOS Version
Product Version3.3.1Product Build 
Target VersionFixed in Version3.3.1 
Summary0034799: [patch] add assembler instructions blsi, blsr, blsmsk, adcx, adox
Descriptionprovided patch add some missing assembler instructions for x86 cpu
Tagsadx, assembler, bmi, bmi1, patch, x86
Fixed in Revision40951
FPCOldBugId
FPCTarget
Attached Files
  • bmi1_adx.patch (18,726 bytes)
    Index: compiler/i386/i386att.inc
    ===================================================================
    --- compiler/i386/i386att.inc	(revision 40739)
    +++ compiler/i386/i386att.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1021,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i386/i386atts.inc
    ===================================================================
    --- compiler/i386/i386atts.inc	(revision 40739)
    +++ compiler/i386/i386atts.inc	(working copy)
    @@ -1021,6 +1021,8 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -1072,6 +1074,9 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
    +attsufNONE,
    +attsufNONE,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    Index: compiler/i386/i386int.inc
    ===================================================================
    --- compiler/i386/i386int.inc	(revision 40739)
    +++ compiler/i386/i386int.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1021,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i386/i386nop.inc
    ===================================================================
    --- compiler/i386/i386nop.inc	(revision 40739)
    +++ compiler/i386/i386nop.inc	(working copy)
    @@ -1,2 +1,2 @@
     { don't edit, this file is generated from x86ins.dat }
    -2121;
    +2126;
    Index: compiler/i386/i386op.inc
    ===================================================================
    --- compiler/i386/i386op.inc	(revision 40739)
    +++ compiler/i386/i386op.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     A_VZEROUPPER,
     A_ANDN,
     A_BEXTR,
    +A_BLSI,
    +A_BLSMSK,
    +A_BLSR,
     A_TZCNT,
     A_BZHI,
     A_MULX,
    @@ -1018,6 +1021,8 @@
     A_SARX,
     A_SHLX,
     A_SHRX,
    +A_ADCX,
    +A_ADOX,
     A_VBROADCASTI128,
     A_VEXTRACTI128,
     A_VINSERTI128,
    Index: compiler/i386/i386prop.inc
    ===================================================================
    --- compiler/i386/i386prop.inc	(revision 40739)
    +++ compiler/i386/i386prop.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
     (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
    @@ -1018,6 +1021,8 @@
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
    Index: compiler/i386/i386tab.inc
    ===================================================================
    --- compiler/i386/i386tab.inc	(revision 40739)
    +++ compiler/i386/i386tab.inc	(working copy)
    @@ -13609,6 +13609,27 @@
         flags   : [if_bmi1,if_prot]
       ),
       (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
         opcode  : A_TZCNT;
         ops     : 2;
         optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
    @@ -13672,6 +13693,20 @@
         flags   : [if_bmi2,if_prot]
       ),
       (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #241#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #219#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
         opcode  : A_VBROADCASTI128;
         ops     : 2;
         optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
    Index: compiler/i8086/i8086att.inc
    ===================================================================
    --- compiler/i8086/i8086att.inc	(revision 40739)
    +++ compiler/i8086/i8086att.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1021,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i8086/i8086atts.inc
    ===================================================================
    --- compiler/i8086/i8086atts.inc	(revision 40739)
    +++ compiler/i8086/i8086atts.inc	(working copy)
    @@ -1021,6 +1021,8 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -1072,6 +1074,9 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
    +attsufNONE,
    +attsufNONE,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    Index: compiler/i8086/i8086int.inc
    ===================================================================
    --- compiler/i8086/i8086int.inc	(revision 40739)
    +++ compiler/i8086/i8086int.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1021,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i8086/i8086nop.inc
    ===================================================================
    --- compiler/i8086/i8086nop.inc	(revision 40739)
    +++ compiler/i8086/i8086nop.inc	(working copy)
    @@ -1,2 +1,2 @@
     { don't edit, this file is generated from x86ins.dat }
    -2153;
    +2158;
    Index: compiler/i8086/i8086op.inc
    ===================================================================
    --- compiler/i8086/i8086op.inc	(revision 40739)
    +++ compiler/i8086/i8086op.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     A_VZEROUPPER,
     A_ANDN,
     A_BEXTR,
    +A_BLSI,
    +A_BLSMSK,
    +A_BLSR,
     A_TZCNT,
     A_BZHI,
     A_MULX,
    @@ -1018,6 +1021,8 @@
     A_SARX,
     A_SHLX,
     A_SHRX,
    +A_ADCX,
    +A_ADOX,
     A_VBROADCASTI128,
     A_VEXTRACTI128,
     A_VINSERTI128,
    Index: compiler/i8086/i8086prop.inc
    ===================================================================
    --- compiler/i8086/i8086prop.inc	(revision 40739)
    +++ compiler/i8086/i8086prop.inc	(working copy)
    @@ -1009,6 +1009,9 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
     (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
    @@ -1018,6 +1021,8 @@
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
    Index: compiler/i8086/i8086tab.inc
    ===================================================================
    --- compiler/i8086/i8086tab.inc	(revision 40739)
    +++ compiler/i8086/i8086tab.inc	(working copy)
    @@ -13637,6 +13637,27 @@
         flags   : [if_bmi1,if_prot]
       ),
       (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
         opcode  : A_TZCNT;
         ops     : 2;
         optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
    @@ -13700,6 +13721,20 @@
         flags   : [if_bmi2,if_prot]
       ),
       (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #241#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #219#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
         opcode  : A_VBROADCASTI128;
         ops     : 2;
         optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
    Index: compiler/x86/aasmcpu.pas
    ===================================================================
    --- compiler/x86/aasmcpu.pas	(revision 40739)
    +++ compiler/x86/aasmcpu.pas	(working copy)
    @@ -335,6 +335,8 @@
             IF_AVX2,
             IF_BMI1,
             IF_BMI2,
    +        { Intel ADX (Multi-Precision Add-Carry Instruction Extensions) }
    +        IF_ADX,
             IF_16BITONLY,
             IF_FMA,
             IF_FMA4,
    Index: compiler/x86/x86ins.dat
    ===================================================================
    --- compiler/x86/x86ins.dat	(revision 40739)
    +++ compiler/x86/x86ins.dat	(working copy)
    @@ -5285,6 +5285,21 @@
     reg32,rm32,reg32                      \362\371\1\xf7\76\110               BMI1,PROT
     reg64,rm64,reg64                      \362\363\371\1\xf7\76\110           BMI1,PROT,X86_64
     
    +[BLSI]
    +(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
    +reg32,rm32                            \362\371\1\xf3\74\213               BMI1,PROT
    +reg64,rm64                            \362\363\371\1\xf3\74\213           BMI1,PROT,X86_64
    +
    +[BLSMSK]
    +(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
    +reg32,rm32                            \362\371\1\xf3\74\212               BMI1,PROT
    +reg64,rm64                            \362\363\371\1\xf3\74\212           BMI1,PROT,X86_64
    +
    +[BLSR]
    +(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
    +reg32,rm32                            \362\371\1\xf3\74\211               BMI1,PROT
    +reg64,rm64                            \362\363\371\1\xf3\74\211           BMI1,PROT,X86_64
    +
     [TZCNT]
     (Ch_Wop2, Ch_WFlags, Ch_Rop1)
     reg16|32|64,regmem                    \320\333\2\x0F\xBC\110              BMI1,SM
    @@ -5333,7 +5348,20 @@
     reg32,rm32,reg32                      \334\362\371\1\xf7\76\110           BMI2,PROT
     reg64,rm64,reg64                      \334\362\363\371\1\xf7\76\110       BMI2,PROT,X86_64
     
    +;*******************************************************************************
    +;********** ADX ****************************************************************
    +;*******************************************************************************
     
    +[ADCX,adcxX]
    +(Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag)
    +reg32,rm32                            \361\3\xf\x38\xf6\110               ADX
    +reg64,rm64                            \361\326\3\xf\x38\xf6\110           ADX,X86_64
    +
    +[ADOX,adoxX]
    +(Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag)
    +reg32,rm32                            \333\3\xf\x38\xf6\110               ADX
    +reg64,rm64                            \333\326\3\xf\x38\xf6\110           ADX,X86_64
    +
     ;*******************************************************************************
     ;********** AVX2 ***************************************************************
     ;*******************************************************************************
    Index: compiler/x86_64/x8664ats.inc
    ===================================================================
    --- compiler/x86_64/x8664ats.inc	(revision 40739)
    +++ compiler/x86_64/x8664ats.inc	(working copy)
    @@ -1017,6 +1017,8 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -1068,6 +1070,9 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
    +attsufNONE,
    +attsufNONE,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    Index: compiler/x86_64/x8664att.inc
    ===================================================================
    --- compiler/x86_64/x8664att.inc	(revision 40739)
    +++ compiler/x86_64/x8664att.inc	(working copy)
    @@ -1005,6 +1005,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1014,6 +1017,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/x86_64/x8664int.inc
    ===================================================================
    --- compiler/x86_64/x8664int.inc	(revision 40739)
    +++ compiler/x86_64/x8664int.inc	(working copy)
    @@ -1005,6 +1005,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1014,6 +1017,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/x86_64/x8664nop.inc
    ===================================================================
    --- compiler/x86_64/x8664nop.inc	(revision 40739)
    +++ compiler/x86_64/x8664nop.inc	(working copy)
    @@ -1,2 +1,2 @@
     { don't edit, this file is generated from x86ins.dat }
    -2178;
    +2188;
    Index: compiler/x86_64/x8664op.inc
    ===================================================================
    --- compiler/x86_64/x8664op.inc	(revision 40739)
    +++ compiler/x86_64/x8664op.inc	(working copy)
    @@ -1005,6 +1005,9 @@
     A_VZEROUPPER,
     A_ANDN,
     A_BEXTR,
    +A_BLSI,
    +A_BLSMSK,
    +A_BLSR,
     A_TZCNT,
     A_BZHI,
     A_MULX,
    @@ -1014,6 +1017,8 @@
     A_SARX,
     A_SHLX,
     A_SHRX,
    +A_ADCX,
    +A_ADOX,
     A_VBROADCASTI128,
     A_VEXTRACTI128,
     A_VINSERTI128,
    Index: compiler/x86_64/x8664pro.inc
    ===================================================================
    --- compiler/x86_64/x8664pro.inc	(revision 40739)
    +++ compiler/x86_64/x8664pro.inc	(working copy)
    @@ -1005,6 +1005,9 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
     (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
    @@ -1014,6 +1017,8 @@
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
    Index: compiler/x86_64/x8664tab.inc
    ===================================================================
    --- compiler/x86_64/x8664tab.inc	(revision 40739)
    +++ compiler/x86_64/x8664tab.inc	(working copy)
    @@ -13952,6 +13952,48 @@
         flags   : [if_bmi1,if_prot,if_x86_64]
       ),
       (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #242#243#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot,if_x86_64]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #242#243#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot,if_x86_64]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #242#243#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot,if_x86_64]
    +  ),
    +  (
         opcode  : A_TZCNT;
         ops     : 2;
         optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
    @@ -14071,6 +14113,34 @@
         flags   : [if_bmi2,if_prot,if_x86_64]
       ),
       (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #241#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #241#214#3#15#56#246#72;
    +    flags   : [if_adx,if_x86_64]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #219#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #219#214#3#15#56#246#72;
    +    flags   : [if_adx,if_x86_64]
    +  ),
    +  (
         opcode  : A_VBROADCASTI128;
         ops     : 2;
         optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
    Index: tests/utils/avx/avxopcodes.pas
    ===================================================================
    --- tests/utils/avx/avxopcodes.pas	(revision 40739)
    +++ tests/utils/avx/avxopcodes.pas	(working copy)
    @@ -51,6 +51,17 @@
     
     procedure TAVXTestGenerator.Init;
     begin
    +  FOpCodeList.Add('ADCX,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('ADCX,1,1,REG64,RM64,,,');
    +  FOpCodeList.Add('ADOX,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('ADOX,1,1,REG64,RM64,,,');
    +
    +  FOpCodeList.Add('BLSI,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('BLSI,1,1,REG64,RM64,,,');
    +  FOpCodeList.Add('BLSR,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('BLSR,1,1,REG64,RM64,,,');
    +  FOpCodeList.Add('BLSMSK,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('BLSMSK,1,1,REG64,RM64,,,');
       FOpCodeList.Add('BZHI,1,1,REG32,RM32,REG32,,');
       FOpCodeList.Add('BZHI,1,1,REG64,RM64,REG64,,');
       FOpCodeList.Add('MULX,1,1,REG32,REG32,RM32,,');
    
    bmi1_adx.patch (18,726 bytes)
  • bmi1_adx_movbe_clmul.patch (24,999 bytes)
    Index: compiler/i386/i386att.inc
    ===================================================================
    --- compiler/i386/i386att.inc	(revision 40765)
    +++ compiler/i386/i386att.inc	(working copy)
    @@ -684,6 +684,8 @@
     'aesimc',
     'aeskeygenassist',
     'rdtscp',
    +'movbe',
    +'pclmulqdq',
     'vaddpd',
     'vaddps',
     'vaddsd',
    @@ -1009,6 +1011,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1023,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i386/i386atts.inc
    ===================================================================
    --- compiler/i386/i386atts.inc	(revision 40765)
    +++ compiler/i386/i386atts.inc	(working copy)
    @@ -684,6 +684,7 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -779,6 +780,7 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
     attsufMM,
     attsufMM,
     attsufNONE,
    @@ -1021,6 +1023,8 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -1068,6 +1072,9 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
    +attsufNONE,
    +attsufNONE,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    Index: compiler/i386/i386int.inc
    ===================================================================
    --- compiler/i386/i386int.inc	(revision 40765)
    +++ compiler/i386/i386int.inc	(working copy)
    @@ -684,6 +684,8 @@
     'aesimc',
     'aeskeygenassist',
     'rdtscp',
    +'movbe',
    +'pclmulqdq',
     'vaddpd',
     'vaddps',
     'vaddsd',
    @@ -1009,6 +1011,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1023,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i386/i386nop.inc
    ===================================================================
    --- compiler/i386/i386nop.inc	(revision 40765)
    +++ compiler/i386/i386nop.inc	(working copy)
    @@ -1,2 +1,2 @@
     { don't edit, this file is generated from x86ins.dat }
    -2121;
    +2129;
    Index: compiler/i386/i386op.inc
    ===================================================================
    --- compiler/i386/i386op.inc	(revision 40765)
    +++ compiler/i386/i386op.inc	(working copy)
    @@ -684,6 +684,8 @@
     A_AESIMC,
     A_AESKEYGENASSIST,
     A_RDTSCP,
    +A_MOVBE,
    +A_PCLMULQDQ,
     A_VADDPD,
     A_VADDPS,
     A_VADDSD,
    @@ -1009,6 +1011,9 @@
     A_VZEROUPPER,
     A_ANDN,
     A_BEXTR,
    +A_BLSI,
    +A_BLSMSK,
    +A_BLSR,
     A_TZCNT,
     A_BZHI,
     A_MULX,
    @@ -1018,6 +1023,8 @@
     A_SARX,
     A_SHLX,
     A_SHRX,
    +A_ADCX,
    +A_ADOX,
     A_VBROADCASTI128,
     A_VEXTRACTI128,
     A_VINSERTI128,
    Index: compiler/i386/i386prop.inc
    ===================================================================
    --- compiler/i386/i386prop.inc	(revision 40765)
    +++ compiler/i386/i386prop.inc	(working copy)
    @@ -684,6 +684,8 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_WEAX, Ch_WEDX]),
    +(Ch: [Ch_Rop1, Ch_Wop2]),
    +(Ch: [Ch_All]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
    @@ -1009,6 +1011,9 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
     (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
    @@ -1018,6 +1023,8 @@
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
    Index: compiler/i386/i386tab.inc
    ===================================================================
    --- compiler/i386/i386tab.inc	(revision 40765)
    +++ compiler/i386/i386tab.inc	(working copy)
    @@ -8709,6 +8709,27 @@
         flags   : [if_sse4,if_sm]
       ),
       (
    +    opcode  : A_MOVBE;
    +    ops     : 2;
    +    optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
    +    code    : #208#3#15#56#240#72;
    +    flags   : [if_movbe,if_sm]
    +  ),
    +  (
    +    opcode  : A_MOVBE;
    +    ops     : 2;
    +    optypes : (ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none);
    +    code    : #209#3#15#56#241#65;
    +    flags   : [if_movbe,if_sm]
    +  ),
    +  (
    +    opcode  : A_PCLMULQDQ;
    +    ops     : 3;
    +    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
    +    code    : #241#3#15#58#68#72#22;
    +    flags   : [if_clmul,if_sandybridge]
    +  ),
    +  (
         opcode  : A_VADDPD;
         ops     : 3;
         optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
    @@ -13609,6 +13630,27 @@
         flags   : [if_bmi1,if_prot]
       ),
       (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
         opcode  : A_TZCNT;
         ops     : 2;
         optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
    @@ -13672,6 +13714,20 @@
         flags   : [if_bmi2,if_prot]
       ),
       (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #241#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #219#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
         opcode  : A_VBROADCASTI128;
         ops     : 2;
         optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
    Index: compiler/i8086/i8086att.inc
    ===================================================================
    --- compiler/i8086/i8086att.inc	(revision 40765)
    +++ compiler/i8086/i8086att.inc	(working copy)
    @@ -684,6 +684,8 @@
     'aesimc',
     'aeskeygenassist',
     'rdtscp',
    +'movbe',
    +'pclmulqdq',
     'vaddpd',
     'vaddps',
     'vaddsd',
    @@ -1009,6 +1011,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1023,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i8086/i8086atts.inc
    ===================================================================
    --- compiler/i8086/i8086atts.inc	(revision 40765)
    +++ compiler/i8086/i8086atts.inc	(working copy)
    @@ -684,6 +684,7 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -779,6 +780,7 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
     attsufMM,
     attsufMM,
     attsufNONE,
    @@ -1021,6 +1023,8 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -1068,6 +1072,9 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
    +attsufNONE,
    +attsufNONE,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    Index: compiler/i8086/i8086int.inc
    ===================================================================
    --- compiler/i8086/i8086int.inc	(revision 40765)
    +++ compiler/i8086/i8086int.inc	(working copy)
    @@ -684,6 +684,8 @@
     'aesimc',
     'aeskeygenassist',
     'rdtscp',
    +'movbe',
    +'pclmulqdq',
     'vaddpd',
     'vaddps',
     'vaddsd',
    @@ -1009,6 +1011,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1018,6 +1023,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/i8086/i8086nop.inc
    ===================================================================
    --- compiler/i8086/i8086nop.inc	(revision 40765)
    +++ compiler/i8086/i8086nop.inc	(working copy)
    @@ -1,2 +1,2 @@
     { don't edit, this file is generated from x86ins.dat }
    -2153;
    +2161;
    Index: compiler/i8086/i8086op.inc
    ===================================================================
    --- compiler/i8086/i8086op.inc	(revision 40765)
    +++ compiler/i8086/i8086op.inc	(working copy)
    @@ -684,6 +684,8 @@
     A_AESIMC,
     A_AESKEYGENASSIST,
     A_RDTSCP,
    +A_MOVBE,
    +A_PCLMULQDQ,
     A_VADDPD,
     A_VADDPS,
     A_VADDSD,
    @@ -1009,6 +1011,9 @@
     A_VZEROUPPER,
     A_ANDN,
     A_BEXTR,
    +A_BLSI,
    +A_BLSMSK,
    +A_BLSR,
     A_TZCNT,
     A_BZHI,
     A_MULX,
    @@ -1018,6 +1023,8 @@
     A_SARX,
     A_SHLX,
     A_SHRX,
    +A_ADCX,
    +A_ADOX,
     A_VBROADCASTI128,
     A_VEXTRACTI128,
     A_VINSERTI128,
    Index: compiler/i8086/i8086prop.inc
    ===================================================================
    --- compiler/i8086/i8086prop.inc	(revision 40765)
    +++ compiler/i8086/i8086prop.inc	(working copy)
    @@ -684,6 +684,8 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_WEAX, Ch_WEDX]),
    +(Ch: [Ch_Rop1, Ch_Wop2]),
    +(Ch: [Ch_All]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
    @@ -1009,6 +1011,9 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
     (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
    @@ -1018,6 +1023,8 @@
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
    Index: compiler/i8086/i8086tab.inc
    ===================================================================
    --- compiler/i8086/i8086tab.inc	(revision 40765)
    +++ compiler/i8086/i8086tab.inc	(working copy)
    @@ -8737,6 +8737,27 @@
         flags   : [if_sse4,if_sm]
       ),
       (
    +    opcode  : A_MOVBE;
    +    ops     : 2;
    +    optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
    +    code    : #208#3#15#56#240#72;
    +    flags   : [if_movbe,if_sm]
    +  ),
    +  (
    +    opcode  : A_MOVBE;
    +    ops     : 2;
    +    optypes : (ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none);
    +    code    : #209#3#15#56#241#65;
    +    flags   : [if_movbe,if_sm]
    +  ),
    +  (
    +    opcode  : A_PCLMULQDQ;
    +    ops     : 3;
    +    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
    +    code    : #241#3#15#58#68#72#22;
    +    flags   : [if_clmul,if_sandybridge]
    +  ),
    +  (
         opcode  : A_VADDPD;
         ops     : 3;
         optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
    @@ -13637,6 +13658,27 @@
         flags   : [if_bmi1,if_prot]
       ),
       (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
         opcode  : A_TZCNT;
         ops     : 2;
         optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
    @@ -13700,6 +13742,20 @@
         flags   : [if_bmi2,if_prot]
       ),
       (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #241#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #219#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
         opcode  : A_VBROADCASTI128;
         ops     : 2;
         optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
    Index: compiler/x86/aasmcpu.pas
    ===================================================================
    --- compiler/x86/aasmcpu.pas	(revision 40765)
    +++ compiler/x86/aasmcpu.pas	(working copy)
    @@ -331,10 +331,14 @@
             IF_SSSE3,
             IF_SSE41,
             IF_SSE42,
    +        IF_MOVBE,
    +        IF_CLMUL,
             IF_AVX,
             IF_AVX2,
             IF_BMI1,
             IF_BMI2,
    +        { Intel ADX (Multi-Precision Add-Carry Instruction Extensions) }
    +        IF_ADX,
             IF_16BITONLY,
             IF_FMA,
             IF_FMA4,
    Index: compiler/x86/x86ins.dat
    ===================================================================
    --- compiler/x86/x86ins.dat	(revision 40765)
    +++ compiler/x86/x86ins.dat	(working copy)
    @@ -3582,7 +3582,22 @@
     (Ch_RWRSI, Ch_RMemEDI, Ch_RWRDI, Ch_RDirFlag, Ch_WOverflowFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WAuxiliaryFlag, Ch_WCarryFlag, Ch_WParityFlag)
     void                   \326\1\xA7                                    X86_64
     
    +[MOVBE,movbeX]
    +(Ch_Rop1, Ch_Wop2)
    +reg16|32|64,mem16|32|64              \320\3\xf\x38\xf0\110           MOVBE,SM
    +mem16|32|64,reg16|32|64              \321\3\xf\x38\xf1\101           MOVBE,SM
    +
    +
     ;*******************************************************************************
    +;********* CLMUL ***************************************************************
    +;*******************************************************************************
    +
    +[PCLMULQDQ]
    +(Ch_All)
    +xmmreg,xmmrm,imm8                    \361\3\xf\x3A\x44\110\26        CLMUL,SANDYBRIDGE
    +
    +
    +;*******************************************************************************
     ;****** AVX I ******************************************************************
     ;*******************************************************************************
     
    @@ -5285,6 +5300,21 @@
     reg32,rm32,reg32                      \362\371\1\xf7\76\110               BMI1,PROT
     reg64,rm64,reg64                      \362\363\371\1\xf7\76\110           BMI1,PROT,X86_64
     
    +[BLSI]
    +(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
    +reg32,rm32                            \362\371\1\xf3\74\213               BMI1,PROT
    +reg64,rm64                            \362\363\371\1\xf3\74\213           BMI1,PROT,X86_64
    +
    +[BLSMSK]
    +(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
    +reg32,rm32                            \362\371\1\xf3\74\212               BMI1,PROT
    +reg64,rm64                            \362\363\371\1\xf3\74\212           BMI1,PROT,X86_64
    +
    +[BLSR]
    +(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
    +reg32,rm32                            \362\371\1\xf3\74\211               BMI1,PROT
    +reg64,rm64                            \362\363\371\1\xf3\74\211           BMI1,PROT,X86_64
    +
     [TZCNT]
     (Ch_Wop2, Ch_WFlags, Ch_Rop1)
     reg16|32|64,regmem                    \320\333\2\x0F\xBC\110              BMI1,SM
    @@ -5333,7 +5363,20 @@
     reg32,rm32,reg32                      \334\362\371\1\xf7\76\110           BMI2,PROT
     reg64,rm64,reg64                      \334\362\363\371\1\xf7\76\110       BMI2,PROT,X86_64
     
    +;*******************************************************************************
    +;********** ADX ****************************************************************
    +;*******************************************************************************
     
    +[ADCX,adcxX]
    +(Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag)
    +reg32,rm32                            \361\3\xf\x38\xf6\110               ADX
    +reg64,rm64                            \361\326\3\xf\x38\xf6\110           ADX,X86_64
    +
    +[ADOX,adoxX]
    +(Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag)
    +reg32,rm32                            \333\3\xf\x38\xf6\110               ADX
    +reg64,rm64                            \333\326\3\xf\x38\xf6\110           ADX,X86_64
    +
     ;*******************************************************************************
     ;********** AVX2 ***************************************************************
     ;*******************************************************************************
    Index: compiler/x86_64/x8664ats.inc
    ===================================================================
    --- compiler/x86_64/x8664ats.inc	(revision 40765)
    +++ compiler/x86_64/x8664ats.inc	(working copy)
    @@ -680,6 +680,7 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -775,6 +776,7 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
     attsufMM,
     attsufMM,
     attsufNONE,
    @@ -1017,6 +1019,8 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufINT,
    +attsufINT,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    @@ -1064,6 +1068,9 @@
     attsufNONE,
     attsufNONE,
     attsufNONE,
    +attsufNONE,
    +attsufNONE,
    +attsufNONE,
     attsufNONE,
     attsufNONE,
     attsufNONE,
    Index: compiler/x86_64/x8664att.inc
    ===================================================================
    --- compiler/x86_64/x8664att.inc	(revision 40765)
    +++ compiler/x86_64/x8664att.inc	(working copy)
    @@ -680,6 +680,8 @@
     'stosq',
     'lodsq',
     'cmpsq',
    +'movbe',
    +'pclmulqdq',
     'vaddpd',
     'vaddps',
     'vaddsd',
    @@ -1005,6 +1007,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1014,6 +1019,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/x86_64/x8664int.inc
    ===================================================================
    --- compiler/x86_64/x8664int.inc	(revision 40765)
    +++ compiler/x86_64/x8664int.inc	(working copy)
    @@ -680,6 +680,8 @@
     'stosq',
     'lodsq',
     'cmpsq',
    +'movbe',
    +'pclmulqdq',
     'vaddpd',
     'vaddps',
     'vaddsd',
    @@ -1005,6 +1007,9 @@
     'vzeroupper',
     'andn',
     'bextr',
    +'blsi',
    +'blsmsk',
    +'blsr',
     'tzcnt',
     'bzhi',
     'mulx',
    @@ -1014,6 +1019,8 @@
     'sarx',
     'shlx',
     'shrx',
    +'adcx',
    +'adox',
     'vbroadcasti128',
     'vextracti128',
     'vinserti128',
    Index: compiler/x86_64/x8664nop.inc
    ===================================================================
    --- compiler/x86_64/x8664nop.inc	(revision 40765)
    +++ compiler/x86_64/x8664nop.inc	(working copy)
    @@ -1,2 +1,2 @@
     { don't edit, this file is generated from x86ins.dat }
    -2178;
    +2191;
    Index: compiler/x86_64/x8664op.inc
    ===================================================================
    --- compiler/x86_64/x8664op.inc	(revision 40765)
    +++ compiler/x86_64/x8664op.inc	(working copy)
    @@ -680,6 +680,8 @@
     A_STOSQ,
     A_LODSQ,
     A_CMPSQ,
    +A_MOVBE,
    +A_PCLMULQDQ,
     A_VADDPD,
     A_VADDPS,
     A_VADDSD,
    @@ -1005,6 +1007,9 @@
     A_VZEROUPPER,
     A_ANDN,
     A_BEXTR,
    +A_BLSI,
    +A_BLSMSK,
    +A_BLSR,
     A_TZCNT,
     A_BZHI,
     A_MULX,
    @@ -1014,6 +1019,8 @@
     A_SARX,
     A_SHLX,
     A_SHRX,
    +A_ADCX,
    +A_ADOX,
     A_VBROADCASTI128,
     A_VEXTRACTI128,
     A_VINSERTI128,
    Index: compiler/x86_64/x8664pro.inc
    ===================================================================
    --- compiler/x86_64/x8664pro.inc	(revision 40765)
    +++ compiler/x86_64/x8664pro.inc	(working copy)
    @@ -680,6 +680,8 @@
     (Ch: [Ch_RRAX, Ch_WMemEDI, Ch_RWRDI, Ch_RDirFlag]),
     (Ch: [Ch_WRAX, Ch_RWRSI, Ch_RDirFlag]),
     (Ch: [Ch_RWRSI, Ch_RMemEDI, Ch_RWRDI, Ch_RDirFlag, Ch_WOverflowFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WAuxiliaryFlag, Ch_WCarryFlag, Ch_WParityFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2]),
    +(Ch: [Ch_All]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
     (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
    @@ -1005,6 +1007,9 @@
     (Ch: [Ch_All]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
    +(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
     (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
    @@ -1014,6 +1019,8 @@
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
     (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
    +(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
     (Ch: [Ch_All]),
    Index: compiler/x86_64/x8664tab.inc
    ===================================================================
    --- compiler/x86_64/x8664tab.inc	(revision 40765)
    +++ compiler/x86_64/x8664tab.inc	(working copy)
    @@ -9010,6 +9010,27 @@
         flags   : [if_x86_64]
       ),
       (
    +    opcode  : A_MOVBE;
    +    ops     : 2;
    +    optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
    +    code    : #208#3#15#56#240#72;
    +    flags   : [if_movbe,if_sm]
    +  ),
    +  (
    +    opcode  : A_MOVBE;
    +    ops     : 2;
    +    optypes : (ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none);
    +    code    : #209#3#15#56#241#65;
    +    flags   : [if_movbe,if_sm]
    +  ),
    +  (
    +    opcode  : A_PCLMULQDQ;
    +    ops     : 3;
    +    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
    +    code    : #241#3#15#58#68#72#22;
    +    flags   : [if_clmul,if_sandybridge]
    +  ),
    +  (
         opcode  : A_VADDPD;
         ops     : 3;
         optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
    @@ -13952,6 +13973,48 @@
         flags   : [if_bmi1,if_prot,if_x86_64]
       ),
       (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSI;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #242#243#249#1#243#60#139;
    +    flags   : [if_bmi1,if_prot,if_x86_64]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSMSK;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #242#243#249#1#243#60#138;
    +    flags   : [if_bmi1,if_prot,if_x86_64]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #242#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot]
    +  ),
    +  (
    +    opcode  : A_BLSR;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #242#243#249#1#243#60#137;
    +    flags   : [if_bmi1,if_prot,if_x86_64]
    +  ),
    +  (
         opcode  : A_TZCNT;
         ops     : 2;
         optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
    @@ -14071,6 +14134,34 @@
         flags   : [if_bmi2,if_prot,if_x86_64]
       ),
       (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #241#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADCX;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #241#214#3#15#56#246#72;
    +    flags   : [if_adx,if_x86_64]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
    +    code    : #219#3#15#56#246#72;
    +    flags   : [if_adx]
    +  ),
    +  (
    +    opcode  : A_ADOX;
    +    ops     : 2;
    +    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
    +    code    : #219#214#3#15#56#246#72;
    +    flags   : [if_adx,if_x86_64]
    +  ),
    +  (
         opcode  : A_VBROADCASTI128;
         ops     : 2;
         optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
    Index: tests/utils/avx/avxopcodes.pas
    ===================================================================
    --- tests/utils/avx/avxopcodes.pas	(revision 40765)
    +++ tests/utils/avx/avxopcodes.pas	(working copy)
    @@ -51,6 +51,17 @@
     
     procedure TAVXTestGenerator.Init;
     begin
    +  FOpCodeList.Add('ADCX,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('ADCX,1,1,REG64,RM64,,,');
    +  FOpCodeList.Add('ADOX,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('ADOX,1,1,REG64,RM64,,,');
    +
    +  FOpCodeList.Add('BLSI,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('BLSI,1,1,REG64,RM64,,,');
    +  FOpCodeList.Add('BLSR,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('BLSR,1,1,REG64,RM64,,,');
    +  FOpCodeList.Add('BLSMSK,1,1,REG32,RM32,,,');
    +  FOpCodeList.Add('BLSMSK,1,1,REG64,RM64,,,');
       FOpCodeList.Add('BZHI,1,1,REG32,RM32,REG32,,');
       FOpCodeList.Add('BZHI,1,1,REG64,RM64,REG64,,');
       FOpCodeList.Add('MULX,1,1,REG32,REG32,RM32,,');
    

Relationships

related to 0034815 resolvedFlorian pclmulqdq instruction is not recognized 

Activities

Marģers

2019-01-03 00:23

reporter  

bmi1_adx.patch (18,726 bytes)
Index: compiler/i386/i386att.inc
===================================================================
--- compiler/i386/i386att.inc	(revision 40739)
+++ compiler/i386/i386att.inc	(working copy)
@@ -1009,6 +1009,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1021,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i386/i386atts.inc
===================================================================
--- compiler/i386/i386atts.inc	(revision 40739)
+++ compiler/i386/i386atts.inc	(working copy)
@@ -1021,6 +1021,8 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1072,6 +1074,9 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
Index: compiler/i386/i386int.inc
===================================================================
--- compiler/i386/i386int.inc	(revision 40739)
+++ compiler/i386/i386int.inc	(working copy)
@@ -1009,6 +1009,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1021,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i386/i386nop.inc
===================================================================
--- compiler/i386/i386nop.inc	(revision 40739)
+++ compiler/i386/i386nop.inc	(working copy)
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-2121;
+2126;
Index: compiler/i386/i386op.inc
===================================================================
--- compiler/i386/i386op.inc	(revision 40739)
+++ compiler/i386/i386op.inc	(working copy)
@@ -1009,6 +1009,9 @@
 A_VZEROUPPER,
 A_ANDN,
 A_BEXTR,
+A_BLSI,
+A_BLSMSK,
+A_BLSR,
 A_TZCNT,
 A_BZHI,
 A_MULX,
@@ -1018,6 +1021,8 @@
 A_SARX,
 A_SHLX,
 A_SHRX,
+A_ADCX,
+A_ADOX,
 A_VBROADCASTI128,
 A_VEXTRACTI128,
 A_VINSERTI128,
Index: compiler/i386/i386prop.inc
===================================================================
--- compiler/i386/i386prop.inc	(revision 40739)
+++ compiler/i386/i386prop.inc	(working copy)
@@ -1009,6 +1009,9 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
 (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
@@ -1018,6 +1021,8 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
Index: compiler/i386/i386tab.inc
===================================================================
--- compiler/i386/i386tab.inc	(revision 40739)
+++ compiler/i386/i386tab.inc	(working copy)
@@ -13609,6 +13609,27 @@
     flags   : [if_bmi1,if_prot]
   ),
   (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
     opcode  : A_TZCNT;
     ops     : 2;
     optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
@@ -13672,6 +13693,20 @@
     flags   : [if_bmi2,if_prot]
   ),
   (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #241#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #219#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
     opcode  : A_VBROADCASTI128;
     ops     : 2;
     optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
Index: compiler/i8086/i8086att.inc
===================================================================
--- compiler/i8086/i8086att.inc	(revision 40739)
+++ compiler/i8086/i8086att.inc	(working copy)
@@ -1009,6 +1009,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1021,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i8086/i8086atts.inc
===================================================================
--- compiler/i8086/i8086atts.inc	(revision 40739)
+++ compiler/i8086/i8086atts.inc	(working copy)
@@ -1021,6 +1021,8 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1072,6 +1074,9 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
Index: compiler/i8086/i8086int.inc
===================================================================
--- compiler/i8086/i8086int.inc	(revision 40739)
+++ compiler/i8086/i8086int.inc	(working copy)
@@ -1009,6 +1009,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1021,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i8086/i8086nop.inc
===================================================================
--- compiler/i8086/i8086nop.inc	(revision 40739)
+++ compiler/i8086/i8086nop.inc	(working copy)
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-2153;
+2158;
Index: compiler/i8086/i8086op.inc
===================================================================
--- compiler/i8086/i8086op.inc	(revision 40739)
+++ compiler/i8086/i8086op.inc	(working copy)
@@ -1009,6 +1009,9 @@
 A_VZEROUPPER,
 A_ANDN,
 A_BEXTR,
+A_BLSI,
+A_BLSMSK,
+A_BLSR,
 A_TZCNT,
 A_BZHI,
 A_MULX,
@@ -1018,6 +1021,8 @@
 A_SARX,
 A_SHLX,
 A_SHRX,
+A_ADCX,
+A_ADOX,
 A_VBROADCASTI128,
 A_VEXTRACTI128,
 A_VINSERTI128,
Index: compiler/i8086/i8086prop.inc
===================================================================
--- compiler/i8086/i8086prop.inc	(revision 40739)
+++ compiler/i8086/i8086prop.inc	(working copy)
@@ -1009,6 +1009,9 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
 (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
@@ -1018,6 +1021,8 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
Index: compiler/i8086/i8086tab.inc
===================================================================
--- compiler/i8086/i8086tab.inc	(revision 40739)
+++ compiler/i8086/i8086tab.inc	(working copy)
@@ -13637,6 +13637,27 @@
     flags   : [if_bmi1,if_prot]
   ),
   (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
     opcode  : A_TZCNT;
     ops     : 2;
     optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
@@ -13700,6 +13721,20 @@
     flags   : [if_bmi2,if_prot]
   ),
   (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #241#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #219#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
     opcode  : A_VBROADCASTI128;
     ops     : 2;
     optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
Index: compiler/x86/aasmcpu.pas
===================================================================
--- compiler/x86/aasmcpu.pas	(revision 40739)
+++ compiler/x86/aasmcpu.pas	(working copy)
@@ -335,6 +335,8 @@
         IF_AVX2,
         IF_BMI1,
         IF_BMI2,
+        { Intel ADX (Multi-Precision Add-Carry Instruction Extensions) }
+        IF_ADX,
         IF_16BITONLY,
         IF_FMA,
         IF_FMA4,
Index: compiler/x86/x86ins.dat
===================================================================
--- compiler/x86/x86ins.dat	(revision 40739)
+++ compiler/x86/x86ins.dat	(working copy)
@@ -5285,6 +5285,21 @@
 reg32,rm32,reg32                      \362\371\1\xf7\76\110               BMI1,PROT
 reg64,rm64,reg64                      \362\363\371\1\xf7\76\110           BMI1,PROT,X86_64
 
+[BLSI]
+(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
+reg32,rm32                            \362\371\1\xf3\74\213               BMI1,PROT
+reg64,rm64                            \362\363\371\1\xf3\74\213           BMI1,PROT,X86_64
+
+[BLSMSK]
+(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
+reg32,rm32                            \362\371\1\xf3\74\212               BMI1,PROT
+reg64,rm64                            \362\363\371\1\xf3\74\212           BMI1,PROT,X86_64
+
+[BLSR]
+(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
+reg32,rm32                            \362\371\1\xf3\74\211               BMI1,PROT
+reg64,rm64                            \362\363\371\1\xf3\74\211           BMI1,PROT,X86_64
+
 [TZCNT]
 (Ch_Wop2, Ch_WFlags, Ch_Rop1)
 reg16|32|64,regmem                    \320\333\2\x0F\xBC\110              BMI1,SM
@@ -5333,7 +5348,20 @@
 reg32,rm32,reg32                      \334\362\371\1\xf7\76\110           BMI2,PROT
 reg64,rm64,reg64                      \334\362\363\371\1\xf7\76\110       BMI2,PROT,X86_64
 
+;*******************************************************************************
+;********** ADX ****************************************************************
+;*******************************************************************************
 
+[ADCX,adcxX]
+(Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag)
+reg32,rm32                            \361\3\xf\x38\xf6\110               ADX
+reg64,rm64                            \361\326\3\xf\x38\xf6\110           ADX,X86_64
+
+[ADOX,adoxX]
+(Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag)
+reg32,rm32                            \333\3\xf\x38\xf6\110               ADX
+reg64,rm64                            \333\326\3\xf\x38\xf6\110           ADX,X86_64
+
 ;*******************************************************************************
 ;********** AVX2 ***************************************************************
 ;*******************************************************************************
Index: compiler/x86_64/x8664ats.inc
===================================================================
--- compiler/x86_64/x8664ats.inc	(revision 40739)
+++ compiler/x86_64/x8664ats.inc	(working copy)
@@ -1017,6 +1017,8 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1068,6 +1070,9 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
Index: compiler/x86_64/x8664att.inc
===================================================================
--- compiler/x86_64/x8664att.inc	(revision 40739)
+++ compiler/x86_64/x8664att.inc	(working copy)
@@ -1005,6 +1005,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1014,6 +1017,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/x86_64/x8664int.inc
===================================================================
--- compiler/x86_64/x8664int.inc	(revision 40739)
+++ compiler/x86_64/x8664int.inc	(working copy)
@@ -1005,6 +1005,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1014,6 +1017,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/x86_64/x8664nop.inc
===================================================================
--- compiler/x86_64/x8664nop.inc	(revision 40739)
+++ compiler/x86_64/x8664nop.inc	(working copy)
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-2178;
+2188;
Index: compiler/x86_64/x8664op.inc
===================================================================
--- compiler/x86_64/x8664op.inc	(revision 40739)
+++ compiler/x86_64/x8664op.inc	(working copy)
@@ -1005,6 +1005,9 @@
 A_VZEROUPPER,
 A_ANDN,
 A_BEXTR,
+A_BLSI,
+A_BLSMSK,
+A_BLSR,
 A_TZCNT,
 A_BZHI,
 A_MULX,
@@ -1014,6 +1017,8 @@
 A_SARX,
 A_SHLX,
 A_SHRX,
+A_ADCX,
+A_ADOX,
 A_VBROADCASTI128,
 A_VEXTRACTI128,
 A_VINSERTI128,
Index: compiler/x86_64/x8664pro.inc
===================================================================
--- compiler/x86_64/x8664pro.inc	(revision 40739)
+++ compiler/x86_64/x8664pro.inc	(working copy)
@@ -1005,6 +1005,9 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
 (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
@@ -1014,6 +1017,8 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
Index: compiler/x86_64/x8664tab.inc
===================================================================
--- compiler/x86_64/x8664tab.inc	(revision 40739)
+++ compiler/x86_64/x8664tab.inc	(working copy)
@@ -13952,6 +13952,48 @@
     flags   : [if_bmi1,if_prot,if_x86_64]
   ),
   (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #242#243#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot,if_x86_64]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #242#243#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot,if_x86_64]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #242#243#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot,if_x86_64]
+  ),
+  (
     opcode  : A_TZCNT;
     ops     : 2;
     optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
@@ -14071,6 +14113,34 @@
     flags   : [if_bmi2,if_prot,if_x86_64]
   ),
   (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #241#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #241#214#3#15#56#246#72;
+    flags   : [if_adx,if_x86_64]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #219#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #219#214#3#15#56#246#72;
+    flags   : [if_adx,if_x86_64]
+  ),
+  (
     opcode  : A_VBROADCASTI128;
     ops     : 2;
     optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
Index: tests/utils/avx/avxopcodes.pas
===================================================================
--- tests/utils/avx/avxopcodes.pas	(revision 40739)
+++ tests/utils/avx/avxopcodes.pas	(working copy)
@@ -51,6 +51,17 @@
 
 procedure TAVXTestGenerator.Init;
 begin
+  FOpCodeList.Add('ADCX,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('ADCX,1,1,REG64,RM64,,,');
+  FOpCodeList.Add('ADOX,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('ADOX,1,1,REG64,RM64,,,');
+
+  FOpCodeList.Add('BLSI,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('BLSI,1,1,REG64,RM64,,,');
+  FOpCodeList.Add('BLSR,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('BLSR,1,1,REG64,RM64,,,');
+  FOpCodeList.Add('BLSMSK,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('BLSMSK,1,1,REG64,RM64,,,');
   FOpCodeList.Add('BZHI,1,1,REG32,RM32,REG32,,');
   FOpCodeList.Add('BZHI,1,1,REG64,RM64,REG64,,');
   FOpCodeList.Add('MULX,1,1,REG32,REG32,RM32,,');
bmi1_adx.patch (18,726 bytes)

Marģers

2019-01-05 01:52

reporter  

bmi1_adx_movbe_clmul.patch (24,999 bytes)
Index: compiler/i386/i386att.inc
===================================================================
--- compiler/i386/i386att.inc	(revision 40765)
+++ compiler/i386/i386att.inc	(working copy)
@@ -684,6 +684,8 @@
 'aesimc',
 'aeskeygenassist',
 'rdtscp',
+'movbe',
+'pclmulqdq',
 'vaddpd',
 'vaddps',
 'vaddsd',
@@ -1009,6 +1011,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1023,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i386/i386atts.inc
===================================================================
--- compiler/i386/i386atts.inc	(revision 40765)
+++ compiler/i386/i386atts.inc	(working copy)
@@ -684,6 +684,7 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -779,6 +780,7 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
 attsufMM,
 attsufMM,
 attsufNONE,
@@ -1021,6 +1023,8 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1068,6 +1072,9 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
Index: compiler/i386/i386int.inc
===================================================================
--- compiler/i386/i386int.inc	(revision 40765)
+++ compiler/i386/i386int.inc	(working copy)
@@ -684,6 +684,8 @@
 'aesimc',
 'aeskeygenassist',
 'rdtscp',
+'movbe',
+'pclmulqdq',
 'vaddpd',
 'vaddps',
 'vaddsd',
@@ -1009,6 +1011,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1023,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i386/i386nop.inc
===================================================================
--- compiler/i386/i386nop.inc	(revision 40765)
+++ compiler/i386/i386nop.inc	(working copy)
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-2121;
+2129;
Index: compiler/i386/i386op.inc
===================================================================
--- compiler/i386/i386op.inc	(revision 40765)
+++ compiler/i386/i386op.inc	(working copy)
@@ -684,6 +684,8 @@
 A_AESIMC,
 A_AESKEYGENASSIST,
 A_RDTSCP,
+A_MOVBE,
+A_PCLMULQDQ,
 A_VADDPD,
 A_VADDPS,
 A_VADDSD,
@@ -1009,6 +1011,9 @@
 A_VZEROUPPER,
 A_ANDN,
 A_BEXTR,
+A_BLSI,
+A_BLSMSK,
+A_BLSR,
 A_TZCNT,
 A_BZHI,
 A_MULX,
@@ -1018,6 +1023,8 @@
 A_SARX,
 A_SHLX,
 A_SHRX,
+A_ADCX,
+A_ADOX,
 A_VBROADCASTI128,
 A_VEXTRACTI128,
 A_VINSERTI128,
Index: compiler/i386/i386prop.inc
===================================================================
--- compiler/i386/i386prop.inc	(revision 40765)
+++ compiler/i386/i386prop.inc	(working copy)
@@ -684,6 +684,8 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_WEAX, Ch_WEDX]),
+(Ch: [Ch_Rop1, Ch_Wop2]),
+(Ch: [Ch_All]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -1009,6 +1011,9 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
 (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
@@ -1018,6 +1023,8 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
Index: compiler/i386/i386tab.inc
===================================================================
--- compiler/i386/i386tab.inc	(revision 40765)
+++ compiler/i386/i386tab.inc	(working copy)
@@ -8709,6 +8709,27 @@
     flags   : [if_sse4,if_sm]
   ),
   (
+    opcode  : A_MOVBE;
+    ops     : 2;
+    optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
+    code    : #208#3#15#56#240#72;
+    flags   : [if_movbe,if_sm]
+  ),
+  (
+    opcode  : A_MOVBE;
+    ops     : 2;
+    optypes : (ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none);
+    code    : #209#3#15#56#241#65;
+    flags   : [if_movbe,if_sm]
+  ),
+  (
+    opcode  : A_PCLMULQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    code    : #241#3#15#58#68#72#22;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
     opcode  : A_VADDPD;
     ops     : 3;
     optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
@@ -13609,6 +13630,27 @@
     flags   : [if_bmi1,if_prot]
   ),
   (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
     opcode  : A_TZCNT;
     ops     : 2;
     optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
@@ -13672,6 +13714,20 @@
     flags   : [if_bmi2,if_prot]
   ),
   (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #241#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #219#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
     opcode  : A_VBROADCASTI128;
     ops     : 2;
     optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
Index: compiler/i8086/i8086att.inc
===================================================================
--- compiler/i8086/i8086att.inc	(revision 40765)
+++ compiler/i8086/i8086att.inc	(working copy)
@@ -684,6 +684,8 @@
 'aesimc',
 'aeskeygenassist',
 'rdtscp',
+'movbe',
+'pclmulqdq',
 'vaddpd',
 'vaddps',
 'vaddsd',
@@ -1009,6 +1011,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1023,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i8086/i8086atts.inc
===================================================================
--- compiler/i8086/i8086atts.inc	(revision 40765)
+++ compiler/i8086/i8086atts.inc	(working copy)
@@ -684,6 +684,7 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -779,6 +780,7 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
 attsufMM,
 attsufMM,
 attsufNONE,
@@ -1021,6 +1023,8 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1068,6 +1072,9 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
Index: compiler/i8086/i8086int.inc
===================================================================
--- compiler/i8086/i8086int.inc	(revision 40765)
+++ compiler/i8086/i8086int.inc	(working copy)
@@ -684,6 +684,8 @@
 'aesimc',
 'aeskeygenassist',
 'rdtscp',
+'movbe',
+'pclmulqdq',
 'vaddpd',
 'vaddps',
 'vaddsd',
@@ -1009,6 +1011,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1018,6 +1023,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/i8086/i8086nop.inc
===================================================================
--- compiler/i8086/i8086nop.inc	(revision 40765)
+++ compiler/i8086/i8086nop.inc	(working copy)
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-2153;
+2161;
Index: compiler/i8086/i8086op.inc
===================================================================
--- compiler/i8086/i8086op.inc	(revision 40765)
+++ compiler/i8086/i8086op.inc	(working copy)
@@ -684,6 +684,8 @@
 A_AESIMC,
 A_AESKEYGENASSIST,
 A_RDTSCP,
+A_MOVBE,
+A_PCLMULQDQ,
 A_VADDPD,
 A_VADDPS,
 A_VADDSD,
@@ -1009,6 +1011,9 @@
 A_VZEROUPPER,
 A_ANDN,
 A_BEXTR,
+A_BLSI,
+A_BLSMSK,
+A_BLSR,
 A_TZCNT,
 A_BZHI,
 A_MULX,
@@ -1018,6 +1023,8 @@
 A_SARX,
 A_SHLX,
 A_SHRX,
+A_ADCX,
+A_ADOX,
 A_VBROADCASTI128,
 A_VEXTRACTI128,
 A_VINSERTI128,
Index: compiler/i8086/i8086prop.inc
===================================================================
--- compiler/i8086/i8086prop.inc	(revision 40765)
+++ compiler/i8086/i8086prop.inc	(working copy)
@@ -684,6 +684,8 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_WEAX, Ch_WEDX]),
+(Ch: [Ch_Rop1, Ch_Wop2]),
+(Ch: [Ch_All]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -1009,6 +1011,9 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
 (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
@@ -1018,6 +1023,8 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
Index: compiler/i8086/i8086tab.inc
===================================================================
--- compiler/i8086/i8086tab.inc	(revision 40765)
+++ compiler/i8086/i8086tab.inc	(working copy)
@@ -8737,6 +8737,27 @@
     flags   : [if_sse4,if_sm]
   ),
   (
+    opcode  : A_MOVBE;
+    ops     : 2;
+    optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
+    code    : #208#3#15#56#240#72;
+    flags   : [if_movbe,if_sm]
+  ),
+  (
+    opcode  : A_MOVBE;
+    ops     : 2;
+    optypes : (ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none);
+    code    : #209#3#15#56#241#65;
+    flags   : [if_movbe,if_sm]
+  ),
+  (
+    opcode  : A_PCLMULQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    code    : #241#3#15#58#68#72#22;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
     opcode  : A_VADDPD;
     ops     : 3;
     optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
@@ -13637,6 +13658,27 @@
     flags   : [if_bmi1,if_prot]
   ),
   (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
     opcode  : A_TZCNT;
     ops     : 2;
     optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
@@ -13700,6 +13742,20 @@
     flags   : [if_bmi2,if_prot]
   ),
   (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #241#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #219#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
     opcode  : A_VBROADCASTI128;
     ops     : 2;
     optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
Index: compiler/x86/aasmcpu.pas
===================================================================
--- compiler/x86/aasmcpu.pas	(revision 40765)
+++ compiler/x86/aasmcpu.pas	(working copy)
@@ -331,10 +331,14 @@
         IF_SSSE3,
         IF_SSE41,
         IF_SSE42,
+        IF_MOVBE,
+        IF_CLMUL,
         IF_AVX,
         IF_AVX2,
         IF_BMI1,
         IF_BMI2,
+        { Intel ADX (Multi-Precision Add-Carry Instruction Extensions) }
+        IF_ADX,
         IF_16BITONLY,
         IF_FMA,
         IF_FMA4,
Index: compiler/x86/x86ins.dat
===================================================================
--- compiler/x86/x86ins.dat	(revision 40765)
+++ compiler/x86/x86ins.dat	(working copy)
@@ -3582,7 +3582,22 @@
 (Ch_RWRSI, Ch_RMemEDI, Ch_RWRDI, Ch_RDirFlag, Ch_WOverflowFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WAuxiliaryFlag, Ch_WCarryFlag, Ch_WParityFlag)
 void                   \326\1\xA7                                    X86_64
 
+[MOVBE,movbeX]
+(Ch_Rop1, Ch_Wop2)
+reg16|32|64,mem16|32|64              \320\3\xf\x38\xf0\110           MOVBE,SM
+mem16|32|64,reg16|32|64              \321\3\xf\x38\xf1\101           MOVBE,SM
+
+
 ;*******************************************************************************
+;********* CLMUL ***************************************************************
+;*******************************************************************************
+
+[PCLMULQDQ]
+(Ch_All)
+xmmreg,xmmrm,imm8                    \361\3\xf\x3A\x44\110\26        CLMUL,SANDYBRIDGE
+
+
+;*******************************************************************************
 ;****** AVX I ******************************************************************
 ;*******************************************************************************
 
@@ -5285,6 +5300,21 @@
 reg32,rm32,reg32                      \362\371\1\xf7\76\110               BMI1,PROT
 reg64,rm64,reg64                      \362\363\371\1\xf7\76\110           BMI1,PROT,X86_64
 
+[BLSI]
+(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
+reg32,rm32                            \362\371\1\xf3\74\213               BMI1,PROT
+reg64,rm64                            \362\363\371\1\xf3\74\213           BMI1,PROT,X86_64
+
+[BLSMSK]
+(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
+reg32,rm32                            \362\371\1\xf3\74\212               BMI1,PROT
+reg64,rm64                            \362\363\371\1\xf3\74\212           BMI1,PROT,X86_64
+
+[BLSR]
+(Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag)
+reg32,rm32                            \362\371\1\xf3\74\211               BMI1,PROT
+reg64,rm64                            \362\363\371\1\xf3\74\211           BMI1,PROT,X86_64
+
 [TZCNT]
 (Ch_Wop2, Ch_WFlags, Ch_Rop1)
 reg16|32|64,regmem                    \320\333\2\x0F\xBC\110              BMI1,SM
@@ -5333,7 +5363,20 @@
 reg32,rm32,reg32                      \334\362\371\1\xf7\76\110           BMI2,PROT
 reg64,rm64,reg64                      \334\362\363\371\1\xf7\76\110       BMI2,PROT,X86_64
 
+;*******************************************************************************
+;********** ADX ****************************************************************
+;*******************************************************************************
 
+[ADCX,adcxX]
+(Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag)
+reg32,rm32                            \361\3\xf\x38\xf6\110               ADX
+reg64,rm64                            \361\326\3\xf\x38\xf6\110           ADX,X86_64
+
+[ADOX,adoxX]
+(Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag)
+reg32,rm32                            \333\3\xf\x38\xf6\110               ADX
+reg64,rm64                            \333\326\3\xf\x38\xf6\110           ADX,X86_64
+
 ;*******************************************************************************
 ;********** AVX2 ***************************************************************
 ;*******************************************************************************
Index: compiler/x86_64/x8664ats.inc
===================================================================
--- compiler/x86_64/x8664ats.inc	(revision 40765)
+++ compiler/x86_64/x8664ats.inc	(working copy)
@@ -680,6 +680,7 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -775,6 +776,7 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
 attsufMM,
 attsufMM,
 attsufNONE,
@@ -1017,6 +1019,8 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufINT,
+attsufINT,
 attsufNONE,
 attsufNONE,
 attsufNONE,
@@ -1064,6 +1068,9 @@
 attsufNONE,
 attsufNONE,
 attsufNONE,
+attsufNONE,
+attsufNONE,
+attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
Index: compiler/x86_64/x8664att.inc
===================================================================
--- compiler/x86_64/x8664att.inc	(revision 40765)
+++ compiler/x86_64/x8664att.inc	(working copy)
@@ -680,6 +680,8 @@
 'stosq',
 'lodsq',
 'cmpsq',
+'movbe',
+'pclmulqdq',
 'vaddpd',
 'vaddps',
 'vaddsd',
@@ -1005,6 +1007,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1014,6 +1019,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/x86_64/x8664int.inc
===================================================================
--- compiler/x86_64/x8664int.inc	(revision 40765)
+++ compiler/x86_64/x8664int.inc	(working copy)
@@ -680,6 +680,8 @@
 'stosq',
 'lodsq',
 'cmpsq',
+'movbe',
+'pclmulqdq',
 'vaddpd',
 'vaddps',
 'vaddsd',
@@ -1005,6 +1007,9 @@
 'vzeroupper',
 'andn',
 'bextr',
+'blsi',
+'blsmsk',
+'blsr',
 'tzcnt',
 'bzhi',
 'mulx',
@@ -1014,6 +1019,8 @@
 'sarx',
 'shlx',
 'shrx',
+'adcx',
+'adox',
 'vbroadcasti128',
 'vextracti128',
 'vinserti128',
Index: compiler/x86_64/x8664nop.inc
===================================================================
--- compiler/x86_64/x8664nop.inc	(revision 40765)
+++ compiler/x86_64/x8664nop.inc	(working copy)
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-2178;
+2191;
Index: compiler/x86_64/x8664op.inc
===================================================================
--- compiler/x86_64/x8664op.inc	(revision 40765)
+++ compiler/x86_64/x8664op.inc	(working copy)
@@ -680,6 +680,8 @@
 A_STOSQ,
 A_LODSQ,
 A_CMPSQ,
+A_MOVBE,
+A_PCLMULQDQ,
 A_VADDPD,
 A_VADDPS,
 A_VADDSD,
@@ -1005,6 +1007,9 @@
 A_VZEROUPPER,
 A_ANDN,
 A_BEXTR,
+A_BLSI,
+A_BLSMSK,
+A_BLSR,
 A_TZCNT,
 A_BZHI,
 A_MULX,
@@ -1014,6 +1019,8 @@
 A_SARX,
 A_SHLX,
 A_SHRX,
+A_ADCX,
+A_ADOX,
 A_VBROADCASTI128,
 A_VEXTRACTI128,
 A_VINSERTI128,
Index: compiler/x86_64/x8664pro.inc
===================================================================
--- compiler/x86_64/x8664pro.inc	(revision 40765)
+++ compiler/x86_64/x8664pro.inc	(working copy)
@@ -680,6 +680,8 @@
 (Ch: [Ch_RRAX, Ch_WMemEDI, Ch_RWRDI, Ch_RDirFlag]),
 (Ch: [Ch_WRAX, Ch_RWRSI, Ch_RDirFlag]),
 (Ch: [Ch_RWRSI, Ch_RMemEDI, Ch_RWRDI, Ch_RDirFlag, Ch_WOverflowFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WAuxiliaryFlag, Ch_WCarryFlag, Ch_WParityFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2]),
+(Ch: [Ch_All]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
 (Ch: [Ch_Wop3, Ch_Rop2, Ch_Rop1]),
@@ -1005,6 +1007,9 @@
 (Ch: [Ch_All]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_W0ZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
+(Ch: [Ch_Rop1, Ch_Wop2, Ch_W0OverflowFlag, Ch_WCarryFlag, Ch_WSignFlag, Ch_WZeroFlag, Ch_WUParityFlag, Ch_WUAuxiliaryFlag]),
 (Ch: [Ch_Wop2, Ch_WFlags, Ch_Rop1]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_REDX, Ch_Rop1, Ch_Wop2, Ch_Wop3]),
@@ -1014,6 +1019,8 @@
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
 (Ch: [Ch_Rop1, Ch_Rop2, Ch_Wop3]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWCarryFlag]),
+(Ch: [Ch_Rop1, Ch_Mop2, Ch_RWOverflowFlag]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
 (Ch: [Ch_All]),
Index: compiler/x86_64/x8664tab.inc
===================================================================
--- compiler/x86_64/x8664tab.inc	(revision 40765)
+++ compiler/x86_64/x8664tab.inc	(working copy)
@@ -9010,6 +9010,27 @@
     flags   : [if_x86_64]
   ),
   (
+    opcode  : A_MOVBE;
+    ops     : 2;
+    optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_none,ot_none);
+    code    : #208#3#15#56#240#72;
+    flags   : [if_movbe,if_sm]
+  ),
+  (
+    opcode  : A_MOVBE;
+    ops     : 2;
+    optypes : (ot_memory or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_none,ot_none);
+    code    : #209#3#15#56#241#65;
+    flags   : [if_movbe,if_sm]
+  ),
+  (
+    opcode  : A_PCLMULQDQ;
+    ops     : 3;
+    optypes : (ot_xmmreg,ot_xmmrm,ot_immediate or ot_bits8,ot_none);
+    code    : #241#3#15#58#68#72#22;
+    flags   : [if_clmul,if_sandybridge]
+  ),
+  (
     opcode  : A_VADDPD;
     ops     : 3;
     optypes : (ot_xmmreg,ot_xmmreg,ot_xmmrm,ot_none);
@@ -13952,6 +13973,48 @@
     flags   : [if_bmi1,if_prot,if_x86_64]
   ),
   (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSI;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #242#243#249#1#243#60#139;
+    flags   : [if_bmi1,if_prot,if_x86_64]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSMSK;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #242#243#249#1#243#60#138;
+    flags   : [if_bmi1,if_prot,if_x86_64]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #242#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot]
+  ),
+  (
+    opcode  : A_BLSR;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #242#243#249#1#243#60#137;
+    flags   : [if_bmi1,if_prot,if_x86_64]
+  ),
+  (
     opcode  : A_TZCNT;
     ops     : 2;
     optypes : (ot_reg16 or ot_bits32 or ot_bits64,ot_rm_gpr,ot_none,ot_none);
@@ -14071,6 +14134,34 @@
     flags   : [if_bmi2,if_prot,if_x86_64]
   ),
   (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #241#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADCX;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #241#214#3#15#56#246#72;
+    flags   : [if_adx,if_x86_64]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg32,ot_rm_gpr or ot_bits32,ot_none,ot_none);
+    code    : #219#3#15#56#246#72;
+    flags   : [if_adx]
+  ),
+  (
+    opcode  : A_ADOX;
+    ops     : 2;
+    optypes : (ot_reg64,ot_rm_gpr or ot_bits64,ot_none,ot_none);
+    code    : #219#214#3#15#56#246#72;
+    flags   : [if_adx,if_x86_64]
+  ),
+  (
     opcode  : A_VBROADCASTI128;
     ops     : 2;
     optypes : (ot_ymmreg,ot_memory or ot_bits128,ot_none,ot_none);
Index: tests/utils/avx/avxopcodes.pas
===================================================================
--- tests/utils/avx/avxopcodes.pas	(revision 40765)
+++ tests/utils/avx/avxopcodes.pas	(working copy)
@@ -51,6 +51,17 @@
 
 procedure TAVXTestGenerator.Init;
 begin
+  FOpCodeList.Add('ADCX,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('ADCX,1,1,REG64,RM64,,,');
+  FOpCodeList.Add('ADOX,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('ADOX,1,1,REG64,RM64,,,');
+
+  FOpCodeList.Add('BLSI,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('BLSI,1,1,REG64,RM64,,,');
+  FOpCodeList.Add('BLSR,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('BLSR,1,1,REG64,RM64,,,');
+  FOpCodeList.Add('BLSMSK,1,1,REG32,RM32,,,');
+  FOpCodeList.Add('BLSMSK,1,1,REG64,RM64,,,');
   FOpCodeList.Add('BZHI,1,1,REG32,RM32,REG32,,');
   FOpCodeList.Add('BZHI,1,1,REG64,RM64,REG64,,');
   FOpCodeList.Add('MULX,1,1,REG32,REG32,RM32,,');

Marģers

2019-01-05 01:54

reporter   ~0113177

updated patch uploaded in regard of 0034815 (add support of pclmulqdq)

Florian

2019-01-20 19:50

administrator   ~0113530

Thank you, applied.

Issue History

Date Modified Username Field Change
2019-01-03 00:23 Marģers New Issue
2019-01-03 00:23 Marģers File Added: bmi1_adx.patch
2019-01-03 00:25 Marģers Tag Attached: assembler
2019-01-03 00:25 Marģers Tag Attached: patch
2019-01-03 00:25 Marģers Tag Attached: x86
2019-01-03 00:27 Marģers Tag Attached: adx
2019-01-03 00:27 Marģers Tag Attached: bmi
2019-01-03 00:27 Marģers Tag Attached: bmi1
2019-01-05 01:52 Marģers File Added: bmi1_adx_movbe_clmul.patch
2019-01-05 01:54 Marģers Note Added: 0113177
2019-01-20 19:13 Florian Relationship added related to 0034815
2019-01-20 19:50 Florian Fixed in Revision => 40951
2019-01-20 19:50 Florian Note Added: 0113530
2019-01-20 19:50 Florian Status new => resolved
2019-01-20 19:50 Florian Fixed in Version => 3.3.1
2019-01-20 19:50 Florian Resolution open => fixed
2019-01-20 19:50 Florian Assigned To => Florian
2019-01-20 20:04 Marģers Status resolved => closed