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, 32-bit)

Test 1: uops

Code:

  ands w0, w0, w1
  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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10041035806191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035708291725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035806191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
100410357061917251000100010006225010351035805388210001000200010354011100110006973227229931000100010361036103610361036
10041035806191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035806191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035706191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035806191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035806191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036
10041035706191725100010001000622501035103580538821000100020001035401110011000073227229931000100010361036103610361036

Test 2: Latency 1->2

Code:

  ands w0, w0, w1
  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 cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020410035759061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575210168992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
10204100357524061992025101001010010100647152049695510035100358656887561010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
10204100357536061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750084992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
102041003575282061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750061992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036
1020410035750082992025101001010010100647152049695510035100358656387321010010200202001003540111020110099100101001000071022722999510000101001003610036100361003610036

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
10024100357542619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064032734999710000100101003610036100361003610036
10024100357530619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010164032734999710000100101003610036100361003610036
10024100357548619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064032734999710000100101003610036100361003610036
100241003575405619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064032743999710000100101003610036100361003610036
10024100357518619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064042744999710000100101003610036100361008410036
1002410035750829918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064042744999710000100101003610036100361003610036
1002410035756619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064042744999710000100101003610036100361003610036
100241003575306619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064032744999710000100101003610036100361003610036
1002410035750619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064042744999710000100101003610036100361003610036
1002410035750619918251001010010100106472460496955100351003586783875410010100202002010035401110021109101001010064032734999710000100101003610036100361003610036

Test 3: Latency 1->3

Code:

  ands w0, w1, w0
  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)03091e3f4d51schedule 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)9fld unit uop (a6)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
102041003575015619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610082
10204100357500619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357502720199920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357503619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357500829920251010010100101006471524969551003510035865638732101001020020200100694011102011009910010100100071012711999510000101001003610036100361003610036
1020410035750141619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357500619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357600849920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
102041003575024619920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036
10204100357610829920251010010100101006471524969551003510035865638732101001020020200100354011102011009910010100100071012711999510000101001003610036100361003610036

1000 unrolls and 10 iterations

Result (median cycles for code): 1.0035

retire uop (01)cycle (02)03mmu table walk data (08)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 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
100241003575000336199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064042743999710000100101003610036100361003610036
1002410035750002766199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064032743999710000100101003610036100361003610036
10024100827500006199182510010100101001064724614969551003510035867838754100101002020020100354011100211091010010100064042743999710000100101003610036100361003610036
10024100357500006199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064042744999710000100101003610036100361003610036
10024100357500066199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064032744999710000100101003610036100361003610036
1002410035750008110399182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010101364042744999710000100101003610036100361003610036
10024100357500008499182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064042734999710000100101003610036100361003610036
10024100357500006199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064042743999710000100101003610036100361003610036
100241003575000246199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064042743999710000100101003610036100361003610036
100241003575000025199182510010100101001064724604969551003510035867838754100101002020020100354011100211091010010100064032734999710000100101003610036100361003610036

Test 4: Latency 4->2

Chain cycles: 1

Code:

  ands w0, w1, w2
  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 data (08)1e3f4d51schedule 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)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515000251199302520100201002011212972330491695520035200351742571748520112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972330491695520035200351742571748620112202243023620035641120201100991002010010100001111320162001220000201002003620036200362007920036
20204200351520061199302520100201002011212972331491695520035200351742581748520112202243023620035641120201100991002010010100101111319162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742571748620112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742571748520112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742581748520112202243023620035641120201100991002010010100101111320162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742581748620112202243023620035641120201100991002010010100501021111320162001220000201002003620036200362003620036
2020420035150006119930252010020100201121297233049169552003520035174258174852011220224302362003564112020110099100201001010001201111320162001220000201002003620036200362003620036
20204200351500061199302520100201002011212972331491695520035200351742581748620112202243023620035641120201100991002010010100501111320162001220000201002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03191e1f3f4d51schedule 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)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024200351500001241991725200102001020092129724700491695520035200351742831750420010200203002020080642120021109102001010010201151286127111999520000200102003620036200362003620081
200242008115110061199182520010200102001012972470049169552003520035174283175042001020020300202003564112002110910200101001000031270127111999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470049169552003520035174283175042001020020300202003564112002110910200101001000261270127111999520000200102003620036200362003620036
2002420035150000189199182520010200102001012972470049169552003520172174283175042001020020300202003564112002110910200101001000061270127111999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470049169552003520035174283175042001020020300202003564112002110910200101001000001270127121999520000200102003620036200362003620036
2002420035150012061199182520010200102001012972470149169552003520035174283175042001020020300202003564112002110910200101001000031270127111999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470149169552021820035174283175042001020020300202003564112002110910200101001000001270127111999520000200102003620036200362003620036
200242003515000061199182520010200102001012972470049169552003520035174283175042001020020300202003564512002110910200101001000031270127111999520000200102003620036200362003620036
2002420035150000611991825200102001020010129724701491695520035200351742831750420010200203002020035641120021109102001010010000181270127111999520000200102003620036200362017020036
2002420035150000611991825200102001020010129724701491695520035201711742831750420010200203002020035641120021109102001010010000181270127111999520000200102003620036200362003620036

