Apple M1 Microarchitecture Research by Dougall Johnson

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

SRI (vector, 4S)

Test 1: uops

Code:

  sri 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)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)a1a6a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
1004203716014161168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037160084168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715006116872510001000100026468020182037203715723189510001000200020372037111001100000010073116111787100020382038203820382038
1004203716010561168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037160061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
100420371500117168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037160061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
100420371600156168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038

Test 2: Latency 1->1

Code:

  sri 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): 2.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)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)9fa0a1a6a7a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102042003715600000000611968725101001001000010010000500284768020018200372003718429121874010261200100082002001620037200371110201100991001001000010000001000111717016001980122100001002003820038200382003820038
1020420037156000000006119687251010010010000100100005002847680200182003720037184297187411010020010008200200002003720037111020110099100100100001000000100000071011621197910100001002003820038200382003820038
1020420037155000000006119687441010010010000100100005002848963200182003720037184223187451010020010000200200002003720037111020110099100100100001000000000000071011611198770100001002003820038200382003820038
1020420037155000000006119687251010010010000100100005002847680200182003720037184223187451010020010000200200002003720037111020110099100100100001000000107030000071011611197910100001002003820038200382003820038
1020420037156000000006119687251010010010048100100005002848650200182003720037184223187451010020010000200200002003720037111020110099100100100001000000106000071011611197910100001002003820038200862003820038
1020420037156000000006119687251010010010000100100005002847680200182013320037184223187451010020010000200200002003720037111020110099100100100001000000106000071011611198610100001002003820038200382003820038
102042003715500000000441196872510169100100001001000050028476802001820037200371842231874510100200100002002000020037200371110201100991001001000010000002400000071011611197910100001002003820038200382003820038
102042003715600000001156419687251010010010000100100005002847680200182003720037184223187451010020010000200200002003720037111020110099100100100001000000103000071011611197910100001002003820038200382003820085
1020420037155000000006119687251010010010000100100005002848963200182003720037184223187451010020010000200200002003720037111020110099100100100001000000200000071011611198270100001002003820038200382003820038
1020420037156000000006119687251010010010012100100005002847680200182003720037184223187451010020010000200200002018220037111020110099100100100001000000003000071011611198250100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)03080b18191e1f3f4e51inst 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)9fa0a1a6a8a9acc2cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024200371560000006119687251001010100001210000502847680020054201322003718459318767100102010830202033820037200371110021109101010000102000045416402162219785210000102003820038200382003820038
10024200851600000604411967625100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000009006402162219785010000102003820038200382003820038
100242003715500000036619687251003410100001010000502848963020018200372003718444318767100102010492202000020037200371110021109101010000100000078206402162219785010000102003820038200382003820038
1002420037155000000611968725100101010000101000050284768002001820037200371844431876710010201000020200002008520037111002110910101000010004000006402162219785010000102003820038200382003820038
1002420037156000000611968725100101110048101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000000206403162219785010000102003820038200382003820038
10024200371550001001171968725100101010000101000050284768012001820037200841844431876710010201000020200002003720037111002110910101000010000000006402162219785010000102003820084202762013220038
10024200371550000001661968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000006006402162219785010000102003820038200382003820038
1002420037155000000611968725100101010000101000050284768002001820037200371844831876710010201000020200002003720037111002110910101000010000003006402162219785010000102003820038200382003820038
100242003715500000128611968725100101010000101000050284768002001820037200371844431876710010201016220200002003720037111002110910101000010000000006402162219785010000102003820038200382003820038
1002420037155000000611965425100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000003006402162219785010000102003820038200382003820038

Test 3: Latency 1->2

Code:

  sri v0.4s, v0.4s, #3
  movi v0.16b, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)0308090b18191e1f3a3f4e5051inst 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)9fa0a1a6a7a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037161010000008851967502510100100100001001000050028475210200182003720037184286187401010020010008200200162003720037111020110099100100100001000000502000011171801600198010100001002003820038200382003820038
