Apple Microarchitecture Research by Dougall Johnson

M1/A14 P-core (Firestorm): Overview | Base Instructions | SIMD and FP Instructions
M1/A14 E-core (Icestorm):  Overview | Base Instructions | SIMD and FP Instructions

CCMN (immediate, 64-bit)

Test 1: uops

Code:

  ccmn x1, #3, #0, hi
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 1.000

Integer unit issues: 1.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)031e3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst int alu (97)9fl1d tlb access (a0)l1d cache writeback (a8)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)f5f6f7f8fd
1004103570619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103570619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
10041035801039172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103580619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103580619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103570619172510001000100062250103510358053882100010002000103510411100110001000117312711990100010361036103610361036
10041035701149172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103580619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103580619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036
1004103580619172510001000100062250103510358053882100010002000103510411100110001000007312711990100010361036103610361036

Test 2: Latency 2->1

Chain cycles: 1

Code:

  ccmn x1, #3, #0, hi
  cset x1, cc
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 1 chain cycle): 1.0035

retire uop (01)cycle (02)03mmu table walk instruction (07)l2 tlb miss instruction (0a)181e3a3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fld unit uop (a6)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204200351502200164619930252010020100201121297233049169552003520035174256174872011220224302362003510411202011009910020100201000001111319316342001320000101002003620036200362003620036
20204200351502200113119930252010020100201121297233049169552003520035174256174872011220224302362003510411202011009910020100201000001111319416342001320000101002003620036200362003620036
202042003515022001257199302520100201002011212972330491695520035200351742561748720112202243023620035104112020110099100201002010022661111319216322001320000101002003620036200362003620036
2020420035150220019119930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000001111319416322001320000101002003620036200362003620036
20204200351502200199619930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000101111319216322001320000101002003620036200362003620036
2020420035150220616819930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000001111319416322001320000101002003620036200362003620036
20204200351502203117319930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000001111319416342001320000101002003620036200362003620036
2020420035150220016819930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000001111319216142001320000101002003620036200362003620036
20204200351502200163819930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000001111319416322001320000101002003620036200362003620036
20204200351502200143719930252010020100201121297233149169552003520035174256174872011220224302362003510411202011009910020100201000001111319216342001320000101002003620036200362003620036

1000 unrolls and 10 iterations

Result (median cycles for code, minus 1 chain cycle): 1.0035

retire uop (01)cycle (02)031e1f3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d cache writeback (a8)branch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200242003515000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327431999520000100102003620036200362003620036
20024200351502400611991825200102001020010129724714916955200352003517428317504200102002030020200351041120021109102001020010001270327331999520000100102003620036200362003620036
200242003515000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327341999520000100102003620036200362003620036
20024200351502280611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010011270327341999520000100102003620036200362003620036
20024200351502310611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327331999520000100102003620081200362003620036
20024200351502280611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327331999520000100102003620036200362003620036
200242003515000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327331999520000100102003620036200362003620036
200242003515000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327341999520000100102003620036200362003620036
200242003515000611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327331999520000100102003620036200362003620036
20024200351502580611991825200102001020010129724704916955200352003517428317504200102002030020200351041120021109102001020010001270327331999520000100102003620036200362003620036

Test 3: Latency 2->2

Code:

  ccmn x0, #3, #0, hi
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(non-fused SUB/CBNZ loop)

