Apple M1 Microarchitecture Research by Dougall Johnson

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

FCMP (scalar, D)

Test 1: uops

Code:

  fcmp d0, d1
  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)031e3f51inst 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)a8accfd5d6ddinst fetch restart (de)e0f5f6f7f8fd
10041038804925100010001000800001019103810388643896100010002000103810381110011000007321622103310391039103910391039
1004103871549251000100010008000010191038103886438961000100020001038103811100110000277321622103310391039103910391039
10041038804925100010001000800001019103810388643896100010002000103810381110011000007321622103310391039103910391039
10041038704925100010001000800011019103810388643896100010002000103810381110011000007321622103310391039103910391039
10041038707025100010001000800001019103810388643896100010002000103810381110011000007321622103310391039103910391039
10041038804925100010001000800011019103810388643896100010002000103810381110011000007321622103310391039103910391039
10041038804925100010001000800011019103810388643896100010002000103810381110011000007321622103310391039103910391039
10041038704925100010001000800011019103810388643896100010002000103810381110011000007321622103310391039103910391039
10041038804925100010001000800011019103810388643896100010002000103810381110011000037321622103310391039103910391039
10041038704925100010001000800011019103810388643896100010002000103810381110011000007321622103310391039103910391039

Test 2: Latency 3->1

Chain cycles: 2

Code:

  fcmp d0, d1
  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)03191e1f3f4e51inst 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)9fa8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
20204400373000007263982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038
2020440037300000613982225201001002000010020000500285388040018400374003737316337495201002002000020050000400374003711202011009910010020000101000013102162239909100001004003840038400384003840038

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0318191e3f4e51inst 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)9fa8cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2002440037300000613982225200101020000102000050285388004001840037400373733803375172001020200002050000400374003711200211091010200001001021270216113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388004001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037299000613982225200101020000102000050285388014001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388014001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388014001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388014001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388014001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388004001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037299000613982225200101020000102000050285388004001840070400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400384003840038
2002440037300000613982225200101020000102000050285388004001840037400373733803375172001020200002050000400374003711200211091010200001001001270116113991010000104003840038400714003840038

Test 3: Latency 3->2

Chain cycles: 2

Code:

  fcmp d0, d1
  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)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)9fa0a8accdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2020440037300025039822252010010020000100200005002853880140018400374008537327033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
202044003730006139822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
202044003729906139822252010010020000100200005002853880040018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
202044003730006139822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
2020440037300053639822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
2020440037300017039822252010010020000100200005002853880140018400374003737316033749520100200200002005000040071400371120201100991001002000010100000013101161139909100001004003840038400384003840038
202044003730006139822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
202044003730006139822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
202044003729906139822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038
2020440037300053639822252010010020000100200005002853880140018400374003737316033749520100200200002005000040037400371120201100991001002000010100000013101161139909100001004003840038400384003840038

1000 unrolls and 10 iterations

Result (median cycles for code, minus 2 chain cycles): 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)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)9fa0a1a6a8accdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
20024400373000061398222520010102000010200005028538801400184003740037373383375172001020204572050695400854022751200211091010200001001027310012706161139910010000104003840038400384003840038
20024400373000061398222520010102000010200805028538801400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161139910010000104003840038400384003840038
20024400373000061398222520010102000010200005028538801400184003740037373383375172001020200002050000400374003711200211091010200001001000009012701161139910010000104003840038400384003840038
20024400373001061398222520010102000010200005028538801400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161139910010000104003840038400384003840038
20024400372990061398222520010102000010200005028543681400184003740037373383375172001020200002050000400374003711200211091010200001001002000012701161139910010000104003840038400384003840038
20024400373000061398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161139977010000104003840075400384003840038
2002440037300004780398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161239910010000104003840038400384003840038
200244003730002161398222520023102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161139910010000104003840038400384003840038
20024400373000061398222520010102000010200005028538801400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161239910010000104003840038400384003840038
20024400372990066398222520010102000010200005028538800400184003740037373383375172001020200002050000400374003711200211091010200001001000000012701161139910010000104003840038400384003840038

Test 4: throughput

Count: 8

Code:

  fcmp d0, d1
  fcmp d0, d1
  fcmp d0, d1
  fcmp d0, d1
  fcmp d0, d1
  fcmp d0, d1
  fcmp d0, d1
  fcmp d0, d1
  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)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)9fa0a1a8a9acc2branch mispredict (cb)cfd5d6ddinst fetch restart (de)e0gpr retires (ef)f5f6f7f8fd
80204800386000000001122580100100800001008000050064000018001980038800386999436999680100200800002001600008003880038118020110099100100800001000000000511032511800351008003980039800398003980039
80204800386000000009232580100100800001008000050064000008001980038800386996436999680100200800002001600008003880038418020110099100100800001000000000511011611801811008003980039800398003980232
8020480038600000000492580100100800001008000054564000008001980038800386996436999680100200800002001600008003880038118020110099100100800001000000000511011611800351008003980039800398003980039
8020480038620000000499980100100800001008000050064000008001980038800386996436999680100200800002001600008003880038118020110099100100800001000000000511011611800351008003980039801848003980039
8020480038600000000492580100100800001008000050064000008001980038800386996436999680100200800002001600008003880038118020110099100100800001000000300511011611800351008003980039800398003980039
8020480038600000000492580100100800001008000050064000008001980038800386996436999680219200800002001600008003880038118020110099100100800001000000000511011611800351008003980039800398003980039
80204800386000000007142580100100800001008000050064000008001980038800386996436999680100200800002001600008003880038118020110099100100800001000000000511011611800351008003980039800398003980039
8020480038600000000492580100100800001008000050064000008001980038800386996436999680100200800002001600008003880038118020110099100100800001000010205600511011611800351008003980039800398003980039
80204800386001000001772580100100800001008000050064000008001980038800386996436999680100200800002001600668003880038118020110099100100800001001000000511011611800351008003980039800398003980039
802048003859900001680492580100100800001008000050064000008001980038800386996436999680100200800002001600008003880038118020110099100100800001000000000511011611800351008003980039800398003980039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030b1e1f3f51inst 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)5f60696b6d6edispatch 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)9fa0a6a8acbranch mispredict (cb)cfd0icache miss (d3)d5d6d9daddinst fetch restart (de)e0eagpr retires (ef)f5f6f7f8fd
8002480038600000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038599000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480072600000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038600000492580010108000010800005064000001800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038599000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038599000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038599000492580010108000010800005064000011800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038599000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
8002480038599000492580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039
80025800386000007142580010108000010800005064000000800190800388003869986370018800102080000201600008003880038118002110910108000010000005020001160011800330108003980039800398003980039