Apple M1 Microarchitecture Research by Dougall Johnson

Firestorm: Overview | Base Instructions | SIMD and FP Instructions
Icestorm:  Overview | Base Instructions | SIMD and FP Instructions

SRSRA (vector, 4H)

Test 1: uops

Code:

  srsra v0.4h, v1.4h, #3
  movi v0.16b, 1
  movi v1.16b, 2

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 1.000

Integer unit issues: 0.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 1.000

retire (01)cycle (02)030f1e3f4e51inst issue (52)~issue fp/simd (54)~dispatch fp/simd (57)huge thing fp/simd (5b)696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op fp/simd (7e)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst neon or fp (9a)a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100430372320612548251000100010003983133018303730372415328951000100020003037303711100110000073216112630100030383038303830383038
100430372300822548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372300612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372200612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372200612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372300612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372300612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372300612548251000100010003983133018303730372415328951000100020003037303711100110002073116112630100030383038303830383038
100430372200612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372300612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  srsra v0.4h, v1.4h, #3
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)030809191e3a3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696b6d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa0a1a8acc2c5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204301202261120064129548251012510010000100100005004277313130018030037300372826532874510125200100002002000030037300371110201100991001001000010000200071011611296340100001003003830038300383003830038
102043003722400000114329548251010010010000100100005004277313030018030037300372826532874510100204100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037224000006129548251010010010000100100005004277313030018030037300372826532874510125200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313030018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
10204300372250000019329548251010010010000100100005004277313030018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830085300383003830038
1020430037224000006129548251010010010000100101485004277313030018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
10204300372250000014929548251010010010000100100005004277313030018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011622296340100001003003830038300383003830038
10204300372250000010529548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000008229548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
10204300372250000116529548251010010010000100100005004277313030018030037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0308090b18191e1f3a3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa0a6a8acc2c5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722500000000612954825100181210000101000050427731313001830037300372828732876710010201000020200003003730037111002110910101000010004712006402162229630010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372250000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000310006402162229630010000103003830038300383003830038
1002430037224000000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100010006402162229630010000103003830038300383003830038
10024300372250000012008229548251001010100001010000504278670130018300373003728287328767100102010000202000030037300371110021109101010000100033006402162229630010000103003830038300383003830038
10024300372250000000071229548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000016402162229630010000103003830038300383003830038
1002430037242000000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000000008029548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  srsra v0.4h, v0.4h, #3
  movi v0.16b, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0308090b18191e1f3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa0a1a6a8a9acc2c5branch mispredict (cb)cdcfd5d6dde0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225000000061295472510100100100001001000050042771601300183003730037282716287401010020010000200200003003730037111020110099100100100001000000000111718016029645100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282716287401010020010008200200163003730037111020110099100100100001000000000111718024029799100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282716287411010020010008200200163003730037111020110099100100100001000000000111718016029646100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282717287571025320010008200200163003730037111020110099100100100001000000000111717016029645100001003003830038300383003830038
