Apple M1 Microarchitecture Research by Dougall Johnson

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

FCCMP (scalar, S)

Test 1: uops

Code:

  fccmp s0, s1, #0, lt
  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)03091e3f4e51inst 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)9fa0a8accfd5d6ddinst fetch restart (de)e0f5f6f7f8fd
100420371500619372510001000100068984120182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
100420371500829372510001000100068984120182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
100420371500619372510001000100068984020182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
100420371500619372510001000100068984120182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
100420371500619372510001000100068984120182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
1004203715001059372510001000100068984020182037203717883189510001000300020372037111001100010000237311611196920382038203820382038
100420371500619372510001000100068984120182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
100420371500619372510001000100068984020182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
1004203715002129372510001000100068984020182037203717883189510001000300020372037111001100010000007311611196920382038203820382038
100420371500619372510001000100068984120182037203717883189510001000300020372037111001100010000007311611196920382038203820382038

Test 2: Latency 3->1

Chain cycles: 2

Code:

  fccmp s0, s1, #0, lt
  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)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)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)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2020440037300000726398222520100100200001002000050028538801400184003740037373163374952010020020000200600004003740037112020110099100100200002010063013101161139909100001004003840038400384003840038
202044003730000061398222520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
202044003730000061398222520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
202044003730000061398222520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
202044003729900061397502520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
2020440037299000346398222520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
20204400373000006278398222520100100200001002000050028543680400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
202044003729900061398222520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
202044003730000061398222520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010000013101161139909100001004003840038400384003840038
202044003730000661398042520100100200001002000050028538800400184003740037373163374952010020020000200600004003740037112020110099100100200002010030013101161139909100001004003840038400384003840038

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030809191e3f4e51inst 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)9fa0a6a8accfd0d2d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
2002440037299020061398222520010102000010200005028538800440018400374003737338337517200102020000206000040037400371120021109101020000200100000127040416223991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538801440018400374003737338337517200102020000206000040037400371120021109101020000200100030127044316343991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538800440018400374003737338337517200102020000206000040037400371120021109101020000200100000127004216223991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538801040018400374003737338337517200102020000206000040037400371120021109101020000200100040127004316323991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538801440018400374003737338337517200102020000206000040037400371120021109101020000200100000127004416443991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538801040018400374003737338337517200102020000206000040037400371120021109101020000200100000127004316433991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538800440018400374003737338337517200102020000206000040037400371120021109101020000200100000127004316243991010000104003840038400384003840038
20024400373000000251398222520010102000010200005028538800440018400374003737338337517200102020000206000040037400371120021109101020000200100000127040316433991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538801440018400374003737338337517200102020000206000040037400371120021109101020000200100040127004216323991010000104003840038400384003840038
2002440037300000061398222520010102000010200005028538801040018400374003737338337517200102020000206000040037400371120021109101020000200100000127044216233991010000104003840038400384003840038

Test 3: Latency 3->2

Chain cycles: 2

Code:

  fccmp s0, s1, #0, lt
  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)9faccfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
20204400373000613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400372990613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400372990613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400372120201100991001002000020100013101161139909100001004003840038400384003840038
202044003729907263982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400372990613982225201001002000010020000500285388004001840037400373731633749520100200201052006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400373000613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400372990613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
202044003730007263982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400373000613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038
20204400372990613982225201001002000010020000500285388004001840037400373731633749520100200200002006000040037400371120201100991001002000020100013101161139909100001004003840038400384003840038

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)9fa8acc5cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
200244003730006139822252001010200001020000502853880140018400374003737361337517200102020000206000040037400371120021109101020000200100001270216323991010000104003840038400384003840038
200244003729906139822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270316433991010000104003840038400384003840038
2002440037299072639822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270316233991010000104003840038400384003840038
2002440037300094339822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270416443991010000104003840038400384003840038
200244003730006139822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270216413991010000104003840038400384003840038
200244003730006139822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270216113991010000104003840038400384003840038
200244003730006139822252001010200001020000502854368140018400374003737338337517200102020000206000040037400371120021109101020000200100001270316333991010000104003840038400384003840038
200244003730006139822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270416443991010000104003840038400384003840038
2002440037300072639822252001010200001020000502853880040018400374003737338337517200102020000206000040037400371120021109101020000200100001270216223991010000104003840038400384003840038
200244003729906139822252001010200001020000502853880140018400374003737338337517200102020000206000040037400371120021109101020000200100001270116223991010000104003840038400384003840038

Test 4: Latency 3->3

Code:

  fccmp s0, s1, #0, lt
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4

