Apple M1 Microarchitecture Research by Dougall Johnson

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

FMSUB (scalar, D)

Test 1: uops

Code:

  fmsub d0, d0, d1, d2
  movi v0.16b, 1
  movi v1.16b, 2
  movi v2.16b, 3

(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)030b1e3f4e51inst 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)a1a6a8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100440373100613407251000100010005319084018403740373258338951000100030004037403711100110000000073216113473100040384038403840384038
100440373000823407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373100613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373009613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
1004403730066613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373100613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373000823407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373000613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373000613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038
100440373000613407251000100010005319084018403740373258338951000100030004037403711100110000000073116113473100040384038403840384038

Test 2: Latency 1->2

Code:

  fmsub d0, d0, d1, d2
  movi v0.16b, 1
  movi v1.16b, 2
  movi v2.16b, 3

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 4.0037

retire (01)cycle (02)030818191e3a3f4e51inst 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)9fa8accfd0d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020440037300000210613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121632394790100001004003840038400384003840038
1020440037300000180613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840038400384003840038
10204400373000003630613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000710131622395530100001004003840038400384003840038
1020440037300000570613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840038400384003840038
10204400373000003661613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840038400384003840038
1020440037300000607263940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840038400384003840038
102044003729900060613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840085400384003840038
1020440037300000180613940725101101001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000712121622394790100001004003840038400384003840038
102044003730000090613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840038400384003840038
102044003730000090613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000710121622394790100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code): 4.0037

retire (01)cycle (02)03080b1e1f3a3f4e51inst 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)9fa0a1a8acafc2branch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100244003730000150061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000000006402162239473010000104003840038400384003840038
100244003729900210061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003721100211091010100001000160006402322239473010000104003840038400384003840038
10024400373000000061394072510010101000010100005057069080400184003740037381308387671001020100002030000400374003711100211091010100001000100006402162239473010000104003840038400384003840038
1002440037299004080061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000000006402162239473010000104003840038400384003840038
1002440037300004230061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000030006402162239473010000104003840038400384003840038
1002440037300004890061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000000006403162239473010000104003840038400384003840038
1002440037299005400061394072510010101000010100005057069080400184003740037381303387671001020100002230000400374003711100211091010100001000000006702162239473010000104003840038400384003840038
1002440037299005160061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000000006402164239473010000104003840038400384003840038
100244003730000270061394072510010101000010100005057069080400184003740037381303387671001020101602030000400374003711100211091010100001000000006402162239473010000104003840038400384003840038
100244003730000001613940725100101210000101000050570690804001840037400373813033876710010201000020300004022440037111002110910101000010000120006402162239473010000104003840038400384003840038

Test 3: Latency 1->3

Code:

  fmsub d0, d1, d0, d2
  movi v0.16b, 1
  movi v1.16b, 2
  movi v2.16b, 3

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 4.0037

retire (01)cycle (02)031e3a3f4e51inst 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)6061696d6edispatch 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)9fa1a8a9accfd0d2d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102044003730033061394072510100100100001001000050057069081040018400374003738108338745101002001000020030000400374003711102011009910010010000100052127106121622394790100001004003840038400384003840038
10204400372991806139407251010010010000100100005005706908054001840037400373810833874510100200100002003000040037400371110201100991001001000010000007106121622394790100001004003840038400384003840038
102044003730027034639407251010010010000100100005005706908104001840037400373810833874510100200100002003000040037400371110201100991001001000010000007121021622394790100001004003840038400384003840038
1020440037299606139407251010010010000100100005005706908104001840037400373810833874510100200100002003000040037400371110201100991001001000010000007101021622394790100001004003840038400384003840038
10204400373003006139407251010010010000100100005005706908054001840037400373810833874510100200100002003000040037400371110201100991001001000010000007106121622394790100001004003840038400384003840038
10204400373003306139407251010010010000100100005005706908054001840037400373810833874510100200100002003000040037400371110201100991001001000010000007106121622394790100001004003840038400384003840038
10204400372992706139407251010010010000100100005005706908054001840037400373810833874510100200100002003000040037400371110201100991001001000010000007101021622394790100001004003840038400384003840038
10204400373003606139407251010010010000100100005005706908104001840037400373811933874510100200100002003000040037400371110201100991001001000010000007106121622394790100001004003840038400384003840038
10204400373003606139407251010010010000100100005005706908054001840037400373810833874510100200100002003000040037400371110201100991001001000010000007101021622394790100001004003840038400384003840038
10204400373003006139407251010010010000100100006235706908054001840037400373810833874510100200100002003000040037400371110201100991001001000010000007106121622394790100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code): 4.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)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)9fa8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002440037300876139407251001010100001010000505706908040018040037400373813033876710010201000020300004003740037111002110910101000010493640316333947310000104003840038400384003840038
10024400373003613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373006613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000668316333947310000104003840038400384003840038
100244003730060613940725100101010000101000050570690804001804003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381463387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400372990613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690804001804003740037381303387671015720100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690804001804003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690804001804003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038

