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

CMP (register, asr, 32-bit)

Test 1: uops

Code:

  cmp w0, w1, asr #17
  mov x0, 1
  mov x1, 2

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 2.000

Integer unit issues: 2.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)031e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)606d6emap 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 int alu (97)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
100470950711000304252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
1004709601081000304252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
100470950611000304252000200010004087717097094982135611000100020007097811100110000973222226842000710710710710710
100470950611000304252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
100470960611000304252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
100470950611000304252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
100470950611000304252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
100470950611000304252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
100470960611000304252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
100470960611000304252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710

Test 2: Latency 3->1

Chain cycles: 1

Code:

  cmp w0, w1, asr #17
  cset x0, cc
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)18191e1f3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)6061696a6d6emap 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)l1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)a9acc2cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020430035225000000611000029893253010030100201001956198104926955300353003527369327478201002020030200300351451120201100991002010010100000000013101331222995430000101003003630036300363003630036
2020430035224000000611000029893253010030100201001956198104926955300353003527369327478201002020030200300351451120201100991002010010100000000013101331222995430000101003003630036300363003630036
2020430035224000000611000029893253010030100201001956198004926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035224000000611000029893253010030100201001956198014926955300353003527369327478201002020030200300351451120201100991002010010100000000013102231222995430000101003003630036300363003630036
2020430035225000000611000029893253010030100201001956198004926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035225000000611000029893253010030100201001956198004926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035225000000611000029893253010030100201001956198004926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035225000000611000029893253010030100201001956198114926955300663003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035224000000611000029893253010030100201001956198014926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035224000000611000029893253010030100201001956198014926955300353003527369327478201002020030200300351451120201100991002010010100000000013102231222995430000101003003630036300363003630036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)031e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f60696a6d6emap 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)9faccfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200243003522505361000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270233312995830000100103003630067300363003630036
200243003522505361000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270233112995830000100103003630036300363003630036
20024300352259611000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270233112995830000100103003630036300363003630036
200243003522507261000029891683005730057201661957018014926955300803007927414032749820010200203002030035145112002110910200101001001287133112995830000100103003630036300363003630036
200243003522507681000029906253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270133232995830000100103003630036300363003630036
20024300352250648100002989125300103001020010195628901492695530035300352739103274982001020020300203003514511200211091020010100101771270233312995830000100103003630036300363003630036
20024300352250611000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270433312995830000100103003630036300363003630036
20024300352250611000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270133122995830000100103003630036300363003630036
20024300352250611000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270233112995830000100103003630036300363003630036
20024300352250611000029891253001030010200101956289014926955300353003527391032749820010200203002030035145112002110910200101001001270133322995830000100103003630036300363003630036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  cmp w0, w1, asr #17
  cset x1, cc
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03181e1f3f4c4d51schedule 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 branch cond (94)inst int alu (97)9fl1d tlb access (a0)l1d tlb miss (a1)l1d cache writeback (a8)acc2c9cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020430035225000611000029893253010030100201001956198492695530035300352738132747820100202003020030035145112020110099100201001010000060013101331222995430000101003003630036300813003630036
2020430173226100611000029893253010030100201001956198492695530035300352736932747820100202003020030035145112020110099100201001010000000013291331332995430000101003003630036300363003630036
2020430035225000611000029893253010030100201001956198492695530035300352736932747820100202003020030035145112020110099100201001010000060013101231232999030000101003003630036300363003630036
2020430035225000611000629893253010030100201001956198492695530035300352736932747820100202003020030035145112020110099100201001010000000013101231222995430000101003003630036300363003630036
20204300352240007261000029893253010030100201001956198492700030035300352736932747820100202003020030035145112020110099100201001010000000013101331322995430000101003003630036300363003630036
2020430035225030611000029893253010030100201001956198492695530035300352736932747820100202003020030035145112020110099100201001010000000013101331222995430000101003003630036300363003630036
2020430035225000611000029893253010030100201001956198492695530035300352736932747820100202003020030035145112020110099100201001010000000013101331322995430000101003003630036301253003630036
2020430035224000611000029893253010030100201001956198492695530035300802736982747820100202893020030035145112020110099100201001010000002013101231222995430000101003003630036300363003630036
2020430035225000611000029893253010030100201001956198492695530035300352736932747820100202003020030035145112020110099100201001010000000013101331332995430000101003003630036300363003630036
2020430035224000611000029893253010030100201001956198492695530035300352736932747820100202003020030068145112020110099100201001010000000013101231222995430000101003003630036300363003630036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)031e3f4c4d51schedule 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 cache writeback (a8)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cfl1i cache miss demand (d3)d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200243003522506110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036
200243003522406110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562891149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562890198269553003530035273913274982001020020300203003514511200211091020010100100000012700133212995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100030012700233112995830046100103003630127300363003630036
200243003522406110000298912530010300102008919562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133212995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562890149269553003530035273913274982001020020300203003514511200211091020010100100000012700133112995830000100103003630036300363003630036

Test 4: throughput

Count: 8

Code:

  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  cmp w0, w1, asr #17
  mov x0, 1
  mov x1, 2

(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)03mmu table walk instruction (07)mmu table walk data (08)18191e1f3f4c4d51schedule 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 cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204534404000000006180000487412516010016010080100344000504950330534105341043298206334336080100802001602005341078118020110099100801001000000511032422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000504950330534105341043298206334336080100802001602005341078118020210099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000504950330534105341043298206034336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000504950330534105341043298206334336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516022116010080100344000514950330534105341043298206034336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000504950330534105341043298206034336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000514950330534105341043298205034336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411
80204534104000000006180000487412516010016010080100344000504950330534105341043298206334336080100802001602005341078118020110099100801001000000511022422533921600001005341153411534115341153411

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)0309l2 tlb miss data (0b)1e3a3f4c4d51schedule 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)9fst unit uop (a7)l1d cache writeback (a8)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8002453383399000067800004794625160010160010800103438130049503005338053380432902707343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
800245338039900588061800004794625160010160010800103438130049503005338053380432902707343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
8002453380399000061800004794625160010160010800103438130049503005338053380432902562343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
8002453380399000061800004794625160010160010800103438130049503005338053380432902562343352800108002016002053380781180021109108001010000050201241153359160103105338153381533815338153381
8002453380399000061800004558725160010160010800103438130049503005338053380432902562343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
8002453380400000061800004794625160010160010800103438130049503005338053380432902707343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
80024533804000000103800004794625160010160010800103438130049503005338053380432902707343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
8002453380400000061800004794625160010160010800103438130049503005338053380432902707343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
8002453380400000061800004794625160010160010800103438130049503005338053380432902707343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381
80024533803990000726800004794625160010160010800103438130049503005338053380432902562343352800108002016002053380781180021109108001010000050201241153359160000105338153381533815338153381