Apple M1 Microarchitecture Research by Dougall Johnson

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

SQSHRUN2 (4S)

Test 1: uops

Code:

  sqshrun2 v0.8h, 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)031e3f4e51inst 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)a0a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100430372208225482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372206125482510001000100039831330183037303724153289510001000200030373037111001100001073116112630100030383038303830383038
1004303723186125482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372306125482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372206125482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372206125482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372306125482510001000100039831330183037303724153289510001000200030373037111001100001073116112630100030383038303830383038
100430372306125482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372206125482510001000100039831330183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303722015625482510001000100039831330183037303724153289510001000200030373037111001100001073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  sqshrun2 v0.8h, 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)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)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)9fa0a6a8a9accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250000000612954825101001001000010010000500427731303001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830086300863013330038
102043003722500000003232954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
102043003722400000003282954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
10204300372250000000612954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
10204300372250000000612954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000010371011611296340100001003003830038300383003830038
10204300372250000000612954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
10204300372250000000612954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
102043003722500000001662954825101001001000010010000500427731303001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
10204300372250000000612954825101001001000010010000500427731313001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038
10204300372250000000612954825101001001000010010000500427731303001830037300372826503287451010020010000200200003003730037111020110099100100100001000000071011611296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03080b1e3f4e51inst 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)9fa8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225000168295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640316222963010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037224000631295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300863008530038
100243003722500061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225000105295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  sqshrun2 v0.8h, 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)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)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)9facc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250061295472510100100100001001000050042771603001830037300372827172874110100200100082002001630037300371110201100991001001000010001117170160029645100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827172874110100200100082002001630037300371110201100991001001000010001117170160029646100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827172874010100200100082002001630037300371110201100991001001000010001117222242229629100001003008930038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827162874010100200100082002001630037300371110201100991001001000010001117180160029645100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827162874010100200100082002001630037300371110201100991001001000010001117170160029645100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827172874110100200100082002001630037300371110201100991001001000010001117180160029645100001003003830038300383003830038
1020430037225003845295472510100100100001001000050042771603001830037300372827172874110100200100082002001630037300371110201100991001001000010001117180160029645100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827172874010100200100082002001630037300371110201100991001001000010001117170160029646100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001830037300372827172874110100200100082002001630037300371110201100991001001000010001117180160029646100001003003830038300383003830038
10204300372240061295472510100100100001001000050042771603001830037300372827162874010100200100082002001630037300371110201100991001001000010001117170160029646100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)030b1e3f4e51inst 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)9fa0a1a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372250061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771600300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372240061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771600300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771600300183003730037282860328767100102010000202000030037300371110021109101010000100000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sqshrun2 v0.8h, v8.4s, #3
  movi v1.16b, 0
  sqshrun2 v1.8h, v8.4s, #3
  movi v2.16b, 0
  sqshrun2 v2.8h, v8.4s, #3
  movi v3.16b, 0
  sqshrun2 v3.8h, v8.4s, #3
  movi v4.16b, 0
  sqshrun2 v4.8h, v8.4s, #3
  movi v5.16b, 0
  sqshrun2 v5.8h, v8.4s, #3
  movi v6.16b, 0
  sqshrun2 v6.8h, v8.4s, #3
  movi v7.16b, 0
  sqshrun2 v7.8h, 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)03040809191e3a3f51inst 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)60696d6e74scheduler 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)9fa6acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200781501000123362580116100800161008002850064019612004520065200650612801282008002820016005620065200651116020110099100100160000100000111101337161113200621600001002006620066200662006620066
