Apple M1 Microarchitecture Research by Dougall Johnson

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

UHSUB (vector, 4H)

Test 1: uops

Code:

  uhsub v0.4h, v0.4h, v1.4h
  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)031e3f4e51inst 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)a0a6a8c2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10042037160611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150821687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720851110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037160611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000101210002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
100420371501491687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038

Test 2: Latency 1->2

Code:

  uhsub v0.4h, v0.4h, v1.4h
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)030918193f4e51inst 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)9fa1a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037150000191196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102163119791100001002003820038200382003820038
102042008415000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000084196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
1020420037149000147196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038
102042003715000061196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007101161119791100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)03191e3f4e51inst 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)9fa8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002420037165015103196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001010640216321978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216421978510000102003820038200382003820038
10024200371500198145196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216421978510000102003820038200382003820038
100242003715000103196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216421978510000102003820038200382003820038
100242003715000214196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216321978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001003640216421978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216321978510000102003820038200382003820038
10024200371500089196874410010101000010100005028476801200182003720037184443187671001020100002020000200842003711100211091010100001000640216421978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216421978510000102003820038200382003820038
1002420037150001075196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216421978510000102003820038200382003820038

Test 3: Latency 1->3

Code:

  uhsub v0.4h, v1.4h, v0.4h
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)0307080b18191e1f3a3f4e51inst 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)9fa0a1a8acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204200371500000000033219687251010010010000100100005002847680020018020037200371842231874510100200100002002000020037200371110201100991001001000010000000710116111979125100001002003820038200382003820038
1020420037150000000006119687251010010010000100100005002847680020018020037200371842231874510100200100002002000020037200371110201100991001001000010000000710116111979125100001002003820038200382003820038
102042003715000000000611968725101001001000010010000500284768002001802003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
1020420037150000100002081968725101001001000010010000500284768002001802003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715000000000611968725101001001000010010000500284768002001802003720037184223187451010020010000200200002003720037111020110099100100100001000000071221722197910100001002003820038200382003820038
102042003715010000000611968725101001001000010010000500284768002001802003720037184223187451010020010000200200002003720037111020110099100100100001000000071011711197910100001002003820038200382003820038
102042003715000000000611968725101001001000010010000500284768002001802003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715000000000611968725101001001000010010000500284768002001802003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715501113141264130719687251010010010000100103045002847680020090020179200371844131880110586220103342122132220275202765110201100991001001000010022057882777441211982519100001002008520038200382003820182
102042022715002024273176011251967643101621001000010010000500284896302001802003720037184223187451010020010000200200002003720037111020110099100100100001000009071011611197910100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)03080b18191e1f3a3f4e51inst 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
1002420037150000000061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
1002420037150000000061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
1002420037150000000061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
1002420037150000000061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
100242003715000007200480196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
10024200371500000000346196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
1002420037150000000061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
10024200371500000000103196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
1002420037150000000082196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038
1002420037150000000061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000000006402162219785010000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

  uhsub v0.4h, v8.4h, v9.4h
  uhsub v1.4h, v8.4h, v9.4h
  uhsub v2.4h, v8.4h, v9.4h
  uhsub v3.4h, v8.4h, v9.4h
  uhsub v4.4h, v8.4h, v9.4h
  uhsub v5.4h, v8.4h, v9.4h
  uhsub v6.4h, v8.4h, v9.4h
  uhsub v7.4h, v8.4h, v9.4h
  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)030b1e3f51inst 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)9facc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
802042006015000113258010810080008100800205006401322001920038200389977699898012020080032200160064200382003811802011009910010080000100011151180160020035800001002003920039200392003920039
80204200381500029258010810080008100800205006401322001920038200389977699898012020080032200160064200382003811802011009910010080000100011151180160020035800001002003920039200392003920039
80204200381500040258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
80204200381500040258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
80204200381500040258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
80204200381500040258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
80204200381500040258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
80204200381500040258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
80204200381500040498010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200392003920039
8020420038150001062258010010080000100800005006400002001920038200389973399968010020080000200160000200382003811802011009910010080000100000051101161120035800001002003920039200892003920039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030b1e3f51inst 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)9fa8a9accfd0d2d5d6d9ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
80024200471501014425800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020003160332003580000102003920039200392003920039
80024200381560030525800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020002160322003580000102003920039200392003920039
8002420038150003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000101035020004160222008280000102003920039200392003920039
8002420038150003943800101080000128009650640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020003160242003580000102003920039200392003920039
8002420038150003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020002160222003580000102003920039200392003920039
80024200381500123925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020002160332003580000102003920039200392003920039
8002420038150003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000101935020002160432003580000102003920039200392003920039
8002420038150003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020002160222003580000102003920039200392003920039
800242003815000392580010108000010800005064000012001920038200389996310018800102080000201600002003820038118002110910108000010550125020002160442003580000102003920039200392003920039
8002420038150003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100005020004160422003580000102003920039200392003920039