1020420037155000100008219686025101001001000010010000500284752102001820037200371842861874110256200100082002001620085200371110201100991001001000010000000004111861074222005210100001002032320323203732037520134
102042032315800167546616050611961801431018911710036119109126362855105020126203712037618436421886511185224111442242233420324203698110201100991001001000010002200016050011171701600198001100001002018120182202772013320183
10204201811561014441444012243196310125101441081002410610152549284878502016220086201321844930188131087221610008200200162003720037111020110099100100100001002400000011171801600198000100001002003820038200382022720038
1020420084155101009352140741960901621021612210084122104566422856169020270204142045918434401887311344220111712282234820371203268110201100991001001000010000000079902111873081102014810100001002037420370203632013320421
10204202271581018892488116219686025101001001000010010000500284752102027020181200851844631187961118521811009212226902018020181811020110099100100100001002000147810211179204001199458100001002032520409203722031320218
10204201801561007295280209719686084101001041008410011216544285380202012620181200371843971874110564200100082002234420418204108110201100991001001000010020201416015011171701620201469100001002027720275202302037520278
10204201321630116452800611968602510100100100001001000050028475210200182003720037184286187411010020010008200200162003720037111020110099100100100001000000027925011192109503200229100001002042120409203142009520038
10204200371560001000137719686132510100100100001001000050028475210200182003720037184096187331010020010000200200002003720037111020110099100100100001000000000011172222422197870100001002003820038201342003820038
102042003715500000001971968602510100100100001001000050028475210200182003720037184096187331010020010000200200002003720037111020110099100100100001000000000011171701600198000100001002008720038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)03080a0b18191e1f3a3f4e51inst 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)6061696b6d6edispatch 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)9fa0a1a6a8a9acbcc2cfd0d2d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002420037156000000006119686251001010100001010000502847521002001802003720037184433187671001020100002020000200372003711100211091010100001000010000640002162219786010000102003820038200382003820038
100242003715500000017606119686251001010100001010000502847521002001802003720037184433187671001020100002020000200372003711100211091010100001000020000640002162219825010000102003820038200382003820038
1002420037155000000006119686251001010100001010000502847521002001802008420037184433187671039120100002020000200372003711100211091010100001000020000640002162219786010000102008620132200382008520038
100242003715500000000628196862510010101000010100005028475210020018020037200371844331876710010201000020200002003720037111002110910101000010020290000640002162219786010000102003820038200382003820038
1002420037155000000006119686251001010100001010000502847521002001802003720037184433187671001020100002020000200372003711100211091010100001000230300640003492219931010000102018020131202302027520179
1002420404163001411817206119686251001010100121010000502847521002001832003720037184478187671001020100002020326200372003711100211091010100001006020300640002162219786010000102003820038200382003820038
1002420037155000000006119686251001010100001010000502847521102001802003720037184433187671001020100002020000200372003731100211091010100001000000206000640002162219786010000102003820038200382003820038
10024200371560000008806119686251001010100001010000502847521102001802003720037184433187671001020100002020000200372003711100211091010100001000000000640002162219786110000102003820038200382003820038
1002420037155000000006119686441001012100001010000502847521102001802003720037184433187671001020100002020000200372003711100211091010100001000030000640002162219786010000102003820038200382003820038
1002420037155000000006119686251001010100001010000502847521102005402003720037184433187671001020100002020000200372003711100211091010100001000040208000640002162419786010000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sri v0.4s, v8.4s, #3
  movi v1.16b, 0
  sri v1.4s, v8.4s, #3
  movi v2.16b, 0
  sri v2.4s, v8.4s, #3
  movi v3.16b, 0
  sri v3.4s, v8.4s, #3
  movi v4.16b, 0
  sri v4.4s, v8.4s, #3
  movi v5.16b, 0
  sri v5.4s, v8.4s, #3
  movi v6.16b, 0
  sri v6.4s, v8.4s, #3
  movi v7.16b, 0
  sri 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)0308090b18191e1f3a3f51inst 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)9fa0a1a8a9acc2c5branch mispredict (cb)cdcficache miss (d3)d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042006515500000000492258011610080016100800285006401960200442006520065612801282008002820016005620065200651116020110099100100160000100000000111101190066002006201600001002006620066200662006620066
