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

Test 1: uops

Code:

  cmp w0, #3, lsl #12
  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)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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
1004369203625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369203625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369203625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369303625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369303625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369303625100010001000500003693692063225100010001000369661110011000373218223661000370370370370370
1004369303625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369203625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370
1004369303625100010001000500003693692063225100010661000369661110011000073218223661000370370370370370
1004369203625100010001000500003693692063225100010001000369661110011000073218223661000370370370370370

Test 2: Latency 2->1

Chain cycles: 1

Code:

  cmp w0, #3, lsl #12
  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)031e3f4d51schedule 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)9facbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204200351500611993025201002010020112129723314916955020035200351742561745620100202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
202042003515001031993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010031111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351500611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036
20204200351506611993025201002010020112129723314916955020035200351742561748720112202242022420035104112020110099100201001010001111318116112001120000101002003620036200362003620036

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)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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200242003515006119918252001020010200101297247049169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
200242003515006119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
2002420035150216119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
2002420035150216119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010601270127111999520000100102003620036200362003620036
200242003515006119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
200242003515006119918252001020010200101297247149169553200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
200242003515006119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
200242003514906119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
2002420035150246119918252001020010200101297247149169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036
200242003515006119918252001020010200101297247049169550200352003517428317504200102002020020200351041120021109102001010010001270127111999520000100102003620036200362003620036

Test 3: throughput

Count: 8

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)09l2 tlb miss instruction (0a)18191e1f3f51schedule 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)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
802042676120100000002827801158011580121400590149236592673926739166796166898012180232802322673966118020110099100801001000003911151180160026736800151002674026740267402674026740
80204267392000000000282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100001011151180160026736800151002674026740267402674026740
80204267392000000028805332780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151180160026736800151002674026740267402674026740
8020426739200000003480282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151200160026736800151002674026740267402674026740
80204267392000000020401352780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151180160026736800151002674026740267402674026740
8020426739200000002220282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151180160026736800151002674026740267402674026740
802042673920000000270282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151180160026736800151002674026740267402674026740
8020426739200000003030282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151180160426736800151002674026740267402674026740
8020426739200000002070282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000011151200160026736800151002674026740267402674026740
8020426739200000003902827801808024480257401259149236592673926739166796166898018980365803042674966318020110099100801001004200111511802660126736803361002701627058270152706126970

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l1i tlb fill (04)mmu table walk data (08)09l2 tlb miss data (0b)18191e1f3f51schedule 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)l1d tlb miss (a1)l1d cache writeback (a8)a9acc2branch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80024267102000000000035258001080010800104000500049236252670526705166653166838001080020800202670566118002110910800101000000005020518532670180000102670626706267062670626706
800242670520000000000402580010800108001040038000492362526705267051666531668380010800208002026705663180021109108001010004100005020318352670180000102670626753267532670626706
8002426705200000000035235258001080010800104000500149236252670526705166653166838001080020800202670566118002110910800101000000005020518352670180000102670626706267062670626706
80024267052000000000035258001080010800104000500049236252670526705166653166838001080020800202670566118002110910800101000100005020518552670180000102670626706267062670626706
800242670520000000000352580010800108001040005000492362526705267051666531668380010800208002026705661180021109108001010001003005020718452670180000102670626706267062670626706
800242670519900000021310835258001080010800104000500049236252670526705166653166838001080020800202670566118002110910800101000100005020318352670180000102670626706267062670626706
80024267052000000000035258001080010800104000500049236252670526705166653166838001080020800202670566118002110910800101000100005020518662670180000102670626706267062670626706
80024267052000000000035258001080010800104000500049236252670526705166833166838001080020800202670566118002110910800101000100015020518352670180000102674326706267062670626706
80024267052000000000035258001080010800104000500049236252670526705166653166838001080020800202670566118002110910800101000000005020518532670180000102670626706267062670626706
80024267052000000000035258001080010800104000500049236252670526705166653166838001080020800202670566118002110910800101000103005020618352670180000102670626706267062670626706