Apple M1 Microarchitecture Research by Dougall Johnson

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

SSRA (vector, 4S)

Test 1: uops

Code:

  ssra v0.4s, v1.4s, #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)03181e3f4e51inst issue (52)~issue fp/simd (54)~dispatch fp/simd (57)huge thing fp/simd (5b)60696d6edispatch 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
1004303722006125482510001000100039831303018303730372415328951000100020003037303711100110003073116112630100030383038303830383038
1004303722006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303722006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037220061254825100010001000398313030183037303724153289510001000200030373037111001100004273116112630100030383038303830383038
10043037230061254825100010001000398313030183037303724153289510001000200030373037111001100003973116112630100030383038303830383038
10043037230061254825100010001000398313030183037303724153289510001000200030373037111001100010073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  ssra v0.4s, v1.4s, #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)03070b1e3f4e51inst 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)696b6d6edispatch 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)9fa7accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225000348295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000671011611296340100001003003830038300383003830038
10204300372251012124295392510100100100001001000050042773133001803008530037282658287451010020010000200200003003730037111020110099100100100001000071011611296340100001003003830038300383003830038
102043003722500061295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000071011611296340100001003003830038300383003830038
1020430037225000631295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000071011611296340100001003003830038300383003830038
102043003722500061295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000371011611296340100001003008630085300383003830038
102043003722500534241295484410100100100001191000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000071011611296340100001003003830038300383003830038
1020430037225001261295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000371011611296340100001003003830038300383003830038
102043003722500061295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000371011611296340100001003003830038300383003830038
102043003722500061295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000071011611296340100001003003830038300383003830038
1020430037225000557295482510100100100001001000050042773133001803003730037282653287451010020010000200200003003730037111020110099100100100001000071011612296340100001003003830038300383003830038

1000 unrolls and 10 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)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)9fa0a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225000000029629548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
1002430037225000000033929548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
1002430037225000000030029548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
10024300372250000000115629548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
1002430037225000000090029548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010050006402162229630210000103003830038300383022830085
100243003722500000531010329548251001010100001010298504277313130162030037300372829232883810010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
10024300372250000000148729548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010020006402162229630010000103003830038300383003830038
1002430037225000003306129548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
1002430037225000000038429548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038
1002430037225000000095529548251001010100001010000504277313130018030037300372828732876710010201000020200003003730037111002110910101000010000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  ssra v0.4s, v0.4s, #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)03080b18191e1f3a3f4e51inst 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)9fa1a6a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003722500009007472954725101001001000010010000500427716013001830037300372827172874110100200100082002001630037300371110201100991001001000010000000011171801600296450100001003003830038300383003830038
102043003722500379366160459529493158101771261005612011050626428708613030630375304202827442288631117122611168222226543037130371811020110099100100100001002300220950111739040002964510100001003046730422304563042230371
10204304042281091011888800653729456213102031271008013011450642429016603037830506305122832151289131147822811669232246683056130514121102011009910010010000100000427805011197639723298298100001003064630457303253037330470
10204303682371161115847921472129427155101751361008813011350658428797603031030322304182829050288551194124812322244226463037630227151102011009910010010000100020236215211110115120333006216100001003003830038300383003830038
1020430037232000000159122954725101001001000010010000632427851213001830037300372825262874910100200100002002000030037300371110201100991001001000010000000011172222422296290100001003003830038300383003830038
102043003723300103019729547251010010010000100100005004277160030054300373003728252152874110100200100082002001630037300371110201100991001001000010000000011171801600296460100001003003830038300383003830038
10204300372250000000612954725101001001000010010000500427716013001830037300372827172874010100200100082002001630037300371110201100991001001000010000000011171801600296460100001003003830038300383003830038
10204300372250000000612954725101001001000010010000500427716013001830037300372827172874110100200100082002001630037300371110201100991001001000010000000011171701600296450100001003003830038300383003830038
10204300372250000000612954725101001001000010010000500427716013001830037300372827162874110100200100082002001630037300371110201100991001001000010000000011171801600296460100001003003830038300383003830038
102043003722500002400612954725101001001000010010000500427716013001830037300372827162874110100200100082002001630037300371110201100991001001000010000000011171801600296450100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)031e3f4e51inst 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)72scheduler 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)9fa8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225088429547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383008530038
1002430037225046829547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002430037225037829547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002430037225033629547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010030640216222962910000103003830038300383003830038
1002430037225040029547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002430037225037729547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002530037224042329547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002430037225066029547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002430037225063529547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  ssra v0.4s, v8.4s, #3
  movi v1.16b, 0
  ssra v1.4s, v8.4s, #3
  movi v2.16b, 0
  ssra v2.4s, v8.4s, #3
  movi v3.16b, 0
  ssra v3.4s, v8.4s, #3
  movi v4.16b, 0
  ssra v4.4s, v8.4s, #3
  movi v5.16b, 0
  ssra v5.4s, v8.4s, #3
  movi v6.16b, 0
  ssra v6.4s, v8.4s, #3
  movi v7.16b, 0
  ssra v7.4s, v8.4s, #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)03081e1f3f51inst 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)9fa0a1a6a7a8acc2c5branch mispredict (cb)cdcfd6dae0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020420065150000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020520065150000292580116100800161008002850064019601201112006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020420065151000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620169200662015920066
