Apple M1 Microarchitecture Research by Dougall Johnson

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

SQRSHRN2 (8H)

Test 1: uops

Code:

  sqrshrn2 v0.16b, v1.8h, #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)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
100430372206125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303722010525482510001000100039831303018303730372415328951000100020003037303711100110000373116112630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723014725482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  sqrshrn2 v0.16b, v1.8h, #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)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)9fa8a9accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225000301032954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
10204300372250100014632954825101001001000010010000500427867003001830037301322826982874510100200103312002066830037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000120612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010010071011611296340100001003003830038300383003830038
102043003722500012082295482510100100100001001000050042773130303423046530452282934228907114912281148822822982304643046910110201100991001001000010002249739121109122994129100001003046530465304653051130468
10204304672280101011887926129548251010010010000100100005004277313030018300373003728276482890111488200106622002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000120612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300781110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.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)9fa0a1a8a9acc2c5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372250000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372240000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372240000061295482510010101000010100005042773131300183003730084282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372250000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372250000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830084300383003830038
10024300372250000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372250000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372250000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000750631295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372250000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  sqrshrn2 v0.16b, v0.8h, #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)03181e3a3f4e51inst 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)9facc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225000612954725101001001000010010000500427716003001830037300372827172874110100200100082002001630037300371110201100991001001000010001117170160029645100001003003830038300383003830038
1020430037225000612954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010001117170160029645100001003003830038300383003830038
1020430037225000612954725101001001000010010000500427716003001830037300372827162874010100200100082002001630037300371110201100991001001000010001117170160029645100001003003830038300383003830038
1020430037224000612954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010001117170160029645100001003003830038300383003830038
1020430037225000612954725101001001000010010000500427716013001830037300372827162874010100200100082002001630037300371110201100991001001000010001117170160029646100001003003830038300383003830038
1020430037225000612954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010001117180240029645100001003003830038300383003830038
10204300372251019729538451011010010008102101505114279864030054301333013428256102877010406208101642022033230085300862110201100991001001000010001117222242229629100001003003830038300383003830038
1020430037225001972954725101001001000010010000500427716003001830037300372825262873310100200100002002000030037300371110201100991001001000010001117222242229629100001003003830038300383003830038
1020430037225001972954725101001001000010010000500427716003001830037300372825262873310100200100002002000030037300371110201100991001001000010001117222242229629100001003003830038300383003830038
1020430037225001972954725101001001000010010000500427716003001830037300372825262873310100200100002002000030037300371110201100991001001000010001117222242229629100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03181e3f4e51inst 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
100243003722500612954725100101010000101000050428121603001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722400612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722400612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038
1002430037225007262954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sqrshrn2 v0.16b, v8.8h, #3
  movi v1.16b, 0
  sqrshrn2 v1.16b, v8.8h, #3
  movi v2.16b, 0
  sqrshrn2 v2.16b, v8.8h, #3
  movi v3.16b, 0
  sqrshrn2 v3.16b, v8.8h, #3
  movi v4.16b, 0
  sqrshrn2 v4.16b, v8.8h, #3
  movi v5.16b, 0
  sqrshrn2 v5.16b, v8.8h, #3
  movi v6.16b, 0
  sqrshrn2 v6.16b, v8.8h, #3
  movi v7.16b, 0
  sqrshrn2 v7.16b, v8.8h, #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)0307080b18191e1f3a3f51inst 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)6061696d6escheduler 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)cdcfd0d2d5d6daddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042009015100000000292580116100800161008002850064019615200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110127518160782006201600001002006620066200662006620066
