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

Test 1: uops

Code:

  cmp x0, w1, uxth
  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)031e3f4c4d5051schedule 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
1004709506110003040252000200010004087707097094982135611000100020007097811100110000073222226842000710710710710710
100470960821000304693252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
100470960611000304693252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
100470950611000304693252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
100470950611000304693252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
100470950611000304693252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
10047095020910003040252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
1004709506110003040252000200010004087717097094982535611000100020007097811100110000073222226842000710710710710710
1004709506110003040252000200010004087717097094982135611000100020007097811100110000073222226842000710710710710710
1004709506110003040252000200010004087717097094982135611000100022087097811100110000073222226842000710710710710710

Test 2: Latency 3->1

Chain cycles: 1

Code:

  cmp x0, w1, uxth
  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)18191e1f3a3f4c4d51schedule 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)l1d cache writeback (a8)a9acc2cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020430035225000000061100002989325301003010020100195619814926955300353003527369327478201002020030200300351451120201100991002010010100000100013100231222995430000101003003630036300363003630036
20204300352240000000611000029893253010030100201001956198049269553003530035273693274782010020200302003003514511202011009910020100101000002100013100231222995430000101003003630036300363003630036
202043003522500000003461000029893253010030100201001956198049269553003530035273693274782010020200302003003514511202011009910020100101000003606013101231322995430000101003003630036300363003630036
20204300352250000000251100002989325301003010020100195619804926955300353003527369327478201002020030200300351451120201100991002010010100000109013101231222995430000101003003630036300363003630036
20204300352240000000726100002989325301003010020100195619804926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036
2020430035225000000061100002989325301003010020100195619804926955300353003527369327478201002020030200300351451120201100991002010010100000100013101231222995430000101003003630036300363003630036
2020430035225000000061100052989325301003010020100195619814926955300353003527369327478201002020030200300351451120201100991002010010100000200013101231222995430000101003003630036300363003630036
20204300352250000000611000029893253010030100201001956198149269553003530035273693274782010020200302003003514511202011009910020100101000003400013101231222995430000101003003630036300363003630036
202043003522500000006110000298932530100301002010019561980492695530035300352736932747820100202003020030035145112020110099100201001010000032012013101231222995430000101003003630036300363003630036
2020430035225000000061100002989325301673010020185195619814926955300353003527369327478201002020030200300351451120201100991002010010100000000013101231222995430000101003003630036300363003630036

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)9fcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200243003522507261000029891253001030010200101956289149269553003530035273913274982001020020300203003514511200211091020010100101270133122995830000100103003630036300363003630036
2002430035225354611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270233112995830000100103003630036300363003630036
2002430035225324611000029891253001030010200101956289149269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630036300363003630036
2002430035224339611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133212995830000100103003630036300363003630036
2002430035225450611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630071300363003630036
20024300352253817261000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630036300363003630036
2002430035225363611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630036300363003630036
2002430035233375611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630036300363003630036
2002430035225360611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630036300363003630036
2002430035224462611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100101270133112995830000100103003630036300363003630036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  cmp x0, w1, uxth
  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 data (08)1e3f4c4d51schedule 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 cache writeback (a8)acbranch mispred nonspec (cb)cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204300352240061100002989325301003010020100195619814926955030035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619814926955030035300352736932747820100202003020030035145112020110099100201001010030013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619814926955330035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619814926955030035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619804926955030035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619804926955030035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619814926955030035300352736932747820100202003036530035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352240061100002989325301003010020100195619804926955030035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619814926955030035300352736932747820100202003020030035145112020110099100201001010090013101231222995430000101003003630036300363003630036
20204300352250061100002989325301003010020100195619814926955030035300352736932747820100202003020030035145112020110099100201001010000013101231222995430000101003003630036300363003630036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l2 tlb miss instruction (0a)1e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f696a6d6emap 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)accfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024300352250300611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700133452995830000100103003630036300363003630036
20024300352250390611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700333332995830000100103003630036300363003630036
20024300352250417611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700233222995830000100103003630036300363003630036
20024300352250453611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700333222995830000100103003630036300363003630036
20024300352250390611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700233232995830000100103003630036300363003630036
20024300352250438611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700533352995830000100103003630036300363003630036
20024300352250417611000029891253001030010200101956289049269553003530035273913274982001020020300203003529411200211091020010100100012700233222995830000100103003630036300363003630036
20024300352250375611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100912700433322995830000100103003630036300363003630036
2002430035225090611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700133222995830000100103003630036300713003630036
20024300352250372611000029891253001030010200101956289049269553003530035273913274982001020020300203003514511200211091020010100100012700233422995830000100103003630036300363003630036