16020420065150000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020420065151000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000010011110119160200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066
16020420065151000292580116100800161008002850064019611200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110119160200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

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)5f6061696d6escheduler 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)e0ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160025200661500004525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010010031135113202117112004315160000102004720047200472004720047
160024200461500004525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010010036351122021112142004315160000102004720047200472004720047
16002420046150000452580010108000010800005064000011102002720046200463228001020800002016000020046200461116002110910101600001001003513518202118112004315160000102004720047200472004720047
160024200461500004525800101080000108000050640000111020027200462004632280430208000020160000200462004611160021109101016000010010038135112202118132004315160000102004720047200472004720047
16002420046150000452580010108000010800005064000011102002720046200463228001020800002016000020046200461116002110910101600001001003513518202118112004315160000102004720047200472004720047
160024200461500004525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010010039135113202118142004315160000102004720047200472004720047
16002420046150000452580010108000010800005064000011102002720046200463228001020800002016000020046200461116002110910101600001001003413618202111372004315160000102004720047200472004720047
160024200461500004525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010010031135112202117112004315160000102004720047200472004720047
16002420046150051604525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010010031135214202128112004315160000102004720047200472004720047
16002420050150072904525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010010035136113202118112004315160000102004720047200472004720047

Test 5: throughput

Count: 16

Code:

  ssra v0.4s, v16.4s, #3
  ssra v1.4s, v16.4s, #3
  ssra v2.4s, v16.4s, #3
  ssra v3.4s, v16.4s, #3
  ssra v4.4s, v16.4s, #3
  ssra v5.4s, v16.4s, #3
  ssra v6.4s, v16.4s, #3
  ssra v7.4s, v16.4s, #3
  ssra v8.4s, v16.4s, #3
  ssra v9.4s, v16.4s, #3
  ssra v10.4s, v16.4s, #3
  ssra v11.4s, v16.4s, #3
  ssra v12.4s, v16.4s, #3
  ssra v13.4s, v16.4s, #3
  ssra v14.4s, v16.4s, #3
  ssra v15.4s, v16.4s, #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)03080918191e1f3f51inst 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)9fa0a6a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440058300010064803025160108100160008100160020500128013240020400394025019977619990160120200160032200320064400394024411160201100991001001600001000050001111011821621400361600001004004040040400404004040040
16020440039300000018050525160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011821612400361600001004004040040400404004040040
160204400393000000603025160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011821622400361600001004004040040400404004040040
160204400393000000003025160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111019311622400361600001004004040040400404004040040
160204400393000000003025160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011811612400361600001004004040146402484026340040
1602044008830010004203025160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011821621400361600001004004040040400404004040040
160204400393000000003025160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011821612400361600001004004040040400404004040040
1602044003930000004505125160108100160008100160020500128013240020400394003919977619990160120200160140200320064400394003911160201100991001001600001000010188101111011811622400361600001004004040040400404004040040
160204400392990000003025160108100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000052001111011821622400361600001004004040040400404004040040
160204400393000000003025160312100160008100160020500128013240020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011821621400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03070b18191e3f51inst 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)5f6061696d6edispatch stall (70)72scheduler 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)9fa0a1a6a8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0? int output thing (e9)eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400503000000154625160010101600001016000050128000011040020400394003919996032001916001020160000203200004003940039111600211091010160000100000021002231121161111816400360155160000104004040040400404004040040
160024400393000000304625160010101600001016000050128000011040020400394003919996032001916001020160000203200004003940039111600211091010160000100000001002231115162111414400360155160000104004040040400404004040040
160024400393000000244625160010101600001016000050128000011040020400394003919996032001916001020160000203200004003940039111600211091010160000100000001002231118161111618400360155160000104004040040400404004040040
160024400393000000124625160010101600001016000050128000011040020400394003919996032001916001020160000203200004003940039111600211091010160000100000001002231116162111319400360155160000104004040040400404004040040
1600244003930000004389025160010101600001016000050128000011040020400394003919996032001916001020160000203200004003940039111600211091010160000100000001002231117162111217400360165160000104004040040400404004040040
160024400393000000456725160010101600001016000050128000011040020400394003919996032001916001020160422203200004003940039111600211091010160000100000001002231118162111719400360155160000104004040040400404004040040
16002440039300000045171843381616701016195910161779501294772110409784091541215201330962060416199520162398203246324116640915181160021109101016000010400102102206222415842231204050603010160000104077640693406594075540604
1600244064931661014263961482160207101600001016137150128908811040773409044100520132033202041608542016000020321674400394003911160021109101016000010000553001002231117162111716400360207160000104004040040400404004040040
160024400393000000454625160010101600001016000050128000011040020400444003919996032001916001020160000203200004003940039111600211091010160000100000001002231117162111318400360206160000104004040040400404004040040
1600244003930000006646251600101016000010160000501280000110400204003940039199960320019160010201600002032000040039400391116002110910101600001000000010022612171641116164003604012160000104004040040400404004040040