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 (immediate, 32-bit)

Test 1: uops

Code:

  cmp w0, #3
  mov x0, 1

(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)031e3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)6d6emap 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)l1d tlb access (a0)ld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
100436930362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436930362510001000100050003693692063225100010001000369661110011000000373118113661000370370370370370
100436930572510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436930362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436920362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
1004369321362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436930362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436930362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436936362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370
100436930362510001000100050003693692063225100010001000369661110011000000073118113661000370370370370370

Test 2: Latency 2->1

Chain cycles: 1

Code:

  cmp w0, #3
  cset x0, cc
  mov x0, 1

(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)031e3a3f4d51schedule 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)l1d cache writeback (a8)acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020420035150014011993025201002010020112129723304916955200352003517425617487201122022420224200351041120201100991002010010100000001111318216112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723304916955200352003517425617487201932022420224200351041120201100991002010010100000001111318116112001120000101002003620036200362003620036
2020420035150004551993025201002010020112129723304916955200352003517425617487201122022420224200351041120201100991002010010100000001111318216112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723314916955200352003517425617487201122022420224200351041120201100991002010010100000001111318116112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723314916955200352003517425617487201122022420224200351041120201100991002010010100000001111318116112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723304916955200352003517425617487201122022420224200351041120201100991002010010100001001111318116112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723314916955200352003517425617487201122022420224200351041120201100991002010010100000001111318116112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723304916955200352003517425617487201122022420224200351042120201100991002010010100000001111318116112001120000101002003620036200362003620036
202042003515000611993025201002010020112129723314916955200352003517425617487201122022420224200351041120201100991002010010100000001111318116112001120000101002003620036200362003620036
2020420035150003401993025201002010020112129723304916955200352003517425617487201122022420224200351041120201100991002010010100000001111318116112001120000101002003620036200362003620036

1000 unrolls and 10 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)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)9fld unit uop (a6)l1d cache writeback (a8)acbranch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2002420035150061199182520010200102001012972471491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200202002020035104112002110910200101001000001270227111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200202002020035104112002110910200101001000001270119111999520000100102003620036200362003620036
2002420035150211160199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
20024200351500536199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
20024200351501861199182520010200102001012972470491695520035200351742831750420010200202002020035104112002110910200101001000001270127111999520000100102003620036200362003620036

Test 3: throughput

Count: 8

Code:

  cmp w0, #3
  cmp w0, #3
  cmp w0, #3
  cmp w0, #3
  cmp w0, #3
  cmp w0, #3
  cmp w0, #3
  cmp w0, #3
  mov x0, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)181e1f3f51schedule 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)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
802042676220100000112278011580115801214005900492365902673926739166796166898012180232802322673966118020110099100801001000000011151181160026736800151002674026740267402674026740
802042673920000030028278011580115801214005900492365902673926739166796166898012180232802322673966118020110099100801001000000011151180160026736800151002674026740267402674026740
80204267392000000028278011580115801214005900492365902673926875166796166898012180232802322673966118020110099100801001000000011151180160026736800151002674026740267402674026752
802042675020100008864338011580115801214005901492367002675126750166769166868012180230802302675066118020110099100801001000000022251281251126747800151002675126751267512675126751
802042675020000090643380115801158012140059014923671026750267511667610166868012180230802302675166118020110099100801001000000022251281251126748800151002675226751267522675226751
802042675120100000131338011580115801214005901492367002675026751166769166868012180230802302675066118020110099100801001000002022251291251126748800151002675126751267512675226752
8020426750201000005013380115801158012140059014923670026751267511667610166868012180230802302675066118020110099100801001000000022251291251126747800151002675126751267512675126751
8020426750201000001063380115801158012140059014923670026750267501667610166868012180230802302675066118020110099100801001000000022251281251126747800151002675126751267512675226751
802042675020100000450338011580115801214005901492367002675126750166769166868012180230802302675066118020110099100801001000000022251281251126747800151002675226752267522675126751
802042675020000000106348011580115801214005901492367002675026750166769166868012180230802302675166118020110099100801001000000022251281251126748800151002675126751267512675226751

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)3f51schedule 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)accfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)ea? int retires (ef)f5f6f7f8fd
8002426710200135258001080010800104000501492362526705267051666531668380010800208002026705661180021109108001010005020051855267018000020102670626706267062670626706
800242670520013525800108001080010400050049236252670526705166653166838001080020800202670566118002110910800101000502003185326701800000102670626706267062670626706
800242670520003525800108001080010400050049236252670526705166653166838001080020800202670566118002110910800101000502003185326701800000102670626706267062670626706
800242670520003525800108001080010400050049236252670526705166653166838001080020800202670566118002110910800101000502005185326701800000102670626706267062670626706
800242670520003525800108001080010400050049236252670526705166653166838001080020800202670566118002110910800101000502004186426701800000102670626706267062670626706
800242670520803525800108001080010400050049236252670526705166653166838001080020800202670566118002110910800101000502003183526701800000102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670566118002110910800101000502005186426701800000102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670566118002110910800101000502003183526701800000102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670566118002110910800101000502005185326701800000102670626706267062670626706
800252670520003525800108001080010400050149236252670526705166653166838001080020800202670566118002110910800101000502005185326701800000102670626706267062670626706