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, lsr, 64-bit)

Test 1: uops

Code:

  cmp x0, x1, lsr #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)0309181e1f3f4c4d51schedule 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)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
1004709600006110003042520002000100040877170970949821356111021000200070978111001100000073122116842000710710710710710
1004709500006110003042520002000100040877170970949825356110001000200070978111001100000073122116842000710710710710710
1004709600006110003042520002000100040877170970949821356110001000200070978111001100000073122116842000710710710710710
1004709600006110003042520002000100040877170970949825356110001000200070978111001100000073122116842000710710710710710
1004709500006110003042520002000100040877170970949821356110001000200070978111001100000073122116842000710710710710710
1004709500006110003042520002000100040877170970949825356110001000200070978111001100000373122116842000710710710710710
1004709500006110003042520002000100040877170970949821356110001000200070978111001100000073122116842000710710710710710
1004709500606110003042520002000100040877170970949821356110001000200070978111001100000073122116842000710710710710710
1004709500006110003042520002000100040877170970949825356110001000200070978111001100000073122116842000710710710710710
1004709600006110003042520002000100040877170970949821356110001000200070978111001100000073122116842000710710710710710

Test 2: Latency 3->1

Chain cycles: 1

Code:

  cmp x0, x1, lsr #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)031e3f4c4d51schedule 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)acbranch cond mispred nonspec (c5)cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202043003522506110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000013101331222995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561981492695530035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000013291231222995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561981492695530035300352736932747820100202003020030035145112020110099100201001010000013101231322995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
202043003522506110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
202043003522596110000298932530100301002010019561981492695530035300352736932747820100202003020030035145112020110099100201001010000013101231322995430000101003003630036300363003630036
202043003522406110000298932530100301002010019561981492695530035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036

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)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
200243003522506110000298912530010300102001019562890492695530035300352739132749820010200203002030035145112002110910200101001001561270133112995830000100103003630036300363003630036
200243003522506110000298912530010300102001019562891492695530035300352739132749820010200203002030035145112002110910200101001001501270133112995830000100103003630036300363003630036
20024300352250611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100751270133112995830000100103003630036300363003630036
2002430035225061100002989125300103001020010195628904926955300353003527391327498200102002030020300351451120021109102001010010001270133112995830000100103003630036300363003630036
2002430035225061100002989125300103001020010195628904926955300353003527391327498200102002030020300351451120021109102001010010001270133112995830000100103006830036300363003630036
2002430035225061100002989125300103001020010195628914926955300353003527391327498200102002030020300351451120021109102001010010001270133112995830000100103003630036300363003630036
2002430035225061100002989125300103001020010195628904926955300353003527391327498200102002030020300351451120021109102001010010001270133112995830000100103003630036300363003630036
2002430035225061100002989125300103001020010195628904926955300353003527391327498200102002030020300351451120021109102001010010001270133113001430000100103003630036300363003630036
2002430035225082100002989125300103001020010195628904926955300353003527391327498200102002030020300351451120021109102001010010001270133112995830000100103003630036300363003630036
2002430035225961100002989125300103001020010195628904926955300353003527391327498200102002030020300351451120021109102001010010001270133112995830000100103003630036300363003630036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  cmp x0, x1, lsr #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)03mmu table walk instruction (07)l2 tlb miss instruction (0a)1e3a3f4c4d51schedule 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 tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202043003522411121611000029899253010030100201071956240149269553003530035273916274872010720224302363003514511202011009910020100101000000000011113180216222998430000101003003630036300363003630036
20204300352251101611000029899253010030100201071956240149269553003530035273916274872010720224302363003514511202011009910020100101000000000011113180216232998430000101003003630036300363003630036
20204300352251101611000029899253010030100201071956240149269553003530035273916274872010720224302363003514511202011009910020100101000000000011113180216222998430000101003003630036300363003630036
20204300352251161611000029899253010030100201071956240049269553003530035273916274872010720224302363003514511202011009910020100101000000000000013101231322995430000101003003630036300363003630036
20204300352250090611000029893253010030100201001956198149270013003530035273693274782010020200302003003514511202011009910020100101000000000000013101331222995430000101003003630036300363003630036
20204300352250000611000029893253010030100201001956198049269553003530035273693274782010020200302003003514511202011009910020100101000000000000013101331232995430000101003003630036300363003630036
20204300352250000611000029893253010030100201001956198149269553003530035273693274782010020200302003003514511202011009910020100101000000000000013101331332995430000101003003630036300363003630036
20204300352240000611000029893253010030100201001956198049269553003530035273693274782010020200302003003514511202011009910020100101000000000000013101331332995430000101003003630036300363003630036
20204300352250000611000029893253010030100201001956198049269553003530035273693274782010020200302003003514511202011009910020100101000000000000013101331322995430000101003003630036300363003630036
20204300352250000611000029893253010030100201001956198149269553003530035273693274782010020200302003003514511202011009910020100101000000000000013101231232995430000101003003630036300363003630036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03091e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200243003522500611000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270433222995830000100103003630036300363003630036
2002430035225008311000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233222995830000100103003630036300363003630036
2002430035225001361000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233222995830000100103003630036300363003630036
2002430035225102611000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000501294233222995830000100103003630036300363003630036
2002430035225001241000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233232995830000100103003630036300363003630036
2002430035225005391000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233322995830000100103003630036300363003630036
2002430035225001241000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233222995830000100103003630036300363003630036
2002430035225001661000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233232995830000100103003630036300363003630036
2002430035225001661000029891253001030010200101956289049269550300353003527391327498200102002030020300351451120021109102001010010200001270233222995830000100103003630036300363003630036
2002430035225001451000029891253001030010200101956289149269550300353003527391327498200102002030020300351451120021109102001010010000001270233222995830000100103003630036300363003630036

