Apple Microarchitecture Research by Dougall Johnson

M1/A14 P-core (Firestorm): Overview | Base Instructions | SIMD and FP Instructions
M1/A14 E-core (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 uop (01)cycle (02)03181e3f4e51schedule uop (52)schedule simd uop (54)dispatch simd uop (57)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map simd uop (7e)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst simd alu (9a)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (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 uop (01)cycle (02)03mmu table walk data (08)09191e1f3f4e51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int 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 uop (01)cycle (02)031e3f4e51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int 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 uop (01)cycle (02)03mmu table walk instruction (07)l2 tlb miss instruction (0a)1e3a3f4e51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9facbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int 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 uop (01)cycle (02)03mmu table walk data (08)1e3f4e51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)acbranch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int 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 uop (01)cycle (02)03181e3f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int 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 uop (01)cycle (02)033f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)5f6061696d6emap rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)accfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0eaec? simd retires (ee)? int 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 uop (01)cycle (02)031e3f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d tlb miss (a1)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int 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 uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss instruction (0a)l2 tlb miss data (0b)18191e1f3f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)5f60696d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)a9acc2cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0eaeb? simd retires (ee)? int retires (ef)f5f6f7f8fd
16002440050300100000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112316211232240036155160000104004040040400404004040040
16002440039300000000004625160010101600001016000050128000001400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112016211232140036165160000104004040040400404004040040
16002440039300000000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100963112216211152440036155160000104004040040400404004040040
160024400393000000000046251600101016000010160000501280000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000001027631131127211292840602156160000104080740858408104050640611
1600244080830521111415198913203252206161571101614651016146150129222211406234086240924201417220419161590201617912032189440812408631811600211091010160000104002772041029331127208211212140036155160000104004040040400404004040040
16002440039299000000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112016211212040036155160000104004040040400404004040040
16002440039300000000004625160010101600841016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000000100223112416211212040036155160000104004040040400404004040040
16002440039299000000004625160010101600001016000050128000010400204003940039200053200711600102016000020320000400394015011160021109101016000010003000100963112216221212240036155160000104004040040400404004040040
16002440039300000000004625160010101600001016000050128000011400204003940039199963200191600102016000020320000400394003911160021109101016000010001030100223112316211212340036155160000104004040040400404004040040
1600244003930000000000462516001010160000101600005012800001140020400394003919996320019160010201600002032000040039401421116002110910101600001002107800100223112316321232340036155160000104004040040400404004040040