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

CLZ (64-bit)

Test 1: uops

Code:

  clz x0, x0
  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)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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10041035706186225100010001000169161103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035806186225100010001000169161103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035806186225100010001000169160103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035706186225100010001000169160103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035706186225100010001000169160103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035736186225100010001000169161103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035706186225100010001000169161103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035706186225100010001000169160103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035806186225100010001000169161103510357283868100010001000103541111001100073341339371000100010361036103610361036
10041035806186225100010001000169160103510357283868100010001000103541111001100073341339371000100010361036103610361036

Test 2: Latency 1->2

Code:

  clz x0, 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)031e3a3f4d51schedule 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)9faccfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
1020410035750061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035753061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035780082987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
10204100357500619877251010010100101008866449695510035100358580387221010010200102001003541111020110099100101001001871013711994110000101001003610036100361003610036
1020410035750061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035750061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035750061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035750261987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035780061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036
1020410035750061987725101001010010100886644969551003510035858038722101001020010200100354111102011009910010100100071013711994110000101001003610036100361003610036

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)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10024100357612619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064044144994010000100101003610036100361003610036
1002410035750619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064044134994010000100101003610036100361003610036
10024100357545619863251001010010100108878414969551003510035860238770100101002010020100354111100211091010010100064034134994010000100101003610036100361003610036
10024100357521619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064034134994010000100101003610036100361003610036
1002410035750619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064034143994010000100101003610036100361003610036
1002410035750619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010102064044134994010000100101003610036100361003610036
1002410035750619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064044144994010000100101003610036100361003610036
1002410035760619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064044144994010000100101003610036100361003610036
1002410035750619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064044143994010000100101003610036100361003610036
1002410035750619863251001010010100108878414969551003510035860238740100101002010020100354111100211091010010100064044144994010000100101003610036100361003610036

Test 3: throughput

Count: 8

Code:

  clz x0, x8
  clz x1, x8
  clz x2, x8
  clz x3, x8
  clz x4, x8
  clz x5, x8
  clz x6, x8
  clz x7, x8
  mov x8, 9

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)03mmu table walk data (08)18191e3f51schedule 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)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204134171000000282780136801368014840071014910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
8020413390100000135282780136801368014840071014910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
80204133901000000282780136801368014840071004910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
80204133901010000282780136801368014840071004910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
80204133901010000282780136801368014840071004910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
80204133901000000282780136801368014840071004910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
802041339010000015282780136801368014840071014910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
80204133901040000282780136801368014840071004910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
80204133901000000282780136801368014840071004910310133901339033266333680148802648026413390391180201100991008010010000011151190161338780036801001339113391133911339113391
8020413390100000028278013680136801484007100491031013390133903326633368014880264802641339039118020110099100801001000500211151190161338780036801001339113391133911339113391

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)18191e1f3f51schedule 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
8002413387101011903525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005020619341336880000800101337213372133721337213372
8002413371100000605725800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005020419461336880000800101337213372133721337213372
8002413371100000007725800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100035021919661342480000800101337213372133721337213372
8002413371100010003525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005020619471336880000800101337213372133721337213372
8002413371100010005666801428001080010400050149102911337113371333033348800108002080020133713911800211091080010100005020419661336880000800101337213372133721337213372
8002413371100000003525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005021419441336880000800101337213372133721337213372
8002413371100000003525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005020319431336880000800101337213372133721337213372
8002413371100000003525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005021619671336880000800101337213372133721337213372
8002413371100000003525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005021419361336880000800101337213372133721337213372
8002413371100000003525800108001080010400050149102911337113371333033348800108002080020133713911800211091080010100005020319671336880000800101337213372133721337213372