Apple M1 Microarchitecture Research by Dougall Johnson

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

SRHADD (vector, 8B)

Test 1: uops

Code:

  srhadd v0.8b, v0.8b, v1.8b
  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)03083f4e51inst 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)a7a8a9accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10042037150611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000373116111787100020382038203820382038
10042037150611687251000100010002646801201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715084168725100010001000264680120182037203715723189510001000200020372037111001100003022373116111787100020382038203820382038
10042037150611687251000100010002646800201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038

Test 2: Latency 1->2

Code:

  srhadd v0.8b, v0.8b, v1.8b
  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)03080b18191e1f3a3f4d4e51inst 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)9fa0a1a6a7a8a9acc2cfd0d5d6ddinst fetch restart (de)e0? int output thing (e9)ec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000007100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000007100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000007103116111979100100001002003820038200382003820038
102042003715000000006101968725101001001000010010000500284768002001820037200371842231874510100200100002042000020037200371110201100991001001000010000003012071001161119791180100001002003820038200382003820038
10204200371500000000604019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000007100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000007100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000020007100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000010007100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100002100307100116111979100100001002003820038200382003820038
1020420037150000000061019687251010010010000100100005002847680020018200372003718422318745101002001000020020000200372003711102011009910010010000100000000007100116111979100100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)0308090b18191e1f3f4e51inst 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)9fa0a1a6a7a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024200371500000000611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000010046402162219785010000102003820038200382003820038
10024200371500000000611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010020000306402162219785010000102003820038200382003820038
10024200371500000000611968725100101010000101000050284768002001820037200371844431876710010201016820200002003720037111002110910101000010000000006402162219785010000102003820038200382003820038
100242003715000000120611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000000006402162219785010000102003820038200382003820038
10024200851500000000611968725100101010000101000050284768002001820037200371844431876710010201000020200002008120037111002110910101000010000020199006402162219785310000102022720038202282022720179
100242018015111030402352105519654801004812100241210608502852812020126201792003718452151882310620201050122209882018020180211002110910101000010402024589827033622219895110000102018120038201812017920216
1002420178150010044082641552196871191002413100361110304822847680020162202162021718448161882210010201049220203382017920226511002110910101000010002012590346842413319823210000102018220228202282008720181
100242003715110133528176200119654631003615100481010456662851529120126201802013118450211885210471221050722213242022420178111002110910101000010022207597807042492319931310000102027220074202732022820132
10024202271521102366088611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010003030006402162219785010000102003820038200382003820038
10024200841500000000611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720084111002110910101000010000000306402162219785010000102003820038200382003820038

Test 3: Latency 1->3

Code:

  srhadd v0.8b, v1.8b, v0.8b
  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)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)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)9fa1cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037150155361968725101001001000010010000500284768020018020037200371842231874510100200100002002000020037200371110201100991001001000010007102161119791100001002003820038200382003820038
102042003715018611968725101001001000010010000500284768020018020037200841842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
102042003715024611968725101001001000010010000500284768020018020037200371842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
102042003715054611968725101001001000010010000500284768020018020037200371842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
10204200371500611968725101001001000010010000500284768020018020037200371842231876410100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
10204200371500611968725101001001000010010000500284768020018020037200371842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
10204200371500611968725101001001000010010000500284768020018020037200371842231874510256200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
102042003715002291968725101001001000010010000500284768020018020037200371842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
10204200371500611966725101001001000010010000500284768020018320037200371842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038
10204200371500611968725101001001000010010000500284768020018020037200371842231874510100200100002002000020037200371110201100991001001000010007101161119791100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)031e1f3f4e51inst 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)9fa1a6a8a9accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002420037150660611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
1002420037150150611968725100101010000101000050284768012001820037200371844431876710010201000020200002003720037111002110910101000010000036402162219785010000102003820038200382003820038
10024200371501507261968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
1002420037150120611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820084
100242003715000611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
1002420037150180611968725100101010000101000050284768012001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
1002420037150540611968725100101010000101000050284768012001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
100242003715000611968725100101010000101000050284768002001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
1002420037150690611968725100101010000101000050284768012001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038
10024200371500038451968725100101010000101000050284768012001820037200371844431876710010201000020200002003720037111002110910101000010000006402162219785010000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

  srhadd v0.8b, v8.8b, v9.8b
  srhadd v1.8b, v8.8b, v9.8b
  srhadd v2.8b, v8.8b, v9.8b
  srhadd v3.8b, v8.8b, v9.8b
  srhadd v4.8b, v8.8b, v9.8b
  srhadd v5.8b, v8.8b, v9.8b
  srhadd v6.8b, v8.8b, v9.8b
  srhadd v7.8b, v8.8b, v9.8b
  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)0304080b18191e1f3f51inst 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)9fa1a6a8accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
8020420038150100002704025801001008000010080000500640000120019200382003899733999680100200800002001600002003820038118020110099100100800001000000511041633200350800001002003920039200392003920039
8020420038150000001204025801001008000010080000500640000120019200382003899733999680100200800002001600002008820038118020110099100100800001000000511031632200350800001002003920039200392003920039
802042003815000000004025801001008000010080000500640000020019200382003899733999680100200800002001600002003820038118020110099100100800001000000511031623200350800001002003920039200392003920039
8020420038150000001804025801001008000010080000500640000020019200382003899733999680100200800002001600002003820038218020110099100100800001000010511031632200350800001002003920039200392003920039
802042003815000000004025801001008000010080000500640000020019200382003899733999680100200800002001600002003820038118020110099100100800001000000511021623200350800001002003920039200392003920039
8020420038150000002104025801001008000010080000500640000020019200382003899733999680100200800002001600002003820038118020110099100100800001000000511021623200350800001002003920039200392003920039
802042003815000000006825801001008000010080000500640000020019200382003899733999680100200800002001600002003820038118020110099100100800001000000511031632200350800001002003920039200392003920039
80204200381500000047104025801001008000010080000500640000020019200382003899733999680100200800002001600002003820038118020110099100100800001000000511021623200350800001002003920039200392003920039
8020420038150000002404025801001008000010080000500640000020019200382003899733999680100200800002001605782003820038118020110099100100800001000010511021623200350800001002003920039200392003920039
80204200381500000012884025801001208000012080000500640764020059200382003899733999680100200800002001600002003820038118020110099100100800001000000511031632200350800001002008920039200392003920039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03080b1e1f3f51inst 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)9fa1a6a8accfd5d6daddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
80024200391500090392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010000050201516014152003580000102003920039200392003920039
8002420038150004950392580010108000010800005064000012001920038200389996310018800102080000201600002003820038118002110910108000010000050201516014142003580000102003920039200392003920039
8002420038150003900392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010000050201416012122003580000102003920039200392003920039
80024200381500000392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010000050201616014142003580000102003920039200392003920039
80024200381500000392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010000050201316013162003580000102003920039200392003920039
800242003815000003925800101080000108000050640000120019200382003899963100188001020800002016000020038200381180021109101080000100041050201816014152003580000102003920039200392003920039
8002420038150001710812580010108000010800005064000012001920038200389996310018800102080000201600002003820038118002110910108000010000050201116015112003580000102003920039200392003920039
80024200381500048039258001010800001080000506400000200192003820038999631001880010208000020160000200382003811800211091010800001000005020121601292003580000102003920039200392003920039
800242003815000810392580010108000010800005064000002001920038200389996310018800102080000201600002003820038118002110910108000010001650201716016132003580000102003920089200392003920039
8002420038150101680392580010108000010800005064000012001920038200389996310018800102080000201600002003820038118002110910108000010000050201516018142003580000102003920039200392003920039