Apple M1 Microarchitecture Research by Dougall Johnson

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

XTN2 (8H)

Test 1: uops

Code:

  xtn2 v0.16b, v1.8h
  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)03091e3f4e51inst 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
1004203716006116872510001000100026468002018203720371572318951000100020002037203711100110000373116111787100020382038203820382038
10042037150010316872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
10042037150246116872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
1004203716006116872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
1004203715008116872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
1004203715006116872510001000100026468002018203720371572318951000100020002037203711100110001073116111787100020382038203820382038
10042037150126116872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
1004203716008216872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
1004203716066116872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038
1004203716006116872510001000100026468002018203720371572318951000100020002037203711100110000073116111787100020382038203820382038

Test 2: Latency 1->1

Code:

  xtn2 v0.16b, v1.8h
  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)0308090b18191e1f3a3f4e4f51inst 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)9fa0a1a6a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204200371550000000061196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000071021611198250100001002003820038200382003820038
102042003715500000000559196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000071011611197910100001002003820038200382003820038
10204200371550000000061196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000071011611197910100001002003820038200382003820038
10204200371550000000061196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000071011611197910100001002003820038200382003820038
10204200371550000000061196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000071011611197910100001002003820038200382003820038
10204200371550000000061196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000100071011611197910100001002003820038200382003820038
10204200371550000030061196870251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000071011611197910100001002003820038200382003820038
1020420037155000000006119687025101001001000010010000500284768002001820037200371842271874510100200100002002000020037200371110201100991001001000010022200116832841465121997227100001002027720276203132027920314
1020420275157000556664400348019632012110197141100601341076065028540950201622026620314184383118840108942121083620221660202282027861102011009910010010000100220209968071011611197910100001002003820086201342003820180
10204200371550000012006119687025101001001000013210456624285016602001820183202761844729188191074021410834216215002013220276611020110099100100100001002020058962800257221997125100001002027920276203242027620276

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)030818191e1f3f4e51inst 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)9fa1a8accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002420037150000906119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038
1002420037150000906119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219823010000102003820038200382003820038
100242003715000000611968725100101010000101000050284768012001820037200371844431876710010201000020200002003720037111002110910101000010001236402162219785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100107072163319785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718453318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038
1002420037150000006119687251001010100001010000502847680120018200372003718444318767100102010000202000020037200371110021109101010000100006402162219785010000102003820038200382003820038

Test 3: Latency 1->2

Code:

  xtn2 v0.16b, v0.8h
  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)031e3a3f4e51inst 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)9fa8acc5branch mispredict (cb)cdcfd5d6e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037155012701968625101001001000010010000500284752102001820037200371842861874010100200100082002001620037200371110201100991001001000010000111718016197870100001002003820038200382003820038
102042003715500611968625101001001000010010000500284752102001820037200371842861874110100200100082002001620037200371110201100991001001000010000111717016198010100001002003820038200382003820038
102042003715500891968625101001001000010010000500284752102001820037200371842861874110100200100082002001620037200371110201100991001001000010000111717016198010100001002003820038200382003820038
102042003715500611968625101001001000010010000500284752102001820037200371842861874010100200100082002001620037200371110201100991001001000010000111717016198010100001002003820038200382003820038
102042003715500611968625101001041000010010000500284752112001820037200371842861874110100200100082022001620037200371110201100991001001000010000111717016198000100001002003820038200382003820038
1020420037155001791968625101001001000010410000500284752112001820037200371842861874010100200100082002001620037200371110201100991001001000010000111718016198010100001002003820038200382003820038
102042003715600611968625101001001000010010000500284752102001820037200371842871874010100200100082002001620037200371110201100991001001000010000111717016198000100001002003820038200382003820038
102042003715500611968625101001001000010010000500284752102001820037200371842861874110100200100082002001620037200371110201100991001001000010000111717016198010100001002003820038200382003820038
102042003715500611968625101001001000010010000500284752102001820037200371842861874010100200100082002001620037200371110201100991001001000010000111718016198010100001002003820038200382003820038
1020420037155011241968625101001001000010010000500284752112001820037200371842871874010100200100082002001620037200371110201100991001001000010000111717016198000100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)0304191e1f3f4e51inst 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)9fa8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024200371560000661968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010030640216221978610000102003820038200382003820038
10024200371550000611968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
10024200371550000611968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
10024200371550000611968625100101010000101000050284752112001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
100242003716100417036019686251001010100001010000502847521020018200372003718443318767100102010000202000020037200371110021109101010000105120640216221978610000102003820038200382003820038
100242003715500001911968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
100242003715600001681968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
100242003715500001891968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
1002420037155001201701968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038
100242003715500001491968625100101010000101000050284752102001820037200371844331876710010201000020200002003720037111002110910101000010000640216221978610000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  xtn2 v0.16b, v8.8h
  movi v1.16b, 0
  xtn2 v1.16b, v8.8h
  movi v2.16b, 0
  xtn2 v2.16b, v8.8h
  movi v3.16b, 0
  xtn2 v3.16b, v8.8h
  movi v4.16b, 0
  xtn2 v4.16b, v8.8h
  movi v5.16b, 0
  xtn2 v5.16b, v8.8h
  movi v6.16b, 0
  xtn2 v6.16b, v8.8h
  movi v7.16b, 0
  xtn2 v7.16b, v8.8h
  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)030708090a0b18191e1f3a3f51inst 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)60696b6d6escheduler 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? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200651560000000000176258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119116002010101600001002006620066200662006620066
