RISC-V Instruction Set Online Reference

Instructions · Registers · CSRs · ABI

RVOPcode is a developer-focused RISC-V instruction set online reference. Search by mnemonic, extension, function, scenario, register name, CSR name, or topic to quickly find instruction syntax, encodings, examples, pseudo-instruction expansions, ABI rules, and CSR field details.

Try: addi·jalr·mstatus·ra·call·I-type·function call
How To Search

Search directly by mnemonic, ABI name, CSR name, or topic keyword.

InstructionsRegistersCSRTopics↑ ↓ NavigateEnter Open

Recent Searches

No search history yet

Core Entry Points

Browse By Multiple Dimensions

By Function
ArithmeticControl TransferJumpMemory LoadMemory StoreBranchLogicalAddress ComputationSystemTrapImmediates & ConstantsAssembler pseudo-instructionNo operationShiftCompareCache & Sync32-bit word operations32-bit Shift32-bit OperationCSR OperationDivisionMultiplicationAtomicAtomic OperationMay-Be-OperationsAddress GenerationBit ManipulationInteger OperationCryptoSingle-Bit OperationConditional OperationsSystem & PrivilegedMicroarch HintsCache & SynchronizationFloating-Point ArithmeticFloating-Point LoadFloating-Point StoreFloating-Point ConvertFloating-Point CompareFloating-Point Bit MoveFloating-Point ClassifyFloating-Point Load ImmediateData MovementFP PrecisionCompressed InstructionJump & Control TransferStack & FunctionsSecurity MechanismsVector CryptoAESVector Bit ManipulationGCM/GHASHSHA-2SM3SM4Vector OperationsVector ConfigInteger ArithmeticVector IntegerBitwiseFixed-Point ArithmeticVector PermutationPermutationVector AddFloating-PointVector Type ConvertMask OperationsVector Multiply-AddVector MultiplyRegister MoveVector ReductionVector SubtractVector MemoryVector LoadFault-Only-First LoadIndexed Vector LoadMultiply-AccumulateCarry/BorrowMultiply-AddMin/MaxVector Data MovementMerge/SelectVector FPVector Mask OperationsMultiplyScalar-Vector TransferVector-Vector TransferVector-Scalar TransferWhole Register MoveVector Fixed-PointNarrowing/ClipMultiply-SubtractShift/NarrowingDivide/RemainderGatherVector StoreVector Configurationvset InstructionsSign-ExtendSlideIndexed Vector StoreMask LogicCrypto & SecurityMemory ManagementSystem & Privilege
By Format
AMOAMO-typeB-typeCC-typeC2 (Zcmp CMPP)CA formatCA-formatCB-formatCBO MISC-MEM fixed fieldsCI formatCI-formatCJ formatCL-formatCR formatCS-formatCSS-formatI-typeI-type (OP-IMM)I-type (OP-IMM-32)I-type (OP-IMM-32, RV64)J-typeOP-32 (R-type)OP-FPOP-FP conversion fieldsOP-FP move fieldsOP-IMM (I-type)OP-VOP-V (OPFVF)OP-V (OPFVV)OP-V (OPIVV)OP-V / OPFVFOP-V / OPFVVOP-V / OPFVV VFUNARY1OP-V / OPIVIOP-V / OPIVVOP-V / OPIVXOP-V OPIVV (funct6=010101, funct3=000)OP-V OPIVX (funct6=010101, funct3=100)OP-V OPMVV (funct6=010010, vs1=01001, funct3=010)OP-V VXUNARY0 (funct3=010)OP-V vector configuration (immediate AVL)OP-V vector configuration (register vtype)OP-V vector-configuration formatOP-V vector-vector formOP-VE (32-bit)OP-VE OPMVV (funct6=101000, vm=1, vs1=10001, funct3=010)OP-VE OPMVV (funct6=101100, vm=1, funct3=010)OP-VE vector-scalar formOP-VE vector-vector formOPFVFOPFVVOPIVIOPIVI (OP-V)OPIVVOPIVV (OP-V)OPIVXOPIVX (OP-V)OPMVVOPMVV (OP-V)OPMVXOPMVX (OP-V)R-typeR-type (OP with bs in bits 31:30)R-type HINT (ADD x0, x0, x2)R-type HINT (ADD x0, x0, x3)R-type HINT (ADD x0, x0, x4)R-type HINT (ADD x0, x0, x5)R4-typeS-typeSHA2 OP-IMM fixed-selector fieldsSTORE-FPSYSTEM (MOP.R.28)SYSTEM (MOP.RR.7)SYSTEM (R-type encoding)SYSTEM (Zimop MOP.R)SYSTEM I-type fieldsSYSTEM R-typeSYSTEM R-type fieldsU-typeU-type (AUIPC HINT)V-typeV-type (OP-V / OPFVF)V-type (OP-V / OPFVV VFUNARY0)V-type (OP-V / OPFVV)V-type (OP-V / OPIVI)V-type (OP-V / OPIVV)V-type (OP-V / OPIVX)V-type (OP-VE / OPMVV)Vector OP-V (OPIVI)Vector OP-V (OPIVV)Vector OP-V (OPIVX)Vector OP-VE (OPMVV)Vector StoreZimop MOP.R SYSTEM fieldsZimop MOP.RR SYSTEM fields
By Scenario
Address & PointerBasic ArithmeticRegister OperationsImmediates & ConstantsBranch & JumpFunction Call & ReturnData LoadingData StoringComparison & DetectionUnsigned Bounds CheckingRegister differenceNegationBit Operations & MasksDebug & MonitoringSystem & PrivilegeExecution Environment CallByte data loadsSign extensionZero extensionHalfword data loadsUnsigned Halfword LoadAlign code segmentsLeave space for inline code modificationsSet-bit masksBit-field combinationByte data storageHalfword data storageBit operations and shiftsSigned comparisonBit OperationsType ConversionLogical OperationsMemory OrderingDevice & IOConcurrent Synchronization32-bit addition in RV64Sign extension of a 32-bit resultRV64I or RV32 Zilsd doubleword loadsBase plus offset addressingUnsigned Data LoadDoubleword data storageRV32 Zilsd register-pair storage32-bit logical left shiftAtomic & SyncCSR AccessSelf-modifying CodeJIT CompilationDynamic Code GenerationMultiplication & DivisionXLEN-bit integer multiplicationSigned product high halfMulti-word signed multiplicationUnsigned product high halfRV64 low-32-bit integer multiplicationInteger remainderRV64 Operations32-bit Atomic OperationsSigned ComparisonsBounded UpdatesUnsigned ComparisonsUnsigned BoundsAtomic Bit TogglingLR/SC conditional updateAtomic read-modify-writeZcmop MOPExtension-definedAddress generation from unsigned word indicesUnsigned word zero-extension and left shiftAddress calculationclz leading-zero countclzw leading-zero countcpop population countcpopw population countctz trailing-zero countInteger ComparisonInteger Min/MaxZero-Byte DetectionCrypto & SecurityNetwork & Byte OrderRotate rightBitwise equality masksInverting an XOR resultZero-extend low 16 bitsBit ManipulationResource ManagementConstruct branchless conditional-select sequencesExtension CompatibilityZimop default zero writeExtension redefinitionSystem & PrivilegedZimop extension compatibilityConcurrency & Multi-corePower OptimizationFloating-point arithmeticNumerical computingNumerical ComputingInteger to FP conversionSingle-Precision to signed 32-bit integer conversionFP-to-unsigned-integer conversionFloating-Point ConditionsFused Floating PointFloating-Point CompareFP bit constructionNaN payload preservationraw encoding debuggingFP bit inspectionSign OperationsFloating-Point Bit ManipulationClass MaskNaN ClassificationSigned-Zero Classification64-bit Numeric ConversionRV64 floating-point and 64-bit integer conversionDouble-precision numerical computingFloating-Point Format ConversionInteger-to-FP conversionFP format conversionDouble-Precision to signed 32-bit integer conversionDouble-Precision to unsigned 32-bit integer conversionDouble-precision class detectionNaN classificationdouble bit constructionRV64 raw encoding debugdouble bit inspectionFloating-Point ClassificationDistinguish signed zeros and NaN classesFloating-point to integer conversionFloating-point wideningNumeric integer-to-floating-point conversionFloating-point format conversionQuad-Precision to signed 32-bit integer conversionFloating Point BasicFloating-Point MemoryData Load/StoreInteger-to-Floating-Point ConversionFloating-Point-to-Integer ConversionHalf-Precision to signed 32-bit integer conversionFloating-Point Bit MoveDebugging Bit PatternsJavaScript integer conversionModulo 2^32 conversionFloating-Point ConstantsRV32 Double Data MovementFloating-Point RoundingNumeric Format HandlingFloating-Point Memory AccessConvert FP32 data to BF16 interchange formatWiden BF16 data to FP32Loops & Iteration16-bit no-operationConditional branch against zeroIndirect Jump & ReturnCompressed word loadStack AccessShift OperationsMemory StoreCompressed & Code SizeDoubleword data loadStack-relative doubleword loadUpper constant generationStack-frame register savesSigned integer scalingLogical Right ShiftInteger SubtractionBitwise XORSign-extend a 32-bit sumShort-range jump and linkArrays & Memory AccessHalfword data loadCompressed integer arithmeticCompressed integer bit operationsSigned byte-value extensionSigned halfword-value extensionCompact halfword storesZero ExtensionFunction epilogueFunction prologueShadow-stack return-address checkingShadow-stack pop after a successful matchShadow-stack return-address copy storageFixed-x1 compressed shadow-stack pushVector AccelerationApply vector-scalar and-not to active vector elements.Apply whole-element bit reversal to active vector elements.Apply bit reversal within bytes to active vector elements.Apply carry-less multiply low to active vector elements.Apply vector-scalar carry-less multiply low to active vector elements.Per-element bit operation exampleFour SM4 roundsVector round keysWidening logical shiftZero-extension bit operationsVector Integer ArithmeticWidening OperationsVectorized LoopsFixed-point averagingVector data processingRVV masked executionMulti-word Integer AdditionPer-element Carry InputArray OpsAdd one integer scalar to active elementsKeep or clear bits in each active elementFixed-point averaging subtraction with vxrm roundingSparse CompressionStream CompactionVector Integer ScalingBatch QuotientsScientific ComputingDSPVector Float OpsNumeric ClassificationNaN / Infinity TestsVectorized Data CleaningInteger data to FP vectorsMixed-type vector mathVectorized numeric preparationFP results to integer vectorsTruncating numeric conversionfrm-rounded conversionVector normalizationScalar scalingNumeric computingLane-wise FP divisionFirst Set Mask BitActive Match IndexFused FP AccumulationMasked Element Multiply-AddFused Multiplicand OverwriteLane-wise FP maximumLower-bound clippingConditional AssignmentTernary OperatorLane-wise FP minimumUpper-bound clippingFused multiply-subtractScalingGain AdjustmentVector FP MultiplyElement-wise MultiplyReduction ResultScalar-Vector InterfaceReduction InitScalar to Element 0Vector InitConstant BroadcastCompress after higher-precision FP computationNarrow FP vectors before storageCompress wide signed integers into narrower FP formatMixed integer/FP vector processingCompress wide unsigned integers into narrower FP formatVector numeric format conversionMulti-step FP narrowingIntermediate step to avoid double roundingTruncate wide FP to narrower signed integersVectorized format conversionFormat compaction needing truncation semanticsWide FP to narrower unsigned integersStore wide FP results as narrower signed integersConversion before storage or integer post-processingStore wide FP results as narrower unsigned integersVectorized format compactionFused evaluation with both product and other term negatedNegated-product fused operationReciprocal scalingDivision OptimizationNewton-RaphsonVector ReductionExtremumMinimumVector SumDot ProductHigh-Perf ReductionVector NormalizationConstant Minus VectorControl vector signs from a scalarVector copysignLane-wise sign copyLane-wise sign-bit copyVector copysign constructionSign-bit teaching examplesControl vector signs from an inverted scalar signBulk result sign selectionSign-bit inversionLane-wise inverted sign injectionVector negative copysign constructionConditionally flip vector signs from a scalarSign-bit XORKeep or flip signs according to the scalar signLane-wise conditional sign flipVector absolute-value / negation constructionLane-wise square rootVector normsDifferencesHigh-Precision AccumMixed PrecisionAdd a narrow FP vector to a wide FP vectorMixed-precision additionbinary32 vectors promoted to binary64mixed-precision FP compute entryhigher-precision processing after wideninginteger vectors promoted to binary64 FPmixed-precision vector compute entryFP paths preserving 32-bit integer precisionFP results to 64-bit integer vectorsmixed-type vector conversionnumeric paths needing double-width integer resultsSEW FP to 2*SEW integersactive-element type conversionSEW multipliers with a 2*SEW addendactive-element fused multiply-addFused binary32 products with a binary64 old destinationbinary32 multipliers with binary64 productsWidening Negated FMAWidening Ordered FP SumWidening Unordered FP SumHigh-Precision DifferenceSequence GenLoop CounterGather IndexSparse IndexingCompress HelperConditional GatherContiguous Array ReadVectorized Memory AccessData-Dependent Exit LoopsContiguous Element ScanningVector Loads That Can Trim vlVectorized String ScanContiguous Memory ProbingRestore packed mask dataVector mask save/restoreMask spill/fillOrdered indirect readsDevice or side-effecting address spacesSparse table readsStructure field accessMatrix row or column stride accessNon-contiguous vector readsSparse data readsGather access without ordering needsIndirect array loadsGather using unsigned byte offsetsIndexed reads without element-order guaranteesElement-wise integer multiply-accumulateSEW-width multiply-addMulti-Precision AddBigIntCarry PropagationElementwise integer multiply-addElementwise maximum selectionData ClippingThresholdingMask WideningPredicate mask generationFP condition testingNaN checksVectorized conditional executionGenerate FP comparison masksSelect compared elements with v0.tMulti-Precision SubLoop TerminationData-Dependent ExitConditional ExecutionRange CheckPredicate GenerationInteger comparisonPredicate maskSet-only-first maskGeneral MultiplyFixed-PointFractionalElement 0 SetupVector Constant SetupCopy vector-register body elementsVector initializationInteger scalar broadcastRead vector element 0Extract a scalar vector resultCompiler register shuffleVector register group rearrangementComplete vector-register group copyFixed-point result narrowingVector DSP scaled outputWide-to-narrow conversion that needs a saturation flagFixed-point scaled and rounded outputVector integer product subtractionDestructive SEW-width multiply-subtractVector-scalar integer product subtractionMultiplicand-overwrite integer multiply-subtractSEW modular arithmeticWide integer field extraction2*SEW-to-SEW narrowingWide-Source Field ExtractionInteger Narrowingsetting selected bits, combining bit fields, or merging per-element data bit patternsRVV per-element bit operationsLoop ConditionMask DensityReduce a vector and seed by bitwise ANDReduce a vector and seed by signed maximumReduce a vector and seed by unsigned maximumReduce a vector and seed by signed minimumSingle-width unsigned minimum reductionSeeded masked reductionSingle-width bitwise OR reductionSingle-width sum reductionSingle-width bitwise XOR reductionElement-wise signed remainderMasked vector remainderElement-wise unsigned remainderRegister table lookupVector element permutationElementwise reverse subtractionVector negationContiguous Array WriteStripmining LoopVector LengthContext SwitchVector State RestoreVector Integer ExtensionEEW-to-SEW extensionV standard vector extensionRegister element rearrangementRearrange elements by scalar offsetPreserve low-index destination elementsVector OperationsPower-of-2 MultiplySave packed mask dataMask-state save during context switchingSigned fixed-point fractional multiplicationVector scaling with vxrm roundingDetecting saturation through vxsatOrdered indirect writesSparse table updatesSigned ShiftsBitfield OpsNon-contiguous vector writesFixed-point scalingVector shiftsDSP data pathsElement-wise vector differencesVector data subtractionSparse data writesScatter access without ordering needsIndirect array storesWidening AddWidening MACWidening integer accumulationWidening integer multiplicationWidening integer multiplySigned widening sum reductionUnsigned widening sumVector reductionStatistical aggregationSigned Widening SubtractionUnsigned Widening Operationstoggling selected bits, combining parity patterns, or building per-element difference masksMachine LearningPredicate condition compositionMask logical family comparisonMask construction before masked executionPolling an LR reservation setWaiting on shared stateReservation polling with a short timeoutCache & HintsPerformanceWrite transfer for modified cache blocksVisibility to relevant non-coherent agentsData visibility between non-coherent agentsZero bytes corresponding to a cache blockData ProtectionKey ScheduleSHA-256 σ0 transformSHA-256 σ1 transformSHA-256 Σ0 transformSHA-256 Σ1 transformSHA-512 σ0 transformSHA-512 hash transformsInteger-register bit operationsHash AlgorithmsChinese National Cryptobyte-local bit permutationper-byte bit reversalForward-edge CFIIndirect call/jump markingSecurity hardeningPacking low register halvesCryptographic bit manipulationPacking low register fieldsShadow-stack switchingSaving shadow-stack checkpointsShadow-stack checkpoint maintenanceShadow-stack checking and unwindingReading shadow-stack stateShadow-stack unwinding and switchingBit deinterleavingRV32 SHA3 bit-interleaved representationRegister LookupRegister bit interleavingSHA3 bit interleavingM-mode handler returnFirmware/SEE returnOS kernel exception/interrupt returnIdle loop power savingLow-power waitingTLB sync after page table modFlush after munmap/mprotectAddress space switchDebugger returnHardware breakpoint resumeG-stage page-table syncVS-stage page-table syncGuest byte accessVirtual-machine memory loadVS/VU effective privilegeTwo-stage address translationGuest unsigned word readsGuest instruction-fetch emulationGuest memory writesHypervisor Device EmulationGuest Memory AccessVirtualized Instruction SimulationRNMI handler returnMemory ManagementTranslation InvalidationTranslation Cache InvalidationSvinval SequenceG-stage invalidation sequenceVS-stage invalidation sequenceCode Optimization

Instruction of the Day

Register Quick Reference

RV32 / RV64 Compare
View All →
RegisterABIRoleSaved by
x0zeroZero constantImmutable
x1raFunction return addressNot preserved across calls
x2spStack pointerPreserved across calls
x3gpGlobal pointer; unallocatable and not modified by standard ABI procedures.Unallocatable
x4tpThread pointer; unallocatable and not modified by standard ABI procedures.Unallocatable
x5t0Temporary / alternate link registerNot preserved across calls
x10a0Argument / Return valueNot preserved across calls
x11a1Argument / Return valueNot preserved across calls