-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2021 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// Define features that are guaranteed to be supported by setting the AMD64 variable. | ||
// If a feature is supported, there's no need to check it at runtime every time. | ||
|
||
#ifdef GOAMD64_v2 | ||
#define hasPOPCNT | ||
#define hasSSE42 | ||
#endif | ||
|
||
#ifdef GOAMD64_v3 | ||
#define hasAVX | ||
#define hasAVX2 | ||
#define hasPOPCNT | ||
#define hasSSE42 | ||
#endif | ||
|
||
#ifdef GOAMD64_v4 | ||
#define hasAVX | ||
#define hasAVX2 | ||
#define hasPOPCNT | ||
#define hasSSE42 | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2015 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// FIXED_FRAME defines the size of the fixed part of a stack frame. A stack | ||
// frame looks like this: | ||
// | ||
// +---------------------+ | ||
// | local variable area | | ||
// +---------------------+ | ||
// | argument area | | ||
// +---------------------+ <- R1+FIXED_FRAME | ||
// | fixed area | | ||
// +---------------------+ <- R1 | ||
// | ||
// So a function that sets up a stack frame at all uses as least FIXED_FRAME | ||
// bytes of stack. This mostly affects assembly that calls other functions | ||
// with arguments (the arguments should be stored at FIXED_FRAME+0(R1), | ||
// FIXED_FRAME+8(R1) etc) and some other low-level places. | ||
// | ||
// The reason for using a constant is to make supporting PIC easier (although | ||
// we only support PIC on ppc64le which has a minimum 32 bytes of stack frame, | ||
// and currently always use that much, PIC on ppc64 would need to use 48). | ||
|
||
#define FIXED_FRAME 32 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2013 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// This file defines the IDs for PCDATA and FUNCDATA instructions | ||
// in Go binaries. It is included by assembly sources, so it must | ||
// be written using #defines. | ||
// | ||
// These must agree with symtab.go and ../cmd/internal/objabi/funcdata.go. | ||
|
||
#define PCDATA_UnsafePoint 0 | ||
#define PCDATA_StackMapIndex 1 | ||
#define PCDATA_InlTreeIndex 2 | ||
#define PCDATA_ArgLiveIndex 3 | ||
|
||
#define FUNCDATA_ArgsPointerMaps 0 /* garbage collector blocks */ | ||
#define FUNCDATA_LocalsPointerMaps 1 | ||
#define FUNCDATA_StackObjects 2 | ||
#define FUNCDATA_InlTree 3 | ||
#define FUNCDATA_OpenCodedDeferInfo 4 /* info for func with open-coded defers */ | ||
#define FUNCDATA_ArgInfo 5 | ||
#define FUNCDATA_ArgLiveInfo 6 | ||
#define FUNCDATA_WrapInfo 7 | ||
|
||
// Pseudo-assembly statements. | ||
|
||
// GO_ARGS, GO_RESULTS_INITIALIZED, and NO_LOCAL_POINTERS are macros | ||
// that communicate to the runtime information about the location and liveness | ||
// of pointers in an assembly function's arguments, results, and stack frame. | ||
// This communication is only required in assembly functions that make calls | ||
// to other functions that might be preempted or grow the stack. | ||
// NOSPLIT functions that make no calls do not need to use these macros. | ||
|
||
// GO_ARGS indicates that the Go prototype for this assembly function | ||
// defines the pointer map for the function's arguments. | ||
// GO_ARGS should be the first instruction in a function that uses it. | ||
// It can be omitted if there are no arguments at all. | ||
// GO_ARGS is inserted implicitly by the linker for any function whose | ||
// name starts with a middle-dot and that also has a Go prototype; it | ||
// is therefore usually not necessary to write explicitly. | ||
#define GO_ARGS FUNCDATA $FUNCDATA_ArgsPointerMaps, go_args_stackmap(SB) | ||
|
||
// GO_RESULTS_INITIALIZED indicates that the assembly function | ||
// has initialized the stack space for its results and that those results | ||
// should be considered live for the remainder of the function. | ||
#define GO_RESULTS_INITIALIZED PCDATA $PCDATA_StackMapIndex, $1 | ||
|
||
// NO_LOCAL_POINTERS indicates that the assembly function stores | ||
// no pointers to heap objects in its local stack variables. | ||
#define NO_LOCAL_POINTERS FUNCDATA $FUNCDATA_LocalsPointerMaps, no_pointers_stackmap(SB) | ||
|
||
// ArgsSizeUnknown is set in Func.argsize to mark all functions | ||
// whose argument size is unknown (C vararg functions, and | ||
// assembly code without an explicit specification). | ||
// This value is generated by the compiler, assembler, or linker. | ||
#define ArgsSizeUnknown 0x80000000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2013 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// This file defines flags attached to various functions | ||
// and data objects. The compilers, assemblers, and linker must | ||
// all agree on these values. | ||
// | ||
// Keep in sync with src/cmd/internal/obj/textflag.go. | ||
|
||
// Don't profile the marked routine. This flag is deprecated. | ||
#define NOPROF 1 | ||
// It is ok for the linker to get multiple of these symbols. It will | ||
// pick one of the duplicates to use. | ||
#define DUPOK 2 | ||
// Don't insert stack check preamble. | ||
#define NOSPLIT 4 | ||
// Put this data in a read-only section. | ||
#define RODATA 8 | ||
// This data contains no pointers. | ||
#define NOPTR 16 | ||
// This is a wrapper function and should not count as disabling 'recover'. | ||
#define WRAPPER 32 | ||
// This function uses its incoming context register. | ||
#define NEEDCTXT 64 | ||
// Allocate a word of thread local storage and store the offset from the | ||
// thread local base to the thread local storage in this variable. | ||
#define TLSBSS 256 | ||
// Do not insert instructions to allocate a stack frame for this function. | ||
// Only valid on functions that declare a frame size of 0. | ||
// TODO(mwhudson): only implemented for ppc64x at present. | ||
#define NOFRAME 512 | ||
// Function can call reflect.Type.Method or reflect.Type.MethodByName. | ||
#define REFLECTMETHOD 1024 | ||
// Function is the outermost frame of the call stack. Call stack unwinders | ||
// should stop at this function. | ||
#define TOPFRAME 2048 | ||
// Function is an ABI wrapper. | ||
#define ABIWRAPPER 4096 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.