cntw

CNTW <Xd>{, <pattern>{, MUL #<imm>}}

Count Words in Vector.

Pseudocode Operation

No pseudocode available.

Encoding

Binary Layout
00000100
31:24
1
23
0
22
10
21:20
imm4
19:16
11100
15:11
0
10
pattern
9:5
Rd
4:0
 
Format SVE
Opcode 0x04A0E000
Extension SVE

Related

More in SVE

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x04A0E000 CNTW <Xd>{, <pattern>{, MUL #<imm>}} A64 00000100 | 1 | 0 | 10 | imm4 | 11100 | 0 | pattern | Rd

Description

Determines the number of active elements implied by the named predicate constraint, multiplies that by an immediate in the range 1 to 16 inclusive, and then places the result in the scalar destination. The named predicate constraint limits the number of active elements in a single predicate to: Unspecified or out of range constraint encodings generate an empty predicate or zero element count rather than Undefined Instruction exception.

Operation

CheckSVEEnabled();
integer count = DecodePredCount(pat, esize);

X[d, 64] = (count * imm)<63:0>;