Apple M1 Microarchitecture Research by Dougall Johnson

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

UQSHRN2 (4S)

Test 1: uops

Code:

  uqshrn2 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)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)a8c2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
1004303723576125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372366125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
1004303722216125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038

Test 2: Latency 1->1

Code:

  uqshrn2 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)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)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)9fa8accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250126129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000371021612296340100001003003830038300383003830038
1020430037224006129548251010010010000123100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000071011611296340100001003003830038300383003830038
10204300372240061295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010001871011611296340100001003003830038300383003830038
102043003722500726295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010001871011611296340100001003003830038300383003830038
102043003722500726295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010002771011611296340100001003003830038300383003830038
10204300372240061295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010001871011611296340100001003003830038300383003830038
10204300372250061295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010009971011611296340100001003003830038300383003830084
102043003722500726295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010002771011611296340100001003003830038300383003830038
102043008022400612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100010271011611296340100001003003830038300383003830038
10204300372250061295482510100100100001001000050042773133001830037300372826532874510100200100002002000030037300371110201100991001001000010001271011611296349100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0318191e3f4e51inst 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)9fa8accdcfd5d6dbddinst fetch restart (de)e0ec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722400061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722400061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
1002430037225000612954825100101010000101000050427731313001830037300372828732876710010201000020200003003730037111002110910101000010021064021602229630210000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722400066295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000064021602229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  uqshrn2 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)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)9fa8acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037224005362954725101001001000010010000500427716030018030037300372827162874010100200100082002001630037300371110201100991001001000010077011171711600296460100001003003830038300383003830038
102043003722500612954725101001001000010010000500427716030018030037300372827162874110100200100082002001630037300371110201100991001001000010002111171801610296460100001003003830038300383003830038
1020430037225001032954725101001001000010010000500427716030018030037300372827162874110100200100082002001630037300371110201100991001001000010002111171801600296450100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001803003730037282716287411010020010008200200163003730037111020110099100100100001000011171701600296460100001003003830038300383003830038
102043003722500612954725101001001000010010000500427716030018030037300372827172874010100200100082002001630037300371110201100991001001000010049611171801600296460100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001803003730037282717287411010020010008200200163003730037111020110099100100100001000011171701600296460100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001803003730037282717287411010020010008200200163003730037111020110099100100100001002911171701600296460100001003003830038300383003830038
102043003722500726295472510100100100001001000050042771603001803003730037282716287401010020010008200200163003730037111020110099100100100001000311171701600296460100001003003830038300383003830038
1020430037225006129547251010010010000100100005004277160300180300373003728271728741101002001000820020016300373003711102011009910010010000100016811171701600296450100001003003830038300383003830038
10204300372250061295472510100100100001001000050042771603001803003730037282716287401010020010008200200163003730037111020110099100100100001000011171801600296460100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03080b18191e1f3a3f4e51inst 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)9fa0a1a6a8acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)eb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000003064021622296290010000103003830038300383003830038
10024300372250000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000078064021622296290010000103003830038300383003830038
1002430037225000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000006064021622296290010000103003830038300383003830038
1002430037225000000061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000006064021622296290010000103003830038300383003830038
1002430037225000000061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000003064021622296290010000103003830038300383003830038
1002430037224000000061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000003064021622296290010000103003830038300383003830038
1002430037224000000061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000003064021622296290210000103003830038300383003830038
100243003722500000001562954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000015064021622296290010000103003830038300383003830038
10024300372250000000536295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000003064021622296290010000103003830038300383003830038
10024300372250000000726295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000013064021622296290010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  uqshrn2 v0.8h, v8.4s, #3
  movi v1.16b, 0
  uqshrn2 v1.8h, v8.4s, #3
  movi v2.16b, 0
  uqshrn2 v2.8h, v8.4s, #3
  movi v3.16b, 0
  uqshrn2 v3.8h, v8.4s, #3
  movi v4.16b, 0
  uqshrn2 v4.8h, v8.4s, #3
  movi v5.16b, 0
  uqshrn2 v5.8h, v8.4s, #3
  movi v6.16b, 0
  uqshrn2 v6.8h, v8.4s, #3
  movi v7.16b, 0
  uqshrn2 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)030b18191e1f3f51inst 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)696d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa0a1a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200901500000050258011610080016100800285006401962011020065200656128012820080028200160056200652006511160201100991001001600001000000301111012021600200621600001002006620066200662006620066
