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

ANDS (register, 64-bit)

Test 1: uops

Code:

  ands x0, x0, x1
  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)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)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100410358084917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410357061917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410358061917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
1004103580159917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410358061917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410358076917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
1004103580120917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410358061917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410357061917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036
100410357061917251000100010006225010351035805388210001000200010354011100110000073127119931000100010361036103610361036

Test 2: Latency 1->2

Code:

  ands x0, x0, x1
  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)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 tlb miss (a1)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10204100357500619920251010010100101006471521496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357600619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001008210036100361003610036
10204100357500619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
102041003575001899920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036
10204100357600619920251010010100101006471520496955100351003586563873210100102002020010035401110201100991001010010000071012711999510000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e1f3f4d5051schedule 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)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1002410035750006199181001925100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064032722999710000100101003610036100361003610036
1002410035750006199181001925100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000364022722999710000100101003610036100361003610036
1002410035750005629918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000619918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101003610036100361003610036
1002410035750004629918025100101001010093647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101008510036100361003610036
100241003576015688619918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575000619918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101012064022722999710000100101003610036100841008410036
100241003575000619918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101003610036100361003610036
1002410035750002549918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101003610036100361003610036
100241003575100619918025100101001010010647246149695510035100358678387541001010020200201003540111002110910100101000064022722999710000100101003610036100361003610036

Test 3: Latency 1->3

Code:

  ands x0, x1, x0
  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)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)9fst unit uop (a7)l1d cache writeback (a8)accdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10204100357600619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
102041003576008759920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000171012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
102041003575008959920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
102041003575003149920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100003071012711999510000101001003610036100361003610036
10204100357500849920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036
102041003575005959920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100000071012711999510000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)0309l2 tlb miss data (0b)3f4d51schedule 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
1002410035750010399182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064032722999710000100101003610036100361003610036
100241003575006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
100241003575006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710045100101003610036100361003610036
100241003575006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
10024100357500829918251001010010100106472461496955100351003586783875410010100202002010035401110021109101001010010564022722999710000100101003610036100361003610036
100241003576006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064022722999710000100101003610036100361003610036
1002410035750061991825100101001010010647246149695510035100358678387541001010020200201003540111002110910100101007264022722999710000100101003610036100361003610036

Test 4: Latency 4->2

Chain cycles: 1

Code:

  ands x0, x1, x2
  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)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)branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2020420035150012619930252010020100201121297233149169552003520035174257174852011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233149169552003520035174257174862011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036
2020420035150014519930252010020100201121297233149169552003520035174347174862011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233149169552003520035174258174852011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233149169552003520035174258174862011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233149169552003520035174258174852011220224302362003564112020110099100201001010001111319162001220000201002007120036200362003620036
202042003515006119930252010020100201121297233149169552003520035174257174862011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
2020420035150016619930252010020100201121297233149169552003520035174258174852011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
2020420035150084619930252010020100201121297233149169552003520035174257174862011220224302362003564112020110099100201001010001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233149169552003520035174258174852011220224302362003564112020110099100201001010001111320162001220000201002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03181e1f3f4d51schedule 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 tlb access (a0)st unit uop (a7)l1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270527651999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270527461999520000200102003620036200362003620036
2002420035150000353199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270527551999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270527451999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270427651999520000200102003620036200362003620036
2002420035150000103199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270527651999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270427551999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270627661999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200351742831750420010200203002020035641120021109102001010010000001270527651999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470491695520035200801742831750420010200203002020035641120021109102001010010000001270427451999520000200102003620036200362003620036

Test 5: Latency 4->3

Chain cycles: 1

Code:

  ands x0, x1, x2
  cset x2, 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)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)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)fetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515001491993025201002010020112129723304916955200352003517425817485201122022430236200356411202011009910020100101000011113201602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723304916955200352003517425717486201122022430236200356411202011009910020100101000011113201602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723314916955200352003517425717485201122022430236200356411202011009910020100101000011113191602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723314916955200352003517425717485201122022430236200356411202011009910020100101000011113201602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723314916955200352003517425817486201122022430236200356411202011009910020100101001011113201602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723304916955200352003517425717486201122022430236200356411202011009910020100101000011113201602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723304916955200352003517425717485201922022430236200356411202011009910020100101000011113201602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723304916955200352003517425717486201122022430236200356411202011009910020100101000011113191602001220000201002003620036200362003620036
