Apple M1 Microarchitecture Research by Dougall Johnson

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

SHRN2 (2D)

Test 1: uops

Code:

  shrn2 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)03181e3f4e51inst 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
1004303722006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723096125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730842415328951000100020003037303711100110000373116112630100030383038303830383038
1004303722036125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303722006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037230246125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030723038303830383038
1004303723006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  shrn2 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)030809191e1f3f4e51inst 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)9fa8acc5cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372240009091929548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
1020430037225000006129548251010010010008117101495004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
10204300372250000088929548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003008530038300383003830038
10204300372250000090029548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
1020430037224000006129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
1020430037225000008429548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
10204300372250000098429548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
10204300372240000099129548251010010010000100100005004277313300183003730084282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
10204300372250000095729548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038

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)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)9fa8cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216232963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001001640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216422963010000103003830038300383003830038
10024300372250128295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  shrn2 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)03070a1e3a3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9facc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372251100612954725101001001000010010000500427716013001830037300372827172874010100200100082002001630037300371110201100991001001000010001117171161129649100001003003830038300383008530038
10204300372251100612954725101001001000010010000500427716003001830037300372827162874010100200100082002001630037300371110201100991001001000010001117171161129650100001003003830038300383003830038
10204300372251100612954725101001001000010010000500427716003001830037300372827172874110100200100082002001630037300371110201100991001001000010001117171161329649100001003003830038300383003830038
10204300372261100612954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010001117171161129649100001003003830038300383003830038
10204300372251100612954725101001001000010010000500427716003001830037300372827162874010100200100082002001630037300371110201100991001001000010001117171161129650100001003003830038300383003830038
10204300372241100612954725101001001000010010000532427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010001117181161129650100001003003830038300383003830038
10204300372251100612954725101001001000010010000500427716003001830037300372827172874110100200100082002001630037300371110201100991001001000010001117181161129650100001003003830038300383003830038
10204300372251100612954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010001117171163429629100001003003830038300383003830038
10204300372250001972954725101001001000010010000500427716003001830037300372825262873310100200100002002000030037300371110201100991001001000010001117223243329629100001003003830038300383003830038
10204300372250001972954725101001001000010010000500427716003001830037300372825262876410100200100002002000030037300371110201100991001001000010001117223243329629100001003003830038300383003830038

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)9fa1a6a8acbranch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722501261295472510010101000010100005042771601300183003730037283073287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
100243003722500126295472510010101000010100005042771601300183003730037282863287861001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000100640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000000640216822962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038
10024300372250061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  shrn2 v0.4s, v8.2d, #3
  movi v1.16b, 0
  shrn2 v1.4s, v8.2d, #3
  movi v2.16b, 0
  shrn2 v2.4s, v8.2d, #3
  movi v3.16b, 0
  shrn2 v3.4s, v8.2d, #3
  movi v4.16b, 0
  shrn2 v4.4s, v8.2d, #3
  movi v5.16b, 0
  shrn2 v5.4s, v8.2d, #3
  movi v6.16b, 0
  shrn2 v6.4s, v8.2d, #3
  movi v7.16b, 0
  shrn2 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)03181e3f51inst 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)9fa8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042008815000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
16020420065150005042580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515100502580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000292580116100800161008002850064019612004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066
1602042006515000502580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000001111011901600200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)033f51inst 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)9fa8accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420087150452780010108000010800005064000010020032200512005132280010208000020160000200512005111160021109101016000010001002634317252126420048402160000102005220061200612006120052
160024200601505129800101080000108000050640000105200322006020060322800102080000201600002005120051111600211091010160000100010030114615342224320057202160000102006120061200612006120052
16002420060150722780010108000010800005064000001520041200512006032280010208000020160000200512005111160021109101016000010001002883814252112320048202160000102005220052200522006120052
160024200511509022780010108000010800005064000011520032200512005132280010208000020160000200512005111160021109101016000010001002884114252125520048201160000102005220052200522005220052
16002420051150452780010108000010800005064000001520032200512005132280010208000020160000200512005111160021109101016000010001002784014252115320048201160000102005220052200522005220052
160024200511501142780010108000010800005064000011520032200512005132280010208000020160000200512005111160021109101016000010001002684214344123420048201160000102005220061200522005220052
16002420051150452780010108000010800005064000011520032200512005132280010208000020160000200512005111160021109101016000010001003184515252114420057201160000102005220052200522005220061
160024200511505127800101080000108000050640000115200322005120051322800102080000201600002005120051111600211091010160000100010027845242521144200484013160000102005220052200522005220052
16002420051150722780010108000010800005064000011020041200512005132280010208000020160000200602006011160021109101016000010001002684313252115520048201160000102005220052200522005220052
16002420051150932780010108000010800005064000011520032200602005132280010208000020160000200512005111160021109101016000010001002684114252113320048201160000102005220052200522005220052

Test 5: throughput

Count: 16

Code:

  shrn2 v0.4s, v16.2d, #3
  shrn2 v1.4s, v16.2d, #3
  shrn2 v2.4s, v16.2d, #3
  shrn2 v3.4s, v16.2d, #3
  shrn2 v4.4s, v16.2d, #3
  shrn2 v5.4s, v16.2d, #3
  shrn2 v6.4s, v16.2d, #3
  shrn2 v7.4s, v16.2d, #3
  shrn2 v8.4s, v16.2d, #3
  shrn2 v9.4s, v16.2d, #3
  shrn2 v10.4s, v16.2d, #3
  shrn2 v11.4s, v16.2d, #3
  shrn2 v12.4s, v16.2d, #3
  shrn2 v13.4s, v16.2d, #3
  shrn2 v14.4s, v16.2d, #3
  shrn2 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)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)9fa1a8acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440059300030251601081071600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600402571600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
160204400393000695251601081001600081001600205001280132040020400894003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
160204400393000576251601081001600081001600205001280132140020400394003919977619990160229200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
160204400392990695251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011806100400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
160204400393000576251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0307080a0b18191e1f3f51inst 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)9fa1a6a8a9acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440050300100000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112316211232240036155160000104004040040400404004040040
16002440039300000000004625160010101600001016000050128000001400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112016211232140036165160000104004040040400404004040040
16002440039300000000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100963112216211152440036155160000104004040040400404004040040
160024400393000000000046251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000001027631131127211292840602156160000104080740858408104050640611
1600244080830521111415198913203252206161571101614651016146150129222211406234086240924201417220419161590201617912032189440812408631811600211091010160000104002772041029331127208211212140036155160000104004040040400404004040040
16002440039299000000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112016211212040036155160000104004040040400404004040040
16002440039300000000004625160010101600841016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112416211212040036155160000104004040040400404004040040
16002440039299000000004625160010101600001016000050128000010400204003940039200053200711600102016000020320000400394015011160021109101016000010003000100963112216221212240036155160000104004040040400404004040040
16002440039300000000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010001030100223112316211212340036155160000104004040040400404004040040
1600244003930000000000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039401421116002110910101600001002107800100223112316321232340036155160000104004040040400404004040040