100 unrolls and 100 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)18191e1f3a3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst int alu (97)9fl1d tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)a9acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020410035750000000619927251020010200102106477120496956100351003586737873610210102242024810035110111020110099101001000000000901117190160010010101001001003610036100361003610036
1020410035750100000619927251020010200102106477120496955100351003586737873610210102242024810035110111020110099101001000000000901117190160010010101001001003610036100361003610036
10204100357500000003499927251020010200102106477120496956100351003586737873610210102242024810035110111020110099101001000000000001117190160010010101001001003610036100361003610036
1020410035750000000619927251020010200102106477120496955100351003586736873610210102242024810035110111020110099101001000000000001117190160010010101001001003610036100361003610036
10204100357500000001569927251020010200102106477120496955100351003586737873610210102242024810035110111020110099101001000000000001117190160010010101001001003610036100361003610036
1020410035770000000619927251020010200102106477120496955100351003586737873610210102242024810035110111020110099101001000000000001117190160010032101001001003610036100361003610036
1020410035750000000619927251020010200102106477120496956100351003586737873610210102242024810035110111020110099101001000000000001117190160010010101001001003610036100361003610036
1020410035750000000619927251020010200102106477120496955100351003586737873610210102242024810035110111020110099101001000000000001117190160010010101001001003610036100361003610036
1020410035750000000619927251020010200102106477120496955100351003586737873610210102242024810035110111020110099101001000000000001117190160010010101001001003610036100361003610036
1020410035750000000619927251020010200102106477120496955100351003586737873610210102242024810035110111020110099101001000000010001117190160010010101001001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)18191e3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst int alu (97)9fl1d tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100241003575000006199182510020100201002064729614969551003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
100241003575000006199182510020100201002064729614969561003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
1002410035750000156199182510020100201002064729614969551003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
100241003575000006199182510020100201002064729614969561003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
100241003579000006199182510020100201002064729614969551003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
1002410035750000061991825100201002010020647296149695610035100358678387541002010020200201003510411100211091001010000000000640227221002510010101003610036100361003610036
100241003575000006199182510020100201002064729614969561003510035867838754100201002020020100351041110021109100101000000020064022722999310010101003610036100361003610036
1002410035760000014599182510020100201002064729614969551003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
100241003575000006199182510020100201002064729614969561003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036
100241003575000006199182510020100201002064729614969561003510035867838754100201002020020100351041110021109100101000000000064022722999310010101003610036100361003610036

Test 4: throughput

Count: 8

Code:

  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  ands xzr, xzr, xzr
  ccmn x0, #3, #0, hi
  mov x0, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)1e3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6b6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fld unit uop (a6)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)dde0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1602045343539900038327160120160120160128106373849503280534085340833347633357160128160240160240534426611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534083990005127160120160120160128106373849503283534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000006927160120160120160128106221049503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534084000002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409
160204534083990002827160120160120160128106373849503280534085340833347633357160128160240160240534086611160201100991001601008010000011110119160534051600201005340953409534095340953409

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l1i tlb fill (04)l2 tlb miss instruction (0a)l2 tlb miss data (0b)1e1f3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f6061696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fld unit uop (a6)l1d cache writeback (a8)accfd0d2l1i cache miss demand (d3)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0? int output thing (e9)eaeb? int retires (ef)f5f6f7f8fd
1600245337840030000708251600101600101600101029388115495029453374533743332433334416001016002016002053374661116002110910160010800100001002281129192112525533701600002011105337553375533755337553375
160024533744001000049251600101600101600101029388215495029453374533743332433334416001016002016002053374661116002110910160010800100001002284127192111726533701600002011105337553375533755337553375
160024533744001000070251600101600101600101029388015495029453374533743332433334416001016002016002053374661116002110910160010800100001002284127192111426533701600002011105337553375533755337553375
1600245337440010000492516001016001016001010293881154950294533745337433324333344160010160020160020533746611160021109101600108001000010024115215193222827533701600004123105337553375533755337553375
16002453374399100004292516001016001016001010293881154950294533745337433324333344160010160020160020533746611160021109101600108001000010024115227193221526533701600004123105337553375533755337553375
1600245337440010000492516001016001016001010293882154950294533745337433324333344160010160020160020533746611160021109101600108001000010025115225193221728533701600004123105337553375533755337553375
16002453374400100002202516001016001016001010293880154950294533745337433324333344160010160020160020533746611160021109101600108001000010025115215193222714533701600004123105337553375533755337553375
160024533744001000049251600771600101600101029388015495029453374533743332433334416001016002016002053374661116002110910160010800100001002284121192112615533701600002011105337553375533755337553375
16002453374400100360432516001016001016001010293880154950294533745337433324333344160010160020160020533746611160021109101600108001000010024115229193222228533701600004123105337553375533755337553375
1600245337440010000492516001016001016001010293880154950294533745337433324333344160010160020160020533746611160021109101600108001000010025115228193221425533701600004123105337553375533755337553375

Test 5: throughput

Count: 4

Code:

  fcmp s0, s0
  ccmn x0, #3, #0, hi
  ccmn x0, #3, #0, hi
  ccmn x0, #3, #0, hi
  ccmn x0, #3, #0, hi
  mov x0, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)181e3f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fld unit uop (a6)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)dde0? int output thing (e9)? int retires (ef)f5f6f7f8fd
5020413437101003282550122401121001040143100135751278009711339513416134166139246777110501564025110013803022002613416134161150201100991004010010000401000031113221016013413400121001341713417134171341613417
50204134161000005032550122401121001040143100135751278009711339513416134166139245677110501564025110013803022002613416134161150201100991004010010000401000001113221016013412400121001341713417134171341713417
5020413416100010282550122401121001040143100135751278009711339513416134166139246777110501564025110013803022002613416134161150201100991004010010000401000001113221016013413400121001341713417134171341713417
5020413416101000282550122401121001040143100135751278009711339513416134166139245677110501564025110013803022002613416134161150201100991004010010000401000001113221016013413400121001341713417134171341713417
50204134161000002825501224011210010401431001357512780097113395134161341661372467671105015640251100138030220026134161341611502011009910040100100004010000511113220016013413400121001341713417134171341713417
5020413416100030282450122401121001040143100135751278009711339513416134166139245677110501564025110013803022002613416134161150201100991004010010000401000001113221016013413400121001341713417134171341713417
5020413416101000282550122401121001040143100135751278009711339513416134166137245677110501564025110013803022002613416134161150201100991004010010000401000001113221016013413400121001341713417134171341713417
5020413416100003282550122401121001040143100135751278009711339513416134166139246777110501564025110013803022002613416134161150201100991004010010000401000001113221016013413400121001341713417134171341713416
5020413416100000282550122401121001040143100135751278009711339513416134166139246777110501564025110013803022002613415134161150201100991004010010000401000001113221016013413400121001341713417134171341713417
5020413416100000282550122401121001040143100135751278009711339513415134166137245677110501564025110013809002002613416134161150201100991004010010000401000001113221116013413400121001341713417134171341713417

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)1e1f3f51schedule uop (52)schedule int uop (53)schedule simd uop (54)dispatch int uop (56)dispatch simd uop (57)int uops in schedulers (59)ldst uops in schedulers (5b)60696d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map simd uop (7e)map int uop inputs (7f)map simd uop inputs (81)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)inst simd alu (9a)9fl1d cache writeback (a8)acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
50024133831000000452550010400101000040010100005734568000011335313382133825575378437109500104002010000800202000013382133821150021109104001010000400100003140419231337940000101338313383133831338313383
500241338210000273045255001040010100004001010000573456800001133531338213382557737953710950010400201000080020200001338213382115002110910400101000040010016203140319431337940000101338313383133831338313383
5002413382100001320452550010400101000040010100005734568000011335313382133825577379537109500104002010000800202000013382133821150021109104001010000400100003140319321337940000101338313383133831338313383
50024133821010000452550010400101000040010100005734568000011335313382133825577379537109500104002010000800202000013382133821150021109104001010000400100003140219231337940000101338313383133831338313383
5002413382101001710452550010400101000040010100005734568000011335313382133825575378437109500104002010000800202000013382133821150021109104001010000400100003140419331337940000101338313383133831338313383
50024133821000000452550010400101000040010100005734568000001335313382133825577379537109500104002010000800202000013382133821150021109104001010000400100003140419321337940000101338313383133831338313383
500241338210000004525500104001010000400101000057345680000113353133821338255753795371095001040020100008002020000133821338211500211091040010100004001003903140319231337940000101338313383133831338313383
50024133821000000452550010400101000040010100005734568000011335313382133825575379537109500104002010000800202000013382133821150021109104001010000400100003140219231337940000101338313383133831338313383
50024133821000000452550010400101000040010100005734568000011335313382133825575378437109500104002010000800202000013382133821150021109104001010000400100003140219331337940000101338313383133831338313383
50024133821000000452550010400101000040010100005734568000011335313382133825577378437109500104002010000800202000013382133821150021109104001010000400100003140319431337940000101338313383133831338313383