16020420065156000000000050258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065156000000060029258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065161000000000029258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065155000000000029258011610080016100800285006401960200440200652006561280128200800282001600562010120065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065156000000000029258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065155000000000029258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065155000000000029258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
160204200651550000000000568258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016002006201600001002006620066200662006620066
16020420065155000000000029258011610080016100800285006401960200440200652006561280128200800282001600562006520065111602011009910010016000010000000011110119016012006201600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030809181e3f51inst 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)5f6061696b6d6escheduler 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)9fa0a9accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200771550000274298001010800001080000506400000152004002005020059321800102080201201600002005920059111600211091010160000100001003011225342228420056402160000102006020060200512006020060
160024200501560000120298001010800001080000506400000152004002005920059321800102080000201600002005920059111600211091010160000100001002811324254217420056411160000102006020060200602005120052
160024200591550000502980010108000010800005064000001520040020059200593218001020800002016000020059200591116002110910101600001000010028113252542210520047211160000102005120051200512006020051
1600242005015600004429800101080000108000050640000115200400200502005132180010208000020160000200502005011160021109101016000010000100278324262126320047402160000102005120060200512005120052
1600242005015600004428800101080000108000050640000115200310200502005032180010208000020160000200502005011160021109101016000010000100278324252116720047201160000102005120051200512005120051
1600242005915500006527800101080000108000050640000015200400200592005032180010208000020160000200592005011160021109101016000010000100278314252118520047201160000102005120051200512005120051
16002420050156000044278001010800001080000506400000102004002005020050321800102080000201600002005920050111600211091010160000100001003084142521110320047202160000102006020060200602006020061
16002420050155000015927800101080000108000050640000115200310200502005032180010208000020160000200502005011160021109101016000010000100288514342117520047201160000102005120051200512005120051
1600242005015500095027800101080000108000050640000115200310200502005032180010208000020160000200502005011160021109101016000010000100288516342119620047402160000102005120051200512005120051
16002420050156000037727800101080000108000050640000115200400200502005032180010208000020160000200502005011160021109101016000010000100288513252119520047201160000102005120051200512005120051

Test 5: throughput

Count: 16

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)0308090b0e18191e1f373a3f4e51inst 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)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)9fa0a1a6a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204401263110000009300013902516015810016000810016002050055983020040019400384014119977061998916012020016003220032006440038400951116020110099100100160000100000000011110118016004008201600001004004040039400394014240090
16020440099310000000000072002516010810016000810016002050012801320140019400954009519998061999016012020016003220032006440038400951116020110099100100160000100000000011110118016004009201600001004005840039400644003940096
160204400383110000003301470561112516010810016007810016002050055656880040122400394003919977062009216012220016003220032006440038400391116020110099100100160000100000000011110118016004013801600001004009640039400964004040039
1602044009531000000000780471112516017810016007810016002050055195500040044400384007319978062005016012020016003220032006440038400571116020110099100100160000100000000011110118016004003501600001004003940039400404004040120
1602044003831100000000005602516010810016005810016002050012801320040020400384005720068061999016012220016003220032006440038400391116020110099100100160000100000000011110118016004007101600001004009640096400394009640039
1602044009531000000000003002516017810016000810016002050039975650040019400384003819977062004616012120016003220032006440038400381116020110099100100160000100000000011110118016004013801600001004022340390403164020040241
16020440299312111000073035116192418916032610016042810016035850012801320040407403454041120164221920128160524200160565200320456402594037041160201100991001001600001000030039902111104390204004126611600001004102241397411724185441515
16020441135325001016161989149640804812150423916228710016123510016175954424694850040555407964084620492068205461617642001613392003227424095740690111160201100991001001600001000202262930111103710139004052511600001004070941057410084105440788
160204401873190110111114529681800385771628016223410216195110216196551127146060040392410764096020291338020407162173206161815204323848409664041915116020110099100100160000100000022253211110118016004003501600001004003940039401834003940102
16020440141310000000005805502516015810016005810016002050054384230040082400954009519977062004616012020016003220032006440085400381116020110099100100160000100000000011110118016004003501600001004008640039400864003940086

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03080b18191e1f373f4e51inst 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)9fa8a9acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440065301000090001340251600101016000010160000501280000210400714003940038199960320018160010201600002032000040038400391116002110910101600001000001002411528164226840035305160000104003940085400884006740113
16002440112300000000045102516001010160000101600005013199980104001940078400842001503200191600102016000020320000400384003811160021109101016000010000010024112261642266400983010160000104003940039400394011340074
16002440039300000000066025160070101600601016000050128000010540019401124003819996032001816001020160000203200004003840084111600211091010160000100000100243119164116940084156160000104014440040400394004040039
160024400383001000360025714925160011101600281016000050131999911040019401124003919996032001916001020160000203200004003840112111600211091010160000100000100223128162116440035155160000104005940040400394003940039
16002440039299000000286710251600101016000010160000505516100105400194003840057200060320018160010201600002032000040038400871116002110910101600001000001002484181641189401091512160000104003940113400394003940065
1600244003830000000060737025160070101600601016000050128000010040019400384003920010032007916001020160000203200004005740039111600211091010160000100000100223125162118840036155160000104003940085400394008540039
1600244003829900000060670251600101016000010160000505516100010400654003840038199960320018160010201600002032000040038400841116002110910101600001000001002284110162119640035155160000104004040039400854003940085
1600244003830000005701066770251600111016004510160000504728951110400654003840038200061332009216001020160000203200004003840084111600211091010160000100000100223116162115640035155160000104004040088400654004040040
16002440112300000000146025160116101600001016000050551977810040020400394003819996032001816001020160000203200004006440039111600211091010160000100000100228418162115640035455160000104003940040400884004040039
1600244003830000000010667325160055101600001016011250128000010540093400384003819996032007016001020160000203200004003840087111600211091010160000100000100223415162116640035155160000104003940076400394004040039