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

AND (register, lsr, 32-bit)

Test 1: uops

Code:

  and w0, w0, w1, lsr #17
  mov x0, 1
  mov x1, 2

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 2.000

Integer unit issues: 2.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e3f4c4d51schedule 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)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10042035150061100017352520002000100032570120352035157581862100010002000203542111001100000731671117812000100020362036203620362036
100420351500611000173525200020001000325700203520351575318421000100020002035421110011000024731671117812000100020362036203620362036
10042035150061100017352520002000100032570020352035157531842100010002000203542111001100000731671117812000100020362036203620362036
10042035150061100017352520002000100032570120352035157531842100010002000203542111001100000731671117812000100020362036203620362036
10042035150061100017352520002000100032570020352035157531842100010002000203542111001100006731671117812000100020362036203620362036
10042035150061100017352520002000114532570120352035157531842100010002000203542111001100000731671117812000100020362036203620362036
10042035150061100017352520002000100032570120352035157531842100010002000203542111001100000731671117812000100020362036203620362036
10042035150061100017352520002000100032570020352035157531842100010002000203542111001100000731671117812000100020362036203620362036
10042035150061100017352520002000100032570120352035157531842100010002000203542111001100000731671117812000100020362036203620362036
10042035150061100017352520002000100032570120352035157531842100010002000203542111001100000731671117812000100020362036203620362036

Test 2: Latency 1->2

Code:

  and w0, w0, w1, lsr #17
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)031e3f4c4d51schedule 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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020420035150061100001980325201002010010100185342149169552003520035184293187001010010200202002003542111020110099100101001000000710159111979120000101002003620036200362003620036
10204200351500251100001980325201002010010100185342149169552003520035184293187001010010200202002003542111020110099100101001000000710159111979120000101002003620036200362003620036
1020420035150061100001980325201002010010100185342049169552003520035184293187001010010200202002003542111020110099100101001001300710159111979120000101002003620036200362003620036
10204200351500611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010027900710159111979120000101002003620036200362003620036
1020420035150061100001980325201002014510100185342049169552003520035184293187001010010200202002003542111020110099100101001000000710159111979120000101002003620036200362003620036
1020420035150061100001980325201002010010100185342149169552003520035184293187001010010200202002003542111020110099100101001002300710159111979120000101002003620036200362003620036
1020420035150061100001980325201002010010100185342149169552003520035184293187001010010200202002003542111020110099100101001002000710159111979120000101002003620036200362003620036
1020420035150061100001980325201002010010100185342049169552003520035184293187001010010200202002003542111020110099100101001000000710159111979120000101002003620036200362003620036
1020420035150061100001980325201002010010100185342149169552003520035184293187001010010200202002003542111020110099100101001000000710159111979120000101002003620036200362003620036
1020420035150061100001980325201002010010100185342149169552003520035184293187001010010200202002003542111020110099100101001000000710159111979120000101002003620036200362003620036

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)03l1i tlb fill (04)1e3a3f4c4d51schedule 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
1002420035150003969100001974325200102001010010185310149169552003520035184513187181001010020200202003542111002110910100101000646106311101979220000100102003620036200362003620036
10024200351500038210000197432520010200101016418531014916955200352003518451318718100101002020020200354211100211091010010100364611636101979220000100102003620036200362003620036
100242003515000382100001974325200102001010010185310149169552003520035184513187181001010020200202003542111002110910100101000646116310111979220000100102003620036201732003620036
10024200351500038210000197432520010200101001018531014916955200352003518451318718100101002020020200354211100211091010010100064610636101979220000100102003620036200362003620036
100242003515000382100001974325200102001010010185310049169552003520035184513187181001010020200202003542111002110910100101000646563871979220000100102003620036200362003620036
100242003515000382100001974325200102001010010185310149169552003520035184513187181001010020200202003542111002110910100101000646116311101979220000100102003620036200362003620036
10024200351500038210000197432520010200101001018531004916955200352003518451318718100101002020428200354211100211091010010100064610631051979220000100102003620036200362003620036
1002420035150112382100001974325200102001010010185310049169552003520035184513187181001010020200202003542111002110910100101000646106310101979220000100102003620036200362003620036
10024200351500038210000197432520010200101001018531004916955200352003518451318718100101002020020200354211100211091010010100064656310101979220000100102003620036200362003620036
10024200351500038210000197432520010200101001018531004916955200352003518451318718100101002020020200354211100211091010010101064686310101979220000100102003620036200362003620036

