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

Test 1: uops

Code:

  cmp w0, w1
  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)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)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
10043692036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
100436920131251000100010005000136936920632251000100020003696611100110005073118113661000370370370370370
10043693936251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
10043693036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
10043693036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
10043692036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
10043693036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
10043693036251000100010005000136936920632251000100020003696611100110001073118113661000370370370370370
10043692036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370
10043693036251000100010005000136936920632251000100020003696611100110000073118113661000370370370370370

Test 2: Latency 3->1

Chain cycles: 1

Code:

  cmp w0, w1
  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)03mmu table walk instruction (07)l2 tlb miss instruction (0a)1e3a3f4d51schedule 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)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020420035150110268199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314828781999220000101002003620036200362003620036
2020420035150116268199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314928761999220000101002003620036200362003620036
20204200351501121268199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314828781999220000101002003620036200362003620036
20204200351501162148199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314428781999220000101002003620036200362003620036
202042003515011182681992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100000013144289101999220000101002003620036200362003620036
20204200351501102681992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100000013141028781999220000101002003620036200362003620036
202042003515011122681992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100000013148289101999220000101002003620036200362003620036
20204200351501190268199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314828781999220000101002003620036200362003620036
2020420035150110268199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314828781999220000101002003620036200362003620036
2020420035150110268199262520100201002010012971501491695520035200351740631748120100202003020020035104112020110099100201001010000001314828781999220000101002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l2 tlb miss data (0b)181e1f3f4d51schedule 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 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
20024200351500000611991825200102001020010129724701491695520217200351742831755720010200203002020035104112002110910200101001000331270227111999520000100102003620036200362003620036
2002420035150000164611991825200102001020010129724700491695520035200351742831752620010200203002020035104112002110910200101001000001270927221999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724701491695520035200351742831750420010200203002020035104112002110910200101001000001270227211999520000100102003620036200362003620036
200242003515010120611991825200102001020010129724700491695520035200351742831750420010200203002020035104112002110910200101001000101270227211999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724700491695520035200351742831750420010200203002020035104112002110910200101001000001270227211999520000100102003620036200362003620036
20024200351500002607261991825200102001020010129724700491695520035200351742831750420010200203002020035104112002110910200101001000101270127211999520000100102003620036200362003620036
20024200351490000611991725200102001020010129724700491695520035200351742831750420010200203002020035104112002110910200101001000001270127121999520000100102003620036200362003620036
20024200351500030611991825200102001020010129724700491695520035200351742831750420010200203002020035104112002110910200101001000001270227211999520000100102003620036200362003620036
20024200351500000611991825200102001020010129724700491695520035200351742831750420010200203002020035104112002110910200101001000001270127121999520000100102003620036200362003620036
20024200351490000611991825200102001020010129724701491695520035200351742831750420010200203002020035104112002110910200101001000001270227211999520000100102003620036200362003620036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  cmp w0, w1
  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)03l2 tlb miss data (0b)0e1e3f4d51schedule 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)acc2cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204200351500266611992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
2020420035150003611992625201002010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
2020420035150000611992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
20204200351500018611992625201232010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
2020420035150000611992625201002010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
2020420035150000611992625201002010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
202042003515000061199262520100201002010012971500491695520035200351740631748120100202003020020035104112020110099100201001010000141013101228221999220000101002003620036200362003620036
2020420035150000611992625201002010020100129715014916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
2020420035150000611992625201002010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036
2020420035150000931992625201002010020100129715004916955200352003517406317481201002020030200200351041120201100991002010010100000013101228221999220000101002003620036200362003620036

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)9fl1d tlb access (a0)ld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001270227121999520000100102003620036200362003620036
20024200351503661199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001270127121999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001270227111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001287127211999520000100102003620036200362003620036
2002420035150061199182520010200332001012972471491695520035200351742831750420010200203002020035104112002110910200101001000061270127211999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001270127121999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000031270127111999520000100102003620036200362003620036
20024200351500611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001010010025331270127111999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200203002020035104112002110910200101001000001270127111999520000100102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  cmp w0, w1
  cmp w0, w1
  cmp w0, w1
  cmp w0, w1
  cmp w0, w1
  cmp w0, w1
  cmp w0, w1
  cmp w0, w1
  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)03l2 tlb miss data (0b)18191e3f51schedule 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)91inst branch cond (94)inst int alu (97)9fl1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8020426772200000035258010080100801004005000492365526735267351667231669080100802001602002673566118020110099010080100100320351102191126731800001002673626736267362673626736
802042673520000003525801008010080100400500149236552673526735166723166908010080200160200267356611802011009901008010010000051101191126731800001002673626736267362673626736
802042673520000003525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010000051101191126731800001002673626736267362673626736
802042673520000003525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010000051101191126731800001002673626736267362673626736
802042673520000003525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010010651101191126731800001002673626736267362673626736
802042673520000103525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010010351101191126731800001002673626736267362673626736
802042673520000003525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010010051101191126731800001002673626736267362673626736
802042673520000003525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010020051101191126731800001002673626736267362673626736
802042673520000003525801008010080100400500049236552673526735166723166908010080200160200267356611802011009901008010010000351101191126731800001002673626736267362673626736
80204267352000000352580100801008010040050004923655267352673516672316690801008020016020026735661180201100990100801001000046351101191126731800001002673626736267362673626736

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e3f51schedule 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)l1d cache writeback (a8)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
800242672219900352580010800108001040005014923625267052670516665316683800108002016002026705661180021109108001010005020518752670180000102670626706267072670626706
800242670520000352580010800108001240005014923625267052670516665316683800108002016002026705661180021109108001010005020518752670180000102670626706267062670626706
800242670520000352580010800108001040005014923626267062670516665316683800108002016002026705661180021109108001010005020718752670180000102670626706267062670626706
800242670520000352580010800108001040005014923625267052670516665316683800108002016002026705661180021109108001010005020718572670180000102670626707267062670626706
800242670520000352580010800108001040005014923625267062670616665316683800108002016002026705661180021109108001010015020718572670180000102670626706267062670626706
800242670520000352580010800108001040005014923625267052670516665316702800108002016002026705661180021109108001010005020518772670180000102670626706267062670626706
800242670520000352580010800108001240005014923625267052670516665316683800108002016002026705661180021109108001010005020718752670180000102670626706267062670626706
8002426705200002252580010800108001040005014923625267052670516665316683800108002016002026705661180021109108001010005020718752670180000102670626706267062670626706
800242670519900352580010800108001040005014923625267052670516665316683800108002016002026705661180021109108001010005020718752670180000102670626706267062670626706
800242670520000352580012800128001240005014923625267052670516665316683800108002016002026705661180021109108001010005020518752670180000102670626706267062670626706