Apple M1 Microarchitecture Research by Dougall Johnson

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

RSHRN2 (8H)

Test 1: uops

Code:

  rshrn2 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)03191e3f4e51inst 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
1004303722006125482510001000100039831303018303730372415328951000100020003037303711100110000073216332630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303723006125482510001000100039831313018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303723106125482510001000100039831313018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303722006125482510001000100039831303018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073316332630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073316222630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073316332630100030383038303830383038

Test 2: Latency 1->1

Code:

  rshrn2 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)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)9fa8a9accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250054612954825101001001000010010000500427731313001830037300372826532874510100200104992002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
10204300372240024612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225030612954825101001001000010010000500427731303001830037300372826532874510100204100002042000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037224000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225040612954825101001001000010010000500427731303001830037300372826532874510100204100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000071011611296340100001003003830038300383003830038

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)9fa0a6a8a9acc2cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006403162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003721100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
10024300372250000018061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
100243008522601100035282295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  rshrn2 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)0318191e3a3f4e51inst 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)60696b6d6edispatch 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)9fa0a6a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300852240000612954725101001001000010010000500427716013005403008530087282716287401025321410008204200163003730085111020110099100100100001000000011171701600296450100001003003830038300383003830038
10204300372250000612954725101001001000010010149500427716013001803003730037282716287411010020010008200200163003730037111020110099100100100001000000311171801600296450100001003003830038300383003830038
10204300372250000612954725101001001000010010000500427716013001803003730037282716287401010020010008200200163003730037111020110099100100100001000000011171801600296450100001003003830038300383003830038
102043003722500006129547251010010210000100100005004277160130018030085300372827117287591010020010179208200163003730085111020110099100100100001002200275411174301600296450100001003003830038300383003830038
10204300372250000612954725101001001000010010000500427716013001803003730037282716287401010020010008200200163003730037111020110099100100100001000000011171801600296450100001003003830038300383003830038
102043003722500007262954725101001041000010010000500427716013001803003730037282716287401010020010008200200163003730037111020110099100100100001000010011171801600296450100001003003830038300383003830038
102043003722500180612954725101001001000010010000500427716013001803003730037282946287401010020010008200200163003730037111020110099100100100001000010011171701600296450100001003003830038300383003830038
102043003722500005132954725101001001000010010000500427716013001803003730037282717287411010020010008200200163003730037111020110099100100100001000000011171701600296460100001003003830038300383003830038
10204300372250000612954725101001001000010010000500427716013001803003730037282716287401010020010008200200163003730037111020110099100100100001000000011171701600296450100001003003830038300383003830038
10204300372250000612954725101001001000010010000500427716013001803003730037282716287411010020010008200200163003730037111020110099100100100001000000011171701600296450100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03081e3f4e51inst 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)9fa0a8a9acc5branch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640416332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
100243003722400612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830083
1002430037225030612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201017220200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
1002430037224002292954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000640316332962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  rshrn2 v0.16b, v8.8h, #3
  movi v1.16b, 0
  rshrn2 v1.16b, v8.8h, #3
  movi v2.16b, 0
  rshrn2 v2.16b, v8.8h, #3
  movi v3.16b, 0
  rshrn2 v3.16b, v8.8h, #3
  movi v4.16b, 0
  rshrn2 v4.16b, v8.8h, #3
  movi v5.16b, 0
  rshrn2 v5.16b, v8.8h, #3
  movi v6.16b, 0
  rshrn2 v6.16b, v8.8h, #3
  movi v7.16b, 0
  rshrn2 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)03191e3f51inst 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)9fa1a6a8acc5branch mispredict (cb)cdcfd5d6e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042009115003629258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119116200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200652116020110099100100160000100000011110119016200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
