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 (8H)

Test 1: uops

Code:

  shrn2 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 uop (01)cycle (02)031e3f4e51schedule 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)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)f5f6f7f8fd
1004303723061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303723061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303722061254825100010001000398313130183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303722061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303723061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303722061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303723061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303723061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303722061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
1004303722061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  shrn2 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 uop (01)cycle (02)03l2 tlb miss data (0b)1e1f3f4e51schedule 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 access (a0)st unit uop (a7)l1d cache writeback (a8)acc2cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? simd retires (ee)? int retires (ef)f5f6f7f8fd
1020430037225000762954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
10204300372250001052954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002099030086300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037224000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037225000612954825101001001000010010000500427731303001830084300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038
1020430037224000612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071011611296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire uop (01)cycle (02)03mmu table walk instruction (07)l2 tlb miss data (0b)18191e1f3f4e51schedule 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)simd prf full (72)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)9fld unit uop (a6)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? simd retires (ee)? int retires (ef)f5f6f7f8fd
1002430037225000000612954825100101010000121000050427731303001830037300372828703287671001220100002020000300373003711100211091010100001000006422162229630010000103003830038300383003830038
10024300372250000005362954825100101010000101000055427731313001830037300372828703287671001020106522020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037233000000612954825100171010000101000050427731303001830037300372828703287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225000000612954825100101010000101000050427731313001830037300372828703287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225000000612954825100101010000101000050427731313001830037300372828703287671001220100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225000000612954825100101010000101000050427731303001830037300372828703287671001220100002020000300373003711100211091010100001000006402162229630210000103003830038300383003830038
1002430037224100000612954825100101010000101000050427731303001830037300372828703287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225000000612954825100101010000101000050427731303001830037300372828703287671001020100002020000300373003711100211091010100001000006403162229630010000103003830038300383003830038
1002430037225000000612954825100101010000101000050427731303001830037300372828703287671001020101792020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
10024300372250000004412954825100101010000101000050427731303001830037300372828703287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  shrn2 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 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)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 tlb access (a0)l1d tlb miss (a1)l1d cache writeback (a8)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? simd retires (ee)? int retires (ef)f5f6f7f8fd
10204300372250612954725101001001000010010000500427716030018300373003728271628740101002001000820020016300373003711102011009910010010000100000001117171629646100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271628741101002001000820020016300373003711102021009910010010000100000001117171629646100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271728740101002001000820020016300843003711102011009910010010000100020001117171629646100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271728740101002001000820020016300373003711102011009910010010000100000001117171629645100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271728740101002001000820020016300373003711102011009910010010000100000001117181629645100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271728740101002001000820020016300373003711102011009910010010000100004031117171629645100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271628740101002001000820020016300373003711102011009910010010000100000001117171629646100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271728741101002001000820020016300373003711102011009910010010000100000001117171629646100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271728741101002001000820020016300373003711102011009910010010000100000001117181629645100001003003830038300383003830038
10204300372250612954725101001001000010010000500427716030018300373003728271628741101002001000820020016300373003711102011009910010010000100000001117171629646100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire uop (01)cycle (02)03l2 tlb miss data (0b)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)9fld unit uop (a6)l1d cache writeback (a8)a9cfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int retires (ef)f5f6f7f8fd
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722400612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010200640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010241000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722400822954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
1002430037225015612954725100101010000101000050427716003001830037300372829132876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722500612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  shrn2 v0.16b, v8.8h, #3
  movi v1.16b, 0
  shrn2 v1.16b, v8.8h, #3
  movi v2.16b, 0
  shrn2 v2.16b, v8.8h, #3
  movi v3.16b, 0
  shrn2 v3.16b, v8.8h, #3
  movi v4.16b, 0
  shrn2 v4.16b, v8.8h, #3
  movi v5.16b, 0
  shrn2 v5.16b, v8.8h, #3
  movi v6.16b, 0
  shrn2 v6.16b, v8.8h, #3
  movi v7.16b, 0
  shrn2 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 uop (01)cycle (02)03l2 tlb miss data (0b)191e1f3f51schedule 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 tlb access (a0)st unit uop (a7)l1d cache writeback (a8)a9acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)fetch restart (de)e0? simd retires (ee)? int retires (ef)f5f6f7f8fd
