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

ADDS (register, 32-bit)

Test 1: uops

Code:

  adds w0, 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)031e3f4d51schedule 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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100410358061917251000102210006225001035103580538821000100020001035401110011000073227119931000100010361036103610361036
100410358061917251000100010006225001035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410358361917251000100010006225001035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410357061917251000100010006225001035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410358061917251000100010006225011035103580538821000100020001035401110011000073135229931000100010361036103610361036
100410358061917251000100010006225011035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410357061917251000100010006225001035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410358061917251000100010006225011035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410357061917251000100010006225001035103580538821000100020001035401110011000073127119931000100010361036103610361036
100410358061917251000100010006225001035103580538821000100020001035401110011000073127119931000100010361036103610361036

Test 2: Latency 1->2

Code:

  adds w0, w0, w1
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 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)9fcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)ea? int retires (ef)f5f6f7f8fd
10204100357506199202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100003101001003610036100361003610036
102041003575010399202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001007210036100361003610036
10204100357508299202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
10204100357506199202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
10204100357506199202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
10204100357508299202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
1020410035752616199202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
10204100357506199202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
10204100357506199202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036
10204100357508299202510100101001010064715214969551003510035865638732101001020020200100354011102011009910010100100710127119995100000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 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)9faccfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003575211409918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
10024100357578619918251001010010100106472461496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
100241003575222619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
10024100357581619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
10024100357504279918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
1002410035750619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361008310036
100241003575264619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
10024100357502489918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036
100241003575327619918251001010010100106472460496955100711003586783875410010100202002010035401110021109101001010364022722999710000100101003610036100361003610036
10024100357554619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064022722999710000100101003610036100361003610036

Test 3: Latency 1->3

Code:

  adds w0, w1, w0
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020410035762161992025101001010010100647152149695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357524061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
1020410035750577992025101001010010100647152149695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357533361992025101001010010100647152149695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
102041003576061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
1020410035750551992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357524361992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071012711999510000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 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)9fcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003575061991825100101001010010647246049695510035100358678387541001010020200201003540111002110910100101064042734999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101064042744999710000100101003610036100361003610036
100241003575061991825100101001010010647246049695510035100358678387541001010020200201003540111002110910100101064032744999710000100101003610036100361003610036
100241003575061991825100101001010010647246049695510035100358678387541001010020200201003540111002110910100101064042743999710000100101003610036100361003610036
100241003575661991825100101001010010647246049695510035100358678387541001010020200201003540111002110910100101064032744999710000100101003610036100361003610036
1002410035750107991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101064042743999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101064042734999710000100101003610036100361003610036
100241003575361991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101064032734999710000100101008310036100361003610036
10024100357618361991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101064042734999710000100101003610036100361003610036
1002410035751261991825100101001010010647246049695510035100358678387541001010020200201003540111002110910100101064042743999710000100101003610036100361003610036

Test 4: Latency 4->2

Chain cycles: 1

Code:

  adds w0, w1, w2
  cset x1, cc
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(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)1e1f3f4d51schedule 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)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
202042003515011006119930252010020100201121297233049169552003520035174258174852011220224302362003564112020110099100201001010001111319116112001520000201002003620036200362003620036
20204200351501116206119930252010020100201121297233049169552003520035174258174862011220224302362003564112020110099100201001010001111319116112001520000201002003620036200362003620036
202042003515011006119930252010020100201121297233049169552003520035174257174862011220224302362003564112020110099100201001010001111320116112001520000201002003620036200362003620036
20204200351501117406119930252010020100201121297233049169552003520035174257174852011220224302362003564112020110099100201001010001111319116112001520000201002003620036200362003620036
20205200351501147106119930252010020100201121297233049169552003520035174257174862011220224302362003564112020110099100201001010001111319116112001520000201002003620036200362003620036
2020420035150111206119930252010020100201121297233149169552003520035174258174862011220224302362003564112020110099100201001010001111319116112001520000201002003620036200362003620036
202042003515011006119930252010020100201121297233049169552003520035174258174852011220224302362003564112020110099100201001010001111320116112001520000201002003620036200362003620036
20204200351501100386619930252010020100201121297233149169552003520035174258174852011220224302362003564112020110099100201001010001111320116112001520000201002003620036200362003620036
2020420035149113010319930252010020100201121297233049169552003520035174258174862011220224302362003564112020110099100201001010001111338116112001520000201002003620036200362003620036
202042003515011006119930252010020100201121297233049169552003520035174258174852011220224302362003564112020110099100201001010001111319116112001520000201002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03191e1f3f4d51schedule 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)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200242003515000061199182520010200102001012972471491695520035200351742831750420010200203002020035641120021109102001010010000001270227221999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270227221999520000200102003620036200362003620036
2002420035150018061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270327221999520000200102003620036200362003620036
200242003515000061199182520010200102001012972471491695520035200351742831750420010200203002020035641120021109102001010010000001270227221999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010001001270227221999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270227221999520000200102003620036200362003620036
2002420035150021061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270227231999520000200102003620036200362003620065
2002420035150024061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270227221999520000200102003620036200362003620036
2002420035150024061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270227221999520000200102003620036200362003620036
20024200351500335261199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000061270227221999520000200102003620036200362003620036