Test 4: Latency 1->4

Code:

  fmsub d0, d1, d2, d0
  movi v0.16b, 1
  movi v1.16b, 2
  movi v2.16b, 3

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 4.0037

retire (01)cycle (02)0308090b18191e1f3a3f4e51inst 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)9fa0a1a6a8a9acc2cfd0d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020440037300000000001033940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001003003200710021622394790100001004003840038400384003840038
102044003730000000000613940725101001001000010010000500570690814001834003740037381083387451010020010000200300004003740037111020110099100100100001000000000710021622394790100001004003840038400384003840038
1020440037299000000005363940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121622394790100001004003840038400384003840038
102044003729900000000613940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121622394790100001004003840038400384003840038
102044003730000000000613940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121623394790100001004003840038400384003840038
102044003730000000000613940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121622394790100001004003840038400384003840038
102044003730000000000613940725101001001000010010000500570690814001804003740037381083387451010020010000202300004003740037111020110099100100100001000000000710121622394790100001004003840038400384003840038
102044003730000000000613940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121622394790100001004003840038400384003840038
102044003730000000000823940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121623394790100001004003840038400384003840038
102044003730000000000613940725101001001000010010000500570690814001804003740037381083387451010020010000200300004003740037111020110099100100100001000000000710121622394790100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code): 4.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)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)9fa8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100244003730007263940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216233947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216223947310000104003840038400384003840038
10024400373000613940725100101210000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216223947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216203947310000104003840038400384003840038
10024400843000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216223947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216233947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216223947310000104003840038400384003840038
10024400373000613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216223947310000104003840038400384003840038
10024400372990613940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001030640216223947310000104003840038400384003840038
100244003729901033940725100101010000101000050570690814001804003740037381303387671001020100002030000400374003711100211091010100001000640216223947310000104003840038400784003840038

Test 5: throughput

Count: 8

Code:

  fmsub d0, d8, d9, d10
  fmsub d1, d8, d9, d10
  fmsub d2, d8, d9, d10
  fmsub d3, d8, d9, d10
  fmsub d4, d8, d9, d10
  fmsub d5, d8, d9, d10
  fmsub d6, d8, d9, d10
  fmsub d7, d8, d9, d10
  movi v8.16b, 9
  movi v9.16b, 10
  movi v10.16b, 11

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03083f51inst 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)9fa8a9accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
8020420060151042258010010080000100800005006400002002120040201049973399988010020080000200240000200402004011802011009910010080000100340051102161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015007025801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015004225801001008000010080000500640000200212004020040997339998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041

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)5f60696d6edispatch 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)9fa8accdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
80024200501500136258001010800001080000506400000020021200402004099963100208001020800002024000020040200401180021109101080000100005020616772003780000102004120041200412004120041
8002420040151041258001010800001080000506400000120021200402004099963100208001020800002024000020040200401180021109101080000100005020516562003780000102004120041200412004120041
8002420040150041258001010800001080000506400000020021200402004099963100208001020800002024000020040200401180021109101080000100005020616662003780000102004120041200412004120041
8002420040150041258001010800001080000506400000120021200402004099963100208001020800002024000020040200401180021109101080000100005020516882003780000102004120041200412004120041
80024200401500230258001010800001080000506400000020021200402004099963100208001020800002024000020040200401180021109101080000101005020516882003780000102004120041200412004120041
80024200401500706258001010800001080000506400000020021200402004099963100208001020800002024000020040200401180021109101080000101005020616652003780000102004120041200412004120041
80024200401500412580010108000010800005064000001200212004020040999631002080010208000020240000200402004011800211091010800001004205020716882003780000102004120041200412004120041
8002420040150041258001010800001080000506400000120021200402004099963100208001020800002024000020040200401180021109101080000100005020716772003780000102004120041200412004120041
8002420040150041258001010800001080000506400001020021200402004099963100208001020800002024000020040200401180021109101080000100005020716772003780000102004120041200412004120041
8002420040150041258001010800001080000506400000120021200402004099963100208001020800002024000020040200401180021109101080000101005020616562003780000102004120041200412004120041