Test 4: throughput

Count: 8

Code:

  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #17
  cmp x0, x1, lsr #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)031e3f4c4d51schedule 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)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
802045345740006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001002000511022411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000000511012412533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000000511012411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000000511012411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206034336080100802001602005341078118020110099100801001000000511012411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001002000511012411533921600001005341153411534115341153411
8020453410400072680000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000036511012411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206334336080100802001602005341078118020110099100801001000000511012411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043298206034336080100802001602005341078118020110099100801001000000511012411533921600001005341153411534115341153411
802045341040006180000487412516010016010080100344000514950330534105341043364206034336080100802001602005341078118020110099100801001000100511012411533921600001005341153411534115341153411

1000 unrolls and 10 iterations

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

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)9fl1d cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)dbddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
800245340141499268000047946251600101600108001034381300149503005338053380432902707343352800108002016002053380781180021109108001010000502032406553359160000105338153381533815338153381
800245338040001708000047946251600101600108001034381300149503005338053380432902562343352800108002016002053380781180021109108001010000502022402353359160000105338153381533815338153381
8002453380400015858000047946251600101600108001034381300149503005343253380432902707343352800108002016002053380781180021109108001010000502022405353359160000105338153381533815338153381
800245338040005818000047946251600101600108001034381300149503005338053380432902707343352800108002016002053380781180021109108001010000502032403253359160000105338153381533815338153381
800245338040009978000047946251600101600108001034381300149503005338053432432902562343352800108002016002053380781180021109108001010031502052403653359160000105338153381533815338153381
800245338040002128000047946251600101600108001034406130049503005338053380432902562343352800108002016002053380781180021109108001010000502022402453359160000105338153381533815338153381
80024533804000214800004794625160010160010800103438130014950300533805338043290270734335280010800201600205338078118002110910800101001710502022402353359160000105338153381533815338153381
800245338039902338000047946251600101600108001034381300049503005338053380432902562343352800108002016002053380781180021109108001010000502052406553359160000105338153381533815338153381
800245338040001918000047946251600101600108001034381300149503005338053380432902707343352800108002016002053380781180021109108001010000502052405653359160000105338153381533815338153381
80024533804000169080000479462516001016001080214343813001495030053380533804329027071243352800108002016002053380781180021109108001010000502032405553359160000105338153381533815338153381