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

CNEG (32-bit)

Test 1: uops

Code:

  cneg w0, w0, hi
  mov x0, 1
  mov x1, 2

(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)033a3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)606d6emap 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 miss (a1)ld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10041035726691725100010001000622501103510358053882100010003000103510411100110001000000077427449901000100010361036103610361036
10041035826691725100010001000622501103510358053882100010003000103510411100110001000001077427439901000100010361036103610361036
10041035826691725100010001000622501103510358053882100010003000103510411100110001000000077427439901000100010361036103610361036
10041035826691725100010001000622501103510358053882100010003000103510411100110001000000077427449901000100010361036103610361036
10041035726691725100010001000622501103510358053882100010003000103510411100110001000000077427449901000100010361036103610361036
10041035826691725100010001000622501103510358053882100010003000103510411100110001000001077427449901000100010361036103610361036
10041035726691725100010001000622501103510358053882100010003000103510411100110001000000077427449901000100010361036103610361036
10041035826691725100010001000622501103510358053882100010003000103510411100110001000003077427449901000100010361036103610361036
10041035826691725100010001000622501103510358053882100010003000103510411100110001000001077427449901000100010361036103610361036
100410358218991725100010001000622501103510358053882100010003000103510411100110001000000077427449901000100010361036103610361036

Test 2: Latency 1->2

Code:

  cneg w0, w0, hi
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03181e3f4d51schedule 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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020410035750061992025101001010010100647152149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610082
1020410214750061992025101001010010100647152049695510035100358656387321010010327302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647152149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647152149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647152049695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647688149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647152049695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647152149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
1020410035750061992025101001010010100647152149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036
10204100357500126992025101001010010100647152149695510035100358656387321010010200302001003510211102011009910010100101000071012711999210000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)031e3f4d51schedule 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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10024100357506199182510010100101001064724614969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
100241003575010299182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610170100361003610036
10024100807506199182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
10024100357596199182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
10024100357506199182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
10024100357506199182510010100101001064724614969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
10024100357506199182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
100241003575010599182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
10024100357506199182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036
10024100357506199182510010100101001064724604969551003510035867838754100101002030020100351041110021109101001010010064022722999310000100101003610036100361003610036

Test 3: Latency 1->3

Chain cycles: 1

Code:

  cneg w0, w1, hi
  tst x0, 1
  mov x0, 1
  mov x1, 2
  mov x2, 3

(non-fused SUB/CBNZ loop)

100 unrolls and 100 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)696a6d6emap 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 cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003514900199199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228221999220100101002003620036200362003620036
2020420035150913261199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228221999220100101002003620036200362003620036
20204200351500061199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228121999220100101002003620036200362003620036
202042003515000105199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228221999220100101002003620036200362003620036
20204200351500082199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000031310228221999220100101002003620036200362003620036
20204200351500061199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228221999220100101002003620036200362003620036
20204200351500061199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310128221999220100101002003620036200362003620036
20204200351500061199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228221999220100101002003620036200362003620036
20204200351500061199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000101310228221999220100101002003620036200362003620036
20204200351500061199262520200202002020012976504916955200352003517406317481202002020040200200351041120201100992010010000001310228221999220100101002003620036200362003620036

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 int alu (97)9fl1d tlb access (a0)ld unit uop (a6)l1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351500010319918252002020020200201297297149169552003520035174283175042002020020400202003510421200211092001010000000001270127111999520010100102003620036200362003620036
20024200351500019719918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000001270127111999520010100102003620036200362003620036
20024200351500021219918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000001270127111999520010100102003620036200362003620036
2002420035150006119918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000001270127111999520010100102003620036200362003620036
20024200351500027319918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000001270227211999520010100102003620036200362003620036
200242003515001328419918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000001270127111999520010100102003620036200362003620036
2002420035150006119924252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000001001295127111999520010100102003620036200362003620036
20024200351500082219918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000001001270127111999520010100102003620036200362003620036
2002420035150006119918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000001270127111999520010100102003620036200362003620036
20024200351500050619918252002020020200201297297149169552003520035174283175042002020020400202003510411200211092001010000000031270127121999520010100102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  cneg w0, w8, hi
  cneg w1, w8, hi
  cneg w2, w8, hi
  cneg w3, w8, hi
  cneg w4, w8, hi
  cneg w5, w8, hi
  cneg w6, w8, hi
  cneg w7, w8, hi
  mov x8, 9

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)18191e1f3a3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6d6emap 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 tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)st unit uop (a7)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
8020426763200000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
80204267402000000120028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248023224053326740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248045524029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740201000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741
8020426740200000000028278011880118801244799164923660267402674016679616689801248023224029626740661180201100991008010080100000000001115118016002673780018801002674126741267412674126741

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss instruction (0a)l2 tlb miss data (0b)18191e1f3a3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f60696a6d6emap 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 tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80024267242000000000003625800108001080010472059004923626267062670616665316684800108002024002026706661180021109108001080010000000005020111811122670280000800102670726707267072670726707
80024267062000000000003625800108001080010472059014923626267062670616665316684800108002024002026706661180021109108001080010000000005020121813132670280000800102670726707267072670726707
80024267062000000006003625800108001080010472059014923626267062670616665316684800108002024002026706661180021109108001080010000000005020141814132670280000800102670726707267072670726707
80024267062000000000003625800108001080010472059014923626267062670616665316684800108002024002026706661180021109108001080010000000005020121810132670280000800102670726707267072670726707
80024267062000000000003625800108001080010472059004923626267062670616665316684800108002024002026706661180021109108001080010000000005020111812122670280000800102670726707267072670726707
80024267062000000000003625800108001080010472059104923626267062670616665316684800108002024002026706661180021109108001080010000100305020121812122670280000800102670726707267072670726707
800242670620000000000036258001080010800104720590149236262679926940167402816857804268046324129227033667180021109108001080010220012280535053137513152691780466800102698827035270232698926985
8002427032202202155936528011281738047580143805004493270049237202703526987167401916831805038052124131627030668180021109108001080010202012325805131137614132694880401800102689526940270352702826983
8002426752203410054804528012971528054280478805014468240049239032698827032167522616712804978053224151727032667180021109108001080010203010278345113177516122691580465800102712627079271242712627078
80024271252030000881059704116861968061480675802194490930049240482707927077167773916918806418059524171527126669180021109108001080010200002324045035114315142673980405800102698726847269862703426991