Apple M1 Microarchitecture Research by Dougall Johnson

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

USHL (vector, 4H)

Test 1: uops

Code:

  ushl 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)030818191e1f3f4e51inst 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)a0a1a6a8a9acc2cfd5d6dbddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10042037150001206116872510001000100026468012018203720371572318951000100020002037203711100110000000000732160111787100020382038203820382038
10042037160009010316872510001000100026468002018203720371572318951000100020002037203711100110000000000731160111787100020382038203820382038
1004203716000006116872510001000100026468002018203720371574318951000100020002037203711100110000000000731160111787100020382038203820382038
1004203716000006116872510001000100026468002018203720371572318951000100020002037203711100110000001000731160111787100020382038203820382038
1004203716000006116872510001000100026468002018203720371572318951000100020002037203711100110000000000731160111787100020382038203820382038
1004203716000006116872510001000100026468002018203720371572318951000100020002037203711100110000000000731160111787100020382038203820382038
10042037170001206116872510001000100026468002018203720371572318951000100020002037203711100110000000000731160111787100020382038203820382038
1004203716000006116872510001000100026468002018203720371572318951000100020002037203711100110000000000731160111787100020382038203820382038
1004203715000006116872510001000100026468002018203720371572318951000100020002037203711100110000000000731160111787100020382038203820382038
10042037160000061168725100010001000264680020182037203715723189510001000200020372037111001100000029000731160111787100020382038203820382038

Test 2: Latency 1->2

Code:

  ushl 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)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)9fa0a1a6a8acc2branch mispredict (cb)cfd0d5d6ddinst fetch restart (de)e0? int output thing (e9)ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102042003715500003300821968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000010007100116111979100100001002003820038200382003820038
10204200371550000000611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000007100116111979100100001002003820038200382003820038
1020420037156000038400611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000007100116111979100100001002003820038200382003820038
10204200371550000300611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000030007410116111979100100001002003820038200382003820038
102042003715500002100611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000007100116111979100100001002003820038200382003820038
102042003715500000001031968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000000007100116111979100100001002003820038200382003820038
1020420037155000015003461968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000003007100116111979100100001002003820038200382003820038
1020420037156000031500611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000007100116111979100100001002003820038200382003820038
102042003715500004500611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000017100116111979100100001002003820038200382003820038
1020420037155000036300611968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000000007100116111979100100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)03181e3f4e51inst 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
10024200371500961196872510010101000010100005028476801200182003720037184447187671001020100002020000200372003711100211091010100001060640216221978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
100242003715013961196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
100242008415009536196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
100242003715002761196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640216121978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640216221978510000102003820038200382003820038

Test 3: Latency 1->3

Code:

  ushl 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)03080b18191e1f3f4e51inst 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)9fa0a1a6a7a8a9acc2cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204200371550000150611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038
102042003715500001650611968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038
1020420037155000012352611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038
10204200371560000270611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000204000071011611197910100001002003820038200382003820038
1020420037157000000611968725101001001000010010000500284768012001820037200371842231874510100200101652002000020037200371110201100991001001000010000002000071011611197910100001002003820038200382003820038
1020420037155000013201561968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038
102042003715500002790611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038
10204200371550000150611968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038
10204200371560000150611968725101001001000010010000500284768002001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820086
10204200371550000330611968725101001001000010010000500284768012001820037200371842231874510100200100002002000020037200371110201100991001001000010000000000071011611197910100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)0308090b1e1f3f4e51inst 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)9fa1a8acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100242003715500102642530196547810035111003612104565528502460200182003720037184563187671001020106192020000200372003711100211091010100001000006402162219785010000102003820038200382003820038
1002420037155000372061196872510010101000010100005028515290200182003720037184443187671001020100002020000200372003711100211091010100001000006402162419785010000102003820038200382003820038
10024200371550000061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000606402162219785010000102003820038200382003820038
10024200371560013061196872510010121000010100005028476801200182003720037184443187671001020100002020000201822003711100211091010100001000006402164219785010000102003820038200382003820038
1002420037155000300281196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000006402162219785010000102003820038200382003820038
1002420037156000348061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000006402162219785010000102003820038200382003820038
1002420037155000420061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000006402162219785010000102003820038200382003820038
100242003715600018061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000006402162219785010000102003820038200382003820038
100242003715500012061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000006402162219785010000102003820038200382003820038
10024200371560006061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001020006402162219785010000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

  ushl v0.4h, v8.4h, v9.4h
  ushl v1.4h, v8.4h, v9.4h
  ushl v2.4h, v8.4h, v9.4h
  ushl v3.4h, v8.4h, v9.4h
  ushl v4.4h, v8.4h, v9.4h
  ushl v5.4h, v8.4h, v9.4h
  ushl v6.4h, v8.4h, v9.4h
  ushl 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)03181e3f51inst 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)9fa8cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
8020420038155012402580100100800001008000050064000012001920038200389973399968010020080000200160000200382003811802011009910010080000100051102161120035800001002003920039200392003920039
802042003815600552580100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815500404880100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815500402580100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815510932580100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815500402580100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815500402580100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815500402580100100800001008000050064000012001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
802042003815500402580100100800001008000050064000002001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039
8020420038155002922580100100800001008000050064000012001920038200389973399968010020080000200160000200382003811802011009910010080000100051101161120035800001002003920039200392003920039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0307181e3f51inst 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? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
80024200391550036825800101080000108000050640000020019200382003899963100188001020800002016000020038200381180021109101080000100130503821167520035080000102003920039200392003920039
8002420038155000812580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010003050208165620035080000102003920039200392003920039
80024200381550003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100230502071671220035080000102003920039200392003920039
800242003816100039258001010800001080000506400001200192003820038999631001880010208000020160000200382003811800211091010800001001700502061661220035080000102003920039200392009120039
80024200381601048392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010000050208167720035080000102003920039200392003920039
8002420038155000392580010108000010800005064000002001920038200389996310018800102080000201603902009020038118002110910108000010000050204168720035080000102003920039200392003920099
80024200381550002292580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010001405050736165620035280000102003920039200392003920039
800242003815500039258001010800001080000506400000200192003820038999631001880010208000020160000200382003811800211091010800001000005020111671220035080000102003920039200392003920039
8002420038155000392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010003050206166520035080000102003920039200392003920039
80024200381550003925800101080000108000050640000020019200382003899963100188001020800002016000020038200381180021109101080000100000502061611720035080000102003920039200392003920039