160204200651500000029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000002001111011901600200621600001002006620066200662006620066
1602042006515100000155258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000001111011901600200621600001002006620066200662006620066
160204200651500000029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000001111012121600200621600001002006620066200662006620066
160204200651500000029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000001111011901600200621600001002006620066200662006620066
160204200651500000029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000001111011901600200621600001002006620066200662006620066
160204200651500000029258022110080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000001111011901621200621600001002006620066200662006620066
160204200651500000029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000001111011901600200621600001002006620066200662006620066
160204200651510000029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000000041111011901600200621600001002006620066200662006620066
1602042036515000000117258011610080016100800285006401962004520065203856128012820080028200160056200652006511160201100991001001600001000000301111011901600200621600001002006620066200662006620066

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)5f60696d6escheduler 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)9fa0a8acbranch mispredict (cb)cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200511500992580010108000010800005064000011200272004620046322800102080000201600002004620046111600211091010160000100000100313111620411952004330160000102005120051200512005120051
160024200501500206258001010800001080000506400000020031200502005032280010208000020160000200502005011160021109101016000010000010027311420211582004730160000102005120051200512005120051
16002420050150045258001010800001080000506400001020027200462004632280010208000020160000200462004611160021109101016000010000010027311420211842004315160000102004720047200472004720047
160024200461500150258001010800001080000506400001120027200462004632280010208000020160000200462004611160021109101016000010010010029311920211992004315160000102004720047200472004720047
160024200461500217258001010800001080000506400001120027200462004632280010208000020160000200462004611160021109101016000010000010032311820211842004315160000102004720047200472004720047
1600242004615001111258001010800001080000506400001120027200462004632280010208000020160000200462004611160021109101016000010040010031311820211582004315160000102004720047200472004720128
16002420046150045258001010800001080000506400001020027200462004632280010208000020160000200462004611160021109101016000010000010031311420211842004315160000102004720047200472004720047
160024200461500129258001010800001080000506400001020027200462004632280010208000020160000200462004611160021109101016000010000010031311820211842004315160000102004720047200472004720047
160024200461500173258001010800001080000506400001120027200462004632280010208000020160000200462004611160021109101016000010010010032311820211892004315160000102004720047200472004720047
16002420046150045258001010800001080000506400001120027200462004632280010208000020160000200462004611160021109101016000010000010027311820211482004315160000102004720047200472004720047

Test 5: throughput

Count: 16

Code:

  uqshrn2 v0.8h, v16.4s, #3
  uqshrn2 v1.8h, v16.4s, #3
  uqshrn2 v2.8h, v16.4s, #3
  uqshrn2 v3.8h, v16.4s, #3
  uqshrn2 v4.8h, v16.4s, #3
  uqshrn2 v5.8h, v16.4s, #3
  uqshrn2 v6.8h, v16.4s, #3
  uqshrn2 v7.8h, v16.4s, #3
  uqshrn2 v8.8h, v16.4s, #3
  uqshrn2 v9.8h, v16.4s, #3
  uqshrn2 v10.8h, v16.4s, #3
  uqshrn2 v11.8h, v16.4s, #3
  uqshrn2 v12.8h, v16.4s, #3
  uqshrn2 v13.8h, v16.4s, #3
  uqshrn2 v14.8h, v16.4s, #3
  uqshrn2 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.2503

retire (01)cycle (02)03080a0b18191e1f3f51inst 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)9fa0a1a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400583000000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000411110118016004003601600001004004040040400404004040040
160204400392990000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118016004003601600001004004040040400404004040040
160204400393000000000302516010810016008410016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118016004003601600001004004040040400404004040040
160204400393000000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118016004003601600001004004040040400404004040040
160204400393000000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118016004003601600001004004040040400404004040040
160204400393000000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118016004003601600001004004040040400404004040040
16020440039300000000030251601081001600081001600205001280132040020400394003919977619990160120200160143202322348406514066312116020110099100100160000100421256530111102951113134043611600001004030840562405634056840565
16020440501303110610133288018751771611881001608951011610765001284220040470405594057120066532025616115120016105920232212040557405628116020110099100100160000100000061230111103482165354061101600001004066840719407364072740766
160204400483000000000762716010010016000010016000050012800000400294004840048199716199941601002001600002003200004004840048111602011009910010016000010000000011110120224224004501600001004004940049400494004940049
160204400483000000000762716010010016000010016000050012800000400294004840048199716199941601002001600002003200004004840048111602011009910010016000010000000011110120224224004501600001004004940049400494004940049

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)5f60696d6edispatch 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)9fa0a6a8acc2c5cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440050300094251600101016000010160000501280000014002040039400391999632001916001020160000203200004003940039111600211091010160000100003001002231151621155440036305160000104004040040400404004040040
160024400392990462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000000010024622516421455400361510160000104004040040400404004040040
160024400393000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000000010024322416221266400363010160000104004040040400404004040040
16002440039300046251600101016000010160000501280000014002040039400391999632001916001020160000203200004003940039111600211091010160000100000001002431261642145640036305160000104004040040400404004040040
160024400393000522516001010160000101600005012800000140020400394003919996320019160010201600002032000040039400391116002110910101600001000000010024322516421466400363010160000104004040040400404004040040
16002440039300052251600101016000010160000501280000014002040039400391999632001916001020160000203200004003940039111600211091010160000100000001002432251642134440036155160000104004040040400404004040040
16002440039300046251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000001002232151641135540036305160000104004040040400404004040092
160024400393000711251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000001002231151621125540036155160000104004040040400404004040040
16002440039300046251600101016000010160000501280000114002040039400391999632001916001020160000203200004009340039111600211091010160000100320001002431151641125540036155160000104004040040400404004040040
16002440039300052251600101016000010160000501280000014002040039400391999632001916001020160000203200004003940039111600211091010160000100000001002231141621115440036155160000104004040040400404004040040