Apple M1 Microarchitecture Research by Dougall Johnson

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

FMADD (scalar, S)

Test 1: uops

Code:

  fmadd s0, s0, s1, s2
  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)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)a8a9accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730082340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908140184037403732583389510001000300040374037111001100070073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100000073116113473100040384038403840384038
1004403730061340725100010001000531908040184037403732583389510001000300040374037111001100070073116113473100040384038403840384038

Test 2: Latency 1->2

Code:

  fmadd s0, s0, s1, s2
  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)03181e3a3f4e51inst 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)9fa8acc2cfd0d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204400373010002323940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000071002163239479100001004003840038400384003840038
1020440037300000613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000071003162239479100001004003840038400384003840038
1020440037300000613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000071002162239479100001004003840038400384003840038
102044003730000061394072510100100100001001000050057069080400184003740037381083387451010020010000200300004003740037111020110099100100100001000132071002162239479100001004003840038400384003840038
1020440037300000613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000071012162239479100001004003840038400384003840038
1020440037299000613940725101001001000010010000522570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000071012242239479100001004003840038400384003840038
1020440037299001613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010000071012162339479100001004003840038400384003840038
1020440037299000613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000071012162239479100001004003840038400384003840038
1020440037300000613940725101001001000010010000500570690804001840037400373810833874510100200100002003000040037400371110201100991001001000010010071012162239479100001004003840038400384003840038
1020440037300000613940725101001001000010010000500570690814001840037400373810833874510100200100002003000040037400371110201100991001001000010000071012162239479100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code): 4.0037

retire (01)cycle (02)030818191e1f3f4e51inst 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)9fa6a8a9accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002440037299000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640216323947310000104003840038400384003840038
1002440037300000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100003640216223947310000104003840038400384003840038
1002440037300000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640316323947310000104003840038400384003840038
1002440037300000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640316223947310000104003840038400384003840038
100244003730000058806139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640316223947310000104003840038400384003840038
10024400373000000025139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640216223947310000104003840038400384003840038
10024400372990000010339407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640224323947310000104003840038400384003840038
1002440037300000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640316223947310000104003840038400384003840038
1002440037300000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640216323947310000104003840038400384003840038
1002440037300000006139407251001010100001010000505706908140018400374003738130338767100102010000203000040037400371110021109101010000100000640216233947310000104003840038400384003840038

Test 3: Latency 1->3

Code:

  fmadd s0, s1, s0, s2
  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? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102044003730000000145394072510100100100001001000050057069081400184003740037381083387451010020010000200300004003740037111020110099100100100001000071002162239479100001004003840038400384003840038
10204400373000000061394072510100100100001001000050057069081400184003740037381083387451010020010000200300004003740037111020110099100100100001000071202162239479100001004003840038400384003840038
10204400373000000061394072510100100100001001000050057069080400184003740037381083387451010020010000200300004003740037111020110099100100100001000071003162239479100001004008540038400384003840038
1020440037300000264061394072510100100100001001000050057069081400184003740037381083387451010020010000200300004003740037111020110099100100100001000071012162239479100001004003840038400384003840038
102044003730000027061394072510100100100001001000050057069081400184003740037381083387451010020010000200300004003740037111020110099100100100001000071012162239479100001004003840038400384003840038
10204400373000000061394072510100100100001001000050057069081400184003740037381083387451010020010000204300004003740037111020110099100100100001000071012162239479100001004003840038400384003840038
10204400373000000061394072510100100100001001000050057069081400184003740037381083387451010020010000200300004003740037111020110099100100100001000071212162239479100001004003840038400384003840038
10204400373000000061394072510100100100001001000050057069080400184003740037381083387451010020010000200300004003740037111020110099100100100001000071212162239479100001004003840038400384003840038
10204400373000000061393892510100100100001001000050057069081400184003740037381083387451010020010000200300004003740037111020110099100100100001000071012162239479100001004003840038400384003840038
1020440037300000849061394072510100100100001001000050057069080400184003740037381083387451010020010000200300004003740037111020110099100100100001000071212162239479100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code): 4.0037