16020420065150019529258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
160204200651510052258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
1602042006515000599258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000011110119016200621600001002006620066200662006620066

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)5f60696b6d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420078150045278001010800001080000506400001120032020051200513228001020800002016000020051200511116002110910101600001010010033311142521110920048201160000102005220052200522005220052
16002420051151045278001010800001080000506400001020032020051200513228001020800002016000020051200511116002110910101600001003010033311102521191020048201160000102005220052200522005220052
160024200511500299278001010800001080000506400001020032020051200513228001020800002016000020051200511116002110910101600001012001003231112252119820048201160000102005220052200522005220052
16002420051150045278001010800001080000506400001120032020051200513228001020800002016000020051200511116002110910101600001020010033311102521191020048201160000102005220052200522005220052
16002420051150045278001010800001080000506400001120032020051200513228001020800002016000020051200511116002110910101600001020010033311925211111020048201160000102005220052200522005220052
160024200511500452780010108000010800005064000010200320200512005132280010208000020160000200512005111160021109101016000010200100353111125211111120048201160000102006120052200522005220052
1600242005115004527800101080000108000050640000112003202005120051322800102080000201600002005120051111600211091010160000102001003131182521111920048201160000102005220052200522005220052
1600242005115004527800101080000108000050640000112003232005120051322800102080000201600002005120051111600211091010160000101301003231110252119920048201160000102005220052200522005220052
16002420051150045278001010800001080000506400001120032020051200513228001020800002016000020051200511116002110910101600001003010032311925211121120048201160000102005220052200522005220052
160024200511509452780010108000010800005064000011200320200512005132280010208000020160000200512005111160021109101016000010000100313111225211101220048201160000102005220052200522005220052

Test 5: throughput

Count: 16

Code:

  rshrn2 v0.16b, v16.8h, #3
  rshrn2 v1.16b, v16.8h, #3
  rshrn2 v2.16b, v16.8h, #3
  rshrn2 v3.16b, v16.8h, #3
  rshrn2 v4.16b, v16.8h, #3
  rshrn2 v5.16b, v16.8h, #3
  rshrn2 v6.16b, v16.8h, #3
  rshrn2 v7.16b, v16.8h, #3
  rshrn2 v8.16b, v16.8h, #3
  rshrn2 v9.16b, v16.8h, #3
  rshrn2 v10.16b, v16.8h, #3
  rshrn2 v11.16b, v16.8h, #3
  rshrn2 v12.16b, v16.8h, #3
  rshrn2 v13.16b, v16.8h, #3
  rshrn2 v14.16b, v16.8h, #3
  rshrn2 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.2502

retire (01)cycle (02)03191e1f3f51inst 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)9fa8a9acc5branch mispredict (cb)cdcfd5d6daddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440059300000972516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010010011110118416033400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416022400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416042400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118316034400361600001004004040142400404004040040
16020440039299000302516010810016000810016002050012801321400704003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118316022400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416043400361600001004004040040400404004040040
16020440039299000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416043400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416044400361600001004004040040400404004040040
16020440039300000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416034400361600001004024240040400404004040040
16020440039300000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118416044400361600001004004040040400404004040088

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0307080a1e1f3f51inst 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)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)9fa0a8a9acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400513001000046251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228212516111221940036216160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228412216111221940036216160000104004040040400404004040040
1600244003930000000310251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228412216211182240036206160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228411816111181940036207160000104004040040400404004040040
1600244003930001115046251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228411916211171640036206160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228411816211182040036206160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000115400204003940039199960320019160010201600002032000040039400391116002110910101600001000000100228422116211172040036206160000104004040040400404004040040
160024400393000000046251600101016000010160000501280000115400204003940039199967320019160010201600002032000040039400391116002110910101600001000000100228511616211161640036206160000104004040090400404004040040
16002440039300000005225160010101600001016000050128000011540020400394003919996032001916001020160000203200004003940039111600211091010160000100000010024167220163222117400364113160000104004040040400404004040040
16002440039300000004625160010101600001016000050128000011104002040039400391999603200191600102016000020320000400394003911160021109101016000010000001002413611716211182140036207160000104004040040400404004040040