Apple M1 Microarchitecture Research by Dougall Johnson

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

FCMPE (scalar, S)

Test 1: uops

Code:

  fcmpe s0, s1
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4

(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)031e1f3f51inst 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)a0a8cfd5d6ddinst fetch restart (de)e0f5f6f7f8fd
100410387004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410387004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
10041038712004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039
100410388004925100010001000800001019103810388643896100010002000103810381110011000007311611103310391039103910391039

Test 2: Latency 3->1

Chain cycles: 2

Code:

  fcmpe s0, s1
  fcsel d0, d2, d3, eq
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 2 chain cycles): 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)73scheduler 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? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
20204400373000016413982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037402283731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202054003729900613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000613982225201001002000010020000500285388004001840037400373731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038
202044003730000993982225201001002000010020000500285388004001840037402243731603374952010020020000200500004003740037112020110099100100200001010000131011611399090100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code, minus 2 chain cycles): 2.0037

retire (01)cycle (02)03080b18191e3f4e51inst 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)6061696b6d6edispatch 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)9fa0a6a7a8a9accfd0d2d5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
200244003730000000613982225200101020000102000050285388011040018040037400373733833751720010202000020500004003740037112002110910102000010010000000127010102161139910010000104003840038400384003840038
20024400373000000061398222520010102000010200005028538801104001804003740037373383375172001020200002050000400374003711200211091010200001001000000012701051161139910010000104003840038400384003840038
20024400373000000094398222520010102000010200005028538801104001804003740037373383375172001020200002050000400374003711200211091010200001001000000012701051161139910010000104003840038400384003840038
20024400373000000061398224220010102000010200005028538801104001804003740037373383375172001020200002050000400374003711200211091010200001001000000012701051161139910010000104003840038400384003840038
200244003730000000613982225200101020000102000050285388010400180400374003737338337517200102020000205000040037400371120021109101020000100100000001270001161139910010000104003840038400384003840038
2002440037300000006139822252001010200001020000502853880110400180400374003737338337517200102020000205000040037400371120021109101020000100100000001270001161139910010000104003840038400384003840038
2002440037299000006139822252001010200001020000502853880110400180400374003737338337517200102020107205000040037400371120021109101020000100100000001270001161139910010000104003840038400384003840038
200244003730000000613982225200101020000102000050285388010400180400374003737338337517200102020000205000040037400371120021109101020000100100000001270001161139910010000104003840038400384003840038
2002440037300000006139822252001010200001020000502853880110400180400374003737338337517200102020000205000040037400371120021109101020000100100000001270001161139910010000104003840038400384003840038
2002440037300000006139822252001010200001020000502853880110400180400374003737338337517200102020000205000040037400371120021109101020000100100000001270001161139910010000104003840038400384003840038

Test 3: Latency 3->2

Chain cycles: 2

Code:

  fcmpe s0, s1
  fcsel d1, d2, d3, eq
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 2 chain cycles): 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)9fa8acc5cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2020440037300061398222520100100200001002000050028538800400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538801400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538801400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538801400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538800400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538800400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538801400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520100100200001002000050028538800400184003740037373163374952010020020000200500004007440037112020110099100100200001010000013101161139909100001004003840038400384003840038
2020440037300061398222520116100200001002000050028538801400184003740037373163374952010020020000200500004003740037112020110099100100200001010010013101161139909100001004003840038400384003840073
2020440037300061398222520100100200001002000050028538801400184003740037373163374952010020020000200500004003740037112020110099100100200001010000013101161139909100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code, minus 2 chain cycles): 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)9fa6a8a9accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
200244003730003725398222520010102000010200005028538801400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538801400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538800400184003740037373383375172001022200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300084398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037299061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000031270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000001270116113991010000104003840038400384003840038
2002440037300061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000001270216113991010000104003840038400384003840038

Test 4: throughput

Count: 8

Code:

  fcmpe s0, s1
  fcmpe s0, s1
  fcmpe s0, s1
  fcmpe s0, s1
  fcmpe s0, s1
  fcmpe s0, s1
  fcmpe s0, s1
  fcmpe s0, s1
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)0307080a0b18191e1f3f51inst 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)9fa6a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)gpr retires (ef)f5f6f7f8fd
8020480038599000000007142580100100800001008000050064000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100020005110216118003501008003980039800398003980039
8020480038600000000005292580100100800001008000050064000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008144781150814448144281573
80204814396082000272735732464530337080793128806211288072563764429008109208148581007705911297110480797201807312021615728153681535231802011009910010080000100012166154552461853381255311008115381630816848143881200
802048172161100203532470729049322580100100800001008000053564000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039
802048003860000000000492580100100800001008000050064000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039
802048003859900000000492580100100800001008000050064000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039
8020480038599000000004913480159124800691118017550064039018005608003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039
802048003859900000000492580100100800001008000050064000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039
802048003859901000000492580100100800001008000050064000018001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039
802048003862100000000492580100100800001008000050064000008001908003880038699643699968010020080000200160000800388003811802011009910010080000100000005110116118003501008003980039800398003980039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03191e1f3f51inst 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)9fa1a8acc2cdcfd5d6d9dadbddinst fetch restart (de)e0ebgpr retires (ef)f5f6f7f8fd
80024800386000001142580010108000010800005064000008005680038800387002837001880010208000020160000800868008611800211091010800001000020507644100035800330108003980039800398003980039
8002480038599000492580010108000010800505064000008001980038800386998637001880010208000020160000800388003811800211091010800001002000502051600035800330108003980039800398003980039
80024800386200907142580010108000010800005064000018001980038800386998637001880010208000020160000800388003811800211091010800001000000505951600035800330108003980039800398003980039
80024800386000120492580010108000010800005064000018001980038800386998637001880010208000020160000800388003811800211091010800001001300502051600055800330108003980039800398003980039
80024800386000001792580010108000010800005064000018001980038800386998637001880010208000020160000800388003811800211091010800001000000502031600053800330108003980039800398003980039
80024800386000007142580010108000010800005064000008001980038800386998637001880010208000020160000800388003811800211091010800001000000502051600045800330108003980039800398003980039
8002480038599000492580010108000010800005064000018001980038800386998637001880010208000020160000800388003821800211091010800001000000502071600573800330108003980039800398003980039
8002480038599029188492580010108000010800005064000018001980038800386998637001880010208000020160000800388003811800211091010800001001000502051600055800330108003980039800398003980039
8002480038600000492580010108000010800005064000018001980038800386998637001880010208000020160000800388003811800211091010800001000000502051600035800330108003980039800398003980039
80024800386440001812580010108000010800005064000018001980038800386998637001880010208000020160000800388003811800211091010800001000000502051600055800330108003980039800398003980039