Test 5: Latency 4->3

Chain cycles: 1

Code:

  adds w0, w1, w2
  cset x2, cc
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(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)031e1f3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6d6emap 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)branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515090611993025201002010020112129723349169552003520035174257174862011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036
202042003515000611993025201002010020112129723349169552003520035174257174862011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036
2020420035150210611993025201002010020112129723349169552003520035174258174852011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
2020420035150240611993025201002010020112129723349169552003520035174257174862011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
2020420035149180611993025201002010020112129723349169552003520035174257174862011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
20204200351504620611993025201002010020112129723349169552003520035174258174852011220224302362003564112020110099100201001010021111320162001220000201002003620036200362003620036
202042003515000821993025201002010020112129723349169552003520035174257174862011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
202042003515030611993025201002010020112129723349169552003520035174258174852011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036
2020420035150180611993025201002010020112129723349169552003520035174257174852011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
2020420035150180611993025201002010020112129723349169552003520035174258174852011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)18191e1f3a3f4d51schedule 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)st unit uop (a7)l1d cache writeback (a8)a9acc2cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351500000600611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000004500611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000060001270127112004520000200102003620036200362003620036
200242003515000001500611991825200102001020010129724704916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000001200611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
20024200351500000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
20024200351500000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000001200611991825200102001020010129724704916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
2002420035150000038700611991825200102001020010129724704916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
2002420035150000030600611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000002100611991825200102001020010129724704916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036

Test 6: throughput

Count: 8

Code:

  adds w0, w8, w9
  adds w1, w8, w9
  adds w2, w8, w9
  adds w3, w8, w9
  adds w4, w8, w9
  adds w5, w8, w9
  adds w6, w8, w9
  adds w7, w8, w9
  mov x8, 9
  mov x9, 10
  mov x10, 11

(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)03l1i tlb fill (04)l2 tlb miss data (0b)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 cache writeback (a8)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204267632000000120352580100801008010040050004923655268752673516672316690801008020016020026735391180201100991008010010005110519612673180259801002687426736267362673626736
802042682720100031204152580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
802042673520000001207422580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735201000060772580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735200000000352580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735200000000352580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735200000000352580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735200000060352580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735201000000352580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736
8020426735200000000352580100801008010040050004923655267352673516672316690801008020016020026735391180201100991008010010005110119112673180000801002673626736267362673626736

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)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)9fld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80024267112000035258001080010800104000500492362526705267051666531668380010800201600202670539118002110910800101000575020418242670280000800102670626706267062670626706
8002426705200003525800108001080010400050049236252670526705166653166838001080020160020267053911800211091080010100005020218422670280000800102670626706267062670626706
80024267052000035258001080010800104000500492362526705267051666531668380010800201600202670539118002110910800101000605020418422670280000800102670626706267062670626706
80024267052000035258001080010800104000500492362526705267051666531670980075800201600202670539118002110910800101000605020418422670280000800102670626706267062670626706
80024267051990035258001080010800104000500492362526705267051666531668380010800201600202670539118002110910800101000185020218242670280000800102670626706267062670626706
80024267052000035258001080010800104000500492362526705267051666531668380010800201600202670539118002110910800101000545020418242670280000800102670626706267062670626706
800242670520700352580010800108001040005004923625267052670516665316683800108002016002026705391180021109108001010001325020418422670280000800102670626706267062670626706
80024267052000056258001080010800104000500492362526705267051666531668380010800201600202670539118002110910800101000515020218442670280000800102670626706267062670626706
800242670520010700258001080010800104000500492362526705267051667731668380010800201600202670539118002110910800101000545020218242670280000800102670626706267062670626706
80024267052000035258001080010800104000500492362526705267051666531668380010800201600202670539118002110910800101000845020418242670280000800102670626706267062670626706