ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

CLS

T2 arm64 alu insn
AArch64 A64 Instruction: CLS
SourceLLVM AArch64 Instruction & Feature Definitions (llvm_aarch64_isa)
Reliability TierT2 — Compiler & Kernel Reference
ISA / Silicon ScopeArmv8-A / Armv9-A (A64)
Armv8-A / Armv9-A (SVE, SVE2, SME, FP8, MTE, Apple Silicon)
License & VersionApache-2.0 WITH LLVM-exception
llvm/main
Upstreamhttps://github.com/llvm/llvm-project/tree/main/llvm/lib/Target/AArch64
Privilegeuser
ExtensionsA64, NEON

Summary

AArch64 CLS instruction (A64, 32-bit) with 8 encoding variants extracted from LLVM TableGen. Extensions: NEON.

Syntax / Encoding

CLSWr: cls $Rd, $Rn
CLSv16i8: cls $Rd.16b, $Rn.16b
CLSv2i32: cls $Rd.2s, $Rn.2s
CLSv4i16: cls $Rd.4h, $Rn.4h
CLSv4i32: cls $Rd.4s, $Rn.4s
CLSv8i16: cls $Rd.8h, $Rn.8h
CLSv8i8: cls $Rd.8b, $Rn.8b

Cross-Chip Latency & Throughput (10 cores)

MicroarchitectureLatency (cycles)Recip. TPuopsPortsSource
Apple M1 Firestorm (P-core)1–20.16711 - - u1-6apple_dougallj
Apple M1 Icestorm (E-core)1–20.33311 - - u1-3apple_dougallj
AmpereOne (Ampere1)10.51Ampere1UnitBllvm_sched_models
AmpereOne (Ampere1B)10.51Ampere1BUnitBllvm_sched_models
Qualcomm Oryon10.171ORYONI012345llvm_sched_models
Samsung Exynos M510.171M5UnitAWllvm_sched_models
Fujitsu A64FX (SVE 512b)211A64FXGI0llvm_sched_models
NVIDIA Olympus (Vera)20.171OlympusUnitVllvm_sched_models
Marvell ThunderX2 T99312THX2T99I1llvm_sched_models
Marvell ThunderX3 T11031.52THX3T110FP23+THX3T110FP0123llvm_sched_models

Binary Encodings (8)

WidthFormatBit PatternMask / Match
32CLSWr0101101011000000000101xxxxxxxxxx0xfffffc00 / 0x5ac01400
32CLSXr1101101011000000000101xxxxxxxxxx0xfffffc00 / 0xdac01400
32CLSv16i80100111000100000010010xxxxxxxxxx0xfffffc00 / 0x4e204800
32CLSv2i320000111010100000010010xxxxxxxxxx0xfffffc00 / 0x0ea04800
32CLSv4i160000111001100000010010xxxxxxxxxx0xfffffc00 / 0x0e604800
32CLSv4i320100111010100000010010xxxxxxxxxx0xfffffc00 / 0x4ea04800
32CLSv8i160100111001100000010010xxxxxxxxxx0xfffffc00 / 0x4e604800
32CLSv8i80000111000100000010010xxxxxxxxxx0xfffffc00 / 0x0e204800

Operands

NameDescription
Rd
Rn
Rd
Rn
Rd
Rn
Rd
Rn