Apple M1 Microarchitecture Research by Dougall Johnson

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

RSHRN2 (4S)

Test 1: uops

Code:

  rshrn2 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)a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10043037220612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723271472548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372312612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372339612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037220612548251000100010003983133018303730372415328951000100020003037303711100110000373116112630100030383038303830383038
10043037230612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037230612548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037230612548251000100010003983133018303730372415328951000100020003037308511100110000073116112630100030383038303830383038
100430372302512548251000100010003983133018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037230612548251005100010003983133018303730372415328951000100020003037303711100110001073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  rshrn2 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)031e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)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? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225151892954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722501662954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722501242954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037224241032954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011613296340100001003003830038300383003830038
102043003722501242954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225012429548251010010010000125100006264277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000710116112963425100001003003830038300383003830038
102043003722501242954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722501872954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
102043003722501242954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)031e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)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)9fa8acbranch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372259124295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640316222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250835295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250814295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250458295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250168295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773133001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  rshrn2 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)030b1e3a3f4e51inst 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)9fa1a8a9acc5branch mispredict (cb)cdcfd5d6e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250006129547251010010010000100100005004277160130018300373003728271728741101002001000020020000300373003711102011009910010010000100000011171801629646100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171701629645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009910010010000100000011171701629645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171701629646100001003003830038300383003830038
10204300372250016129547251010010010000100100005004277160030018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171801629645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171701629646100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160130018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171801629645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271628741101002001000820020016300373003711102011009910010010000100000011171801629645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009910010010000100000011171801629645100001003003830038300383003830038
10204300372250306129547251010010010000100100005004277160030018300373003728271728741101002001000820020016300373003711102011009910010010000100000311171701629645100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0308090b18191e1f3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)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)9fa0a1a6a7a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000306402162229629010000103003830038300383003830038
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
10024300372250000000892954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003722500000001562954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402161229629010000103003830038300383003830038
100243003722400000007262954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003722500000901262954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  rshrn2 v0.8h, v8.4s, #3
  movi v1.16b, 0
  rshrn2 v1.8h, v8.4s, #3
  movi v2.16b, 0
  rshrn2 v2.8h, v8.4s, #3
  movi v3.16b, 0
  rshrn2 v3.8h, v8.4s, #3
  movi v4.16b, 0
  rshrn2 v4.8h, v8.4s, #3
  movi v5.16b, 0
  rshrn2 v5.8h, v8.4s, #3
  movi v6.16b, 0
  rshrn2 v6.8h, v8.4s, #3
  movi v7.16b, 0
  rshrn2 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.2510

retire (01)cycle (02)0318191e3f51inst 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)9fa8c5branch mispredict (cb)cdcfd0d2d5d6dbddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042008915000029258011610080016100800285006401960020045200652006561280128200800282001600562006520065111602011009910010016000010001111011951016000200621600001002006620066200662006620066
1602042006515000029258011610080016100800285006401961520045200652006561280128200800282001600562006520065111602011009910010016000010001111011950016000200621600001002006620066200662006620066
1602042006515100029258011610080016100800285006401961520045200652006561280128200800282001600562006520065111602011009910010016000010001111011901016000200621600001002006620066200662006620066
1602042006515100029258011610080016100800285006401960020045200652006561280128200800282001600562006520065111602011009910010016000010001111011901016000200621600001002006620066200662006620066
1602042006515000029258011610080016100800285006401960020045200652006561280128200800282001600562006520065111602011009910010016000010001111011951016000200621600001002006620066200662006620066
1602042006515000029258011610080016100800285006401961520045200652006561280128200800282001600562006520065111602011009910010016000010001111011951016000200621600001002006620066200662006620066
1602042006515011029258011610080016100800285006401961520045200652006561280128200800282001600562006520065111602011009910010016000010001111011900016000200621600001002006620066200662006620066
1602042006515000029258011610080016100800285006401961520045200652006561280128200800282001600562006520065111602011009910010016000010001111011951016000200621600001002006620066200662006620066
1602042006515000029258011610080016100800285006401961020045200652006561280128200800282001600562006520065111602011009910010016000010001111011900016000200621600001002006620066200662006620066
1602042006515100029258011610080016100800285006401960020045200652006561280128200800282001600562006520065111602011009910010016000010001111011951016000200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

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)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)9fa6a8accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0? int output thing (e9)eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420075150100000004527800101080000108000050640000115200322005120051322800102080000201600002005120051111600211091010160000100001002783123421244200570201160000102005220052200522005220052
16002420051150000000004529800101080000108000050640000115200322005120051322800102080000201600002005120051111600211091010160000100001002785152541255200570401160000102005220061200522005220052
1600242005115000000150051278001010800001080000506400001002003220051200513228001020800002016000020051200601116002110910101600001000310027114142522142200480201160000102005220052200522005220052
160024200601500000000063627800101080000108000050640000005200322005120060322800102080211201600002005120051111600211091010160000100001003084132521133200480201160000102005220052200612005220052
160024200511500000000045278001010800001080000506400001102003220372200513228001020800002016000020060200511116002110910101600001000010027115242522143200480201160000102005220052202922005220052
16002420051150000000004527800101080000108000050640000110200322006020060322800102080000201600002005120060111600211091010160000100001003081152521153200480402160000102005220052200522005220052
160024200511500010000019427800101080000108000050640000115200322005120051322800102080000201600002029420051111600211091010160000100001002731142521144200480201160000102005220052200522005220052
16002420051150000000006327800101080000108000050640000010200322005120051322800102080000201600002005120051111600211091010160000100001002784132522244200480201160000102006120052200522005220052
1600242005115000000917604527800101080000108000050640000000200322005120051322800102080000201600002005120060111600211091010160000100001002735133421144200480201160000102006120052200522005220052
16002420051150000000004527800101080000108000050640000105200322005120051322800102080000201600002006020051111600211091010160000100001002635133421235200480201160000102005220052200522006120052