160204200881500048029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000000111101190160200621600001002006620066200662006620066
16020420065151000029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000000111101190160200621600001002006620066200662006620066
160204200651500021029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000000111101190160200621600001002006620066200662006620066
160204200651500036029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000000111101190161200621600001002006620066200662006620066
1602042006515100330292580116100800161008002850064019602004520065200651479801282008002820016005620065200651116020110099100100160000100000000111101190160200621600001002006620066200662006620066
16020420065151001259829908022410080124100801325006401961200452014720147612801282008002820016005620065200651116020110099100100160000100000000111101190160200621600001002006620066200662006620066
160204200651500015029321802231008001610080028505641044020045201472014761280128200800282001600562006520147111602011009910010016000010040025300111101190160200621600001002045820164200662011520199
16020420065150116029258011610080016100802395006410520200452006520065612802332008024020016005620065200651116020110099100100160000100400000111101430160200621600001002006620149200662006620066
16020420065151020050487802211008011210080133500641036120118201542015513128012820280136202160056200652006511160201100991001001600001000010301111011911823200621600001002006620066200662006620066
16020420065150006071258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000000111101190160200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)031e3a3f51schedule 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)5f60696b6d6emap 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)cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0ea? simd retires (ee)? int retires (ef)f5f6f7f8fd
16002420076150604252580010108000010800005064000011200420200462004632280010208000020160000200482004811160021109101016000010010048311252011118212004315160000102004720049201532004920049
1600242004815060452580010108000010800005064000011200380200462004632280010208000020160000200462005011160021109101016000010110043611182041118182004515160000102004920049200472004720053
16002420046151210452580010108000010800005064000011200470200462005032280010208000020160000200462004611160021109101016000010010045311232221123182004331160000102004720047200472004720047
1600242005015000452580010108000010800005064000011200470200462004632280010208000020160000200462004611160021109101016000010010042321192021220162004515160000102004920047200472004920049
16002420046150480732580010108000010800005064000011200380200462004632280010208000020160000200482004811160021109101016000010010042311202611120192004515160000102004920051200472004720047
160024200501503420452580010108000010800005064000011200390200462004832280010208000020160000200502004611160021109101016000010010040311192011118182004516160000102004720047200472004720138
1600242004815000452580010108000010800005064000011200390200462004832280010208000020160000200502004811160021109101016000010010045311232222119222004330160000102005320047200512004720047
1600242004815000452580010108000010800005064000011200370200462004632280010208000020160000200462004611160021109101016000010010040311172421121172004316160000102004720049200532004720047
16002420048150120452580010108000010800005064000011200370200482004832280010208000020160000200482004811160021109101016000010010043311182021121222004316160000102004720049200492004920047
1600242004615000452580010108000010800005064000001200460200462004632280010208000020160000200462004811160021109101016000010010043611192241120232004315160000102004720047200492004920049

Test 5: throughput

Count: 16

Code:

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

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)simd prf full (72)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)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int retires (ef)f5f6f7f8fd
16020440058300030251601081001600081001600205001280132040020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004008940040400404004040040
16020440039299030251601081001600081001600205001280132040061400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132140020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132140020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394003919977061999016012020016003220032006440039400391116020110099100100160000100001111011801600400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l2 tlb miss data (0b)18191e1f3a3f51schedule 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)5f6061696b6d6emap 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)91inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)acc2cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0eaeb? simd retires (ee)? int retires (ef)f5f6f7f8fd
160024400512990000004625160010101600001016000050128000011540020040039400391999632001916001020160000203200004003940039111600211090101016000010000001002211216162127640036155160000104004040040400404004040040
16002440039300000000462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109010101600001000000100228317162117740036155160000104004040040400404004040040
16002440039300000000462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109010101600001000000100228227162124640036155160000104004040040400404004040040
16002440039300000000462516001010160000101600005012800000154002004003940039199968200191600102016000020320210400394013011160021109010101600001000000100228214162114440036156160000104010440040400404004040040
16002440039300100000942516001010160000101600005012800000154002004003940039199963200481600102016000020320636400914003911160021109010101600001000000100228217162114440036155160000104004040040400404004040040
160024400392990000005212516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109010101600001000000100228214162114340036155160000104004040040400404004040040
16002440039300000000462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109010101600001000000100228214362116640036155160000104010240040400404004040040
160024400393000111013329681462516001010160000101600005012800001154031504003940039199963200191600102016000020320000400394003911160021109010101600001002030100228213162116440036155160000104004040040400404004040040
16002440039299000000462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109010101600001000100100228213162114440036155160000104004040040400404025040040
160024400393000001200462516001010160000101600005012800001154002004003940039199963200191600102016000020320000400394003911160021109010101600001000000100228214162114340036305160000104004040040400404004040040