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

Test 1: uops

Code:

  subs w0, w0, #3, lsl #12
  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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10041035706191725100010001000622500103510358053882100010001000103540111001100073227119931000100010361036103610361036
10041035896191725100010001000622500103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035806191725100010001000622500103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035806191725100010001000622500103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035706191725100010001000622501103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035806191725100010001000622501103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035706191725100010001000622500103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035706191725100010001000622501103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035706191725100010001000622501103510358053882100010001000103540111001100073127119931000100010361036103610361036
10041035806191725100010001000622501103510358053882100010001000103540111001100073127119931000100010361036103610361036

Test 2: Latency 1->2

Code:

  subs w0, w0, #3, lsl #12
  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)03181e1f3f4d51schedule 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
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
1020410035750330441992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357500061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
102041003575021061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036
10204100357600061992025101001010010100647152049695510035100358656387321010010200102001003540111020110099100101001000071012711999510000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e3a3f4d51schedule 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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003575000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575030619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003576100619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575030619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610070
100241003575000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241008275000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010101064022723999710000100101003610036100821003610036
100241003575000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575000619918251001010010100106472464969551003510035867838754100101002010020100354011100211091010010100064022722999710000100101003610036100361003610036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  subs w0, w1, #3, lsl #12
  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)03l2 tlb miss data (0b)1e3f4d51schedule 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)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)dde0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204200351500061199302520100201002027712972331491695520035200351742581748620112202242022420035644120201100991002010010100020011113191602001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742581748520112202242022420035641120201100991002010010100000311113191602001220000201002003620036200362003620036
2020420035150028861199272520100201002011212972331491695520035200351742581748620112202242022420035641120201100991002010010100000311113201602001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742581748520112202242022420035641120201100991002010010100000311113191602001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742571748620112202242022420035641120201100991002010010100000311113201602001220000201002003620036200362003620036
202042003515000611993025201002010020112129723314916955200352003517425717486201122022420224200356411202011009910020100101000103011113201602001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742571748620112202242022420035641120201100991002010010100000611113201602001220000201002003620036200362003620036
202042003515000124199302520100201002011212972331491695520035200351742571748620112202242022420035641120201100991002010010100000011113191602001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742571748620112202242022420035641120201100991002010010100000011113191602001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742571748620112202242022420035641120201100991002010010100010311113191602001220000201002003620036200362003620036

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)9fld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2002420035150216119918252001020010200101297247049169552003520035174283175042001020020200202003513911200211091020010100100001270827331999520000200102003620036200362003620077
200242003515001561991825200102001020010129724714916955200352003517428317504200102002020020200356411200211091020010100100001270327331999520000200102003620036200362003620036
20024200351500611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270427231999520000200102003620036200362003620036
200242003515024611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270327321999520000200102003620036200362003620036
20024200351500611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270227331999520000200102003620036200362003620036
20024200351500611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270327231999520000200102003620036200362003620036
200242003515001561991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270227231999520000200102003620036200362003620036
2002420035150225611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270327331999520000200102003620036200362003620036
20024200351500611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270327331999520000200102003620036200362003620036
20024200351500611991825200102001020010129724704916955200352003517428317504200102002020020200356411200211091020010100100001270327341999520000200102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  subs w0, w8, #3, lsl #12
  subs w1, w8, #3, lsl #12
  subs w2, w8, #3, lsl #12
  subs w3, w8, #3, lsl #12
  subs w4, w8, #3, lsl #12
  subs w5, w8, #3, lsl #12
  subs w6, w8, #3, lsl #12
  subs w7, w8, #3, lsl #12
  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)0309l2 tlb miss data (0b)181e1f3f51schedule 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)st unit uop (a7)l1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
802042674620000000352580100801008010040050004923655267352673516672316690801008020080200267353911802011009910080100100001005110319352673180000801002673626736267362673626736
802042673520000060352580100801008010040050014923655267352673516672316690801008020080200267353911802011009910080100100001035110219222673180000801002673626736267362673626736
802042673520000000352580100801008010040050004923655267352673516672316690801008020080200267353911802011009910080100100001035110219222673180000801002673626736267362673626736
802042673520000000352580100801008010040050014923655267352673516672316690801008020080200267353911802011009910080100100001005110319332673180000801002673626736267362673626736
80204267352000000035258010080100801004005001492365526735267351667231669080100802008020026735391180201100991008010010000104535110319322673180000801002673626736267362673626736
8020426735201000204308352580100801008010040050014923655267352673516672316690801008020080200267353911802011009910080100100002005110319332673180000801002673626736267362673626736
802042673520000000352580100801008010040050014923655267352673516672316690801008020080200267353911802011009910080100100001005110219332673180000801002673626736267362673626736
8020426735200000003525801008010080100400500149236552673526735166723166908010080200802002673539118020110099100801001000000425110319332673180000801002673626736267362673626736
8020426735200000003525801008010080100400500149236552673526735166723166908010080200802002673539118020110099100801001000035005110319332673180000801002673626736267362673626736
8020426735200000003525801008010080100400500149236552673526735166723166908010080200802002673539118020110099100801001000000545110219232673180000801002673626736267362673626736

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)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)cfd5map dispatch bubble (d6)d9ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80024267202002118225800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050233180322670280000800102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050203180332670280000800102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050203180332670280000800102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050202180232670280000800102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101010050202182232670280000800102670626706267062670626706
800242670520003525800108001080010400050049236252670526705166653166838001080020800202670539118002110910800101000050203180332670280000800102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050203180332670280000800102670626706267062670626706
800242670520003525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050202180332670280000800102670626706267062670626706
800242670519903525800108001080010400050049236252670526705166653166838001080020800202670539118002110910800101010050203180422670280000800102670626706267062670626706
800242670519903525800108001080010400050149236252670526705166653166838001080020800202670539118002110910800101000050202180332670280000800102670626706267062670626706