1602042006515000000000292580116100800161008002850064019615200452006520065612801282008002820016005620065200651116020110099100100160000100000203011110127008160882006201600001002006620066200662006620066
16020420065150000009002925801161008001610080028500640196052004520065200656128012820080028200160056200652006511160201100991001001600001000000012011110127008160882006201600001002006620066200662006620066
16020420065151000000002925801161008001610080028500640196052004520065200656128012820080028200160056200652006511160201100991001001600001000000024011110127007160832006201600001002006620066200662006620066
1602042006515000000000292880116100800161008002850064019610200452006520065612801282008002820016005620065200651116020110099100100160000100000000011110122003160382006201600001002006620066200662006620066
1602042006515000000000292580116100800161008002850064019610200452006520065612801282008002820016005620065200651116020110099100100160000100000103011110127008160882006201600001002006620066200662006620066
1602042006515000000000292580116100800161008002850064019600200452006520065612801282008002820016005620065200651116020110099100100160000100000400011110127508160892006201600001002006620066200662006620066
1602042006515000000000292580116100800161008002850064019605200452006520065612801282008002820016005620065200651116020110099100100160000100000203011110126508160832006201600001002006620066200662006620066
1602042006515100000000292580116100800161008002850064019610200452006520065612801282008002820016005620065200651116020110099100100160000100000200011110126013163882006201600001002006620066200662006620066
1602042006515000000000292580116100800161008002850064019605200452006520065612801282008002820016005620065200651116020110099100100160000100000103011110127508160882006201600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0307080a0b1e1f3f51inst 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)9fa7a8acc5cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420069150201000577980010108000010800005064000011520034200512005132280010208000020160000200512005311160021109101016000010001501004213112327111201820048201160000102005420052200522005220052
160024200531501010002478480010108000010800005064000011102003220051200513228001020800002016000020051200511116002110910101600001000001003813412025111191620048211160000102005420054200522005220061
16002420051151101000517580010108000010800005064000011102003220051200533228001020800002016000020051200511116002110910101600001000001004113311925212171720048201160000102005420052200542005220052
16002420053150201000519580010108000010800005064000011102003420053200533228001020800002016000020051200511116002110910101600001000001004213311625211182220050201160000102005220052200542005420052
1600242005315020300051748001010800001080000506400001110200342005120053322800102080000201600002005320051111600211091010160000100013501004213311825211211820048201160000102005220054200542005220052
16002420051150402000577480010108000010800005064000011102003220051200513228001020800002016000020053200511116002110910101600001000001003913312227211172120048211160000102005420052200542005420052
16002420053151202100747080010108000010800005064000011102003220053200513228001020800002016000020051200531116002110910101600001000301004013312027111191820050201160000102005220052200522005220054
160024200511502020004574800101080000108000050640000111020032200512005132280010208000020160000200512005111160021109101016000010035001003916311825111192020050211160000102005220052200612006120068
16002420053150100000517480010108000010800005064000011102003220051200513228001020800002016000020053200531116002110910101600001000001004513312425211192120048201160000102005220052200522005220052
16002420051151101000577480010108000010800005064000011102003220053200533228001020800002016027020053200511116002110910101600001001301003813511825211211820048201160000102005220052200522005220052

Test 5: throughput

Count: 16

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)030708090b18191e1f3f51inst 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)9fa6a7a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400603000000009030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000050301111011811611400361600001004004040040400404004040040
160204400392990000000035251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011811611400361600001004004040040400404004040040
160204400393000000000030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000010001111011811611400361600001004004040040400404004040040
160204400393000000000030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011811611400361600001004004040040400404004040040
1602044003930000000000505251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011811611400361600001004004040040400404004040040
160204400393000000000030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011811611400361600001004004040040400404004040040
160204400393000000000030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000000001111011811611400361600001004004040040400404004040040
1602044003930000000000514616011610016001610016002850012834041400294010040264199861019986160128200160000200320000400994004811160201100991001001600001000010601111012042434401661600001004004940049400494004940049
1602044004830000000030206271601001001600001001600005001280000140029400484004819971619994160100200160000200320000400484004811160201100991001001600001000010001111012042444400451600001004004940049400494004940049
160204400483000000010076271601001001600001001600005001280000140029400484004819971619994160100200160000200320000400484004811160201100991001001600001000000001111012033344400451600001004004940049400494004940049

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030408090b191e1f3a3f51inst 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)9fa0a8a9accfd0d2icache miss (d3)itlb miss (d4)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400512992010000012425160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001001001002581124816111434140036165160000104004040076400404004040040
160024400392992010000095251600101016000010160000501280000015400204003940039199963200191600102016000020320000400394003911160021109101016000010030010026352247163214135400363110160000104004040084400404004040040
160024400393002010000168363160303101602921016030750128160010540115400394003919996320019160319201601042032000040039400391116002110910101600001021014501010484124681111453740124165160000104020240197401914014840206
160024400893012010000011825160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001002001002584124716111463140036165160000104004040094400404004040040
160024400393002010000111825160010101600001016000050128000011540020400394003919996320019160010201600002032000040039400391116002110910101600001001001002584124516111454540036165160000104004040103400404004040040
160024400393002010000112425160010101600001016000050128000010540020400394003919996320019160010201600002032000040039400391116002110910101600001001001002584123216111374640036165160000104004040089400404004040040
1600244003930020100088112425160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001001001002484124516111463140036165160000104004040089400404004040040
160024400393002010000012425160010101600001016000050128000011540020400394003919996320019160010201600002032000040039400391116002110910101600001001001002584123116311434640036165160000104004040089400404004040194
160024400393002010000011825160010101600001016000050128000011040020400394003919996320019160114201600002032000040039400391116002110910101600001003001002484124416111434440036165160000104004040094400404004040040
160024400393002010000112425160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001001001002431123616111463640036165160000104004040089400404004040040