common

package
v0.0.0-...-03cd3b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImmI

func ImmI[W int16 | int32 | int64](imm W, nbits uint) (uint32, error)

immI extracts the signed integer of the specified size from an immediate.

func ImmIFits

func ImmIFits[W int16 | int32 | int64](x W, nbits uint) bool

immIFits reports whether immediate value x fits in nbits bits as a signed integer.

func SignExtend

func SignExtend[inp uint32 | int16 | int32 | int64, W uint32 | int16 | int32 | int64](val inp, bit uint) W

signExtend sign extends val starting at bit bit.

func Split32BitImmediate

func Split32BitImmediate[inp int64, outp int32](imm inp) (low, high outp, err error)

Split32BitImmediate splits a signed 32-bit immediate into a signed 20-bit upper immediate and a signed 12-bit lower immediate to be added to the upper result. For example, high may be used in LUI and low in a following ADDI to generate a full 32-bit constant.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL