archconst

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	/*
		X86 (i386)
	*/
	ARCH_X86 = "x86"

	ARCH_X86_SF = "x86sf"

	/*
		AMD64 (x86_64)
	*/
	ARCH_AMD64 = "amd64"

	ARCH_AMD64_V1 = "amd64v1"
	ARCH_AMD64_V2 = "amd64v2"
	ARCH_AMD64_V3 = "amd64v3"
	ARCH_AMD64_V4 = "amd64v4"

	ARCH_ARM = "arm" // alias of armv7

	ARCH_ARM_V5 = "armv5"
	ARCH_ARM_V6 = "armv6"
	ARCH_ARM_V7 = "armv7"

	/*
		ARM64 (aarch64)
	*/
	ARCH_ARM64 = "arm64"

	ARCH_ARM64_V8 = "arm64v8"
	ARCH_ARM64_V9 = "arm64v9"

	ARCH_MIPS    = "mips"
	ARCH_MIPS_SF = "mipssf"

	ARCH_MIPS_LE    = "mipsle"
	ARCH_MIPS_LE_SF = "mipslesf"

	ARCH_MIPS64    = "mips64"
	ARCH_MIPS64_SF = "mips64sf"

	ARCH_MIPS64_LE    = "mips64le"
	ARCH_MIPS64_LE_SF = "mips64lesf"

	ARCH_PPC    = "ppc"
	ARCH_PPC_SF = "ppcsf"

	ARCH_PPC_LE    = "ppcle"
	ARCH_PPC_LE_SF = "ppclesf"

	ARCH_PPC64    = "ppc64"
	ARCH_PPC64_V8 = "ppc64v8"
	ARCH_PPC64_V9 = "ppc64v9"

	ARCH_PPC64_LE    = "ppc64le"
	ARCH_PPC64_LE_V8 = "ppc64lev8"
	ARCH_PPC64_LE_V9 = "ppc64lev9"

	ARCH_RISCV64 = "riscv64"

	ARCH_S390X = "s390x"

	ARCH_IA64 = "ia64"
)

Arch values format: [arch name]{endian variant}{`sf` (soft float mark)}{micro arch}

arch name is required, usually a valid GOARCH value (exceptions: `x86`) when {endian variant} not set, default endian is assumed when `sf` absent, hard float support is assumed (unless micro arch indicates soft float) if there is no micro arch specified, the lowest micro arch is assumed (exception: `arm` is `armv7`)

example `mips`: - `mipsle` -> [arch name] = mips, {endian variant} = little-endian (le) as original mips uses big-endian - `mipslesf` -> soft float version of `mipsle`

example `amd64` - `amd64v3` -> [arch name] = amd64, {micro arch} = v3

example `ppc64`: `ppc64` - `ppc64le` -> little-endian version of ppc64 - `ppc64lev9` -> `ppc64le` with `v9` micro arch

Variables

This section is empty.

Functions

func Format added in v0.10.0

func Format[R ~string, B ~byte, T stringhelper.String[B]](
	name T,
	littleEndian, softfloat bool,
	microArch string,
) (_ R, ok bool)

Format arch value with name and variant info

Types

type ArchValue added in v0.10.0

type ArchValue string

ArchValue is a typed string for cpu arch values

type Spec added in v0.10.0

type Spec struct {
	Name         ArchValue
	MicroArch    string
	LittleEndian bool
	SoftFloat    bool
}

Spec of a cpu arch

func Parse added in v0.10.0

func Parse[B ~byte, T stringhelper.String[B]](arch T) (s Spec, ok bool)

Parse arch value into arch Spec

if the provided arch value is unknown to this package, it returns the arch value as name, along with littleEndian = false, softfloat = false, microArch = ""

func (Spec) String added in v0.10.0

func (s Spec) String() (ret string)

String is a wrapper of Format for Spec s

Jump to

Keyboard shortcuts

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