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

Test 1: uops

Code:

  adds w0, w0, w1, sxtw
  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)03191e3f4d51schedule 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 miss (a1)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10041035800619172510001000100062250103510358053882100010002000103540111001100000073327449931000100010361036103610361036
10041035800619172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036
10041035803619172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036
10041035800619172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036
100410357001039172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036
10041035800619172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036
10041035800619172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036
10041035800619172510001000100062250103510358053882100010002000103540111001100000073427439931000100010361036103610361036
10041035800619172510001000100062250103510358053882100010002000103540111001100005073427449931000100010361036103610361036
10041035700619172510001000100062250103510358053882100010002000103540111001100000073427449931000100010361036103610361036

Test 2: Latency 1->2

Code:

  adds w0, w0, w1, sxtw
  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 cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020410035750619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010003971022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750441992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152149695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010004571022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036

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)9fl1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101005164022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010101364022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036

Test 3: Latency 1->3

Code:

  adds w0, w1, w0, sxtw
  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)03l2 tlb miss data (0b)181e3f4d51schedule 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)acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
102041003575000619927251010010100101106472124969551003510082867388736101101022420248100354011102011009910010100100030111720016001001310000101001003610036100361003610036
1020410035750001039927251010010100101106472124969551003510035867388735101101022420248100354011102011009910010100100100111720016001001310024101001003610036100361003610036
10204100357500061992725101001010010100647152496955100351003586563873210100102002039010035401110201100991001010010000000071012711999510042101001003610036100361003610036
10204100357500061992025101001010010100647152496955100351003586563873210100102002020010035401110201100991001010010003000071012711999510000101001003610036100361003610036
102041003575002461992025101381014610100647152497002100351003586563873210100102002020010083401110201100991001010010003000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152496955100351003586563873210100102002020010035401110201100991001010010000000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152496955100351003586563873210100102002020010035401110201100991001010010000000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152496955100351003586563873210100102002020010035401110201100991001010010000000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152496955100351003586563873210100102002020010035401110201100991001010010006000071012711999510000101001003610036100361003610036
102041003575000619920251010010100101006471524969551003510035865638732101001020020392100354011102011009910010100100036000071012722999510000101001003610036100811008610083

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)9fl1d cache writeback (a8)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1002410035750619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010015064052767999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064062777999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101009064062757999710000100101003610036100361003610036
100241003576061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064062777999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064072776999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064062767999710000100101003610036100361003610036
1002410035759061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064072767999710000100101003610036100361003610036
1002410035760126991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101009064062766999710000100101003610036100361003610036
100241003575061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064072777999710000100101003610036100361003610036
100241003575061991825100101001010010647246049695510035100358678387541001010020200201003540111002110910100101003064072775999710000100101003610036100361003610036

Test 4: Latency 4->2

Chain cycles: 1

Code:

  adds w0, w1, w2, sxtw
  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)033f4d51schedule 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)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515061199302520100201002011212972331491695520035200351742571748620112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
202042003515061199302520100201002011212972331491695520035200351742571748620112202243023620035641120201100991002010010100031111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972331491695520035200351742581748520112202243023620035641120201100991002010010100101111319162001220000201002003620036200812003620036
202042003515061199302520100201002011212972331491695520035200351742581748620112202243023620035641120201100991002010010100101111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972331491695520035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
20204200351506119930252010020100201121297233149169552003520035174258174852011220224302362003564112020110099100201001010001321111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972331491695520035200351742581748620112202243023620035641120201100991002010010100401111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972331491695520035200351742571748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972331491695520035200351742571748520112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
2020420035150537199302520100201002011212972331491695520035200351742571748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036

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)191e3a3f4d51schedule 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)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2002420035150000006119918252001020010200101297247149169552003520035174283175042001020020300202003564112002110910200101001002510801270227221999520000200102003620036200362003620036
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001006001270227221999520000200102003620036200362003620036
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001005001270227221999520000200102003620036200362003620036
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001003001270227221999520000200102003620036200362003620066
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001000001270227221999520000200102003620036200362003620036
20024200351500000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010003601270227221999520000200102003620036200362003620036
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001003001270227231999520000200102003620036200362003620036
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001000601270227221999520000200102003620036200362003620036
200242012515000000611991825200102001020010129724704916955200352003517428317504200102002030020200356411200211091020010100100435701270227231999520000200102003620036200362003620036
2002420035150000006119918252001020010200101297247049169552003520035174283175042001020020300202003564112002110910200101001000001270227221999520000200102003620036200362003620036

