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

Test 1: uops

Code:

  subs w0, w0, #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)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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100410358061917251000100010006225011035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410358061917251000100010006225001035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410358082917251000100010006225001035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410357082917251000100010006225011035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410358061917251000100010006225001035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410357061917251000100010006225011035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410357061917251000100010006225001035103580538821000100010001035401110011000373127119931000100010361036103610361036
100410358061917251000100010006225011035103580538821000100010001035401110011000073127119931000100010361036103610361036
100410358061917251000100010006225001035103580538821000100010001035401110011000073127119931000100010361036103610361036
1004103570103917251000100010006225001035103580538821000100010001035401110011000073127119931000100010361036103610361036

Test 2: Latency 1->2

Code:

  subs w0, w0, #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)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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10204100357506199202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357506199202510100101001010064715214969551008310035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
102041003575010399202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
102041003575061992025101001010010100647152149695510035100358656387321010010200102001003540111020110099100101001000710127111001310000101001003610036100361003610036
1020410035751116199202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
1020410035751778299202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
102041003575246199202510132101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357506199202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357536199202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357506199202510100101001010064715214969551003510035865638732101001020010200100354011102011009910010100100071012711999510000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)0309191e3f4d51schedule 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 miss (a1)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003576000214991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000145991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003576000168991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101021064022722999710000100101003610036100361003610036
1002410035750057272991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000245991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
10024100357500061991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000224991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000364022722999710000100101003610036100361003610036
100241003575000145991825100101001010010647246149695510035100358678388091001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000221991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000107991825100101001010010647246149695510035100358678387541001010020100201003540111002110910100101000064024322999710000100101003610036100361003610036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  subs w0, w1, #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)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 miss (a1)l1d cache writeback (a8)acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204200351500186119930252010020100201121297233149169552003520035174258174852011220224202242003564112020110099100201001010000001111319162001220000201002003620036200362003620036
202042003515003906119930252010020100201121297233149169552003520035174258174852011220224202242003564112020110099100201001010000001111319162001220000201002003620036200362003620036
2020420035150006119928252010020100201121297233149169552003520035174257174862011220224202242003564112020110099100201001010000001111319162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233149169552003520035174257174862011220224202242003564112020110099100201001010000001111319162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233149169552003520035174257174862011220224202242003564112020110099100201001010000001111320162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233149169552003520035174258174852011220224202242003564112020110099100201001010000001111319162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233149169552003520035174258174852011220224202242003564112020110099100201001010000041111320162001220000201002003620036200362003620036
2020420035150106119930252010020100201121297233149169552003520035174258174862011220224203202003564112020110099100201001010000001111319162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233149169552003520035174257174862011220224202242003564112020110099100201001010000001111320162001220000201002003620036200362003620036
20204200351500366119930252010020100201121297233149169552003520035174257174852011220224202242003564112020110099100201001010000001111320162001220000201002003620036200362003620036

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)6061696a6d6emap 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)cfd2d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351500611991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012703127111999520000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012706127111999520000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012706127211999520000200102003620036200362003620036
200242003515001241991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012700127111999520000200102003620036200362003620036
200242003515002511991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012706127111999520000200102003620036200362003620036
200242003515001051991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012706227111999520000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012702227111999520000200102003620036200362003620036
200242003515001031991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012705127111999520000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012705127111999520000200102003620036200362003620036
20024200351500611991825200102001020010129724700491695520035200351742831750420010200202002020035641120021109102001010010012703127111999520000200102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  subs w0, w8, #3
  subs w1, w8, #3
  subs w2, w8, #3
  subs w3, w8, #3
  subs w4, w8, #3
  subs w5, w8, #3
  subs w6, w8, #3
  subs w7, w8, #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)030e1e3f5051schedule 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)9fl1d cache writeback (a8)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204267642000035267192580100801008010040050014923655026735267351667215166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
8020426735200003526719258010080100801004005001492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
802042673520000350258010080100801004005000492365502673526735166723167168010080200802002673539118020110099100801001000025110119112673180000801002673626736267362673626736
802042673520000350258010080100801004005000492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
802042673520000350258010080100801004005001492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
802042673520000350258010080100801004005001492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
802042673520000350258010080100801004005001492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
802042673520100350258010080100801004005001492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736
8020426735200027350258010080100801004005001492365502673526735166723166908010080200802002673539218020110099100801001000305110119112673180000801002673626736267362673626736
80204267352000013120258010080100801004005001492365502673526735166723166908010080200802002673539118020110099100801001000005110119112673180000801002673626736267362673626736

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)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)9fl1d cache writeback (a8)accfd2d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eb? int retires (ef)f5f6f7f8fd
8002426711200035258001080010800104000501492362502670526705166653166838001080020800202670539118002110910800101000502002018101126702800000800102670626706267062670626706
80024267052000352580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010005020071810426702800000800102670626706267062670626706
80024267052000352580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010005020061810726702800000800102670626706267062670626706
80024267052000352580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010005020011189526702800000800102670626706267062670626706
8002426705200035258001080010800104000501492362502670526705166653166838001080020800202670539118002110910800101000502009188826702800000800102670626706267062670626706
800242670520007002580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010005020071810726702800000800102670626706267062670626706
80024267052000352580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010135020051810726702800000800102670626706267062670626706
80024267052000352580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010005020071810926702800000800102670626706267062670626706
8002426705199035258001080010800104000501492362502670526705166653166838001080020800202670539118002110910800101000502006185826702800000800102670626706267062670626706
80024267052000352580010800108001040005014923625026705267051666531668380010800208002026705391180021109108001010005020010188826702800000800102670626706267062670626706