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

SUBS (immediate, 64-bit)

Test 1: uops

Code:

  subs x0, x0, #3
  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)03mmu table walk instruction (07)l2 tlb miss instruction (0a)18191e3a3f4d51schedule 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
100410357110021268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225001035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225001035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225001035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035811000268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036
100410358110078268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036
10041035711000268917251000100010006225011035103580538821000100010001035401110011000077427449931000100010361036103610361036

Test 2: Latency 1->2

Code:

  subs x0, x0, #3
  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)031e1f3f4d51schedule 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
102041003575150619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
102041003575120619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
102041003575001249920251010010100101006471520496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
102041003575330619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
1020410035752340619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
102041003575780619920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010000071012711999510000101001003610036100361003610036
102041003575001039920251010010100101006471521496955100351003586563873210100102001020010035401110201100991001010010003071012711999510000101001003610036100361003610036
1020410035752400619920251010010100101006471520496955100351003586683873210100102001020010035401110201100991001010010000271012711999510000101001003610036100361003610082

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03181e3f4d51schedule 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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1002410035750061991825100101001010175647246496955100351003586783875410010100201002010035401110021109101001010064042722999710000100101003610036100361003610036
1002410035750061991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010064022722999710000100101003610036100361003610036
1002410035760061991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010064022722999710000100101003610036100361003610036
1002410035750061991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010164022722999710000100101003610036100361003610070
10024100357506274991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010164022722999710000100101003610036100361003610036
100241003575116261991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010064022722999710000100101003610036100361003610036
1002410035760061991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010164022722999710000100101003610036100361003610036
1002410035750061991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010064022722999710000100101003610036100361003610036
1002410035750061991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010064022722999710000100101003610036100361003610036
10024100357500536991825100101001010010647246496955100351003586783875410010100201002010035401110021109101001010064022722999710000100101003610036100361003610036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  subs x0, x1, #3
  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)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)9facbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020420035150006119930252010020100201121297233491695520035200351742581748620112202242022420035641120201100991002010010100011113201162001220000201002003620036200362003620036
2020420035150606119930252010020100201121297233491695520035200351742571748620112202242022420035641120201100991002010010100011113190162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233491695520035200351742581748620112202242022420035641120201100991002010010100011113200162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233491695520035200351742581748620112202242022420035641120201100991002010010100011113190162001220000201002003620036200362003620036
2020420035150906119930252010020100201121297233491695520035200351742571748620112202242022420035641120201100991002010010100011113190162001220000201002003620036200362003620036
20204200351503306119930252010020100201121297233491695520035200351742571748520112202242022420035641120201100991002010010100011113200162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233491695520035200351742571748620112202242022420035641120201100991002010010100011113200162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972334916955200352003517425717485201122022420224200351401120201100991002010010100011113200162001220000201002003620036200362003620036
2020420035150906119930252010020100201121297233491695520035200351742581748520112202242022420035641120201100991002010010100011113190162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233491695520035200351742581748520112202242022420035641120201100991002010010100011113200162001220000201002003620036200362003620036

1000 unrolls and 10 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)181e3a3f4d51schedule 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)9fst unit uop (a7)l1d cache writeback (a8)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351501101471681991825200102001020010129724714916955200352003517428317504200102002020020200356411200211091020010100101812719278101999520000200102003620036200362003620036
200242003515011001681991825200102001020010129724714916955200352003517428317504200102002020020200356411200211091020010100100012711027881999520000200102003620036200362003620036
20024200351501100168199182520010200102001012972471491695520035200351742831750420010200202002020035641120021109102001010010001271112711111999520000200102003620036200362003620036
20024200351501100168199182520010200102001012972471491695520035200351742831750420010200202002020035641120021109102001010010001271927791999520000200102003620036200362003620036
20024200351501100168199182520010200102001012972471491695520035200351742831750420010200202002020035641120021109102001010010001271102710111999520000200102003620036200362003620036
200242003515011101681991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100012719271091999520000200102003620036200362003620036
200242003514911001681991825200102001020010129724714916955200352003517428317504200102002020020200356411200211091020010100100012711027991999520000200102003620036200362003620036
2002420035150110016819918252001020010200101297247049169552003520035174283175042001020020200202003564112002110910200101001000127110276101999520000200102003620036200362003620036
20024200351501100168199182520010200102001012972470491695520035200351742831750420010200202002020035641120021109102001010010001271827991999520000200102003620036200362003620036
200242003515011001407199182520010200102001012972471491695520035200351742831750420010200202002020035641120021109102001010010001271927991999520000200102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  subs x0, x8, #3
  subs x1, x8, #3
  subs x2, x8, #3
  subs x3, x8, #3
  subs x4, x8, #3
  subs x5, x8, #3
  subs x6, x8, #3
  subs x7, x8, #3
  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)031e3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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)9fc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204267632000352580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
80204267352000352580100801008010040050014923655026735267351667231669080100802008020026735391180201100991008010010005120119112673180000801002673626736267362673626736
80204267352000352580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
802042673520007002580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
802042673520097002580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
802042673520003525801008010080100400500049236550267352673516672161669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
80204267352000352580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
80204267352010352580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
80204267352000352580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736
80204267352010352580100801008010040050004923655026735267351667231669080100802008020026735391180201100991008010010005110119112673180000801002673626736267362673626736

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)0318191e3f51schedule 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)9fl1d cache writeback (a8)acc2branch mispred nonspec (cb)cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0? int output thing (e9)eaeb? int retires (ef)f5f6f7f8fd
800242671220000123525800108001080010400050149236252670526705166650316683800108002080020267053911800211091080010100000502000024180002324267028000000800102670626706267062670626706
8002426705200001533525800108001080010400050149236252670526705166650316683800108002080020267053911800211091080010100000502000023180002222267028000000800102670626706267062670626706
800242670520000035258001080010800104000501492362526705267051666503166838001080020800202670539118002110910800101000005020000121800025212670280000168800102670626706267062670626706
80024267051990003525800108001080010400050149236252670526705166650316683800108002080020267053911800211091080010100000502000011180102419267028000000800102670626706267062670626706
800242670520000035258001080010800104000501492362526705267051666503166838001080020800202670539118002110910800101000005020000261800020222670280000168800102670626706267062670626706
800242670519900035258001080010800104000501492362526705267051666503166838001080020800202670539118002110910800101020005020000251800014252670280000168800102670626706267062670626706
800242670520001123525800108001080010400050149236252670526705166650316683800108002080020267053911800211091080010100000502000014180002520267028000000800102670626706267062670626706
80024267052000003525800108001080010400050049236252670526705166650316683800108002080020267053911800211091080010100000502001024180002626267028000000800102670626706267062670626706
80024267052000063525800108001080010400050149236252670526705166650316683800108002080020267053911800211091080010100000502000025180002525267028000000800102670626706267062670626706
80024267052000003525800108001080010400050149236252670526705166650316683800108002080020267053911800211091080010100000502000025180002424267028000000800102670626706267062670626706