LLVM 22.0.0git
RISCVBaseInfo.h
Go to the documentation of this file.
1//===-- RISCVBaseInfo.h - Top level definitions for RISC-V MC ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains small standalone enum definitions for the RISC-V target
10// useful for the compiler back-end and the MC libraries.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
14#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
15
17#include "llvm/ADT/APFloat.h"
18#include "llvm/ADT/APInt.h"
19#include "llvm/ADT/StringRef.h"
21#include "llvm/MC/MCInstrDesc.h"
25
26namespace llvm {
27
28// RISCVII - This namespace holds all of the target specific flags that
29// instruction info tracks. All definitions must match RISCVInstrFormats.td.
30namespace RISCVII {
31enum {
61
64
70
73
74 // Is this a _TIED vector pseudo instruction. For these instructions we
75 // shouldn't skip the tied operand when converting to MC instructions.
78
79 // Does this instruction have a SEW operand. It will be the last explicit
80 // operand unless there is a vector policy operand. Used by RVV Pseudos.
83
84 // Does this instruction have a VL operand. It will be the second to last
85 // explicit operand unless there is a vector policy operand. Used by RVV
86 // Pseudos.
89
90 // Does this instruction have a vector policy operand. It will be the last
91 // explicit operand. Used by RVV Pseudos.
94
95 // Is this instruction a vector widening reduction instruction. Used by RVV
96 // Pseudos.
99
100 // Does this instruction care about mask policy. If it is not, the mask policy
101 // could be either agnostic or undisturbed. For example, unmasked, store, and
102 // reduction operations result would not be affected by mask policy, so
103 // compiler has free to select either one.
106
107 // Indicates that the result can be considered sign extended from bit 31. Some
108 // instructions with this flag aren't W instructions, but are either sign
109 // extended from a smaller size, always outputs a small integer, or put zeros
110 // in bits 63:31. Used by the SExtWRemoval pass.
113
116
119
120 // Indicates whether these instructions can partially overlap between source
121 // registers and destination registers according to the vector spec.
122 // 0 -> not a vector pseudo
123 // 1 -> default value for vector pseudos. not widening or narrowing.
124 // 2 -> narrowing case
125 // 3 -> widening case
128
131
134
135 // Indicates the EEW of a vector instruction's destination operand.
136 // 0 -> 1
137 // 1 -> SEW
138 // 2 -> SEW * 2
139 // 3 -> SEW * 4
142
145
146 // 0 -> Don't care about altfmt bit in VTYPE.
147 // 1 -> Is not altfmt.
148 // 2 -> Is altfmt(BF16).
151
152 // XSfmmbase
155
158
161};
162
163// Helper functions to read TSFlags.
164/// \returns the format of the instruction.
165static inline unsigned getFormat(uint64_t TSFlags) {
166 return (TSFlags & InstFormatMask) >> InstFormatShift;
167}
168/// \returns the LMUL for the instruction.
169static inline RISCVVType::VLMUL getLMul(uint64_t TSFlags) {
170 return static_cast<RISCVVType::VLMUL>((TSFlags & VLMulMask) >> VLMulShift);
171}
172/// \returns true if this a _TIED pseudo.
173static inline bool isTiedPseudo(uint64_t TSFlags) {
174 return TSFlags & IsTiedPseudoMask;
175}
176/// \returns true if there is a SEW operand for the instruction.
177static inline bool hasSEWOp(uint64_t TSFlags) {
178 return TSFlags & HasSEWOpMask;
179}
180/// \returns true if there is a VL operand for the instruction.
181static inline bool hasVLOp(uint64_t TSFlags) {
182 return TSFlags & HasVLOpMask;
183}
184/// \returns true if there is a vector policy operand for this instruction.
185static inline bool hasVecPolicyOp(uint64_t TSFlags) {
186 return TSFlags & HasVecPolicyOpMask;
187}
188/// \returns true if it is a vector widening reduction instruction.
189static inline bool isRVVWideningReduction(uint64_t TSFlags) {
190 return TSFlags & IsRVVWideningReductionMask;
191}
192/// \returns true if mask policy is valid for the instruction.
193static inline bool usesMaskPolicy(uint64_t TSFlags) {
194 return TSFlags & UsesMaskPolicyMask;
195}
196
197/// \returns true if there is a rounding mode operand for this instruction
198static inline bool hasRoundModeOp(uint64_t TSFlags) {
199 return TSFlags & HasRoundModeOpMask;
200}
201
203static inline AltFmtType getAltFmtType(uint64_t TSFlags) {
204 return static_cast<AltFmtType>((TSFlags & AltFmtTypeMask) >> AltFmtTypeShift);
205}
206
207/// \returns true if this instruction uses vxrm
208static inline bool usesVXRM(uint64_t TSFlags) { return TSFlags & UsesVXRMMask; }
209
210/// \returns true if the elements in the body are affected by VL,
211/// e.g. vslide1down.vx/vredsum.vs/viota.m
212static inline bool elementsDependOnVL(uint64_t TSFlags) {
213 return TSFlags & ElementsDependOnVLMask;
214}
215
216/// \returns true if the elements in the body are affected by the mask,
217/// e.g. vredsum.vs/viota.m
218static inline bool elementsDependOnMask(uint64_t TSFlags) {
219 return TSFlags & ElementsDependOnMaskMask;
220}
221
222/// \returns true if the instruction may read elements past VL, e.g.
223/// vslidedown/vrgather
224static inline bool readsPastVL(uint64_t TSFlags) {
225 return TSFlags & ReadsPastVLMask;
226}
227
228// XSfmmbase
229static inline bool hasTWidenOp(uint64_t TSFlags) {
230 return TSFlags & HasTWidenOpMask;
231}
232
233static inline bool hasTMOp(uint64_t TSFlags) { return TSFlags & HasTMOpMask; }
234
235static inline bool hasTKOp(uint64_t TSFlags) { return TSFlags & HasTKOpMask; }
236
237static inline unsigned getTNOpNum(const MCInstrDesc &Desc) {
238 const uint64_t TSFlags = Desc.TSFlags;
239 assert(hasTWidenOp(TSFlags) && hasVLOp(TSFlags));
240 unsigned Offset = 3;
241 if (hasTKOp(TSFlags))
242 Offset = 4;
243 return Desc.getNumOperands() - Offset;
244}
245
246static inline unsigned getTMOpNum(const MCInstrDesc &Desc) {
247 const uint64_t TSFlags = Desc.TSFlags;
248 assert(hasTWidenOp(TSFlags) && hasTMOp(TSFlags));
249 if (hasTKOp(TSFlags))
250 return Desc.getNumOperands() - 5;
251 // vtzero.t
252 return Desc.getNumOperands() - 4;
253}
254
255static inline unsigned getTKOpNum(const MCInstrDesc &Desc) {
256 [[maybe_unused]] const uint64_t TSFlags = Desc.TSFlags;
257 assert(hasTWidenOp(TSFlags) && hasTKOp(TSFlags));
258 return Desc.getNumOperands() - 3;
259}
260
261static inline unsigned getVLOpNum(const MCInstrDesc &Desc) {
262 const uint64_t TSFlags = Desc.TSFlags;
263 // This method is only called if we expect to have a VL operand, and all
264 // instructions with VL also have SEW.
265 assert(hasSEWOp(TSFlags) && hasVLOp(TSFlags));
266 // In Xsfmmbase, TN is an alias for VL, so here we use the same TSFlags bit.
267 if (hasTWidenOp(TSFlags))
268 return getTNOpNum(Desc);
269 unsigned Offset = 2;
270 if (hasVecPolicyOp(TSFlags))
271 Offset = 3;
272 return Desc.getNumOperands() - Offset;
273}
274
275static inline MCRegister
277 // For Zicfilp, PseudoTAIL should be expanded to a software guarded branch.
278 // It means to use t2(x7) as rs1 of JALR to expand PseudoTAIL.
279 return FeatureBits[RISCV::FeatureStdExtZicfilp] ? RISCV::X7 : RISCV::X6;
280}
281
282static inline unsigned getSEWOpNum(const MCInstrDesc &Desc) {
283 const uint64_t TSFlags = Desc.TSFlags;
284 assert(hasSEWOp(TSFlags));
285 unsigned Offset = 1;
286 if (hasVecPolicyOp(TSFlags) || hasTWidenOp(TSFlags))
287 Offset = 2;
288 return Desc.getNumOperands() - Offset;
289}
290
291static inline unsigned getVecPolicyOpNum(const MCInstrDesc &Desc) {
292 assert(hasVecPolicyOp(Desc.TSFlags));
293 return Desc.getNumOperands() - 1;
294}
295
296/// \returns the index to the rounding mode immediate value if any, otherwise
297/// returns -1.
298static inline int getFRMOpNum(const MCInstrDesc &Desc) {
299 const uint64_t TSFlags = Desc.TSFlags;
300 if (!hasRoundModeOp(TSFlags) || usesVXRM(TSFlags))
301 return -1;
302
303 if (hasTWidenOp(TSFlags) && hasTMOp(TSFlags))
304 return getTMOpNum(Desc) - 1;
305
306 // The operand order
307 // --------------------------------------
308 // | n-1 (if any) | n-2 | n-3 | n-4 |
309 // | policy | sew | vl | frm |
310 // --------------------------------------
311 return getVLOpNum(Desc) - 1;
312}
313
314/// \returns the index to the rounding mode immediate value if any, otherwise
315/// returns -1.
316static inline int getVXRMOpNum(const MCInstrDesc &Desc) {
317 const uint64_t TSFlags = Desc.TSFlags;
318 if (!hasRoundModeOp(TSFlags) || !usesVXRM(TSFlags))
319 return -1;
320 // The operand order
321 // --------------------------------------
322 // | n-1 (if any) | n-2 | n-3 | n-4 |
323 // | policy | sew | vl | vxrm |
324 // --------------------------------------
325 return getVLOpNum(Desc) - 1;
326}
327
328// Is the first def operand tied to the first use operand. This is true for
329// vector pseudo instructions that have a merge operand for tail/mask
330// undisturbed. It's also true for vector FMA instructions where one of the
331// operands is also the destination register.
332static inline bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc) {
333 return Desc.getNumDefs() < Desc.getNumOperands() &&
334 Desc.getOperandConstraint(Desc.getNumDefs(), MCOI::TIED_TO) == 0;
335}
336
337// RISC-V Specific Machine Operand Flags
338enum {
341 MO_LO = 3,
342 MO_HI = 4,
355
356 // Used to differentiate between target-specific "direct" flags and "bitmask"
357 // flags. A machine operand can only have one "direct" flag, but can have
358 // multiple "bitmask" flags.
360};
361} // namespace RISCVII
362
363namespace RISCVOp {
364enum OperandType : unsigned {
429 // Operand is a 3-bit rounding mode, '111' indicates FRM register.
430 // Represents 'frm' argument passing to floating-point operations.
432 // Operand is a 3-bit rounding mode where only RTZ is valid.
434 // Condition code used by select and short forward branch pseudos.
436 // Vector policy operand.
438 // Vector SEW operand. Stores in log2(SEW).
440 // Special SEW for mask only instructions. Always 0.
442 // Vector rounding mode for VXRM or FRM.
444 // Vtype operand for XSfmm extension.
447
450
451 // Simm12 or constant pool, global, basicblock, etc.
453
455
456 // Operand is either a register or uimm5, this is used by V extension pseudo
457 // instructions to represent a value that be passed as AVL to either vsetvli
458 // or vsetivli.
460};
461} // namespace RISCVOp
462
463// Describes the predecessor/successor bits used in the FENCE instruction.
466 I = 8,
467 O = 4,
468 R = 2,
469 W = 1
470};
471}
472
473// Describes the supported floating point rounding mode encodings.
474namespace RISCVFPRndMode {
476 RNE = 0,
477 RTZ = 1,
478 RDN = 2,
479 RUP = 3,
480 RMM = 4,
481 DYN = 7,
483};
484
486 switch (RndMode) {
487 default:
488 llvm_unreachable("Unknown floating point rounding mode");
490 return "rne";
492 return "rtz";
494 return "rdn";
496 return "rup";
498 return "rmm";
500 return "dyn";
501 }
502}
503
514
515inline static bool isValidRoundingMode(unsigned Mode) {
516 switch (Mode) {
517 default:
518 return false;
525 return true;
526 }
527}
528} // namespace RISCVFPRndMode
529
530namespace RISCVVXRndMode {
532 RNU = 0,
533 RNE = 1,
534 RDN = 2,
535 ROD = 3,
537};
538
540 switch (RndMode) {
541 default:
542 llvm_unreachable("Unknown vector fixed-point rounding mode");
544 return "rnu";
546 return "rne";
548 return "rdn";
550 return "rod";
551 }
552}
553
562
563inline static bool isValidRoundingMode(unsigned Mode) {
564 switch (Mode) {
565 default:
566 return false;
571 return true;
572 }
573}
574} // namespace RISCVVXRndMode
575
578 NX = 0x01, // Inexact
579 UF = 0x02, // Underflow
580 OF = 0x04, // Overflow
581 DZ = 0x08, // Divide by zero
582 NV = 0x10, // Invalid operation
583 ALL = 0x1F // Mask for all accrued exception flags
584};
585}
586
587//===----------------------------------------------------------------------===//
588// Floating-point Immediates
589//
590
591namespace RISCVLoadFPImm {
592float getFPImm(unsigned Imm);
593
594/// getLoadFPImm - Return a 5-bit binary encoding of the floating-point
595/// immediate value. If the value cannot be represented as a 5-bit binary
596/// encoding, then return -1.
597int getLoadFPImm(APFloat FPImm);
598} // namespace RISCVLoadFPImm
599
600namespace RISCVSysReg {
601struct SysReg {
602 const char Name[32];
603 unsigned Encoding;
604 // FIXME: add these additional fields when needed.
605 // Privilege Access: Read, Write, Read-Only.
606 // unsigned ReadWrite;
607 // Privilege Mode: User, System or Machine.
608 // unsigned Mode;
609 // Check field name.
610 // unsigned Extra;
611 // Register number without the privilege bits.
612 // unsigned Number;
617
618 bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const {
619 // Not in 32-bit mode.
620 if (IsRV32Only && ActiveFeatures[RISCV::Feature64Bit])
621 return false;
622 // No required feature associated with the system register.
623 if (FeaturesRequired.none())
624 return true;
625 return (FeaturesRequired & ActiveFeatures) == FeaturesRequired;
626 }
627};
628
629#define GET_SysRegEncodings_DECL
630#define GET_SysRegsList_DECL
631#include "RISCVGenSearchableTables.inc"
632} // end namespace RISCVSysReg
633
634namespace RISCVInsnOpcode {
636 char Name[10];
638};
639
640#define GET_RISCVOpcodesList_DECL
641#include "RISCVGenSearchableTables.inc"
642} // end namespace RISCVInsnOpcode
643
644namespace RISCVABI {
645
657
658// Returns the target ABI, or else a StringError if the requested ABIName is
659// not supported for the given TT and FeatureBits combination.
660ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
661 StringRef ABIName);
662
663ABI getTargetABI(StringRef ABIName);
664
665// Returns the register used to hold the stack pointer after realignment.
667
668// Returns the register holding shadow call stack pointer.
670
671} // namespace RISCVABI
672
673namespace RISCVFeatures {
674
675// Validates if the given combination of features are valid for the target
676// triple. Exits with report_fatal_error if not.
677void validate(const Triple &TT, const FeatureBitset &FeatureBits);
678
680parseFeatureBits(bool IsRV64, const FeatureBitset &FeatureBits);
681
682} // namespace RISCVFeatures
683
684namespace RISCVRVC {
685bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
686bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
687} // namespace RISCVRVC
688
689namespace RISCVZC {
706
707inline unsigned encodeRegList(MCRegister EndReg, bool IsRVE = false) {
708 assert((!IsRVE || EndReg <= RISCV::X9) && "Invalid Rlist for RV32E");
709 switch (EndReg.id()) {
710 case RISCV::X1:
711 return RLISTENCODE::RA;
712 case RISCV::X8:
713 return RLISTENCODE::RA_S0;
714 case RISCV::X9:
716 case RISCV::X18:
718 case RISCV::X19:
720 case RISCV::X20:
722 case RISCV::X21:
724 case RISCV::X22:
726 case RISCV::X23:
728 case RISCV::X24:
730 case RISCV::X25:
732 case RISCV::X27:
734 default:
735 llvm_unreachable("Undefined input.");
736 }
737}
738
739inline static unsigned encodeRegListNumRegs(unsigned NumRegs) {
740 assert(NumRegs > 0 && NumRegs < 14 && NumRegs != 12 &&
741 "Unexpected number of registers");
742 if (NumRegs == 13)
744
745 return RLISTENCODE::RA + (NumRegs - 1);
746}
747
748inline static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64) {
749 assert(RlistVal >= RLISTENCODE::RA && RlistVal <= RLISTENCODE::RA_S0_S11 &&
750 "Invalid Rlist");
751 unsigned NumRegs = (RlistVal - RLISTENCODE::RA) + 1;
752 // s10 and s11 are saved together.
753 if (RlistVal == RLISTENCODE::RA_S0_S11)
754 ++NumRegs;
755
756 unsigned RegSize = IsRV64 ? 8 : 4;
757 return alignTo(NumRegs * RegSize, 16);
758}
759
760void printRegList(unsigned RlistEncode, raw_ostream &OS);
761} // namespace RISCVZC
762
763namespace RISCVVInversePseudosTable {
770
771#define GET_RISCVVInversePseudosTable_DECL
772#include "RISCVGenSearchableTables.inc"
773} // namespace RISCVVInversePseudosTable
774
775namespace RISCV {
785
795
804
814
823
831
840
848
849#define GET_RISCVVSSEGTable_DECL
850#define GET_RISCVVLSEGTable_DECL
851#define GET_RISCVVLXSEGTable_DECL
852#define GET_RISCVVSXSEGTable_DECL
853#define GET_RISCVVLETable_DECL
854#define GET_RISCVVSETable_DECL
855#define GET_RISCVVLXTable_DECL
856#define GET_RISCVVSXTable_DECL
857#define GET_RISCVNDSVLNTable_DECL
858#include "RISCVGenSearchableTables.inc"
859} // namespace RISCV
860
861} // namespace llvm
862
863#endif
unsigned RegSize
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file implements a class to represent arbitrary precision integral constant values and operations...
IRTranslator LLVM IR MI
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Tagged union holding either a T or a Error.
Definition Error.h:485
Container class for subtarget features.
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
constexpr unsigned id() const
Definition MCRegister.h:82
Generic base class for all target subtargets.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ OPERAND_FIRST_TARGET
Definition MCInstrDesc.h:79
ABI getTargetABI(StringRef ABIName)
ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, StringRef ABIName)
MCRegister getBPReg()
MCRegister getSCSPReg()
static bool isValidRoundingMode(unsigned Mode)
static RoundingMode stringToRoundingMode(StringRef Str)
static StringRef roundingModeToString(RoundingMode RndMode)
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatureBits(bool IsRV64, const FeatureBitset &FeatureBits)
static unsigned getVecPolicyOpNum(const MCInstrDesc &Desc)
static unsigned getTMOpNum(const MCInstrDesc &Desc)
static bool usesMaskPolicy(uint64_t TSFlags)
static bool hasRoundModeOp(uint64_t TSFlags)
@ TargetOverlapConstraintTypeMask
@ TargetOverlapConstraintTypeShift
@ IsRVVWideningReductionShift
static bool readsPastVL(uint64_t TSFlags)
static bool hasTWidenOp(uint64_t TSFlags)
static bool isTiedPseudo(uint64_t TSFlags)
static RISCVVType::VLMUL getLMul(uint64_t TSFlags)
static unsigned getTKOpNum(const MCInstrDesc &Desc)
static unsigned getVLOpNum(const MCInstrDesc &Desc)
static AltFmtType getAltFmtType(uint64_t TSFlags)
static unsigned getFormat(uint64_t TSFlags)
static bool hasTKOp(uint64_t TSFlags)
static bool hasVLOp(uint64_t TSFlags)
static MCRegister getTailExpandUseRegNo(const FeatureBitset &FeatureBits)
static bool elementsDependOnMask(uint64_t TSFlags)
static int getFRMOpNum(const MCInstrDesc &Desc)
static bool hasTMOp(uint64_t TSFlags)
static int getVXRMOpNum(const MCInstrDesc &Desc)
static unsigned getTNOpNum(const MCInstrDesc &Desc)
static bool hasVecPolicyOp(uint64_t TSFlags)
static bool usesVXRM(uint64_t TSFlags)
static bool isRVVWideningReduction(uint64_t TSFlags)
static unsigned getSEWOpNum(const MCInstrDesc &Desc)
static bool elementsDependOnVL(uint64_t TSFlags)
static bool hasSEWOp(uint64_t TSFlags)
static bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc)
int getLoadFPImm(APFloat FPImm)
getLoadFPImm - Return a 5-bit binary encoding of the floating-point immediate value.
float getFPImm(unsigned Imm)
@ OPERAND_SIMM10_LSB0000_NONZERO
bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
static bool isValidRoundingMode(unsigned Mode)
static RoundingMode stringToRoundingMode(StringRef Str)
static StringRef roundingModeToString(RoundingMode RndMode)
unsigned encodeRegList(MCRegister EndReg, bool IsRVE=false)
static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64)
void printRegList(unsigned RlistEncode, raw_ostream &OS)
static unsigned encodeRegListNumRegs(unsigned NumRegs)
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:532
Op::Description Desc
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition Alignment.h:144
bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const