Test 5: throughput

Count: 16

Code:

  rshrn2 v0.8h, v16.4s, #3
  rshrn2 v1.8h, v16.4s, #3
  rshrn2 v2.8h, v16.4s, #3
  rshrn2 v3.8h, v16.4s, #3
  rshrn2 v4.8h, v16.4s, #3
  rshrn2 v5.8h, v16.4s, #3
  rshrn2 v6.8h, v16.4s, #3
  rshrn2 v7.8h, v16.4s, #3
  rshrn2 v8.8h, v16.4s, #3
  rshrn2 v9.8h, v16.4s, #3
  rshrn2 v10.8h, v16.4s, #3
  rshrn2 v11.8h, v16.4s, #3
  rshrn2 v12.8h, v16.4s, #3
  rshrn2 v13.8h, v16.4s, #3
  rshrn2 v14.8h, v16.4s, #3
  rshrn2 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)030818191e3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)696b6d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa1a8a9acc5branch mispredict (cb)cdcfd5d6dde0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440058299000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040
1602044003930000057030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000629111101180162400361600001004004040040400404004040040
16020440039300000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101183160400361600001004004040040400404004040040
16020440039300000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040
16020440039299000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040
160204400393000000246251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040
16020440039300000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040
16020440039299100030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101182160400361600001004004040040400404004040040
16020440039300000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040
16020440039300000030251601081001600081001600205001280132400200400394003919977619990160120200160032200320064400394003911160201100991001001600001000000111101180160400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030718191e1f3f51inst 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
160024400393000000046251600101016000010160000501280000110400200400394003919996320019160010201600002032000040039400391116002110910101600001000100223115162113440036206160000104004040040400404004040040
16002440039300000486046251600101016000010160000501280000105400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228114162114340036206160000104004040040400404004040040
16002440039300000882046251600101016000010160000501280000110400200400394003919996320019160010201600002032000040039400891116002110910101600001000100223214162114340036206160000104004040040400404004040040
16002440039300000825046251600101016000010160000501280000105400200400394003919996320019160010201600002032000040039400391116002110910101600001000100228314162113440036206160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000100400200400394003919996320019160010201600002032000040039400391116002110910101600001000100223114162114340036206160000104004040040400404004040040
1600244003929900010513246251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100223314162114340036206160000104004040040400404004040040
160024400393000005460711251600101016000010160000501280000110400200400394003919996320019160010201600002032000040039400391116002110910101600001000100243324164224440036406160000104004040040400404004040040
160024400393000006270462516001010160000101600005012800002004002004003940039199963200191600102016000020320000400394003911160021109101016000010001002464241641244400362012160000104004040040400404004040040
160024400393000007830522516001010160000101600005012800000004002004003940039199963200191600102016000020320000400394003911160021109101016000010001002233110162113440036206160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000115400200400394003919996320019160010201600002032000040039400391116002110910101600001000100223313162113440036206160000104004040040400404004040040