go/src/cmd/internal/obj/riscv/obj.go

func buildop(ctxt *obj.Link) {}

func jalToSym(ctxt *obj.Link, p *obj.Prog, lr int16) {}

// progedit is called individually for each *obj.Prog. It normalizes instruction
// formats and eliminates as many pseudo-instructions as possible.
func progedit(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc) {}

// addrToReg extracts the register from an Addr, handling special Addr.Names.
func addrToReg(a obj.Addr) int16 {}

// movToLoad converts a MOV mnemonic into the corresponding load instruction.
func movToLoad(mnemonic obj.As) obj.As {}

// movToStore converts a MOV mnemonic into the corresponding store instruction.
func movToStore(mnemonic obj.As) obj.As {}

// markRelocs marks an obj.Prog that specifies a MOV pseudo-instruction and
// requires relocation.
func markRelocs(p *obj.Prog) {}

// InvertBranch inverts the condition of a conditional branch.
func InvertBranch(as obj.As) obj.As {}

// containsCall reports whether the symbol contains a CALL (or equivalent)
// instruction. Must be called after progedit.
func containsCall(sym *obj.LSym) bool {}

// setPCs sets the Pc field in all instructions reachable from p.
// It uses pc as the initial value and returns the next available pc.
func setPCs(p *obj.Prog, pc int64) int64 {}

// stackOffset updates Addr offsets based on the current stack size.
//
// The stack looks like:
// -------------------
// |                 |
// |      PARAMs     |
// |                 |
// |                 |
// -------------------
// |    Parent RA    |   SP on function entry
// -------------------
// |                 |
// |                 |
// |       AUTOs     |
// |                 |
// |                 |
// -------------------
// |        RA       |   SP during function execution
// -------------------
//
// FixedFrameSize makes other packages aware of the space allocated for RA.
//
// A nicer version of this diagram can be found on slide 21 of the presentation
// attached to https://golang.org/issue/16922#issuecomment-243748180.
func stackOffset(a *obj.Addr, stacksize int64) {}

// preprocess generates prologue and epilogue code, computes PC-relative branch
// and jump offsets, and resolves pseudo-registers.
//
// preprocess is called once per linker symbol.
//
// When preprocess finishes, all instructions in the symbol are either
// concrete, real RISC-V instructions or directive pseudo-ops like TEXT,
// PCDATA, and FUNCDATA.
func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {}

func pcAlignPadLength(pc int64, alignedValue int64) int {}

func stacksplit(ctxt *obj.Link, p *obj.Prog, cursym *obj.LSym, newprog obj.ProgAlloc, framesize int64) *obj.Prog {}

// signExtend sign extends val starting at bit bit.
func signExtend(val int64, bit uint) int64 {}

// 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.
func Split32BitImmediate(imm int64) (low, high int64, err error) {}

func regVal(r, min, max uint32) uint32 {}

// regI returns an integer register.
func regI(r uint32) uint32 {}

// regF returns a float register.
func regF(r uint32) uint32 {}

// regV returns a vector register.
func regV(r uint32) uint32 {}

// regAddr extracts a register from an Addr.
func regAddr(a obj.Addr, min, max uint32) uint32 {}

// regIAddr extracts the integer register from an Addr.
func regIAddr(a obj.Addr) uint32 {}

// regFAddr extracts the float register from an Addr.
func regFAddr(a obj.Addr) uint32 {}

// immEven checks that the immediate is a multiple of two. If it
// is not, an error is returned.
func immEven(x int64) error {}

// immIFits checks whether the immediate value x fits in nbits bits
// as a signed integer. If it does not, an error is returned.
func immIFits(x int64, nbits uint) error {}

// immI extracts the signed integer of the specified size from an immediate.
func immI(as obj.As, imm int64, nbits uint) uint32 {}

func wantImmI(ctxt *obj.Link, ins *instruction, imm int64, nbits uint) {}

func wantReg(ctxt *obj.Link, ins *instruction, pos string, descr string, r, min, max uint32) {}

func wantNoneReg(ctxt *obj.Link, ins *instruction, pos string, r uint32) {}

// wantIntReg checks that r is an integer register.
func wantIntReg(ctxt *obj.Link, ins *instruction, pos string, r uint32) {}

// wantFloatReg checks that r is a floating-point register.
func wantFloatReg(ctxt *obj.Link, ins *instruction, pos string, r uint32) {}

// wantVectorReg checks that r is a vector register.
func wantVectorReg(ctxt *obj.Link, ins *instruction, pos string, r uint32) {}

// wantEvenOffset checks that the offset is a multiple of two.
func wantEvenOffset(ctxt *obj.Link, ins *instruction, offset int64) {}

func validateRII(ctxt *obj.Link, ins *instruction) {}

func validateRIII(ctxt *obj.Link, ins *instruction) {}

func validateRFFF(ctxt *obj.Link, ins *instruction) {}

func validateRFFFF(ctxt *obj.Link, ins *instruction) {}

func validateRFFI(ctxt *obj.Link, ins *instruction) {}

func validateRFI(ctxt *obj.Link, ins *instruction) {}

func validateRIF(ctxt *obj.Link, ins *instruction) {}

func validateRFF(ctxt *obj.Link, ins *instruction) {}

func validateIII(ctxt *obj.Link, ins *instruction) {}

func validateIF(ctxt *obj.Link, ins *instruction) {}

func validateSI(ctxt *obj.Link, ins *instruction) {}

func validateSF(ctxt *obj.Link, ins *instruction) {}

func validateB(ctxt *obj.Link, ins *instruction) {}

func validateU(ctxt *obj.Link, ins *instruction) {}

