Apple M1 Microarchitecture Research by Dougall Johnson

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

RSHRN2 (2D)

Test 1: uops

Code:

  rshrn2 v0.4s, v1.2d, #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
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372206125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372396125482510001000100039831303018308330372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372206125394410001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372206125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
1004303723246125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038

Test 2: Latency 1->1

Code:

  rshrn2 v0.4s, v1.2d, #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)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)9fa0a1a8a9acbranch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003722506129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
1020430037224366129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
1020430037225072629548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000010007101161129634100001003003830038300383003830038
1020430037225072629548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
1020430037225072629548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
1020430037225072629548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313300653003730037282653287451010020010000200200003003730037111020110099100100100001000000007101161129634100001003003830038300383003830038

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)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)9fa0a1a6a8a9accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722500061295482510010101000010100005042773130300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730084282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000810100005042773130300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282870328767100102010000202000030037300371110021109101010000100003006403162329630010000103003830038300383003830038
100243003722400061295482510010101000010100005042773131300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773131300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329650010000103003830038300383003830038
100243003722500061295482510010101000010100005042773130300183003730037282870328767100102010000202000030037300371110021109101010000100000006403163329630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  rshrn2 v0.4s, v0.2d, #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)03080b18191e1f3a3f4e5051inst 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)9fa0a1a6a8acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225000000061295473002125101001001000010010000500427716003001830037300372827172874010100200100082002001630037300371110201100991001001000010000000011172222422296290100001003003830038300383003830038
102043003722500000009729547025101001001000010010000500427716003001830037300372825262873310100200100002002000030037300372110201100991001001000010000000011172222422296290100001003003830038300383003830038
102043003722400000019729547025101001001000010010000500427716003001830037300372827172874010100200100082002001630037300371110201100991001001000010000000011171701600296460100001003003830038300383003830038
102043003722500000006129547025101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010000020011171801622296290100001003003830038300383003830038
102043003722500000019729547025101001001000010010000500427716003001830037300372825262873310100200100002002000030037300371110201100991001001000010000000011172222422296290100001003003830038300383003830038
102043003722500000019729547025101001001000010010000500427716003001830037300372827172874110100200100082002001630037300371110201100991001001000010000000011171801600296450100001003003830038300383003830038
102043003722500000006129547025101001001000010010000500427716003001830037300372827172874110100200100082002001630037300371110201100991001001000010000000011171701600296450100001003003830038300383003830038
102043003722500000006129547025101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010000000011171701600296450100001003003830038300383003830038
10204300372240000000612954702510100100100001001000050042771600300183003730037282717287411010020010008200200163003730037111020110099100100100001000004712011171701600296450100001003003830038300383003830038
102043003722500000006129547025101001001000010010000500427716003001830037300372827172874010100200100082002001630037300371110201100991001001000010000000011171801600296460100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03191e3f4e51inst 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)9fa6a8acbranch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225006129547251001010100001010000504277634300223003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000300640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037224006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
1002430037225006129547251001010100001010000504277160300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  rshrn2 v0.4s, v8.2d, #3
  movi v1.16b, 0
  rshrn2 v1.4s, v8.2d, #3
  movi v2.16b, 0
  rshrn2 v2.4s, v8.2d, #3
  movi v3.16b, 0
  rshrn2 v3.4s, v8.2d, #3
  movi v4.16b, 0
  rshrn2 v4.4s, v8.2d, #3
  movi v5.16b, 0
  rshrn2 v5.4s, v8.2d, #3
  movi v6.16b, 0
  rshrn2 v6.4s, v8.2d, #3
  movi v7.16b, 0
  rshrn2 v7.4s, v8.2d, #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)030b1e1f3f51inst 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)60696d6escheduler 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)9fa0a1a6a7a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200651500002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010070003001111011901600200621600001002006620066200662006620066
