Apple Microarchitecture Research by Dougall Johnson

M1/A14 P-core (Firestorm): Overview | Base Instructions | SIMD and FP Instructions
M1/A14 E-core (Icestorm):  Overview | Base Instructions | SIMD and FP Instructions

CCMP (immediate, 32-bit)

Test 1: uops

Code:

  ccmp w1, #3, #0, hi
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 1.000

Integer unit issues: 1.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)031e3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)606d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst int alu (97)9faccfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
1004103589619172510001000100062250010351035805388210001000200010351041110011000100007332722990100010361036103610361036
1004103570619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103570619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103580619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103580619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103580619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103580619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103580619172510001000100062250110351035805388210001000200010351041110011000100007322722990100010361036103610361036
1004103580619172510001000100062250110351035805388210001000200010351041110011000100007322722990100010361036103610361036
100410358183619172510001000100062250010351035805388210001000200010351041110011000100007322722990100010361036103610361036

Test 2: Latency 2->1

Chain cycles: 1

Code:

  ccmp w1, #3, #0, hi
  cset x1, cc
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 1 chain cycle): 1.0035

retire uop (01)cycle (02)031e3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6b6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
20204200351551261199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035149061199302520100201002011212972334916955020035200811743161748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036
2020420035150061199302520100201002011212972334916955020035200351742561748720112202243023620035104112020110099100201002010001111318162001120000101002003620036200362003620036

1000 unrolls and 10 iterations

Result (median cycles for code, minus 1 chain cycle): 1.0035

retire uop (01)cycle (02)033f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351501201991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001287127111999520000100102003620036200362003620036
2002420035150611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
20024200351501471991825200102001020010129724704916955200352003517428317528200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
20024200351501701991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
20024200351501911991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
20024200351501031991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
20024200351501451991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001020010061270127211999520000100102003620036200362003620036
200252003515010851991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
20024200351501511991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270127111999520000100102003620036200362003620036
2002420035150611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010101270127111999520000100102003620036200362003620036

Test 3: Latency 2->2

Code:

  ccmp w0, #3, #0, hi
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(non-fused SUB/CBNZ loop)

100 unrolls and 100 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03mmu table walk instruction (07)l2 tlb miss instruction (0a)1e1f3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst int alu (97)9fl1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10204100357500006199272510200102001021064771214969561003510035867378736102101022420248100351101110201100991010010000201117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771204969561003510035867368736102101022420248100351101110201100991010010000001117181161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771204969561003510035867378736102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771204969551003510035867378736103781022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771204969561003510035867378736102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771204969561003510035867378737102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
102041003575110053699272510200102001021064771204969561003510035867378737102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771204969551003510035867378736102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771214969561003510035867378736102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036
10204100357511006199272510200102001021064771214969561003510035867378736102101022420248100351101110201100991010010000001117191161110012101001001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03l2 tlb miss data (0b)18191e1f3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst int alu (97)9fld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003575000001479918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022732999310010101003610036100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022722999310010101003610171100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022722999310010101003610036100361003610036
10024100357500060619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022722999310010101003610036100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000364022722999310010101003610036100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022723999310010101003610036100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022722999310010101003610036100361003610036
10024100357500000849918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000001064032722999310010101003610036100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022722999310010101003610036100361003610036
10024100357500000619918251002010020100206472964969551003510035867838754100201002020020100351041110021109100101000000064022723999310010101003610036100361003610036

Test 4: throughput

Count: 8

Code:

  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmp w0, #3, #0, hi
  mov x0, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code divided by count): 0.6676

retire uop (01)cycle (02)03l1i tlb fill (04)mmu table walk data (08)18191e3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
16020453408399100002827160120160120160128106373814950328534085340833347063335716012816024016024053408661116020110099100160100801000000001111011901600534051600201005340953409534095340953409
16020453408400000002827160120160120160128106373814950328534085340833347063335716012816024016024053408661116020110099100160100801000000001111011901601534051600201005340953409534095340953409
16020453408400000007227160120160120160128106373814950328534085340833347063335716012816024016031253408661116020110099100160100801000000001111011911611534051600201005340953409534095340953409
16020453408400000002827160120160120160128106373814950328534085340833347063335716012816024016024053408661116020110099100160100801000000001111011911600534051600201005340953409534095340953409
160204534084000000071627160120160120160128106373814950328534085340833347063335716012816024016024053408661116020110099100160100801000000001111011901600534051600201005340953409534095340953409
16020453408400000002827160120160120160128106373814950328534085340833347063338116012816024016024053408661116020110099100160100801000000001111011901601534051600201005340953409534095340953409
160204534084000000040827160120160120160128106373814950328534085340833347063335716012816024016024053408661116020110099100160100801000000001111011901600534051600201005340953409534095340953409
16020453408400000002827160120160120160128106373814950328534085340833347063335716012816024016024053408662116020110099100160100801000000001111011901610534051600201005340953409534095340953409
16020453408400000005627160120160120160128106373814950328534085340833347063335716012816024016024053408661116020110099100160100801000000001111011911611534051600201005340953409534095340953409
16020453408400000102827160163160120160128106373814948121534085340833347063335716012816024016024053408661116020110099100160100801000000001111011901610534051600201005340953409534095340953409

1000 unrolls and 10 iterations

Result (median cycles for code divided by count): 0.6672