1020430037224000000061295472510100100100001001000050042771600300183003730037282716287401010020010008200200163003730037111020110099100100100001000000000111717016029646100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282716287411010020010008200200163003730037111020110099100100100001000000000111717016029646100001003003830038300383003830038
1020430037224000000061295472510100100100001001000050042771600300183003730037282716287401010020010008200200163003730037111020110099100100100001000021282780111717016029646100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282717287411010020010008200200163003730037111020110099100100100001000000000111718016029645100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282716287401010020010008200200163003730037111020110099100100100001000000000111717016029645100001003003830038300383003830038
1020430037225000000061295472510100100100001001000050042771600300183003730037282717287401010020010008200200163003730037111020110099100100100001000000000111718016029645100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03081e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa6a8accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722500822954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427716030018300373003728286328767100102010000202000030037300371110021109101010000100006403162229629010000103003830038300383003830038
100243003722500612954725100101010000101000050427851230018300373003728286328767100102010000202000030037300371110021109101010000100066403162229629010000103003830038300383003830038
100243003722410612954725100101010000101000050427716030018300373003728286328767103102010000202032230037300371110021109101010000100006402162229629010000103003830038300383003830038
100243003722400612954725100101010000101000050427716030018300373003728286328787100102010000202000030037300371110021109101010000100006402162229629010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  srsra v0.4h, v8.4h, #3
  movi v1.16b, 0
  srsra v1.4h, v8.4h, #3
  movi v2.16b, 0
  srsra v2.4h, v8.4h, #3
  movi v3.16b, 0
  srsra v3.4h, v8.4h, #3
  movi v4.16b, 0
  srsra v4.4h, v8.4h, #3
  movi v5.16b, 0
  srsra v5.4h, v8.4h, #3
  movi v6.16b, 0
  srsra v6.4h, v8.4h, #3
  movi v7.16b, 0
  srsra v7.4h, v8.4h, #3
  movi v8.16b, 9

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03191e1f3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8acc5branch mispredict (cb)cdcfd0d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200881500001632580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000011110122081688200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000011110127381688200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000011110128081683200621600001002006620066200662006620066
16020420065151000292580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000011110127071673200621600001002006620066200662006620066
16020420065151000522580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000011110127081688200621600001002006620066200662006620066
16020420065151000292580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000011110127031688200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000011110128371688200621600001002006620066200662006620066
160204200651500004132580116100800161008002850064019602004520065201436128012820080028200160056200652006511160201100991001001600001000011110150081683200621600001002006620066200662006620066
16020420065150000292580200100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000011110127081689200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000011110127071687200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03041e3a3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)5f60696d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9faccfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200761501004525800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004084113022111292220045160160000102004920049200492004920049
160024200481501007425800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004760112626111252520045310160000102004920053200492004920049
160024200481500019725800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004966111522111261620045160160000102004920049200492004920049
160024200481501014525800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004966112622111162520045160160000102004920049200492004920049
160024200481501014525800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004863112522111152520045160160000102004920049200492004920049
1600242004815010011025800101080000108000050640000112002920052200483228001020800002016000020048200481116002110910101600001001004957112722111262620045160160000102004920049200492004920049
160024200481501004525800101080000108000050640000012002920048200483228001020800002016000020048200481116002110910101600001001004960112822111202520045160160000102004920049200492004920049
160024200481501017425800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004957112522121262620045160160000102004920049200492004920049
160024200521501017425800101080000108000050640000112002920048200483228001020800002016000020048200481116002110910101600001001004360112722111261620045160160000102004920053200492004920049
160024200481501017425800101080000108000050640000112002920048200483228001020800002016000020052200481116002110910101600001001004957112626111152520045160160000102004920049200492004920049

Test 5: throughput

Count: 16

Code:

  srsra v0.4h, v16.4h, #3
  srsra v1.4h, v16.4h, #3
  srsra v2.4h, v16.4h, #3
  srsra v3.4h, v16.4h, #3
  srsra v4.4h, v16.4h, #3
  srsra v5.4h, v16.4h, #3
  srsra v6.4h, v16.4h, #3
  srsra v7.4h, v16.4h, #3
  srsra v8.4h, v16.4h, #3
  srsra v9.4h, v16.4h, #3
  srsra v10.4h, v16.4h, #3
  srsra v11.4h, v16.4h, #3
  srsra v12.4h, v16.4h, #3
  srsra v13.4h, v16.4h, #3
  srsra v14.4h, v16.4h, #3
  srsra v15.4h, v16.4h, #3
  movi v16.16b, 17

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03091e1f3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa7a8a9acc5branch mispredict (cb)cdcfd6e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440059300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940112111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039300090302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039299000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039299000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039300090302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040
160204400393000006952516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011816400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0308090b18191e3a3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)5f60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa0a6a8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400512990000000462516001010160000101600005012800001040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223112516211252540036155160000104004040040400404004040040
160024400392990000000462516001010160000101600005012800001140020400394003919996320047160116201600002032000040039400391116002110910101600001000000100223112516211242640036155160000104004040040400404004040040
160024400393000000000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223112416211262540036155160000104004040040400404004040040
16002440039300000005640882516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000030100229112416211242440086155160000104004040040400404004040040
160024400393000000000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223232616211242440036155160000104004040040400404004040040
160024400392990000000672516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001003500100223112416211272340036155160000104004040040400404004040040
160024400392990000000462516001010160000101600005012800001040020400394003919996320019160010201600002032000040039400901116002110910101600001000000100223112616211242340036155160000104004040040400404004040040
160024400393010000000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000100100223112416211242440036155160000104004040040400404004040040
160024400393000000000462516001010160000101601075012800001040020400394003919996320019160010201600002032000040039400391116002110910101600001000300100223112516211252340036155160000104004040040400404004040040
160024400393000000000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223112616411262740036155160000104004040040400404004040040