(non-fused SUB/CBNZ loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)03080b18191e1f3a3f4e51inst 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 integer (97)inst neon or fp (9a)9fa0a1a6a8a9acc2c5cfd0d5d6ddinst fetch restart (de)e0? int output thing (e9)gpr retires (ef)f5f6f7f8fd
102042003714900000006199372510200200100002001000011007079841200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710121622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079841200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710131622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079840200182003720037186383187451020020010000200300002003720037111020110099100100001000000020000710121622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079840200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710121622199691001002003820038200382003820038
102042003715000000006199182510200200100002001000011007079840200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710131622199691001002003820038200382003820038
1020420037150000000072699372510200200100002001000011007079840200182003720037186383187451020020010000200300002003720037111020110099100100001000000000001710131622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079841200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710121622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079841200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000712121622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079841200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710131622199691001002003820038200382003820038
102042003715000000006199372510200200100002001000011007079841200182003720037186383187451020020010000200300002003720037111020110099100100001000000000000710121622199691001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)030b1e3f4e51inst 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 integer (97)inst neon or fp (9a)9fa0a8accfd5d6ddinst fetch restart (de)e0? int output thing (e9)gpr retires (ef)f5f6f7f8fd
1002420037150006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640516451996910102003820038200382003820038
1002420037156006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640416451996910102003820038200382003820038
1002420037150006199182510020201000020100441107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640616451996910102003820038200382003820038
1002420037150006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640416441996910102003820038200382003820038
1002420037150006199372510020201000020100001107079840200180200372013218660318767100202010000203000020037200371110021109101000010000000640816451996910102003820038200382003820038
1002420037150006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640716641996910102003820038200382003820038
1002420037150006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640816441996910102003820038200382003820038
1002420037150006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640616451996910102003820038200382003820038
1002420037150033201199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000003640616541996910102003820038200382003820038
1002420037150006199372510020201000020100001107079840200180200372003718660318767100202010000203000020037200371110021109101000010000000640716441996910102003820038200382003820038

Test 5: throughput

Count: 8

Code:

  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  ands xzr, xzr, xzr
  fccmp s0, s1, #0, lt
  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)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)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)9fa8accdcfd5d6daddinst fetch restart (de)e0? int output thing (e9)gpr retires (ef)f5f6f7f8fd
16020480044599052251601008010080000801008000040050088000008002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
160204800415990717251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
160204800415990717251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
16020480041599052251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
16020480041600052251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
16020480041599052251601008010080000801008000040050088000018017908004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
16020480041600052251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
16020480041599052251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
1602048004160061852251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000001011011601180035800001008004280042800428004280042
16020480041600052251601008010080000801008000040050088000018002208004180041599643599991601008020080000200240000800418004111160201100991008010080000801000011011011601180035800001008004280042800428004280042

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030818191e3f51inst 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)5f6061696d6edispatch 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)cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0? int output thing (e9)eaebgpr retires (ef)f5f6f7f8fd
16002480042600000078251600108001080000800108000040005086445311580022800418004159986360020160010800208000020240000800418004111160021109108001080000800106830100228211017211111180074800001511108004280042800428004280042
1600248004160000005725160010800108000080159800004000508800001158002280041800415998636002016001080020800002024011480093800911116002110910800108000080010910010022811101722113880036800003011108004280042800428004280042
1600248004159900005725160010800108000080010800004000508800001158002280041800415998636002016001080020800002024000080041800411116002110910800108000080010090100228218172119980036800001511108004280042800428004280042
1600248004160000005725160010800108000080010800004000508800001158002280041800415998636002016001080020800002024000080041800411116002110910800108000080010013501002211219172119980036800001511108004280042800428004280042
1600248004160000004940251600108001080000800108000040005088000011580022800418004159986360020160010800208000020240000800418004111160021109108001080000800100120100221121121741110980036800001511108004280042800428004280042
160024800416000000532251600108001080000800108000040005088000011580022800418004159986360020160010800208000020240000800418004111160021109108001080000800101766010022822121721212980036800001523108004280042800428004280042
1600248004159900005725160010800108000080159800004000508800001058002280041800415998636002016001080020800002024000080041800411116002110910800108000080010890010022821917211101180036800001511108004280042800428004280042
160024800416000000553251600108001080000800108000040005088000011580022800418004159986360020160010800208000020240000800418004111160021109108001080000800100001002482191721116880036800001511108004280042800428004280042
160024800415990000572516001080010800008001080000400050880000115800228004180041599861260020160010800208000020240000800418004111160021109108001080000800100601002281191721110980036800001511108004280042800428004280042
16002480041600000057251600108001080000800108000040005088000011580022800418004159986360020160010800208000020240000800418004111160021109108001080000800100001002232110172119880036800001511108004280042800428004280042