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

SQSHRN2 (4S)

Test 1: uops

Code:

  sqshrn2 v0.8h, v1.4s, #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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)f5f6f7f8fd
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110007073216222630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
1004303723061254825100010001000398313030183037303724153289510001000200030373037111001100001273216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372308225482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
1004303723126125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038

Test 2: Latency 1->1

Code:

  sqshrn2 v0.8h, v1.4s, #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)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 tlb miss (a1)l1d cache writeback (a8)acbranch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? simd retires (ee)? int retires (ef)f5f6f7f8fd
1020430037225017529548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100010071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722406129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
1020430037225014529548251010010010000100100005004277313130018300853003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038

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)9fst unit uop (a7)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? simd retires (ee)? int retires (ef)f5f6f7f8fd
10024300372240021029548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006403162229630010000103003830038300383003830038
1002530037225006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006402162229630010000103003830038300383003830038
1002430037225006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006402162229630010000103003830038300383003830038
10024300372250016629548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006402163229630010000103008630168300383003830038
1002430133225106129548251001010100001010000504277313130018300373003728287328767100102010000202000030084300371110021109101010000101006402162229630010000103003830038300383003830038
10024300372250021229548451001910100001010149604277313130018300373003728290828767100102010329202000030037300371110021109101010000100006402162229630010000103003830038300383003830038
1002430037225006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006402162229630010000103003830038300383003830038
1002430037225006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006402162229630010000103003830038300383003830038
1002430037225006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100006402162229630010000103003830038300383003830038
10024300372250061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000126402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  sqshrn2 v0.8h, v0.4s, #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)033f4e51schedule 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)60696b6d6emap 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)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? simd retires (ee)? int retires (ef)f5f6f7f8fd
102043003722561295472510100100100001001000050042771601300180300373003728271628741101002001000820020016300373003711102011009910010010000100001117181629645100001003003830038300383003830038
102043003722561295472510100100100001001000050042771600300180300373003728271628740101002001000820020000300373003711102011009910010010000100001117181629645100001003003830038300383003830038
102043003722561295472510100100100001001000050042771601300180300373003728271628740101002001000820020016300373003711102011009910010010000100001117181629645100001003003830038300383003830038
102043003722561295472510100100100001001000050042771601300180300373003728271728741101002001000820020016300373003711102011009910010010000100001117171629646100001003003830038300383003830038
102043003722561295472510100100100001001000050042771601300180300373003728271628740101002001000820020016300373003711102011009910010010000100001117171629646100001003003830038300383003830038
102043003722561295472510100100100001001000050042771601300180300373003728271628741101002001000820020016300373003711102011009910010010000100001117181630034100001003003830038300383003830038
102043003722561295472510100100100001001000050042771601300180300373003728271628741101002001000820020016300373003711102011009910010010000100001117181629645100001003003830038300383003830038
102043003722561295472510100100100001001000050042771600300180300373003728271728741101002001000820020016300373003711102011009910010010000100001117171629645100001003003830038300383003830038
102043003722461295472510100100100001001000050042771600300180300373003728271628741101002021000820020016300373003711102011009910010010000100001117181629645100001003003830038300383003830038
102043003722561295472510100100100001001000050042771600300180300373003728271728740101002001000820020016300373003711102011009910010010000100001117181629645100001003003830038300383003830038

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 tlb access (a0)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? simd retires (ee)? int retires (ef)f5f6f7f8fd
10024300372250612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
10024300372240612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
10024300372240612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722509952954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
10024300372250612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316362962910000103003830038300383003830038
10024300372250612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
10024300372250612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
10024300372250612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
10024300372250612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038
100243003722401452954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000640316332962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sqshrn2 v0.8h, v8.4s, #3
  movi v1.16b, 0
  sqshrn2 v1.8h, v8.4s, #3
  movi v2.16b, 0
  sqshrn2 v2.8h, v8.4s, #3
  movi v3.16b, 0
  sqshrn2 v3.8h, v8.4s, #3
  movi v4.16b, 0
  sqshrn2 v4.8h, v8.4s, #3
  movi v5.16b, 0
  sqshrn2 v5.8h, v8.4s, #3
  movi v6.16b, 0
  sqshrn2 v6.8h, v8.4s, #3
  movi v7.16b, 0
  sqshrn2 v7.8h, v8.4s, #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)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 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)st unit uop (a7)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