1602042006515500000088094258011610080016100800285006401961200442006520065612801282008002820016025820065200651116020110099100100160000100000002111101190016002006201600001002006620145200662006620066
1602042006515500020000933198011610080016100800285006401961200442006520065612801282008002820016046420065200651116020110099100100160000100000000111101190016002006201600001002006620066200662006620091
1602042014416111000000471258011610080016100800285006401960200442006520065612801282008002820016005620065200651116020110099100100160000100000000111101190016002006201600001002006620066200662006620066
16020420065156000001320052258011610080016100800285006401961200442006520065612801282008002820016005620065200651116020110099100100160000100000000111101190116002006201600001002006620066200662006620066
160204200651560000000029258011610080016100800285006401961200442006520223612801282008013120016005620065200651116020110099100100160000100000200111101190016002006201600001002006620066200662006620066
1602042006515500000000178258011610080016100800285006401961200442006520065612801282008002820016005620065200651116020110099100100160000100000000111101190016002006201600001002006620066200662006620066
1602042006515800000000465848011610080217100800285006401960200442006520065612801282008002820016005620065200651116020110099100100160000100200000111101190016002006201600001002006620066200662006620066
160204200651550000000071258011610080016100800285006401961201732006520065612801282008002820016005620065200651116020110099100100160000100000000111101190016002006201600001002006620066200662006620066
160204200651560000000029258011610080016100800285006401961201282006520065612801282008002820016005620065200651116020110099100100160000100000000111101190016002006201600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0308090b18191e1f3a3f51inst 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)9fa0a1a6a7a8a9acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200751560000000216527800101080000108000050640000115200342005020050321800102080000201600002020520050111600211091010160000100000000010032133113252123920047201160000102005120051200512005120060
160024200511610000000154427800101080000108019950640000111020031200502005032180010208000020160000200502005011160021109101016000010000010001002913619252115520047402160000102006020060200602005120051
160024200501550000040801788227800101080000108000050640000011020031200502005032180010208000020160202201292015121160021109101016000010060000001002813719252219520047201160000102005120051200512005120052
1600242005015500000001715329800101080000108000050640000111020031200502005032180206208000020160000201502005011160021109101016000010000000001002613615254113920047202160000102005120051200602012620051
1600242005915500000001344768010810800001080000506400001110200312005020050321800102080000201600002005020050111600211091010160000100000000010032136192541112520056401160000102005120051200512005120051
1600242005015500000001617427800101080000108000050640000011020031201432005032180010208000020160000200502005011160021109101016000010000000001002613715252119520047401160000102005120060201302005120051
160024200501560000000169227800101080100108000050640000111020031200522005032180010208000020160000200502005011160021109101016000010000000001002813615262113520177201160000102005120051200512005120051
160024200501560000000156727800101080000108000050640000111020031200502005032180010208000020160000200592005011160021109101016000010000000001002613613252115520047201160000102005120051200602005120060
1600242005015500003000109278001010800001080000506400001102003120050200503218001020800002016000020050200501116002110910101600001000000000100263113252114920047201160000102005120051200512005120051
1600242012915510000000442780010108000010800005064000001020031200502005032180010208000020160000200502005011160021109101016000010000000001003161211252113520111201160000102005120051200512005120051

Test 5: throughput

Count: 16

Code:

  sri v0.4s, v16.4s, #3
  sri v1.4s, v16.4s, #3
  sri v2.4s, v16.4s, #3
  sri v3.4s, v16.4s, #3
  sri v4.4s, v16.4s, #3
  sri v5.4s, v16.4s, #3
  sri v6.4s, v16.4s, #3
  sri v7.4s, v16.4s, #3
  sri v8.4s, v16.4s, #3
  sri v9.4s, v16.4s, #3
  sri v10.4s, v16.4s, #3
  sri v11.4s, v16.4s, #3
  sri v12.4s, v16.4s, #3
  sri v13.4s, v16.4s, #3
  sri v14.4s, v16.4s, #3
  sri 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)03080b18191e1f3a3f51inst 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)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)9fa0a1a6a7a8a9acc2c5branch mispredict (cb)cdcficache miss (d3)d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400383100001088029251601081001600081001600205001286280040019040038400381997706199861601202001600322003200644003840038311602011009910010016000010000000000111101180216324003501600001004003940039400394003940039