160204200651500002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066
16020420065150000292580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000000160901111011901600200621600001002006620066200662006620066
160204200651510002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066
160204200651500002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066
160204200651500002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000001001111011901600200621600001002006620066200662006620066
1602042006515000050425801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066
160204200651500002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066
160204200651500002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066
160204200651500002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000000001111011901600200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)031e3a3f51inst 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)9fa0a8acc5cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)dfe0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420110150004527800101080000108000050640000102003220051200513228001020800002016000020051200511116002110910101600001000001004231182521144620048201160000102006120061200522006120061
16002420060150005129800101080000108000050640000012004120060200603228001020800002016000020060200601116002110910101600001001001004562142542243620048402160000102005220061200612006120061
16002420060150004527800101080000108000050640000112003220051200513228001020800002016026420051200511116002110910101600001000001004661132521166620048201160000102005220061200522005220061
16002420051150015127800101080000108000050640000112003220051200513228001020800002016000020051200511116002110910101600001000001004661172521176620048201160000102005220052200522005220052
16002420051150015127800101080000108000050640000112003220051200513228001020800002016000020051200511116002110910101600001000001004461142521144620048201160000102005220052200522005220052
16002420051151015127800101080000108000050640000112003220051200513228001020800002016000020051200511116002110910101600001006001004361162521164620048201160000102005220052200522006120052
16002420051150015127800101080000108000050640000112003220051200513228001020800002016000020051200511116002110910101600001021001004561162521167620048202160000102005220052200522005220052
16002420051150019327800101080000108000050640000112003220051200513228001020800002016000020051200511116002110910101600001000001004361143421144620048201160000102005220052201192005220052
16002420051150015127800101080000108000050640000112003220051200513228001020800002016000020051200511116002110910101600001000001004362142521176620048201160000102005220052200612013020052
16002420051150015127800101080000108000050640000112003220051200513228001020800002016000020051200601116002110910101600001000001004361132521176620048202160000102005220052200522005220052

Test 5: throughput

Count: 16

Code:

  rshrn2 v0.4s, v16.2d, #3
  rshrn2 v1.4s, v16.2d, #3
  rshrn2 v2.4s, v16.2d, #3
  rshrn2 v3.4s, v16.2d, #3
  rshrn2 v4.4s, v16.2d, #3
  rshrn2 v5.4s, v16.2d, #3
  rshrn2 v6.4s, v16.2d, #3
  rshrn2 v7.4s, v16.2d, #3
  rshrn2 v8.4s, v16.2d, #3
  rshrn2 v9.4s, v16.2d, #3
  rshrn2 v10.4s, v16.2d, #3
  rshrn2 v11.4s, v16.2d, #3
  rshrn2 v12.4s, v16.2d, #3
  rshrn2 v13.4s, v16.2d, #3
  rshrn2 v14.4s, v16.2d, #3
  rshrn2 v15.4s, v16.2d, #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)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)9fa8acc5branch mispredict (cb)cdcfd6e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400393000513251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039313030251601081001600081001600205001280132014002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400392116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039299330251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
160204400392990734251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040
160204400393000695251601081001600081001600205001280132004002040039400391997761999016012020016003220032006440039400391116020110099100100160000100001111011816400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0318191e1f3f51inst 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)9fa6a8a9accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1600244005130000001574251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100223116162114540036206160000104004040040400404004040040
160024400393000000294251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100223115162115440036206160000104004040040400404004040040
160024400392990000280251600101016000010160000501280000114002040089400391999632001916001020160000203200004003940039111600211091010160000100000100226115162115740036406160000104004040040400404004040040
160024400392990000243251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100223118162117740036206160000104004040040400404004040040
160024400393000000291251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100223117162115840036406160000104004040040400404004040040
16002440039300000024012516001010160000101600005012800001140020400394003919996320019160010201600002032000040039400391116002110910101600001000001002462141642145400364012160000104004040040400404004040040
1600244003930000001613251600101016000010160000501280000014002040039400391999632001916001020160000203200004003940039111600211091010160000100000100226115162115840036406160000104004040040400404004040040
1600244003930000001561251600101016000010160000501280000114002040039400391999632001916001020160000203202644003940039111600211091010160000100000100246128164215540036406160000104004040040400404004040040
160024400393001000275251600101016000010160000501280000014002040039400391999632001916001020160000203200004003940039111600211091010160000100000100243118162115440036406160000104004040040400404004040040
160024400393000090275251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100243127162115440036406160000104004040040400404004040040