github.com/zxy12/go_duplicate_1_12@v0.0.0-20200217043740-b1636fc0368b/src/cmd/internal/obj/wasm/a.out.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package wasm
     6  
     7  import "cmd/internal/obj"
     8  
     9  //go:generate go run ../stringer.go -i $GOFILE -o anames.go -p wasm
    10  
    11  const (
    12  	/* mark flags */
    13  	DONE          = 1 << iota
    14  	PRESERVEFLAGS // not allowed to clobber flags
    15  )
    16  
    17  /*
    18   *	wasm
    19   */
    20  const (
    21  	ACallImport = obj.ABaseWasm + obj.A_ARCHSPECIFIC + iota
    22  	AGet
    23  	ASet
    24  	ATee
    25  	ANot // alias for I32Eqz
    26  
    27  	// The following are low-level WebAssembly instructions.
    28  	// Their order matters, since it matches the opcode encoding.
    29  	// Gaps in the encoding are indicated by comments.
    30  
    31  	AUnreachable // opcode 0x00
    32  	ANop
    33  	ABlock
    34  	ALoop
    35  	AIf
    36  	AElse
    37  
    38  	AEnd // opcode 0x0B
    39  	ABr
    40  	ABrIf
    41  	ABrTable
    42  	// ACall and AReturn are WebAssembly instructions. obj.ACALL and obj.ARET are higher level instructions
    43  	// with Go semantics, e.g. they manipulate the Go stack on the linear memory.
    44  	AReturn
    45  	ACall
    46  	ACallIndirect
    47  
    48  	ADrop // opcode 0x1A
    49  	ASelect
    50  
    51  	AI32Load // opcode 0x28
    52  	AI64Load
    53  	AF32Load
    54  	AF64Load
    55  	AI32Load8S
    56  	AI32Load8U
    57  	AI32Load16S
    58  	AI32Load16U
    59  	AI64Load8S
    60  	AI64Load8U
    61  	AI64Load16S
    62  	AI64Load16U
    63  	AI64Load32S
    64  	AI64Load32U
    65  	AI32Store
    66  	AI64Store
    67  	AF32Store
    68  	AF64Store
    69  	AI32Store8
    70  	AI32Store16
    71  	AI64Store8
    72  	AI64Store16
    73  	AI64Store32
    74  	ACurrentMemory
    75  	AGrowMemory
    76  
    77  	AI32Const
    78  	AI64Const
    79  	AF32Const
    80  	AF64Const
    81  
    82  	AI32Eqz
    83  	AI32Eq
    84  	AI32Ne
    85  	AI32LtS
    86  	AI32LtU
    87  	AI32GtS
    88  	AI32GtU
    89  	AI32LeS
    90  	AI32LeU
    91  	AI32GeS
    92  	AI32GeU
    93  
    94  	AI64Eqz
    95  	AI64Eq
    96  	AI64Ne
    97  	AI64LtS
    98  	AI64LtU
    99  	AI64GtS
   100  	AI64GtU
   101  	AI64LeS
   102  	AI64LeU
   103  	AI64GeS
   104  	AI64GeU
   105  
   106  	AF32Eq
   107  	AF32Ne
   108  	AF32Lt
   109  	AF32Gt
   110  	AF32Le
   111  	AF32Ge
   112  
   113  	AF64Eq
   114  	AF64Ne
   115  	AF64Lt
   116  	AF64Gt
   117  	AF64Le
   118  	AF64Ge
   119  
   120  	AI32Clz
   121  	AI32Ctz
   122  	AI32Popcnt
   123  	AI32Add
   124  	AI32Sub
   125  	AI32Mul
   126  	AI32DivS
   127  	AI32DivU
   128  	AI32RemS
   129  	AI32RemU
   130  	AI32And
   131  	AI32Or
   132  	AI32Xor
   133  	AI32Shl
   134  	AI32ShrS
   135  	AI32ShrU
   136  	AI32Rotl
   137  	AI32Rotr
   138  
   139  	AI64Clz
   140  	AI64Ctz
   141  	AI64Popcnt
   142  	AI64Add
   143  	AI64Sub
   144  	AI64Mul
   145  	AI64DivS
   146  	AI64DivU
   147  	AI64RemS
   148  	AI64RemU
   149  	AI64And
   150  	AI64Or
   151  	AI64Xor
   152  	AI64Shl
   153  	AI64ShrS
   154  	AI64ShrU
   155  	AI64Rotl
   156  	AI64Rotr
   157  
   158  	AF32Abs
   159  	AF32Neg
   160  	AF32Ceil
   161  	AF32Floor
   162  	AF32Trunc
   163  	AF32Nearest
   164  	AF32Sqrt
   165  	AF32Add
   166  	AF32Sub
   167  	AF32Mul
   168  	AF32Div
   169  	AF32Min
   170  	AF32Max
   171  	AF32Copysign
   172  
   173  	AF64Abs
   174  	AF64Neg
   175  	AF64Ceil
   176  	AF64Floor
   177  	AF64Trunc
   178  	AF64Nearest
   179  	AF64Sqrt
   180  	AF64Add
   181  	AF64Sub
   182  	AF64Mul
   183  	AF64Div
   184  	AF64Min
   185  	AF64Max
   186  	AF64Copysign
   187  
   188  	AI32WrapI64
   189  	AI32TruncSF32
   190  	AI32TruncUF32
   191  	AI32TruncSF64
   192  	AI32TruncUF64
   193  	AI64ExtendSI32
   194  	AI64ExtendUI32
   195  	AI64TruncSF32
   196  	AI64TruncUF32
   197  	AI64TruncSF64
   198  	AI64TruncUF64
   199  	AF32ConvertSI32
   200  	AF32ConvertUI32
   201  	AF32ConvertSI64
   202  	AF32ConvertUI64
   203  	AF32DemoteF64
   204  	AF64ConvertSI32
   205  	AF64ConvertUI32
   206  	AF64ConvertSI64
   207  	AF64ConvertUI64
   208  	AF64PromoteF32
   209  	AI32ReinterpretF32
   210  	AI64ReinterpretF64
   211  	AF32ReinterpretI32
   212  	AF64ReinterpretI64
   213  
   214  	// End of low-level WebAssembly instructions.
   215  
   216  	ARESUMEPOINT
   217  	// ACALLNORESUME is a call which is not followed by a resume point.
   218  	// It is allowed inside of WebAssembly blocks, whereas obj.ACALL is not.
   219  	// However, it is not allowed to switch goroutines while inside of an ACALLNORESUME call.
   220  	ACALLNORESUME
   221  
   222  	ARETUNWIND
   223  
   224  	AMOVB
   225  	AMOVH
   226  	AMOVW
   227  	AMOVD
   228  
   229  	AWORD
   230  	ALAST
   231  )
   232  
   233  const (
   234  	REG_NONE = 0
   235  )
   236  
   237  const (
   238  	// globals
   239  	REG_PC_F = obj.RBaseWasm + iota
   240  	REG_PC_B
   241  	REG_SP // SP is currently 32-bit, until 64-bit memory operations are available
   242  	REG_CTXT
   243  	REG_g
   244  	// RET* are used by runtime.return0 and runtime.reflectcall. These functions pass return values in registers.
   245  	REG_RET0
   246  	REG_RET1
   247  	REG_RET2
   248  	REG_RET3
   249  	REG_PAUSE
   250  
   251  	// locals
   252  	REG_R0
   253  	REG_R1
   254  	REG_R2
   255  	REG_R3
   256  	REG_R4
   257  	REG_R5
   258  	REG_R6
   259  	REG_R7
   260  	REG_R8
   261  	REG_R9
   262  	REG_R10
   263  	REG_R11
   264  	REG_R12
   265  	REG_R13
   266  	REG_R14
   267  	REG_R15
   268  	REG_F0
   269  	REG_F1
   270  	REG_F2
   271  	REG_F3
   272  	REG_F4
   273  	REG_F5
   274  	REG_F6
   275  	REG_F7
   276  	REG_F8
   277  	REG_F9
   278  	REG_F10
   279  	REG_F11
   280  	REG_F12
   281  	REG_F13
   282  	REG_F14
   283  	REG_F15
   284  
   285  	MAXREG
   286  
   287  	MINREG  = REG_PC_F
   288  	REGSP   = REG_SP
   289  	REGCTXT = REG_CTXT
   290  	REGG    = REG_g
   291  )