retire uop (01)cycle (02)0318191e1f3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d tlb access (a0)ld unit uop (a6)l1d cache writeback (a8)acc2cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0? int output thing (e9)eaeb? int retires (ef)f5f6f7f8fd
1600245337940000004325160010160010160010102938811495029453374533743333183337916001016002016002053412661116002110910160010800100000010083359333194112513533701600002011105337553375533755337553375
1600245337440000004325160010160010160010102938810495029453374533743333133335116001016002016002053374661116002110910160010800100000010022340323192112513533701600002011105337553375533755337553375
160024533744000000431091600101600101600101029388104950294533745337433331333351160010160020160020533746611160021109101600108001000100010022344311192112513533701600002011105337553375533755337553375
1600245337440000004368160010160010160010102938810495029453570534683333133335116001016002016002053374661116002110910160010800100330010022353412192111125533701600002011105337553375533755337553375
1600245337440000004325160212160010160010102938810495029453374533743333133335116001016002016002053374661116002110910160010800100000010022350313192111225533701600002011105337553375533755337553375
16002453374399000042325160010160010160010102938810495029453515533743333133335116001016002016002053374661116002110910160010800100003010022338626192111325533701600002011105337553375533755337553375
1600245337440000004325160010160010160010102938811495029453374533743333133335116001016002016002053374661116002110910160010800100000010022343625192112511533701600002011105337553375533755337553375
1600245337440000513528525160010160010160010102938811495029453374533743333133335116001016002016002053374661116002110910160010800100000010022348311192111325533701600002011105337553375533755337553375
16002453374399000043251600101600101600101029388114950294533745337433331133335116001016002016016853374661116002110910160010800100000010022343613192112512534071600682011105337553375533755337553375
160024533744000000432516001016007816001099396511495029453374533743333133335116001016002016002053374661116002110910160010800100000010022341625192112525533701600002011105337553375533755337553375

Test 5: throughput

Count: 4

Code:

  fcmp s0, s0
  ccmp w0, #3, #0, hi
  ccmp w0, #3, #0, hi
  ccmp w0, #3, #0, hi
  ccmp w0, #3, #0, hi
  mov x0, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code divided by count): 0.3354

retire uop (01)cycle (02)033f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)696d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
5020413458101309255019340112100104014310013575127800971339513416134166139246777110501564025110013803022002613416134161150201100991004010010000401000011132211160013413400121001341713417134171341713417
502041341610128255012240112100104014310013575127800971339513416134166137246777110501564025110013803022002613416134161150201100991004010010000401000011132200160113413400121001341713416134171341713417
502041341610128255012240112100104014310013575127800971339513416134166139245667110501564025110013803022002613416134161150201100991004010010000401000011132210160013413400121001341713417134171341713417
5020413416100112255012240112100104025010013575127800971339513416134166139246777110501564025110013803022002613416134161150201100991004010010000401001011132210160013413400121001341713417134171341613417
502041341610028255012240112100104014310013575127800971339513416134166137246767110501564025110013803022002613416134161150201100991004010010000401001011132210161013413400121001341713417134171341713417
502041341610028255012240112100104014310013575127800971339513416134166139245677110501564025110013803022002613416134161150201100991004010010000401001311132210160013413400121001341713417134171341713417
502041341610028255012240112100104014310013575127800971339513416134166137245677110501564025110013803022002613416134161150201100991004010010000401000011132210160113413400121001341713417134171341713417
5020413416100683255012240112100104014310013575127800971339513416134166137246777110501564025110013803022002613416134161150201100991004010010000401001311132210160113413400121001341713417134171341613417
5020413415101156255012240112100104014310013575127800971339513416134166139245677110501564025110013803022002613416134161150201100991004010010000401000011132210160013413400121001341713416134171341713417
502041341610151255012240112100104014310013575127800971339513416134166137245677110501564025110013803022002613416134161150201100991004010010000401000011132210160013413400121001341713417134171341713417

1000 unrolls and 10 iterations

Result (median cycles for code divided by count): 0.3346

retire uop (01)cycle (02)03mmu table walk data (08)1e1f3a3f4d51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)696d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)acc2cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
5002413383104090011971714350586404281004940597101495760448117513353133821338255773784371095001040020100008002020000133821338211500211091040010100004001000032500383131369940426101338313383133831338313383
5002413382103100011251114250584401751019640582101695876668134013353133821343755753795371095001040020100008002020000133821338211500211091040010100004001000432710190211352040000101338313383134521338313383
500241338210400008802550010400101000040010100005734568000013353133821338255773784371095001040020100008002020000133821338211500211091040010100004001000031400119111337940000101338313383133831338313383
500241338210000006802550010400101000040010100005734568000013353133821338255773795371095001040020100008002020000133821338211500211091040010100004001000031400119111337940000101338313383133831338313383
50024133821000000158025500104001010000400101000057345680000133531338213382557737953710950010400201000080020200001338213382115002110910400101000040010066031400119111337940000101338313383133831338313383
5002413382100000010802550010400101000040010100005734568000013353133821338255753784371095001040020100008002020000133821338211500211091040010100004001000031400119111337940000101338313383133831338313383
5002413382100000072302550010400101000040010100005734568000013353133821338255773784371095001040020100008002020000133821338211500211091040010100004001000031400119111337940000101338313383133831338313383
5002413382100000019802550010400101000040010100005734568000013353133821338255753795371095001040020100008002020000133821338211500211091040010100004001000031400119111337940000101338313383133831338313383
5002413382101000060302550010400101000040010100005734568000013353133821338255753784371095001040020100008002020000133821338211500211091040010100004001090031400119111337940000101338313383133831338313383
500241338210000008902550010400101002940010100005734568000013353133821338255773784371095001040020100008002020000133821338211500211091040010100004001000031400119111337940000101338313383133831338313383