retire (01)cycle (02)030818191e1f3f4e5051inst 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)9fa0a1a6a8a9acc2c5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024400373000005190106839407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010040000006403163339473010000104003840038400384003840038
100244003730000011106139407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010003100006403163339473010000104003840086400864003840038
100244003730000051906139407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010000000006403163339473010000104003840038400384003840038
100244003730000048606139407025100101010000101000050570690840018040037400373813073876710010201000020300004003740037111002110910101000010020000006403483339473010000104003840038400384003840038
100244003729900066610889239407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010000506016403163339473010000104003840038400384003840038
10024400372990001506139407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010000000006403163339473010000104003840038400384003840038
1002440037300000006139407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010000000006403163339473010000104003840038400384003840038
10024400373001000010339407025100101010000101000050570830440018340037400373813033876710010201000020300004003740037111002110910101000010000309006403483339473010000104003840038400384003840038
100244003729900053408239407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010000000006403163339473010000104003840038400384003840038
100244003730000010806139407025100101010000101000050570690840018040037400373813033876710010201000020300004003740037111002110910101000010000000006403163339473010000104003840038400384003840038

Test 4: Latency 1->4

Code:

  fmadd s0, s1, s2, s0
  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)03040b1e3a3f4e51inst 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)9fa6a8a9acc2cdcfd0d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102044003730000017839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071305164539479100001004003840038400384003840038
102044003730010017839407251010010010000100100005005706908040018040037400373810833874510100200100002043000040037400371110201100991001001000010000000071213163539479100001004003840038400384003840038
1020440037300100136339407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071315163539479100001004003840038400384003840038
102044003729910017839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071315165539479100001004003840038400384003840038
102044003730010027839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071614164439479100001004003840038400384003840038
102044003730010017839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071315164539479100001004003840038400384003840038
102044003730010017839407251010010010000100100005005706908140018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071315165539479100001004003840038400384003840038
102044003729910017839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071215165639479100001004003840038400384003840038
102044003730010017839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071314165539479100001004003840038400384003840038
102044003730010017839407251010010010000100100005005706908040018040037400373810833874510100200100002003000040037400371110201100991001001000010000000071616165639479100001004008640038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code): 4.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
100244003730009103394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640416633947310000104003840038400384003840038
10024400372990061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316433947310000104003840038400384003840038
10024400373000061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
10024400373000061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316333947310000104003840038400384003840038
100244003730000726394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640416433947310000104003840038400384003840038
10024400373000061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316533947310000104003840038400384003840038
10024400373000061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640416433947310000104003840038400384003840038
10024400372990061394072510010101000010100005057069080400184003740037381303387671001020100002030000400374003711100211091010100001000640316443947310000104003840038400384003840038

Test 5: throughput

Count: 8

Code:

  fmadd s0, s8, s9, s10
  fmadd s1, s8, s9, s10
  fmadd s2, s8, s9, s10
  fmadd s3, s8, s9, s10
  fmadd s4, s8, s9, s10
  fmadd s5, s8, s9, s10
  fmadd s6, s8, s9, s10
  fmadd s7, s8, s9, s10
  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)03181f3f51inst 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)72scheduler 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
8020420050150001262580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
8020420040150001072580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000422580100100800001008000050064000002002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015010422580100100800001008000050064000002002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000422580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000422580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000422580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000632580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000422580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041
802042004015000422580100100800001008000050064000012002120040200409973039998801002008000020024000020040200401180201100991001008000010000051101161120037800001002004120041200412004120041

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030b18191e3f51inst 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)9fa8a9accdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
8002420040150000083258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020216112003780000102004120041200412004120041
8002420040150000041258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020116222003780000102004120041200412004120041
8002420040150000041258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020116122003780000102004120041200412004120041
80024200401500000104258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020216332003780000102004120041200412004120041
8002420040150010041258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020216232003780000102004120041200412004120041
8002420040150000041258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020116112003780000102004120041200412004120041
8002420040150000941258009510800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020116222003780000102004120041200412004120041
8002420040150000041258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020116212003780000102004120041200412004120041
8002420040150000041258001010800001080000506400000200212004020040999631002080126208000020240000200402004011800211091010800001000005020116212003780000102004120041200412004120041
8002420040150000041258001010800001080000506400000200212004020040999631002080010208000020240000200402004011800211091010800001000005020116112003780000102004120041200412004120041