Apple M1 Microarchitecture Research by Dougall Johnson

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

TRN2 (vector, 16B)

Test 1: uops

Code:

  trn2 v0.16b, v0.16b, v1.16b
  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)696d6edispatch 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)a1a8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10042037150120168725100010001000264680201820372037157231895100010002000203720371110011000000073216111787100020382038203820382038
1004203716061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203716061168725100010001000264680201820372037157231895100010002000203720371110011000010073116111787100020382038203820382038
10042037160166168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715099168725100010001000264680201820372037157231895100010002000203720371110011000003073116111787100020382038203820382038
1004203716061168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715082168725100010001000264680201820372037157231895100010002000203720371110011000000073116111787100020382038203820382038
1004203715061168725100010001000264680201820372037157231895100010002000203720371110011000020073116111787100020382038203820382038

Test 2: Latency 1->2

Code:

  trn2 v0.16b, v0.16b, v1.16b
  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)030b1e3f4e51inst 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)9fa8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102042003715000166196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102162219791100001002003820038200382003820038
102042003715000168196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000647103164219791100001002003820038200382008720038
102042003715000646196762510100100100001001000050028489631200182003720037184223187451010020010000200200002003720037211020110099100100100001000007102162219791100001002003820038200382003820038
1020420037150101024196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001001007102162219791100001002003820038200382003820038
102042003715000103196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102162219791100001002003820038200382003820038
102042003715000191196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102162219791100001002003820038200382003820038
10204200371500061196872510100100100001001000050028476801200182003720037184243187451010020010000200200002003720037111020110099100100100001000007102492219791100001002003820038200382003820038
10204200371500061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102162219791100001002003820038200382003820038
102042003715000168196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102162219791100001002003820038200382003820038
102042003715000189196872510100100100001001000050028476800200182003720037184223187451010020010000200200002003720037111020110099100100100001000007102162219791100001002003820038200382003820038

1000 unrolls and 10 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)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
1002420037150081196872510010101000010100005028476800200182003720084184443187671001020100002020000200372003711100211091010100001000640416431978510000102003820038200382003820038
1002420037150061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640416431978510000102003820038200382003820038
10024200371509196196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640416431978510000102003820038200382003820038
1002420037150061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640416341978510000102003820038200382003820038
1002420037150061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640416441978510000102003820038200382003820038
1002420037150061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640416441978510000102003820038200382003820038
1002420037150061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640316441978510000102003820038200382003820038
1002420037150744145196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640416431978510000102003820038200382003820038
1002420084150061196872510010101000010100005028476801200182003720037184443187671001020100002020000200372003711100211091010100001000640416441978510000102003820038200852003820038
1002420037150061196872510010101000010100005028476800200182003720037184443187671001020100002020000200372003711100211091010100001000640416441978510000102003820038200382003820038

Test 3: Latency 1->3

Code:

  trn2 v0.16b, v1.16b, v0.16b
  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)0308181e1f3f4e51inst 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)9fa6a8a9accdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102042003715000357061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000003071011611197910100001002003820038200382003820038
102042003715000369061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715000321061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715000345061196872510100100100001241000050028476801200182003720037184223187451058520010000200200002003720037111020110099100100100001000000071011611198610100001002003820038200382003820038
102042003715000348061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000006071011611197910100001002003820038200382003820038
102042003715000375061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715000294061196762510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000078211611197910100001002003820038200382003820038
102042003715000288061196872510100100100001051030450028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715001267061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038
102042003715000546061196872510100100100001001000050028476801200182003720037184223187451010020010000200200002003720037111020110099100100100001000000071011611197910100001002003820038200382003820038

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)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)9fa8acbranch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024200371500061196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820038
100242003715000124196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820132
10024200371500061196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820038
100242003715000187196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316431978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820038
100242003715000229196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010100640316331978510000102003820038200382003820038
10024200371500061196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316331978510000102003820038200382003820038
10024200371500361196872510010101000010100005028476802001820037200371844431876710010201000020200002003720037111002110910101000010000640316431978510000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

  trn2 v0.16b, v8.16b, v9.16b
  trn2 v1.16b, v8.16b, v9.16b
  trn2 v2.16b, v8.16b, v9.16b
  trn2 v3.16b, v8.16b, v9.16b
  trn2 v4.16b, v8.16b, v9.16b
  trn2 v5.16b, v8.16b, v9.16b
  trn2 v6.16b, v8.16b, v9.16b
  trn2 v7.16b, v8.16b, v9.16b
  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)03080b18191e1f3f51inst 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
802042005915000000040258010010080000100800006046400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000000000511021611200350800001002003920039200392003920039
802042003815000000040258010010080000100800005006400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000001000511011611200350800001002003920039200392003920039
802042003815000000040258010010080000100800005006400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000000000511011611200350800001002003920039200392003920039
802042003815000000040258010010080000100800005006400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000000000511011611200350800001002003920039200392003920039
8020420038150000000402580100100800001008000050064000012001920038200389973399968010020080000200160000200382003811802011009910010080000100000030120511011611200350800001002003920039200392003920039
802042003815000000040258010010080000113800005006400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000000000511011611200350800001002003920039200392003920039
80204200381500000004025801001008000010080000500640000120019200382003899733999680100200800002001600002003820038118020110099100100800001000000001230511011611200350800001002003920039200392003920039
80204200381500000004025801001008000010080000500640000120019200382003899733999680100200800002001600002003820038118020110099100100800001000000001410511011611200350800001002003920039200392003920039
802042003815000000040258010010080000100800005006400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000000030511011611200350800001002003920039200392003920039
802042003815000000040258010010080000100800005006400001200192003820038997339996801002008000020016000020038200381180201100991001008000010000000000511011611200350800001002003920039200392003920039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03070a0b18191e1f3f51inst 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)9fa1a6a8acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
800242004815000000312039258001010800001080000506400001200192003820038999631001880010208000020160000200382003811800211091010800001000000502023161526200350080000102003920039200392003920039
800242003815000000237039258001010800001080000506400000200192003820038999631001880010208000020160000200382003811800211091010800001000032505414162327200350080000102003920039200392003920039
800242003815000000300039258001010800001080000506400000200192003820038999631001880010208000020160000200382003811800211091010800001000000502027162727200350080000102003920039200392003920039
80024200381500000030039258001010800001080099506400000200192009420038999671001880010208009720160000200972009111800211091010800001000000502025162626200350080000102003920039200392003920039
80024200381500010190817258001010800001080000506400001200192003820038999631001880010208000020160000200382003811800211091010800001000000502020492716200350080000102003920039200392003920039
80024200381500000027081258001010800001080000506400000200192003820241999631001880010208000020160000200382003811800211091010800001000000502027162828200350080000102003920039200392003920039
800242003815000000378081258001010800001080000506400000200192003820038999631001880010208000020160000200382003811800211091010800001000000502028162827200350080000102003920039200392003920039
800242003815000000438081258001010800001080000506400001200192003820038999631001880010208000020160000200382003811800211091010800001000000502016162726200350080000102008820039200392003920088
80024200381500001030363258001010800931080000506400001200192003820038999631001880109208009820160196200382003811800211091010800001040000502014162714200350080000102003920039200392003920039
800242003815000000237039258001010800001080000506400001200192003820038999631001880401208000020160000200382003811800211091010800001000000502028162819200350080000102003920039200392003920039