160204200891511529258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011911600200621600001002006620066200662006620066
1602042006515090124258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111012001600200621600001002006620066200662006620066
160204200651509329258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901611200621600001002006620066200662006620066
160204200651518429258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
160204200651517529258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111012011610200621600001002006620066200662006620066
16020420065150426504258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111012011611200621600001002006620066200662006620066
160204200651501022925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000004931111012011611200621600001002006620066200662006620066
160204200651509029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
16020420065150029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
160204200651519929258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901610200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 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)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 tlb access (a0)ld unit uop (a6)l1d cache writeback (a8)acc2cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0ea? simd retires (ee)? int retires (ef)f5f6f7f8fd
1600242008615000100516680010108000010800005064000011520029200502004632280114208000020160210200522005011160021109101016000010000001004413322414431115182004930160000102004720047200532005320047
1600242004815000092645164800101080000108000050640832011020031200502005032280010208000020160000200622004611160021109101016000010020001004213511917342219222004930160000102005120053200532005320051
16002420050150000004525800101080000108000050640000011020033200502005032280010208000020160000200462005011160021109101016000010000001004413512117941219202004915160000102004720051200492005320051
16002420052150000004525800101080104108000050640000111020027200462004832280010208000020160000200502004611160021109101016000010000001004213512016321117182004315160000102004920047200472004920049
16002420048150000004525800101080000108000050640000111020029200462004832280010208000020160000200522004611160021109101016000010000001004213511914121119182004315160000102004720047200492004920049
16002420048150000004525800101080000108000050640000111020027200482004632280010208000020160000200462004611160021109101016000010000001003613511813921120202004515160000102004920049200492004720049
16002420046150000004525800101080000108000050640000111020027200462004632280010208000020160000200522004611160021109101016000010000001004013511813921116182004316160000102004920047200472004920047
16002420048150000004525800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010000001004313511814721119182004515160000102004720047200472004720049
16002420046150000004525800101080000108000050640000111020029200462004632280010208000020160000200532004611160021109101016000010000001004113511914221118172004316160000102004720047200472004720049
16002420046150000004525800101080000108000050640000111020027200462004632280010208000020160000200502004611160021109101016000010000001004113511313621113152004715160000102004720047200472004720047

Test 5: throughput

Count: 16

Code:

  sqshrn2 v0.8h, v16.4s, #3
  sqshrn2 v1.8h, v16.4s, #3
  sqshrn2 v2.8h, v16.4s, #3
  sqshrn2 v3.8h, v16.4s, #3
  sqshrn2 v4.8h, v16.4s, #3
  sqshrn2 v5.8h, v16.4s, #3
  sqshrn2 v6.8h, v16.4s, #3
  sqshrn2 v7.8h, v16.4s, #3
  sqshrn2 v8.8h, v16.4s, #3
  sqshrn2 v9.8h, v16.4s, #3
  sqshrn2 v10.8h, v16.4s, #3
  sqshrn2 v11.8h, v16.4s, #3
  sqshrn2 v12.8h, v16.4s, #3
  sqshrn2 v13.8h, v16.4s, #3
  sqshrn2 v14.8h, v16.4s, #3
  sqshrn2 v15.8h, v16.4s, #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)9fld unit uop (a6)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
16020440039300030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011811600400361600001004004040040400404004040040
160204400393002430251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039300051251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132040020400394009019977619990160120200160032200320064400394003911160201100991001001600001002301111011801600400361600001004004040040400404004040040
160204400392990695251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132140021400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039299030251601081001600081001600205001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039300030251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040
16020440039300330251601081001600081001600205001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000001111011801600400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)0318191e3f51schedule 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 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)st unit uop (a7)l1d cache writeback (a8)acc2cfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0eaeb? simd retires (ee)? int retires (ef)f5f6f7f8fd
1600244005130000364625160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223115162116440036206160000104004040040400404004040040
1600244003929900516725160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223117162114540036206160000104004040040400404004040040
1600244003929900071125160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223116162113540036206160000104004040040400404004040040
160024400393000004625160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000002100223117162115540036206160000104004040040400404004040040
160024400393000004625160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223119162115540036206160000104004040040400404004040040
160024400392990004625160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223117162115340036206160000104004040040400404004040040
1600244003930000052251600101016000010160000501280000010400204003940039199963200191600102016000020320000400394003911160021109101016000010000001002462271642268400364012160000104004040040400404004040040
160024400393000005225160010101600001016000050128000001040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223118162117740036206160000104004040040400404004040040
160024400393000004625160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223115162116440036206160000104004040040400404004040040
160024400393000004625160010101600001016000050128000011040020400394003919996320019160010201600002032000040039400391116002110910101600001000000100223113162117440036206160000104004040040400404004040040