16020440038310000200029251601081001600081001600205001280132040019040038400381997706199891601202001600322003200644003840038111602011009910010016000010000000000111101180216224003501600001004003940166400394003940039
160204400383101000000292516010810016000810016002050012801320400190400384009419977011199891601202001600322003200644003840038111602011009910010016000010000000002111101180216224003501600001004003940039400394003940111
16020440038310000000029251601081001600081001600205001280132040019040038400381997706199891601202001600322003202564003840038111602011009910010016000010000000000111101180216224003501600001004003940039400394014840039
16020440038310000000029251601081001601041001600205001280132040019040143400891997706199891602242001600322003200644003840038111602011009910010016000010000000000111101180316214003501600001004003940039400394003940156
1602044003831000000003092516010810016000810016002050012801320400930400964003819977015200401601202001600322003200644010840038111602011009910010016000010000000200111101180216224003501600001004003940039400394003940039
1602044003831000000002925160108100160008100160020500128013204001904003840038199770161998916012020016003220032006440038400381116020110099100100160000100000000001111011802125214003501600001004003940039400394003940039
160204400383220000000205251602971001600081001600205001280132040019040038400381997706199891601202001600322003200644003840038111602011009910010016000010000200000111101180238224003501600001004003940039400394003940039
16020440038310000000014211281601081001600081001600205001281676040019040038400381997706199891601202001600322003206544003840038111602011009910010016000010000000000111101180216244003501600001004003940039400394003940039
1602044003831010000006394251601081001600081001600205001280132040019040038400381997706199891601202001600322003200644003840038111602011009910010016000010000000000111101520216224003501600001004003940039400394003940039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0304080b18191e1f3a3f51inst 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)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)9fa0a1a6a8a9acc2c9cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440120311011000004525160010101600001016000050128000011040019400874003819996320018160108201600982032000040038400381116002110910101600001000000000100413317162113640035155160000104003940039400394003940039
160024400383110000000045251600101016009510160000501281544010400194003840038199963200181600102016000020320000400384003811160021109101016000010200003001002481241622234400351510160000104003940039400394003940039
16002440038310000124260045251600101016000010160000501280000015400194003840038199963200181600102016000020320000400384003811160021109101016000010000000001002283161641123402093010160000104003940268400394003940039
1600244003831000000300519616001010160000101600975012800001154009740038400381999632001816001020160000203200004003840038111600211091010160000100000000010022821410421124400351510160000104003940039400394003940039
1600244003831100000000150251600101016027910160098501280000105400194003840038199963200181600102016000020320000400384010811160021109101016000010000000401002211313162112240035155160000104003940039400394003940039
160024400383110000119200512516001010160000101600005012800001104001940038400381999632001816010720160485203200004003840038111600211091010160000100000000010024112161641135400353010160000104003940039400394003940161
16002440087310000000004525160010101600001016009950128000001540019400384003819996320018160010201600002032000040038400381116002110910101600001000300000100228216162113540035305160000104003940039400394003940088
16002440090310000000004543160197101600001016000050128000011540019400384003819996320018160010201600002032000040038400381116002110910101600001000004000100248214162112440035155160000104003940039400394003940039
16002440038310000011890045671603831016000010160000501280000110400194003840138199963200181600102016000020320000400384003811160021109101016000010000000001002232151621234400353010160000104003940039400394003940039
16002440038311000040004525160010101600001016000050128000011540019400384003819996320046160106201600982032019240038400383116002110910101600001000000153300100228214162114440035155160000104003940090400394003940039