Test 5: Latency 4->3

Chain cycles: 1

Code:

  adds w0, w1, w2, sxtw
  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)033f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6b6d6emap 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)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515082199302520100201002011212972334916955020035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
2020420035150191199302520100201002011212972334916955020035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515084199302520100201002011212972334916955020035200351742571748520112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
2020420035150126199302520100201002011212972334916955020035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972334916955020035200351742571748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
2020420035150149199302520100201172011212972334916955020035200351742581748520112202243023620035641120201100991002010010100201111319162001220000201002003620036200362003620036
202042003515061199302520100201002011212972334916955020035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
2020420035150170199302520100201002011212972334916955020035200351742571748620112202243023620035641120201100991002010010100091111320162001220000201002003620036200362003620036
2020420035149126199302520100201002011212972334916955020035200351742571748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
2020420035150189199302520100201002011212972334916955020035200351742571748520112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036

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)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)9faccfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dbddfetch restart (de)e0? int output thing (e9)eaeb? int retires (ef)f5f6f7f8fd
20024200351500611991825200102001020010129724701491695520035200351742831750420010200203002020035641120021109102001010010012700001270011199952000000200102003620036200362003620036
20024200351500611991825200102001020010129724701491695520035200351742831750420010200203002020035641120021109102001010010012700001270011199952000000200102003620036200362003620036
2002420035150061199182520010200102001012972470149169552003520035174283175042001020020300202003564112002110910200101001001270000127001119995200001512200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200203002020035641120021109102001010010012700001270012199952000000200102003620036200362003620036
20024200351490611991825200102001020010129724700491695520035200351742831750420010200203002020035641120021109102001010010012700001270011199952000000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200203002020035641120021109102001010010012700001270021199952000000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200203002020035641120021109102001010010012700001270011199952000000200102003620036200362003620036
20024200351500611991825200102001020010129724701491695520035200351742831750420010200203002020035641120021109102001010010012700001270011199952000000200102003620036200362003620036
200242003515006119918252001020010200101297247004916955200352003517428317504200102002030020200356411200211091020010100100127231122700111999520000150200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200203002020035641120021109102001010010012700001270011199952000000200102003620036200362003620036

Test 6: throughput

Count: 8

Code:

  adds w0, w8, w9, sxtw
  adds w1, w8, w9, sxtw
  adds w2, w8, w9, sxtw
  adds w3, w8, w9, sxtw
  adds w4, w8, w9, sxtw
  adds w5, w8, w9, sxtw
  adds w6, w8, w9, sxtw
  adds w7, w8, w9, sxtw
  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)03mmu table walk data (08)181e3f5051schedule 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)st unit uop (a7)l1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8020426762200000350258010080100801004005001492365526735267351667203166908010080200160200267353911802011009910080100100000005110119132673180000801002673626736267362673626736
80204267352000003526719258010080100801004005000492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005000492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005001492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005000492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005000492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005001492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005001492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005001492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
8020426735200000350258010080100801004005001492365526735267351667203166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)031e3f51schedule 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)accdcfd2l1i cache miss demand (d3)d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eb? int retires (ef)f5f6f7f8fd
800242672020003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201702418142326702800000800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201302418222026702800000800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201212518232226702800000800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201402418122426702800000800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201302318232326702800000800102670626706267062670626706
8002426705200035258001080010800104000504923625267052670516665316683800108002016002026705391180021109108001010000502013122182319267028000012800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201212518142326702800000800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201312318232326702800000800102670626706267062670626706
800242675120003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000050201402318132226702800000800102670626706267062670626706
800242670520003525800108001080010400050492362526705267051666531668380010800201600202670539118002110910800101000150201201718231426702800000800102670626706267062670626706