Apple M1 Microarchitecture Research by Dougall Johnson

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

SUBHN (vector, 4S)

Test 1: uops

Code:

  subhn v0.4h, v0.4s, v1.4s
  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)031e1f3f4e51inst 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)a8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10043037220061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
10043037230061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
100430372330061254825100010001000398313030183037303724153289510001000200030373037111001100003073116112630100030383038303830383038
10043037233061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
10043037230061254825100010001000398313030223037303724153289510001000200030373037111001100000073116112630100030383038303830383038
10043037220082254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
10043037220061254825100010001000398313030183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
10043037230061254825100010001000398313130183037303724153289510001000200030373037111001100000073116112630100030383038303830383038
10043037230061254825100010001000398313030183037303724153289510001000200030373037111001100013073116112630100030383038303830383038
10043037230061254825100010001000398313130183037303724153289511491000200030373037111001100023073116112630100030383038303830383038

Test 2: Latency 1->2

Code:

  subhn v0.4h, v0.4s, v1.4s
  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)03080918191e3f4e51inst 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)9fa0a1a6a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225000006129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037224000006129548251010010010000100100005004277313130018300853003728269328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
10204300372250000072629548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000003071021622296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037225100006129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071021622296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0308090b181e3f4e51inst 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)696b6d6edispatch 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)9faccfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225000006129548251001010100001010000504277313300540300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
10024300372260000246129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640116222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038
1002430037225000006129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100640216222963010000103003830038300383003830038

Test 3: Latency 1->3

Code:

  subhn v0.4h, v1.4s, v0.4s
  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)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)9fa1a8a9accfd0d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038300383003830038
1020430037225082295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038302273003830038
1020430037225061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000200710011611296340100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038300383003830038
1020430037224961295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038300383003830038
10204300372254561295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830170300383003830038
1020430037225061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011611296340100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710011610296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03090b18191e1f3a3f4e51inst 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)9fa0a8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037233000000050329548251001010100001010000504277313130018300373003728287328767100102010000202000030085300853110021109101010000100600640216222963010000103003830038300383003830038
1002430037225000090061295482510010101000010100005042773131300183003730037283013287671001020100002020000300373003711100211091010100001002200640216222963010000103003830038300383003830038
100243003722500001200612954825100101010000101000050427731313001830037300372828719287671001020100002020000300373003711100211091010100001006100640216222963010000103003830038300383003830038
1002430037225000000094329548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100030640216222963010000103003830085300383003830038
1002430037225000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001001900640216222963010000103003830038300383003830038
1002430037225000000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001004200640216222963010000103003830038300383003830038
1002430037225000000061295482510010101000010100006042773131300183003730037282873287671001020100002020000300373003711100211091010100001002600640216222963010000103003830038300383003830038
10024300372251000411352061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001001000640249222963010000103003830038300383003830038
100243003722500000006129548841001010100001010000504277313130018300373003728287328841100102010000202000030037300371110021109101010000100290640216222963010000103003830038300383003830038
1002430037224000000069029548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100100640216222963010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  subhn v0.4h, v8.4s, v9.4s
  subhn v1.4h, v8.4s, v9.4s
  subhn v2.4h, v8.4s, v9.4s
  subhn v3.4h, v8.4s, v9.4s
  subhn v4.4h, v8.4s, v9.4s
  subhn v5.4h, v8.4s, v9.4s
  subhn v6.4h, v8.4s, v9.4s
  subhn v7.4h, v8.4s, v9.4s
  movi v8.16b, 9
  movi v9.16b, 10

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)0308090b1e3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696b6d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8acc2c5cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
80204200581500200412580100100800001008000050064000002002002003920039997339997801002008000020016000020039200391180201100991001008000010030000511031611200360800001002004020040200402004020040
80204200391500000412580100100800001008000050064000012002002003920039997339997801002008000020016000020039200391180201100991001008000010000000511011611200360800001002004020040200402004020040
8020420039150000010862580100100800001008000050064000012002002003920039997339997801002008000020016000020039200391180201100991001008000010010000511011611200360800001002004020040200402004020040
80204200391500000412580100100800001008000050064000012002002003920039997339997801002008000020016000020039200391180201100991001008000010010000511011611200360800001002004020040200402004020040
802042003915000004125801001008000010080000500640000120020320039200399973399978010020080000200160000200392003911802011009910010080000100024000511011611200360800001002004020040200402004020040
80204200391500000412580100100800001008000050064000002002002003920039997339997801002008000020016000020039200392180201100991001008000010000000511011611200360800001002004020040200402004020040
80204200391500000412580100100800001008000050064000002002002003920039997339997801002008000020016000020039200391180201100991001008000010010000511011611200360800001002004020040200402004020040
802042003915000004125801001008000010080000500640000020020020039200399973310025801002008000020016000020039200391180201100991001008000010010000511011611200360800001002004020040200402004020040
80204200391500000412580100100800001008000050064000002002002003920039997339997801002008000020016000020039200391180201100991001008000010000000511011611200360800001002004020040200402004020040
80204200391500000415080100100800001008000050064000002002002003920039997339997801002008000020016000020039200391180201100991001008000010010000511011611200360800001002004020040200402004020040

1000 unrolls and 10 iterations

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

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)9fa8a9acc2cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
800242004815004025800101080000108000050640000120020200392003910011310019800102080000201600002003920039118002110910108000010000005020316322003680000102004020040200402004020040
80024200391500402580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010000005020316322003680000102004020040200402004020040
800242003915004025800101080000108000050640000120020200392003999963100198001020800002016000020039200391180021109101080000100021005020316322003680000102004020040200402004020040
800242003915007052580010108000010800005064000002002020039200399996310019800102080000201600002003920039118002110910108000010109005020216332003680000102004020040200402004020040
80024200391500402580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010003005020316232003680000102004020040200402004020040
80024200391500402580010108000010800005064000002002020039200399996310019800102080000201600002003920039118002110910108000010100005020316332003680000102004020040200402004020040
80024200391500402580010108000010800005064000002002020039200399996310019800102080000201600002003920039118002110910108000010103005020216322003680000102004020040200402004020040
80024200391500402580010108000010800005064000002002020039200399996310019800102080000201600002003920039118002110910108000010000005020216332003680000102004020040200402004020040
800242003915002582580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010100005020316232003680000102004020040200402004020042
80024200391500402580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010000005020316332003680000102004020040200402004020040