202042003515009661993025201002010020112129723314916955200352003517425717486201122022430236200356411202011009910020100101000011113191602001220000201002003620036200362003620036
20204200351500611993025201002010020112129723304916955200352003517425717486201122022430236200356411202011009910020100101000011113191602001220000201002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)033f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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
2002420035149143199182520010200102001012972470491695502003520035174283175042001020020300202003564112002110910200101001001270127111999520000200102003620036200362003620036
200242003515061199182520010200102001012972471491695502003520035174283175042001020020300202003564112002110910200101001001270127121999520000200102003620036200362003620036
2002420035150597199182520010200102001012972471491695502003520035174283175042001020020300202003564112002110910200101001001270127111999520000200102003620036200362003620036
2002420035150631199182520010200102001012972470491695502003520035174283175042001020020300202003564112002110910200101001001270127111999520000200102003620036200362003620036
200242003515061199182520010200102001012972471491695502003520035174283175042001020020300202003564112002110910200101001001270127211999520000200102003620036200362003620036
200242003515061199182520010200102001012972470491695502003520035174283175042001020020300202003564112002110910200101001021270127121999520000200102003620036200362003620036
200242003515061199182520010200102001012972471491695502003520035174283175042001020020300202003564112002110910200101001001270127211999520000200102003620036200362003620036
200242003515061199182520010200102001012972470491695502003520035174283175042001020020300202003564112002110910200101001001270227121999520000200102003620036200362003620036
200242003515061199182520010200102001012972470491695502003520035174283175042001020020300202003564112002110910200101001001270127111999520000200102003620036200362003620036
200242003515061199182520010200102010212972470491695502003520035174283175042001020020300202003564112002110910200101001001270127111999520000200102003620036200362003620036

Test 6: throughput

Count: 8

Code:

  ands x0, x8, x9
  ands x1, x8, x9
  ands x2, x8, x9
  ands x3, x8, x9
  ands x4, x8, x9
  ands x5, x8, x9
  ands x6, x8, x9
  ands x7, x8, x9
  mov x8, 9
  mov x9, 10
  mov x10, 11

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)09l2 tlb miss instruction (0a)18191e1f3f5051schedule 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)acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204267632000000000330298011580115801214005901492366126741267411667981668980121802321602642674139118020110099100801001000001115120016102673880015801002674226742267412674226742
80204267412000000000280298011580115801214005901492366126741267411667981668980121802321602642674139118020110099100801001000001115120116112677180015801002674226742267422674226742
80204267412000000000280538011580181801214005001492365526735267351667231669080100802001602002673539118020110099100801001000000005110219222673180000801002673626736267362673626736
80204267352010000000350258010080100801004005001492365526735267351667231669080100802001602002673539118020110099100801001000000005110119212673180000801002673626736267362673626736
80204267352000000000350258010080100801004005001492365526735267351667231669080187802001602002673539118020110099100801001000000005110219212673180000801002673626736267362673626736
80204267352000000000350258010080100801004005000492365526735267351667231669080100802001602002673539118020110099100801001000000005110119222673180000801002673626736267362673626736
802042673520000000003512258010080100801004005001492365526735267351667231669080100802001602002673539118020110099100801001000000005110119212673180000801002673626736267362673626736
80204267352000000000350258010080100801004005001492365526735267351667231669080100802001602002673539118020110099100801001000000005110219122673180000801002673626736267362673626736
80204267352000000000350258010080100801004005001492365526735267351667231669080100802001602002673539118020110099100801001000000005110219112673180000801002673626736267362673626778
80204267352000000000350258010080100801004005001492365526735267351667231669080100802001602002673539118020110099100801001000000005110219112673180000801002673626736267362673626736

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e3f51schedule 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)9faccfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
800242672020004235258001080010800104000501492362526705267051666531668380075800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
8002426705200030035258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
800242670520012735258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
800242670520006635258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
800242670520006335258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
800242670520001535258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
80024267052000935258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
80024267052000035258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
80024267052000035258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706
80024267052000035258001080010800104000501492362526705267051666531668380010800201600202670539118002110910800101005020218222670280000800102670626706267062670626706