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

Test 1: uops

Code:

  cmp x0, x1
  mov x0, 1
  mov x1, 2

(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)033f51schedule 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)l1d cache writeback (a8)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
100436923625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436923625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436933625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436933625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436933625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436923625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436933625100010001000500036936920632251000100020003696611100110000173118113661000370370370370370
100436933625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436923625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370
100436933625100010001000500036936920632251000100020003696611100110000073118113661000370370370370370

Test 2: Latency 3->1

Chain cycles: 1

Code:

  cmp x0, x1
  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): 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)9fl1d tlb access (a0)l1d cache writeback (a8)accfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515001561992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100041513100328331999220000101002003620036200362003620036
20204200351500611992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100039013101328331999220000101002003620036200362003620036
2020420035150061199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000013101328331999220000101002003620036200362003620036
2020420035150061199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010001013101328331999220000101002003620036200362003620036
20204200351500611992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100010013101328331999220000101002003620036200362003620036
20204200351500726199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010001313101328331999220000101002003620036200362003620036
2020420035150061199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000013101328331999220000101002003620036200362003620036
20204200351500611992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100051213101328331999220000101002003620036200362003620036
2020420035150061199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000013101328331999220000101002003620036200362003620036
2020420035150061199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000313101328331999220000101002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l1i tlb fill (04)091e3f4d51schedule 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
2002420035150120611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270727221999520000100102003620036200362003620036
2002420035150000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010061270227221999520000100102003620036200362003620036
2002420035150000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270327221999520000100102003620036200362003620036
2002420035150000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270227221999520000100102003620036200362003620036
2002420035150000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270227221999520000100102003620036200362003620036
200242003514900091219918252001020010200101297247149169552003520035174283175042001020020300202003510411200211091020010100102201270227221999520000100102003620036200362003620036
20024200351500005361991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270227221999520000100102003620036200362003620036
20024200351500021611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270227221999520000100102003620036200362003620036
2002420035150000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270227321999520000100102003620036200362003620036
2002420035150000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001270227221999520000100102003620036200362003620036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  cmp x0, x1
  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): 1.0035

retire uop (01)cycle (02)03mmu table walk data (08)191e3f4d51schedule 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)acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515000061199302520100201002011212972330491695520035200351742561748720112202243023620035104112020110099100201001010000011113180116112001120000101002003620036200362003620036
202042003515000061199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520035200351740631748120100202003020020035104112020110099100201001010000000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520035200351740631748120100202003020020035104112020110099100201001010000000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520035200351740631748120100202003020020035104112020110099100201001010000000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520035200351740631748120100202003020020035104112020110099100201001010003000013101228221999220000101002003620036200362003620036
2020420035150000441199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010033000013101228221999220000101002003620036200362003620036
2020420035150000611992625201002010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100160000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520066200351740631748120100202003020020035104112020110099100201001010010000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520035200351740631748120100202003020020035104112020110099100201001010020000013101228221999220000101002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)0318191e1f3f4d51schedule 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 miss (a1)ld unit uop (a6)l1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351500000611991825200102001020010129724704916955200352003517428317504200102014430020200351041120021109102001010010000001270227111999520000100102008220036200362003620036
20024200351501115688611991846200322003320094129512304916955200352003517428717530200942011030020200351041120021109102001010010000001287127111999520000100102003620036200362003620036
20024200351500090611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010000001270227211999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001010010000001270127211999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010000001270127111999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001010010000001270127121999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010000001270127121999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001010010000001270127121999520000100102003620036200362003620036
200242003514900005431991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010001001270227111999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010000001270227111999520000100102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  cmp x0, x1
  cmp x0, x1
  cmp x0, x1
  cmp x0, x1
  cmp x0, x1
  cmp x0, x1
  cmp x0, x1
  cmp x0, x1
  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.3342

retire uop (01)cycle (02)03191e3f51schedule 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)9fld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204267712000077258010080100801004005001492365526735267351667203166908010080200160200267356611802011009910080100100001551105191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010001051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010023651101191126731800001002673626736267362673626736
8020426735200103525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010001051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010004051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010002051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010003051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010020051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010004051101191126731800001002673626736267362673626736
8020426735200003525801008010080100400500149236552673526735166720316690801008020016020026735661180201100991008010010001051101191126773800001002673626736267362673626736

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)09l2 tlb miss data (0b)18191e1f3a3f51schedule 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)st unit uop (a7)l1d cache writeback (a8)acc2cdcfd0d2d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8002426721200000000031232580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000023112580010800108001040005010492362526705267051666531670280010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
800242670520000000002772580010800108001040005000492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000021002580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
80024267052000000000423752580073800128001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000021232580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000021002580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000021192580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000021402580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706
8002426705200000000021232580010800108001040005010492362526705267051666531668380010800201600202670566118002110910800101000000000502000118112670180000102670626706267062670626706