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

Test 1: uops

Code:

  cmp x0, #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)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)accfd5map dispatch bubble (d6)ddfetch restart (de)dfe0? int output thing (e9)f5f6f7f8fd
10043693036251000100010005000369369206322510001000100036966111001100018752181123661000370370370370370
1004369303625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369203625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369393625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
10043692123625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369303625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369333625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369203625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369303625100010001000500036936920632251000100010003696611100110000751181123661000370370370370370
1004369333625100010001000500036936920632251000100010003696621100110000751181123661000370370370370370

Test 2: Latency 2->1

Chain cycles: 1

Code:

  cmp x0, #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)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 cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204200351501206119930252010020100201121297233149169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
20204200351501806119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120023101002003620036200362003620036
20204200351502706119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
2020420035150006119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
20204200351503306119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116212001120000101002003620036200362003620036
20204200351506006119930252010020100201121297233049169552003520035174256174872019420224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
202042003515021906119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
20204200351501806119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
2020420035150006119930252010020100201121297233049169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036
202042003515018015619930252010020100201121297233149169552003520035174256174872011220224202242003510411202011009910020100101000011113180116112001120000101002003620036200362003620036

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 cache writeback (a8)acbranch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200242003515006119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100106301270427331999520000100102003620036200362003620036
200242003515008219918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100100001270227231999520000100102003620036200362003620036
2002420035150061199182520010200102001012972471491695520035200351742831750420010200202002020035104112002110910200101001048401270327231999520000100102003620036200362003620036
2002420035150044119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100101001270227231999520000100102003620036200362003620036
200242003514906119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100101001270327331999520000100102003620036200362003620036
200242003515006119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100100301270227231999520000100102003620036200362003620036
200242003514906119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100100011270327331999520000100102003620036200362003620036
200242003515006119918312001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100100001270327341999520000100102003620036200362003620036
200242003514906119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100100001270327431999520000100102003620036200362003620036
200242003515006119918252001020010200101297247149169552003520035174283175042001020020200202003510411200211091020010100101001270327331999520000100102003620036200362003620036

Test 3: throughput

Count: 8

Code:

  cmp x0, #3, lsl #12
  cmp x0, #3, lsl #12
  cmp x0, #3, lsl #12
  cmp x0, #3, lsl #12
  cmp x0, #3, lsl #12
  cmp x0, #3, lsl #12
  cmp x0, #3, lsl #12
  cmp x0, #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.3343

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)18191e1f3a3f51schedule 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)a9acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
802042676120000000049500282780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000000011151184164426736800151002674026740267402674026740
80204267392010000000002492780115801158012140059014923659267392673916679616689801218023280232267396611802011009910080100100000000011151184164226736800151002674026740267402674026740
802042673920000000027900282780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151183164326736800151002674026740267402674026740
802042673920000000014700282780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151183163326736800151002674026740267402674026740
802042673920000000020700282780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151183163226736800151002674026740267402674026740
80204267392000000003600282780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151183162226736800151002674026740267402674026740
80204267392000000000001812780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151184162326736800151002674026740267402674026740
80204267392000000008700282780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151183163226736800151002674026740267402674026740
802042673920100000024300282780115801158012140059004923659267392673916679616689801218023280232267396611802011009910080100100000000011151183163326736800151002674026740267402674026740
802042673920000000033900643380115801158012140059004923670267512675016676916686801218023080230267506611802011009910080100100000000022251284254526747800151002675126752267512675126751

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)mmu table walk data (08)l2 tlb miss instruction (0a)1e1f3a3f51schedule 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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8002426721200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024181814162670180000102670626706267062670626706
8002426705200101002422580010800108001040005004923625267052670516665316683800108002080020267056611800211091080010100305024121814152670180000102670626706267062670626706
8002426705200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024101717182670180000102670626706267062670626706
8002426705200101002134125800108001080010400050149236252670526705166653166838001080020800202670566118002110910800101000050248189152670180000102670626706267062670626706
8002426705200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024161815172670180000102670626706267062670626706
8002426705200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024161815152670180000102670626706267062670626706
8002426705200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024141814162670180000102670626706267062670626706
8002426705200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024161815172670180000102670626706267062670626706
8002426705200101002422580010800108001040005004923625267052670516665316683800108002080020267056611800211091080010100005024181814162670180000102670626706267062670626706
8002426705200101002422580010800108001040005014923625267052670516665316683800108002080020267056611800211091080010100005024151814162670180000102670626706267062670626706