Test 5: Latency 4->3

Chain cycles: 1

Code:

  ands w0, w1, w2
  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)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)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfmap dispatch bubble (d6)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202042003515006119930252010020100201121297233491695520035200351742571748520112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351742571748520112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
2020420035150053619930252010020100201121297233491695520035200351742571748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351742581748620112203193023620035641120201100991002010010100031111320162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351742571748620112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351742581748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351742571748520112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
20204200351500157919930252010020100201121297233491695520035200351742581748620112202243023620035641120201100991002010010100001111320162001220000201002003620036200362003620036
202042003515006119930252010020100201121297233491695520035200351743271748620112202243023620035641120201100991002010010100001111319162001220000201002003620036200362003620036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)09l2 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 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 mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000006001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000000001270127111999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000100001270127211999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000006001270127121999520000200102003620036200362003620036
200242003515000000000611991825200102001020010129724714916955200352003517428317504200102002030020200356411200211091020010100100000003001270127111999520000200102003620036200362003620036

Test 6: throughput

Count: 8

Code:

  ands w0, w8, w9
  ands w1, w8, w9
  ands w2, w8, w9
  ands w3, w8, w9
  ands w4, w8, w9
  ands w5, w8, w9
  ands w6, w8, w9
  ands w7, w8, w9
  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)0318191e1f3f51schedule 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)st unit uop (a7)l1d cache writeback (a8)a9accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
802042676120000003525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100000005110119112673180000801002673626783267362673626736
802042673520000003525801008010080169400500149236552673526735166723167178010080200160200267353911802011009910080100100401035110119112676780000801002673626736267822678326736
8020426735200000062325801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100020265125136112673180000801002673626736267362673626736
802042673520000003525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
802042673520000003525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
802042673520000003525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100000005110119112673180000801002673626736267362673626736
802042673520000003525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100001005110119112673180000801002673626736267362673626736
802042673520000003525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100000035110119112673180000801002673626736267362673626736
8020426735200001203525801008010080100400500149236552673526735166723166908010080200160200267353911802011009910080100100000005110119112673180066801002673626736267362673626736
80204267352011401043546801008010080165400500149236552673526735166723166908010080272160200267803911802011009910080100100000005110119112673180000801002673626736267362673626736

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03l1i tlb fill (04)mmu table walk data (08)l2 tlb miss data (0b)18191e1f3f51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap stall dispatch (70)flags prf full (73)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)accfl1i cache miss demand (d3)d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eb? int retires (ef)f5f6f7f8fd
8002426720200100001805625800108001080010400050149236250267052670516665031668380010800201600202670539118002110910800101000502002518142126702800008800102670626706267062670626706
8002426705200000000012325800108001080010400050149236250267052670516665031668380010800201600202670539118002110910800101000502002518262526702800000800102670626706267062670626706
8002426705200000000010025800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002518142526702800000800102670626706267062670626706
800242670520000000008125800108001080010400050149236250267052670516665031668380010800201600202670539118002110910800101000502002618261726702800000800102670626706267062670626706
800242670520000000008125800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002518122526702800000800102670626706267062670626706
8002426705200000000010025800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002118241526702800000800102670626706267062670626706
800242670520000000003525800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002618252526702801950800102670626706267062670626706
8002426705200000000014425800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002418262526702800000800102670626706267062670626706
8002426705200000000016725800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002018262026702800000800102670626706267062670626706
800242670520000000007925800108001080010400050049236250267052670516665031668380010800201600202670539118002110910800101000502002517241926702800000800102670626706267062670626706