func validateJ(ctxt *obj.Link, ins *instruction) {}

func validateRaw(ctxt *obj.Link, ins *instruction) {}

// extractBitAndShift extracts the specified bit from the given immediate,
// before shifting it to the requested position and returning it.
func extractBitAndShift(imm uint32, bit, pos int) uint32 {}

// encodeR encodes an R-type RISC-V instruction.
func encodeR(as obj.As, rs1, rs2, rd, funct3, funct7 uint32) uint32 {}

// encodeR4 encodes an R4-type RISC-V instruction.
func encodeR4(as obj.As, rs1, rs2, rs3, rd, funct3, funct2 uint32) uint32 {}

func encodeRII(ins *instruction) uint32 {}

func encodeRIII(ins *instruction) uint32 {}

func encodeRFFF(ins *instruction) uint32 {}

func encodeRFFFF(ins *instruction) uint32 {}

func encodeRFFI(ins *instruction) uint32 {}

func encodeRFI(ins *instruction) uint32 {}

func encodeRIF(ins *instruction) uint32 {}

func encodeRFF(ins *instruction) uint32 {}

// encodeI encodes an I-type RISC-V instruction.
func encodeI(as obj.As, rs1, rd, imm uint32) uint32 {}

func encodeIII(ins *instruction) uint32 {}

func encodeIF(ins *instruction) uint32 {}

// encodeS encodes an S-type RISC-V instruction.
func encodeS(as obj.As, rs1, rs2, imm uint32) uint32 {}

func encodeSI(ins *instruction) uint32 {}

func encodeSF(ins *instruction) uint32 {}

// encodeBImmediate encodes an immediate for a B-type RISC-V instruction.
func encodeBImmediate(imm uint32) uint32 {}

// encodeB encodes a B-type RISC-V instruction.
func encodeB(ins *instruction) uint32 {}

// encodeU encodes a U-type RISC-V instruction.
func encodeU(ins *instruction) uint32 {}

// encodeJImmediate encodes an immediate for a J-type RISC-V instruction.
func encodeJImmediate(imm uint32) uint32 {}

// encodeJ encodes a J-type RISC-V instruction.
func encodeJ(ins *instruction) uint32 {}

// encodeCBImmediate encodes an immediate for a CB-type RISC-V instruction.
func encodeCBImmediate(imm uint32) uint32 {}

// encodeCJImmediate encodes an immediate for a CJ-type RISC-V instruction.
func encodeCJImmediate(imm uint32) uint32 {}

func encodeRawIns(ins *instruction) uint32 {}

func EncodeBImmediate(imm int64) (int64, error) {}

func EncodeCBImmediate(imm int64) (int64, error) {}

func EncodeCJImmediate(imm int64) (int64, error) {}

func EncodeIImmediate(imm int64) (int64, error) {}

func EncodeJImmediate(imm int64) (int64, error) {}

func EncodeSImmediate(imm int64) (int64, error) {}

func EncodeUImmediate(imm int64) (int64, error) {}

type encoding

var rIIIEncoding

var rIIEncoding

var rFFFEncoding

var rFFFFEncoding

var rFFIEncoding

var rFIEncoding

var rIFEncoding

var rFFEncoding

var iIIEncoding

var iFEncoding

var sIEncoding

var sFEncoding

var bEncoding

var uEncoding

var jEncoding

var rawEncoding

var pseudoOpEncoding

var badEncoding

var encodings

// encodingForAs returns the encoding for an obj.As.
func encodingForAs(as obj.As) (encoding, error) {}

type instruction

func (ins *instruction) String() string {}

func (ins *instruction) encode() (uint32, error) {}

func (ins *instruction) length() int {}

func (ins *instruction) validate(ctxt *obj.Link) {}

func (ins *instruction) usesRegTmp() bool {}

// instructionForProg returns the default *obj.Prog to instruction mapping.
func instructionForProg(p *obj.Prog) *instruction {}

// instructionsForOpImmediate returns the machine instructions for an immediate
// operand. The instruction is specified by as and the source register is
// specified by rs, instead of the obj.Prog.
func instructionsForOpImmediate(p *obj.Prog, as obj.As, rs int16) []*instruction {}

// instructionsForLoad returns the machine instructions for a load. The load
// instruction is specified by as and the base/source register is specified
// by rs, instead of the obj.Prog.
func instructionsForLoad(p *obj.Prog, as obj.As, rs int16) []*instruction {}

// instructionsForStore returns the machine instructions for a store. The store
// instruction is specified by as and the target/source register is specified
// by rd, instead of the obj.Prog.
func instructionsForStore(p *obj.Prog, as obj.As, rd int16) []*instruction {}

func instructionsForTLS(p *obj.Prog, ins *instruction) []*instruction {}

func instructionsForTLSLoad(p *obj.Prog) []*instruction {}

func instructionsForTLSStore(p *obj.Prog) []*instruction {}

// instructionsForMOV returns the machine instructions for an *obj.Prog that
// uses a MOV pseudo-instruction.
func instructionsForMOV(p *obj.Prog) []*instruction {}

// instructionsForRotate returns the machine instructions for a bitwise rotation.
func instructionsForRotate(p *obj.Prog, ins *instruction) []*instruction {}

// instructionsForProg returns the machine instructions for an *obj.Prog.
func instructionsForProg(p *obj.Prog) []*instruction {}

// assemble emits machine code.
// It is called at the very end of the assembly process.
func assemble(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {}

func isUnsafePoint(p *obj.Prog) bool {}

func ParseSuffix(prog *obj.Prog, cond string) (err error) {}

var LinkRISCV64