160204200651510000053625801161008001610080028500640196120045200652006506128012820080028200160056200652006511160201100991001001600001000001111013513161314200621600001002006620066200662006620066
160204200651501000056725801161008001610080028500640196120045200652006506128012820080028200160056200652006511160201100991001001600001000001111012714161211200621600001002006620066200662006620066
1602042006515010001241562580116100800161008002850064019612004520065200650612801282008002820016005620065200651116020110099100100160000100032111101351316612200621600001002006620066200662006620066
16020420065150100004362580116100800161008002850064019612004520065200650612801282008002820016005620065200651116020110099100100160000100000111101341116912200621600001002006620066200662006620066
16020420065150100094612580116100800161008002850064019612004520065200650612801282008002820016005620065200651116020110099100100160000100000111101331216612200621600001002006620066200662006620066
16020420065151000021461104801161008001610080028500640196120045200652006506128012820080028200160056200652006511160201100991001001600001000001111013513161413201301600001002006620066200662006620066
1602042006515100111546725801161008001610080028500640196120045200652006506128012820080028200160056200652006511160201100991001001600001000301111013513161113201321600001002015520150201572014920066
160204200651511003061072580116100800161008002850064019612004520065200650612801282008002820016005620065200651116020110099100100160000100000111101331116515200621600001002006620066200662006620066
1602042006515010000361258011610080016100800285006401961200452006520065028128012820080028200160056200652006511160201100991001001600001001001111013411161311200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)031e3f51inst 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)9fa8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420081156360452580010108000010800005064000001020027200462004632280010208000020160000200502004611160021109101016000010000100293216202115820043150160000102004720051200472004720047
160024200461510452580010108000010800005064000001020027200462004632280010208000020160000200462004611160021109101016000010000100313114202115620043150160000102004720047200472004720051
16002420046150273242580010108000010800005064000011020027200462004632280010208000020160000200462004611160021109101016000010000100293117202116820043150160000102004720047200472004720047
1600242004615039453680010108000010800005064000011020027200502004632280114208000020160000200522004611160021109101016000010000100283216202116620043150160000102004720047200472004720047
160024200461500452580010108000010800005064000011020027200462004632280010208000020160000200462004611160021109101016000010000100293226202116620049150160000102005120047200472004720047
1600242004615048452580010108000010800005064000011020027200462004632280010208000020160000200462005211160021109101016000010000100296226204217620043150160000102004720051200512005120051
160024200501500452580010108000010800005064000001020033200462004632280010208000020160000200502004611160021109101016000010000100286118202116520043150160000102004720047200532005120047
160024200461500452580010108000010800005064000011020027200462004632280010208000020160000200462004611160021109101016000010000100303127203128620047150160000102005120047200512004720051
160024200501500452580010108000010800005064000011020027200502004632280429208000020160000200462004611160021109101016000010000100296115242125720049150160000102005120047200472005320047
16002420050150423452580010108000010800005064000011020027200502004632280010208000020160000200462004611160021109101016000010000100293116202115620043150160000102004720047200472004720047

Test 5: throughput

Count: 16

Code:

  sqshrun2 v0.8h, v16.4s, #3
  sqshrun2 v1.8h, v16.4s, #3
  sqshrun2 v2.8h, v16.4s, #3
  sqshrun2 v3.8h, v16.4s, #3
  sqshrun2 v4.8h, v16.4s, #3
  sqshrun2 v5.8h, v16.4s, #3
  sqshrun2 v6.8h, v16.4s, #3
  sqshrun2 v7.8h, v16.4s, #3
  sqshrun2 v8.8h, v16.4s, #3
  sqshrun2 v9.8h, v16.4s, #3
  sqshrun2 v10.8h, v16.4s, #3
  sqshrun2 v11.8h, v16.4s, #3
  sqshrun2 v12.8h, v16.4s, #3
  sqshrun2 v13.8h, v16.4s, #3
  sqshrun2 v14.8h, v16.4s, #3
  sqshrun2 v15.8h, 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)031e3f51inst 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)91inst b.cc (94)inst integer (97)inst neon or fp (9a)9facc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400393003930251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003601600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003601600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003601600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003601600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118116104003601600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003601600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394018919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003631600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016114003601600001004004040040400404004040040
16020440039300330251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016004003601600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100990100100160000100011110118016104003601600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)031e3f51inst 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)5f6061696b6d6edispatch 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)9fa8accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400513009646251600101016000010160000501280000110400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228512416411241240036206160000104004040040400404004040040
160024400393002746251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228311216211241240036206160000104004040040400404004040040
160024400393003946251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228312416221242440036206160000104004040040400404004040040
1600244003930026446251600101016000010160000501280000115400203400394003919996320019160010201600002032000040039400391116002110910101600001000100228511216211122440036206160000104004040040400404004040040
160024400393003646251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228511016211241240036206160000104004040040400404004040040
1600244003930054676216030610160292101600005012800001154002004003940039199962020019160010201600002032000040039400391116002110910101600001000100228512416211102440036206160000104004040040400404004040040
160024400392993646251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228511216211241240036206160000104004040040400404004040040
160024400393004846251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228512416211241240036206160000104004040040400404004040040
1600244003930030462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109101016000010001002285124162111924400362012160000104004040040400404004040040
1600244003929927462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109101016000010075100228512416211242440036206160000104004040040400404004040040