Test 4: throughput

Count: 8

Code:

  cmp x0, w1, uxth
  cmp x0, w1, uxth
  cmp x0, w1, uxth
  cmp x0, w1, uxth
  cmp x0, w1, uxth
  cmp x0, w1, uxth
  cmp x0, w1, uxth
  cmp x0, w1, uxth
  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)03l2 tlb miss data (0b)1e3f4c4d5051schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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)a9acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)ec? int retires (ef)f5f6f7f8fd
8020453457400006180000487410251601001601008010034400051495033005341053410432982063343360801008020016020053410781180201100991008010010000005110324115339216000001005341153411534115341153411
8020453410400006180000487410251601001601008010034400051495033005341053410432982050343360801008020016020053410781180201100991008010010000005110124115339216000001005341153411534115341153411
8020453458399008280000487410251601001601008010034400051495033005341053410432982060343360801008020016020053410781180201100991008010010000005110124115339216000001005341153411534115341153411
8020453410400006180000487410251601001601008010034400051495033005341053410432982063343360801008020016020053410781180201100991008010010000005139124115339216000001005341153411534115341153411
8020453410400006180000487410251601001601008010034400051495033005341053410432982060343360801008020016020053410781180201100991008010010000005110124115339216000001005341153411534115341153411
8020453410400006180000487410251601001601008010034400051495033005341053410432982063343360801008020016020053410781180201100991008010010000005110124315339216000001005341153411534115341153411
8020453410400006180000487410251601001601008010034400051495033005341053410432982063343360801008020016020053410781180201100991008010010010005110124115339216000001005341153411534115341153411
8020453410400006180000487410251601001601008010034400051495033005341053410432982063343360801008020016020053410781180201100991008010010000005110124115339216000001005341153411534115341153411
8020453410400008280000487410251601001601008010034400051495033005341053410432982060343360801008020016020053410781180201100991008010010000005110124115339216000001005341153411534115341153411
8020553410400006180000487410251601001601008010034400051495033005341053410432982050343360802858020016020053410781180201100991008010010000005110124115339216000001005341153454534115341153411

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss instruction (0a)l2 tlb miss data (0b)18191e1f3a3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f60696a6b6d6emap 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)a9acc2cfd0l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0? int output thing (e9)ea? int retires (ef)f5f6f7f8fd
800245338340000000000072680000479462516001016001080010343813000495030005338053380433582707343352800108002016002053380781180021109108001010000000050200025240002424533591600000105338153381533815338153381
80024535884000000000006180000479462516001016001080010343813000495030005338053380432902707343352800108002016002053380781180021109108001010000000050200026240002025533591600000105338153381533815338153381
80024533804000000030006180000479462516001016009880010343813000495030005338053380432902562343352800108002016002053380781180021109108001010000000050200020240002620533591600000105338153381533815338153381
800245338040000004000010380000479462516001016001080010343813000495030005338053380432902707343352800108002016002053380781180021109108001010000000050200028240002826533591600000105338153381533815338153381
800245338040000000039006180000479462516001016001080010343813001495030005338053380432902562343447800108002016002053380781180021109108001010000000050200026240001925533591600000105338153381533815338153381
80024533804000000000006180000479462516001016001080010343813001495030005338053380432902562343352800108002016002053380781180021109108001010000000050200015240002815533591600000105338153381533815338153381
80024533804000000000006180000479462516001016001080010343813001495030005338053380432902562343352800108002016002053380781180021109108001010000000050200024240002323533591600000105338153381533815338153381
800245338039900000000053680000479464416001016001080010343813000495030005338053380432902707343352800108002016002053380781180021109108001010000003050200026240003227533591600000105338153381533815338153381
800245338040000000000061800004794610616001016001080010343813000495030005338053380432902562343352800108002016002053380781180021109108001010000000050200028240002727533591600000105338153381533815338153381
80024533803990000000006180000479462516001016001080010343813000495030005338053380432902562343352800108002016002053380781180021109108001010000100050200026240001627533591600000105338153381533815338153381