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, H)

Test 1: uops

Code:

  fcmpe h0, h1
  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)030818191e1f3a3f51inst 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)a0a1a6a8a9acc2cfd5d6ddinst fetch restart (de)e0f5f6f7f8fd
10041038800000049251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038800000049251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038800000049251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038800000091251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038800000049251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038700000049251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
100410388000000144251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038800000049251000100010008000101910381038864389610001000200010381038111001100000000007311622103310391039103910391039
100410387000000144251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039
10041038700000049251000100010008000101910381038864389610001000200010381038111001100000000007311611103310391039103910391039

Test 2: Latency 3->1

Chain cycles: 2

Code:

  fcmpe h0, h1
  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)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
2020440037300006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013103161139909100001004003840038400384003840038
2020440037300008639822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037300006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037300006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037300006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037300006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101001013101161139909100001004003840038400384003840038
2020440037299006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037300008439822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037300006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038
2020440037299006139822252010010020000100200005002853880140018400374003737316337495201002002000020050000400374003711202011009910010020000101000013101161139909100001004003840038400384003840038

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030b181e3f4e51inst 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)9fa8acbranch mispredict (cb)cdcfd0d2d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
200244003730000061398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127090116113991010000104003840038400384003840038
2002440037300000658398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127000116113991010000104003840038400384003840038
2002440037300000251398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127096116113991010000104003840038400384003840038
200244003730000061398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127000116113991010000104003840038400384003840038
200244003730000061398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127096116113991010000104003840038400384003840038
200244003729900061398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127000116113991010000104003840038400384003840038
200244003730000061398222520010102000010200005028538800040018400374003737338337517200102020000205000040037400371120021109101020000100100000127000116213991010000104003840038400384003840038
200244003730000061398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127096116113991010000104003840038400384003840038
2002440037299000726398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127096116113991010000104003840038400384003840038
200244003730000061398222520010102000010200005028538801940018400374003737338337517200102020000205000040037400371120021109101020000100100000127000116213991010000104003840038400384003840038

Test 3: Latency 3->2

Chain cycles: 2

Code:

  fcmpe h0, h1
  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)03090b1e3a3f4e51inst 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)9fa0a8acc5cfd0d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2020440037300000061398222520100100200001002000050028538801040018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131011161139909100001004003840038400384003840038
2020440037300000061398222520100100200001002000050028538801040018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131001161139909100001004003840038400384003840038
2020440037299000061398222520100100200001002000050028538800140018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131011161139909100001004003840038400384003840038
20204400373000000103398222520100100200001002000050028538801040018400374003737316337495201002002000020050238400374003711202011009910010020000101000000131011161139909100001004003840038400384003840038
20204400373000000726398222520100100200001002000050028538801040018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131011161139909100001004003840038400384003840038
2020440037300000061398222520100100200001002000050028538800140018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131001161139909100001004003840038400384003840038
2020440037300000061398222520100100200001002000050028538801040018400374003737316337495201002002000020050000400374003711202011009910010020000101000001131011161139909100001004003840038400384003840038
2020440037299000061398222520100100200001002000050028538800140018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131011161139909100001004003840038400384003840038
2020440037299000061398222520100100200001002000050028538801040018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131011161139909100001004003840038400384003840038
2020440037300000089398222520100100200001002000050028538800140018400374003737316337495201002002000020050000400374003711202011009910010020000101000000131001161139909100001004003840038400384003840038

1000 unrolls and 10 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)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)9faccfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2002440037300006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003721200211091010200001001001270216113991010000104003840038400384003840038
2002440037300006139822252001010200001020080502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037299006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
20024400373000063139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374007411200211091010200001001001270116113991010000104003840038400384003840038
2002440037300006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037299006139822252001010200001020000502853880400184003740037373383375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038

Test 4: throughput

Count: 8

Code:

  fcmpe h0, h1
  fcmpe h0, h1
  fcmpe h0, h1
  fcmpe h0, h1
  fcmpe h0, h1
  fcmpe h0, h1
  fcmpe h0, h1
  fcmpe h0, h1
  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)0308090b18191e1f3f51inst 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)9fa0a1a6a7a8a9acc2cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)gpr retires (ef)f5f6f7f8fd
8020480040600000000035125801001008000010080024500640000080019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110316118003501008003980039800398003980039
802048003859900000004925801001008000010080000500640000180019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110116118003501008003980039800398003980039
8020480038600000000071425801001008002310080023500640000080019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110116118003501008003980039800398003980039
802048003859900000004925801001008000010080000500640000180019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110116118003501008003980039800398003980039
802048003859900000004925801001008000010080000500640000180019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110116118003501008003980039800398003980039
8020480038599000000017925801001008000010080000500640000180019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000015110116118003501008003980075800398003980039
802048003860000000007025801001008000010080000500640000180019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110116118003501008003980039800398003980039
802048003859900000004925801001008000010080000500640000080019800388003869964036999680100200800002001600008003880038118020110099100100800001000000000005110116118003501008003980039800398003980039
802048003860000000004925801001008000010080000500640000180019800388003869964036999680100200800002001600008003880038118020110099100100800001000000003005110116118003501008003980039800398003980039
802048003860000000004925801001008000010080000500640000080019800388003869964036999680100200800002001600008003880073118020110099100100800001000000000005110116118006901008003980039800398003980039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0318191e3f51inst 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)9fa1a7a8a9acc2cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)eagpr retires (ef)f5f6f7f8fd
800248003860000049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020181614138003300108003980039800398003980039
800248003859900049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020121612128003300108003980039800398003980039
800248003859900049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020131612128003300108003980039800398003980039
800248003860000049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020111612148003300108003980039800398003980039
800248003859900049258001010800001180175506400008001980038800726998637001880010208000020160000800388003811800211091010800001000000005020121612128003300108003980039800398003980039
800248003860000049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000400005020131614128003300108003980039800398003980039
8002480038599000492580010108000010800005064000080019800388003869986370018800102080000201600008003880038118002110910108000010000000050209169138003300108003980039800398003980039
800248003860000049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020121613118003300108003980039800398003980039
800248003860000049258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020101610138003300108003980039800398003980039
8002480038599000408258001010800001080000506400008001980038800386998637001880010208000020160000800388003811800211091010800001000000005020121612118003300108003980039800398003980039