Test 3: Latency 1->3

Code:

  and w0, w1, w0, lsr #17
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)091e1f3a3f4c4d51schedule 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)ld unit uop (a6)l1d cache writeback (a8)acbranch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020420035150000000611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
10204200351500000001451000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
1020420035150000000611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
1020420035150000000611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
1020420035150000000611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000001710159111979120000101002003620036200362003620036
102042003515000000010510000198032520100201001010018534214916955200352003518429318700101001020020200200354211102011009910010100100006000710159111979120000101002003620036200362003620036
1020420035150000000611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
1020420035150000000611000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
10204200351500000001241000019803252010020100101001853421491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036
1020420035150000900821000019803252010020100101001853420491695520035200351842931870010100102002020020035421110201100991001010010000000710159111979120000101002003620036200362003620036

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)0318191e3f4c4d51schedule 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 cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
100242003515000027510000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640363221979220000100102003620036200362003620036
100242003514900012410000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101010640263221979220000100102003620036200362003620036
10024200351500006110000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640263221979220000100102003620036200362003620036
10024200351500006110000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101016640263221979220000100102003620036200362003620036
10024200351500006110000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640263221979220000100102003620036200362003620036
10024200351500006110000197432520010200101001018531049169552003520035184513187181001010183200202003542111002110910100101000640263221979220000100102003620036200362003620036
100242003515000022910000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640263221979220000100102003620036200362003620036
10024200351500006110000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640263221979220000100102003620036200362003620036
10024200351500096110000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640263221979220000100102003620036200362003620036
10024200351500006110000197432520010200101001018531049169552003520035184513187181001010020200202003542111002110910100101000640263221979220000100102003620036200362003620036

Test 4: throughput

Count: 8

Code:

  and w0, w8, w9, lsr #17
  and w1, w8, w9, lsr #17
  and w2, w8, w9, lsr #17
  and w3, w8, w9, lsr #17
  and w4, w8, w9, lsr #17
  and w5, w8, w9, lsr #17
  and w6, w8, w9, lsr #17
  and w7, w8, w9, lsr #17
  mov x8, 9
  mov x9, 10

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)09l2 tlb miss data (0b)18191e1f3f4c4d51schedule 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)l1d tlb miss (a1)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9acbranch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204267732000000000208800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051103222226717160000801002672626726267262672626726
8020426725200000000061800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626726
802042672520000000088516800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626726
8020426725200000000061800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626726
80204267252000000000346800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222326717160000801002672626726267262672626726
80204267252000000000726800002609425160100160100801001643181492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626726
8020426725200000000061800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626726
80204267252000000000726800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222326717160000801002672626726267262672626726
8020426725200000000061800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626786
80204267252000000000156800002609425160100160100801001643180492364526725267251661531667780100802001602002672539118020110099100801001000000000051102222226717160000801002672626726267262672626726

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)033f4c4d51schedule 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 mispred nonspec (cb)cfl1i cache miss demand (d3)d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
800242673520018980000212802516001016001080010163142149206182671126711166233166858001080020160020267113911800211091080010100005020072231626704160000800102671226712267122671226712
80024267112006180000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020052241426704160000800102671226712267122671226712
80024267112006180000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020032231526704160000800102671226712267122671226712
80024267112006180000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020052252126704160000800102671226712267122671226712
800242671120014780000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020032231426704160000800102671226712267122671226712
8002426711200618000021280251600101600108001016314214923631267112671116623316685800108002016002026711391180021109108001010000502004224626704160000800102671226712267122671226712
80024267112006180000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020152251826704160000800102671226712267122671226712
80024267111996180000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020042252226704160000800102671226712267122671226712
80024267112001478000021280251600101600108001016314214923631267112671116623316685800108002016002026711391180021109108001010000502003224726704160000800102671226712267122671226712
80024267112006180000212802516001016001080010163142149236312671126711166233166858001080020160020267113911800211091080010100005020032252426704160000800102671226712267122671226712