github.com/kidsbmilk/gofronted_all@v0.0.0-20220701224323-6479d5976c5d/go/runtime.def (about)

     1  // runtime.def -- runtime functions called by generated code.  -*- C++ -*-
     2  
     3  // Copyright 2011 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // Definitions for the Go runtime functions.
     8  
     9  // Parameter type helper macros.
    10  #define ABFT6(T1, T2, T3, T4, T5, T6) \
    11    { RFT_ ## T1, RFT_ ## T2, RFT_ ## T3, RFT_ ## T4, RFT_ ## T5, RFT_ ## T6 }
    12  #define P0()			ABFT6(VOID, VOID, VOID, VOID, VOID, VOID)
    13  #define P1(T)			ABFT6(T, VOID, VOID, VOID, VOID, VOID)
    14  #define P2(T1, T2)		ABFT6(T1, T2, VOID, VOID, VOID, VOID)
    15  #define P3(T1, T2, T3)		ABFT6(T1, T2, T3, VOID, VOID, VOID)
    16  #define P4(T1, T2, T3, T4)	ABFT6(T1, T2, T3, T4, VOID, VOID)
    17  #define P5(T1, T2, T3, T4, T5)	ABFT6(T1, T2, T3, T4, T5, VOID)
    18  #define P6(T1,T2,T3,T4,T5,T6)	ABFT6(T1, T2, T3, T4, T5, T6)
    19  
    20  // Result type helper macros.
    21  #define ABFT2(T1, T2) { RFT_ ## T1, RFT_ ## T2 }
    22  #define R0()			ABFT2(VOID, VOID)
    23  #define R1(T)			ABFT2(T, VOID)
    24  #define R2(T1, T2)		ABFT2(T1, T2)
    25  
    26  // Define all the Go runtime functions.  The first parameter is the
    27  // enum code used to refer to the function.  The second parameter is
    28  // the name.  The third is the parameter types and the fourth is the
    29  // result types.
    30  
    31  // The standard C memcmp function, used for struct comparisons.
    32  DEF_GO_RUNTIME(MEMCMP, "__builtin_memcmp", P3(POINTER, POINTER, UINTPTR), R1(INT32))
    33  
    34  // Decode a non-ASCII rune from a string.
    35  DEF_GO_RUNTIME(DECODERUNE, "runtime.decoderune", P2(STRING, INT),
    36  	       R2(RUNE, INT))
    37  
    38  // Concatenate strings.
    39  DEF_GO_RUNTIME(CONCATSTRINGS, "runtime.concatstrings",
    40                 P3(POINTER, POINTER, INT), R1(STRING))
    41  
    42  // Compare two strings.
    43  DEF_GO_RUNTIME(CMPSTRING, "runtime.cmpstring", P2(STRING, STRING), R1(INT))
    44  
    45  // Convert an integer to a string.
    46  DEF_GO_RUNTIME(INTSTRING, "runtime.intstring", P2(POINTER, INT64), R1(STRING))
    47  
    48  // Convert a []byte to a string.
    49  DEF_GO_RUNTIME(SLICEBYTETOSTRING, "runtime.slicebytetostring",
    50  	       P3(POINTER, POINTER, INT), R1(STRING))
    51  
    52  // Convert a []rune to a string.
    53  DEF_GO_RUNTIME(SLICERUNETOSTRING, "runtime.slicerunetostring",
    54  	       P2(POINTER, SLICE), R1(STRING))
    55  
    56  // Convert a string to a []byte.
    57  DEF_GO_RUNTIME(STRINGTOSLICEBYTE, "runtime.stringtoslicebyte",
    58  	       P2(POINTER, STRING), R1(SLICE))
    59  
    60  // Convert a string to a []rune.
    61  DEF_GO_RUNTIME(STRINGTOSLICERUNE, "runtime.stringtoslicerune",
    62  	       P2(POINTER, STRING), R1(SLICE))
    63  
    64  
    65  // Make a slice.
    66  DEF_GO_RUNTIME(MAKESLICE, "runtime.makeslice", P3(TYPE, INT, INT),
    67  	       R1(POINTER))
    68  
    69  DEF_GO_RUNTIME(MAKESLICE64, "runtime.makeslice64", P3(TYPE, INT64, INT64),
    70  	       R1(POINTER))
    71  
    72  
    73  // Make a map with a hint and an (optional, unused) map structure.
    74  DEF_GO_RUNTIME(MAKEMAP, "runtime.makemap", P3(TYPE, INT, POINTER),
    75  		R1(MAP))
    76  DEF_GO_RUNTIME(MAKEMAP64, "runtime.makemap64", P3(TYPE, INT64, POINTER),
    77  		R1(MAP))
    78  
    79  // Make a map with no hint, or a small constant hint.
    80  DEF_GO_RUNTIME(MAKEMAP_SMALL, "runtime.makemap__small", P0(), R1(MAP))
    81  
    82  // Build a map from a composite literal.
    83  DEF_GO_RUNTIME(CONSTRUCT_MAP, "__go_construct_map",
    84  	       P5(POINTER, UINTPTR, UINTPTR, UINTPTR, POINTER),
    85  	       R1(MAP))
    86  
    87  // Look up a key in a map.
    88  DEF_GO_RUNTIME(MAPACCESS1, "runtime.mapaccess1", P3(TYPE, MAP, POINTER),
    89  	       R1(POINTER))
    90  
    91  // Look up a uint32 key in a map.
    92  DEF_GO_RUNTIME(MAPACCESS1_FAST32, "runtime.mapaccess1__fast32",
    93                 P3(TYPE, MAP, UINT32), R1(POINTER))
    94  
    95  // Look up a uint64 key in a map.
    96  DEF_GO_RUNTIME(MAPACCESS1_FAST64, "runtime.mapaccess1__fast64",
    97                 P3(TYPE, MAP, UINT64), R1(POINTER))
    98  
    99  // Look up a string key in a map.
   100  DEF_GO_RUNTIME(MAPACCESS1_FASTSTR, "runtime.mapaccess1__faststr",
   101                 P3(TYPE, MAP, STRING), R1(POINTER))
   102  
   103  // Look up a key in a map when the value is large.
   104  DEF_GO_RUNTIME(MAPACCESS1_FAT, "runtime.mapaccess1__fat",
   105  	       P4(TYPE, MAP, POINTER, POINTER), R1(POINTER))
   106  
   107  // Look up a key in a map returning the value and whether it is
   108  // present.
   109  DEF_GO_RUNTIME(MAPACCESS2, "runtime.mapaccess2", P3(TYPE, MAP, POINTER),
   110  	       R2(POINTER, BOOL))
   111  
   112  // Look up a uint32 key in a map returning the value and whether
   113  // it is present.
   114  DEF_GO_RUNTIME(MAPACCESS2_FAST32, "runtime.mapaccess2__fast32",
   115                 P3(TYPE, MAP, UINT32), R2(POINTER, BOOL))
   116  
   117  // Look up a uint64 key in a map returning the value and whether
   118  // it is present.
   119  DEF_GO_RUNTIME(MAPACCESS2_FAST64, "runtime.mapaccess2__fast64",
   120                 P3(TYPE, MAP, UINT64), R2(POINTER, BOOL))
   121  
   122  // Look up a string key in a map returning the value and whether
   123  // it is present.
   124  DEF_GO_RUNTIME(MAPACCESS2_FASTSTR, "runtime.mapaccess2__faststr",
   125                 P3(TYPE, MAP, STRING), R2(POINTER, BOOL))
   126  
   127  // Look up a key in a map, returning the value and whether it is
   128  // present, when the value is large.
   129  DEF_GO_RUNTIME(MAPACCESS2_FAT, "runtime.mapaccess2__fat",
   130  	       P4(TYPE, MAP, POINTER, POINTER), R2(POINTER, BOOL))
   131  
   132  // Assignment to a key in a map.
   133  DEF_GO_RUNTIME(MAPASSIGN, "runtime.mapassign", P3(TYPE, MAP, POINTER),
   134  	       R1(POINTER))
   135  
   136  // Assignment to a uint32 key in a map.
   137  DEF_GO_RUNTIME(MAPASSIGN_FAST32, "runtime.mapassign__fast32",
   138                 P3(TYPE, MAP, UINT32), R1(POINTER))
   139  
   140  // Assignment to a uint64 key in a map.
   141  DEF_GO_RUNTIME(MAPASSIGN_FAST64, "runtime.mapassign__fast64",
   142                 P3(TYPE, MAP, UINT64), R1(POINTER))
   143  
   144  // Assignment to a 32-bit pointer key in a map.
   145  DEF_GO_RUNTIME(MAPASSIGN_FAST32PTR, "runtime.mapassign__fast32ptr",
   146                 P3(TYPE, MAP, POINTER), R1(POINTER))
   147  
   148  // Assignment to a 64-bit pointer key in a map.
   149  DEF_GO_RUNTIME(MAPASSIGN_FAST64PTR, "runtime.mapassign__fast64ptr",
   150                 P3(TYPE, MAP, POINTER), R1(POINTER))
   151  
   152  // Assignment to a string key in a map.
   153  DEF_GO_RUNTIME(MAPASSIGN_FASTSTR, "runtime.mapassign__faststr",
   154                 P3(TYPE, MAP, STRING), R1(POINTER))
   155  
   156  // Delete a key from a map.
   157  DEF_GO_RUNTIME(MAPDELETE, "runtime.mapdelete", P3(TYPE, MAP, POINTER), R0())
   158  
   159  // Delete a uint32 key from a map.
   160  DEF_GO_RUNTIME(MAPDELETE_FAST32, "runtime.mapdelete__fast32",
   161                 P3(TYPE, MAP, UINT32), R0())
   162  
   163  // Delete a uint64 key from a map.
   164  DEF_GO_RUNTIME(MAPDELETE_FAST64, "runtime.mapdelete__fast64",
   165                 P3(TYPE, MAP, UINT64), R0())
   166  
   167  // Delete a string key from a map.
   168  DEF_GO_RUNTIME(MAPDELETE_FASTSTR, "runtime.mapdelete__faststr",
   169                 P3(TYPE, MAP, STRING), R0())
   170  
   171  // Begin a range over a map.
   172  DEF_GO_RUNTIME(MAPITERINIT, "runtime.mapiterinit", P3(TYPE, MAP, POINTER),
   173  	       R0())
   174  
   175  // Range over a map, moving to the next map entry.
   176  DEF_GO_RUNTIME(MAPITERNEXT, "runtime.mapiternext", P1(POINTER), R0())
   177  
   178  // Clear a map.
   179  DEF_GO_RUNTIME(MAPCLEAR, "runtime.mapclear", P2(TYPE, MAP), R0())
   180  
   181  
   182  // Make a channel.
   183  DEF_GO_RUNTIME(MAKECHAN, "runtime.makechan", P2(TYPE, INT), R1(CHAN))
   184  DEF_GO_RUNTIME(MAKECHAN64, "runtime.makechan64", P2(TYPE, INT64), R1(CHAN))
   185  
   186  // Send a value on a channel.
   187  DEF_GO_RUNTIME(CHANSEND, "runtime.chansend1", P2(CHAN, POINTER), R0())
   188  
   189  // Receive a value from a channel.
   190  DEF_GO_RUNTIME(CHANRECV1, "runtime.chanrecv1", P2(CHAN, POINTER), R0())
   191  
   192  // Receive a value from a channel returning whether it is closed.
   193  DEF_GO_RUNTIME(CHANRECV2, "runtime.chanrecv2", P2(CHAN, POINTER), R1(BOOL))
   194  
   195  
   196  // Run a select, returning the index of the selected clause and
   197  // whether that channel received a value.
   198  DEF_GO_RUNTIME(SELECTGO, "runtime.selectgo",
   199  	       P5(POINTER, POINTER, INT, INT, BOOL), R2(INT, BOOL))
   200  
   201  // Non-blocking send a value on a channel, used for two-case select
   202  // statement with a default case.
   203  DEF_GO_RUNTIME(SELECTNBSEND, "runtime.selectnbsend", P2(CHAN, POINTER), R1(BOOL))
   204  
   205  // Non-blocking receive a value from a channel, used for two-case select
   206  // statement with a default case.
   207  DEF_GO_RUNTIME(SELECTNBRECV, "runtime.selectnbrecv", P2(POINTER, CHAN),
   208  	       R2(BOOL, BOOL))
   209  
   210  // Block execution.  Used for zero-case select.
   211  DEF_GO_RUNTIME(BLOCK, "runtime.block", P0(), R0())
   212  
   213  
   214  // Panic.
   215  DEF_GO_RUNTIME(GOPANIC, "runtime.gopanic", P1(EFACE), R0())
   216  
   217  // Recover.
   218  DEF_GO_RUNTIME(GORECOVER, "runtime.gorecover", P0(), R1(EFACE))
   219  
   220  // Recover when called directly from defer.
   221  DEF_GO_RUNTIME(DEFERREDRECOVER, "runtime.deferredrecover", P0(), R1(EFACE))
   222  
   223  // Decide whether this function can call recover.
   224  DEF_GO_RUNTIME(CANRECOVER, "runtime.canrecover", P1(UINTPTR), R1(BOOL))
   225  
   226  // Set the return address for defer in a defer thunk.
   227  DEF_GO_RUNTIME(SETDEFERRETADDR, "runtime.setdeferretaddr", P1(UINTPTR),
   228  	       R1(BOOL))
   229  
   230  // Check for a deferred function in an exception handler.
   231  DEF_GO_RUNTIME(CHECKDEFER, "runtime.checkdefer", P1(BOOLPTR), R0())
   232  
   233  // Run deferred functions.
   234  DEF_GO_RUNTIME(DEFERRETURN, "runtime.deferreturn", P1(BOOLPTR), R0())
   235  
   236  
   237  // Close.
   238  DEF_GO_RUNTIME(CLOSE, "runtime.closechan", P1(CHAN), R0())
   239  
   240  
   241  // Copy of value containing pointers.
   242  DEF_GO_RUNTIME(TYPEDSLICECOPY, "runtime.typedslicecopy",
   243  	       P5(TYPE, POINTER, INT, POINTER, INT), R1(INT))
   244  
   245  // Grow a slice for append.
   246  DEF_GO_RUNTIME(GROWSLICE, "runtime.growslice",
   247                 P5(TYPE, POINTER, INT, INT, INT), R1(SLICE))
   248  
   249  
   250  // Check the length and cap passed to make, without making a slice.
   251  // This is used for apend(s, make([]T, len)...).
   252  DEF_GO_RUNTIME(CHECK_MAKE_SLICE, "runtime.checkMakeSlice", P3(TYPE, INT, INT),
   253  	       R1(UINTPTR))
   254  
   255  // Register roots (global variables) for the garbage collector.
   256  DEF_GO_RUNTIME(REGISTER_GC_ROOTS, "runtime.registerGCRoots", P1(POINTER), R0())
   257  
   258  // Register type descriptors.
   259  DEF_GO_RUNTIME(REGISTER_TYPE_DESCRIPTORS, "runtime.registerTypeDescriptors",
   260                 P2(INT, POINTER), R0())
   261  
   262  
   263  // Allocate memory.
   264  DEF_GO_RUNTIME(NEW, "runtime.newobject", P1(TYPE), R1(POINTER))
   265  
   266  // Start a new goroutine.
   267  DEF_GO_RUNTIME(GO, "__go_go", P2(UINTPTR, POINTER), R1(POINTER))
   268  
   269  // Defer a function.
   270  DEF_GO_RUNTIME(DEFERPROC, "runtime.deferproc", P3(BOOLPTR, UINTPTR, POINTER),
   271  	       R0())
   272  
   273  // Defer a function, with stack-allocated defer structure.
   274  DEF_GO_RUNTIME(DEFERPROCSTACK, "runtime.deferprocStack",
   275                 P4(POINTER, BOOLPTR, UINTPTR, POINTER), R0())
   276  
   277  
   278  // Convert an empty interface to an empty interface, returning ok.
   279  DEF_GO_RUNTIME(IFACEE2E2, "runtime.ifaceE2E2", P1(EFACE), R2(EFACE, BOOL))
   280  
   281  // Convert a non-empty interface to an empty interface, returning ok.
   282  DEF_GO_RUNTIME(IFACEI2E2, "runtime.ifaceI2E2", P1(IFACE), R2(EFACE, BOOL))
   283  
   284  // Convert an empty interface to a non-empty interface, returning ok.
   285  DEF_GO_RUNTIME(IFACEE2I2, "runtime.ifaceE2I2", P2(TYPE, EFACE),
   286  	       R2(IFACE, BOOL))
   287  
   288  // Convert a non-empty interface to a non-empty interface, returning ok.
   289  DEF_GO_RUNTIME(IFACEI2I2, "runtime.ifaceI2I2", P2(TYPE, IFACE),
   290  	       R2(IFACE, BOOL))
   291  
   292  // Convert an empty interface to a pointer type, returning ok.
   293  DEF_GO_RUNTIME(IFACEE2T2P, "runtime.ifaceE2T2P", P2(TYPE, EFACE),
   294  	       R2(POINTER, BOOL))
   295  
   296  // Convert a non-empty interface to a pointer type, return ok.
   297  DEF_GO_RUNTIME(IFACEI2T2P, "runtime.ifaceI2T2P", P2(TYPE, IFACE),
   298  	       R2(POINTER, BOOL))
   299  
   300  // Convert an empty interface to a non-pointer type, returning ok.
   301  DEF_GO_RUNTIME(IFACEE2T2, "runtime.ifaceE2T2", P3(TYPE, EFACE, POINTER),
   302  	       R1(BOOL))
   303  
   304  // Convert a non-empty interface to a non-pointer type, returning ok.
   305  DEF_GO_RUNTIME(IFACEI2T2, "runtime.ifaceI2T2", P3(TYPE, IFACE, POINTER),
   306  	       R1(BOOL))
   307  
   308  // Return the interface method table for the second type converted to
   309  // the first type which is a (possibly empty) interface type.  Panics
   310  // if the second type is nil (indicating a nil interface value) or if
   311  // the conversion is not possible.  Used for type assertions.  This is
   312  // like REQUIREITAB, but for type assertions.
   313  DEF_GO_RUNTIME(ASSERTITAB, "runtime.assertitab", P2(TYPE, TYPE), R1(POINTER))
   314  
   315  // Return the interface method table for the second type converted to
   316  // the first type, which is a non-empty interface type.  Return nil if
   317  // the second type is nil, indicating a nil interface value.  Panics
   318  // if the conversion is not possible.  Used for assignments.  This is
   319  // like ASSERTITAB, but for assignments.
   320  DEF_GO_RUNTIME(REQUIREITAB, "runtime.requireitab", P2(TYPE, TYPE),
   321  	       R1(POINTER))
   322  
   323  // Panic when an interface type to non-interface type conversion fails.
   324  DEF_GO_RUNTIME(PANICDOTTYPE, "runtime.panicdottype", P3(TYPE, TYPE, TYPE),
   325                 R0())
   326  
   327  // Return whether we can convert a type to an interface type.
   328  DEF_GO_RUNTIME(IFACET2IP, "runtime.ifaceT2Ip", P2(TYPE, TYPE), R1(BOOL))
   329  
   330  // Compare two type descriptors for equality.
   331  DEF_GO_RUNTIME(EQTYPE, "runtime.eqtype", P2(TYPE, TYPE), R1(BOOL))
   332  
   333  // Compare two empty interface values.
   334  DEF_GO_RUNTIME(EFACEEQ, "runtime.efaceeq", P2(EFACE, EFACE), R1(BOOL))
   335  
   336  // Compare an empty interface value to a non-interface value.
   337  DEF_GO_RUNTIME(EFACEVALEQ, "runtime.efacevaleq", P3(EFACE, TYPE, POINTER),
   338  	       R1(BOOL))
   339  
   340  // Compare two non-empty interface values.
   341  DEF_GO_RUNTIME(IFACEEQ, "runtime.ifaceeq", P2(IFACE, IFACE), R1(BOOL))
   342  
   343  // Compare a non-empty interface value to a non-interface value.
   344  DEF_GO_RUNTIME(IFACEVALEQ, "runtime.ifacevaleq", P3(IFACE, TYPE, POINTER),
   345  	       R1(BOOL))
   346  
   347  // Compare a non-empty interface value to an interface value.
   348  DEF_GO_RUNTIME(IFACEEFACEEQ, "runtime.ifaceefaceeq", P2(IFACE, EFACE),
   349  	       R1(BOOL))
   350  
   351  
   352  // Set *dst = src where dst is a pointer to a pointer and src is a pointer.
   353  DEF_GO_RUNTIME(GCWRITEBARRIER, "runtime.gcWriteBarrier",
   354  	       P2(POINTER, UINTPTR), R0())
   355  
   356  // Set *dst = *src for an arbitrary type.
   357  DEF_GO_RUNTIME(TYPEDMEMMOVE, "runtime.typedmemmove",
   358  	       P3(TYPE, POINTER, POINTER), R0())
   359  
   360  // Clear memory that contains pointer.
   361  DEF_GO_RUNTIME(MEMCLRHASPTR, "runtime.memclrHasPointers",
   362                 P2(POINTER, UINTPTR), R0())
   363  
   364  
   365  // Lock the printer (for print/println).
   366  DEF_GO_RUNTIME(PRINTLOCK, "runtime.printlock", P0(), R0())
   367  
   368  // Unlock the printer (for print/println).
   369  DEF_GO_RUNTIME(PRINTUNLOCK, "runtime.printunlock", P0(), R0())
   370  
   371  // Print a string (for print/println).
   372  DEF_GO_RUNTIME(PRINTSTRING, "runtime.printstring", P1(STRING), R0())
   373  
   374  // Print a uint64 (for print/println).
   375  DEF_GO_RUNTIME(PRINTUINT, "runtime.printuint", P1(UINT64), R0())
   376  
   377  // Print a uint64 in hex (for print/println, used for runtime.hex type).
   378  DEF_GO_RUNTIME(PRINTHEX, "runtime.printhex", P1(UINT64), R0())
   379  
   380  // Print a int64 (for print/println).
   381  DEF_GO_RUNTIME(PRINTINT, "runtime.printint", P1(INT64), R0())
   382  
   383  // Print a float64 (for print/println).
   384  DEF_GO_RUNTIME(PRINTFLOAT, "runtime.printfloat", P1(FLOAT64), R0())
   385  
   386  // Print a complex128 (for print/println).
   387  DEF_GO_RUNTIME(PRINTCOMPLEX, "runtime.printcomplex", P1(COMPLEX128), R0())
   388  
   389  // Print a bool (for print/println).
   390  DEF_GO_RUNTIME(PRINTBOOL, "runtime.printbool", P1(BOOL), R0())
   391  
   392  // Print a pointer/map/channel/function (for print/println).
   393  DEF_GO_RUNTIME(PRINTPOINTER, "runtime.printpointer", P1(POINTER), R0())
   394  
   395  // Print an empty interface (for print/println).
   396  DEF_GO_RUNTIME(PRINTEFACE, "runtime.printeface", P1(EFACE), R0())
   397  
   398  // Print a non-empty interface (for print/println).
   399  DEF_GO_RUNTIME(PRINTIFACE, "runtime.printiface", P1(IFACE), R0())
   400  
   401  // Print a slice (for print/println).
   402  DEF_GO_RUNTIME(PRINTSLICE, "runtime.printslice", P1(SLICE), R0())
   403  
   404  // Print a space (for println).
   405  DEF_GO_RUNTIME(PRINTSP, "runtime.printsp", P0(), R0())
   406  
   407  // Print a newline (for println).
   408  DEF_GO_RUNTIME(PRINTNL, "runtime.printnl", P0(), R0())
   409  
   410  
   411  // Used for field tracking for data analysis.
   412  DEF_GO_RUNTIME(FIELDTRACK, "__go_fieldtrack", P1(POINTER), R0())
   413  
   414  
   415  // Unreachable code.
   416  DEF_GO_RUNTIME(UNREACHABLE, "__builtin_unreachable", P0(), R0())
   417  
   418  // Memmove.
   419  DEF_GO_RUNTIME(BUILTIN_MEMMOVE, "__builtin_memmove",
   420                 P3(POINTER, POINTER, UINTPTR), R0())
   421  
   422  // Memset, used for zeroing memory.
   423  DEF_GO_RUNTIME(BUILTIN_MEMSET, "__builtin_memset",
   424                 P3(POINTER, INT32, UINTPTR), R0())
   425  
   426  // Various intrinsics.
   427  
   428  // Get the caller's PC, used for runtime.getcallerpc.
   429  DEF_GO_RUNTIME(BUILTIN_RETURN_ADDRESS, "__builtin_return_address",
   430                 P1(UINT32), R1(POINTER))
   431  
   432  // Get the caller's SP, used for runtime.getcallersp.
   433  DEF_GO_RUNTIME(BUILTIN_DWARF_CFA, "__builtin_dwarf_cfa", P0(),
   434                 R1(POINTER))
   435  
   436  // Swap bytes.
   437  DEF_GO_RUNTIME(BUILTIN_BSWAP16, "__builtin_bswap16", P1(UINT16),
   438                 R1(UINT16))
   439  DEF_GO_RUNTIME(BUILTIN_BSWAP32, "__builtin_bswap32", P1(UINT32),
   440                 R1(UINT32))
   441  DEF_GO_RUNTIME(BUILTIN_BSWAP64, "__builtin_bswap64", P1(UINT64),
   442                 R1(UINT64))
   443  
   444  // Count trailing zeros.
   445  DEF_GO_RUNTIME(BUILTIN_CTZ, "__builtin_ctz", P1(UINT32), R1(INT32))
   446  DEF_GO_RUNTIME(BUILTIN_CTZLL, "__builtin_ctzll", P1(UINT64), R1(INT32))
   447  
   448  // Count leading zeros.
   449  DEF_GO_RUNTIME(BUILTIN_CLZ, "__builtin_clz", P1(UINT32), R1(INT32))
   450  DEF_GO_RUNTIME(BUILTIN_CLZLL, "__builtin_clzll", P1(UINT64), R1(INT32))
   451  
   452  // Count one bits.
   453  DEF_GO_RUNTIME(BUILTIN_POPCOUNT, "__builtin_popcount", P1(UINT32), R1(INT32))
   454  DEF_GO_RUNTIME(BUILTIN_POPCOUNTLL, "__builtin_popcountll", P1(UINT64), R1(INT32))
   455  
   456  // Atomics.
   457  DEF_GO_RUNTIME(ATOMIC_LOAD_4, "__atomic_load_4", P2(POINTER, INT32),
   458                 R1(UINT32))
   459  DEF_GO_RUNTIME(ATOMIC_LOAD_8, "__atomic_load_8", P2(POINTER, INT32),
   460                 R1(UINT64))
   461  DEF_GO_RUNTIME(ATOMIC_STORE_4, "__atomic_store_4", P3(POINTER, UINT32, INT32),
   462                 R0())
   463  DEF_GO_RUNTIME(ATOMIC_STORE_8, "__atomic_store_8", P3(POINTER, UINT64, INT32),
   464                 R0())
   465  DEF_GO_RUNTIME(ATOMIC_EXCHANGE_4, "__atomic_exchange_4", P3(POINTER, UINT32, INT32),
   466                 R1(UINT32))
   467  DEF_GO_RUNTIME(ATOMIC_EXCHANGE_8, "__atomic_exchange_8", P3(POINTER, UINT64, INT32),
   468                 R1(UINT64))
   469  DEF_GO_RUNTIME(ATOMIC_COMPARE_EXCHANGE_4, "__atomic_compare_exchange_4",
   470                 P6(POINTER, POINTER, UINT32, BOOL, INT32, INT32),
   471                 R1(BOOL))
   472  DEF_GO_RUNTIME(ATOMIC_COMPARE_EXCHANGE_8, "__atomic_compare_exchange_8",
   473                 P6(POINTER, POINTER, UINT64, BOOL, INT32, INT32),
   474                 R1(BOOL))
   475  DEF_GO_RUNTIME(ATOMIC_ADD_FETCH_4, "__atomic_add_fetch_4",
   476                 P3(POINTER, UINT32, INT32),
   477                 R1(UINT32))
   478  DEF_GO_RUNTIME(ATOMIC_ADD_FETCH_8, "__atomic_add_fetch_8",
   479                 P3(POINTER, UINT64, INT32),
   480                 R1(UINT64))
   481  DEF_GO_RUNTIME(ATOMIC_LOAD_1, "__atomic_load_1", P2(POINTER, INT32),
   482  	       R1(UINT8))
   483  DEF_GO_RUNTIME(ATOMIC_STORE_1, "__atomic_store_1", P3(POINTER, UINT8, INT32),
   484  	       R0())
   485  DEF_GO_RUNTIME(ATOMIC_AND_FETCH_1, "__atomic_and_fetch_1",
   486                 P3(POINTER, UINT8, INT32),
   487                 R1(UINT8))
   488  DEF_GO_RUNTIME(ATOMIC_OR_FETCH_1, "__atomic_or_fetch_1",
   489                 P3(POINTER, UINT8, INT32),
   490                 R1(UINT8))
   491  
   492  // Check the length of an unsafe slice.
   493  DEF_GO_RUNTIME(UNSAFESLICE, "runtime.unsafeslice",
   494  	       P3(TYPE, POINTER, INT), R0())
   495  DEF_GO_RUNTIME(UNSAFESLICE64, "runtime.unsafeslice64",
   496  	       P3(TYPE, POINTER, INT64), R0())
   497  
   498  // Panic reporting a division by zero.
   499  DEF_GO_RUNTIME(PANIC_DIVIDE, "runtime.panicdivide", P0(), R0())
   500  
   501  // Panic reporting a shift by negative count.
   502  DEF_GO_RUNTIME(PANIC_SHIFT, "runtime.panicshift", P0(), R0())
   503  
   504  // Panic reporting a nil dereference.
   505  DEF_GO_RUNTIME(PANIC_MEM, "runtime.panicmem", P0(), R0())
   506  
   507  // Panic reporting that make's slice len argument is out of range.
   508  DEF_GO_RUNTIME(PANIC_MAKE_SLICE_LEN, "runtime.panicmakeslicelen", P0(), R0())
   509  
   510  // Panic reporting that make's slice cap argument is out of range.
   511  DEF_GO_RUNTIME(PANIC_MAKE_SLICE_CAP, "runtime.panicmakeslicecap", P0(), R0())
   512  
   513  // Panic reporting using go with a nil function.
   514  DEF_GO_RUNTIME(PANIC_GO_NIL, "runtime.panicgonil", P0(), R0())
   515  
   516  // Panics reporting an index or slice out of bounds error.
   517  DEF_GO_RUNTIME(PANIC_INDEX, "runtime.goPanicIndex",
   518  	       P2(INT, INT), R0())
   519  DEF_GO_RUNTIME(PANIC_INDEX_U, "runtime.goPanicIndexU",
   520  	       P2(UINT, INT), R0())
   521  DEF_GO_RUNTIME(PANIC_SLICE_ALEN, "runtime.goPanicSliceAlen",
   522  	       P2(INT, INT), R0())
   523  DEF_GO_RUNTIME(PANIC_SLICE_ALEN_U, "runtime.goPanicSliceAlenU",
   524  	       P2(UINT, INT), R0())
   525  DEF_GO_RUNTIME(PANIC_SLICE_ACAP, "runtime.goPanicSliceAcap",
   526  	       P2(INT, INT), R0())
   527  DEF_GO_RUNTIME(PANIC_SLICE_ACAP_U, "runtime.goPanicSliceAcapU",
   528  	       P2(UINT, INT), R0())
   529  DEF_GO_RUNTIME(PANIC_SLICE_B, "runtime.goPanicSliceB",
   530  	       P2(INT, INT), R0())
   531  DEF_GO_RUNTIME(PANIC_SLICE_B_U, "runtime.goPanicSliceBU",
   532  	       P2(UINT, INT), R0())
   533  DEF_GO_RUNTIME(PANIC_SLICE3_ALEN, "runtime.goPanicSlice3Alen",
   534  	       P2(INT, INT), R0())
   535  DEF_GO_RUNTIME(PANIC_SLICE3_ALEN_U, "runtime.goPanicSlice3AlenU",
   536  	       P2(UINT, INT), R0())
   537  DEF_GO_RUNTIME(PANIC_SLICE3_ACAP, "runtime.goPanicSlice3Acap",
   538  	       P2(INT, INT), R0())
   539  DEF_GO_RUNTIME(PANIC_SLICE3_ACAP_U, "runtime.goPanicSlice3AcapU",
   540  	       P2(UINT, INT), R0())
   541  DEF_GO_RUNTIME(PANIC_SLICE3_B, "runtime.goPanicSlice3B",
   542  	       P2(INT, INT), R0())
   543  DEF_GO_RUNTIME(PANIC_SLICE3_B_U, "runtime.goPanicSlice3BU",
   544  	       P2(UINT, INT), R0())
   545  DEF_GO_RUNTIME(PANIC_SLICE3_C, "runtime.goPanicSlice3C",
   546  	       P2(INT, INT), R0())
   547  DEF_GO_RUNTIME(PANIC_SLICE3_C_U, "runtime.goPanicSlice3CU",
   548  	       P2(UINT, INT), R0())
   549  
   550  // Panics reporting an index or slice out of bounds error with a
   551  // 64-bit index type.  These are only used by 32-bit targets.
   552  DEF_GO_RUNTIME(PANIC_EXTEND_INDEX, "runtime.goPanicExtendIndex",
   553  	       P2(INT64, INT), R0())
   554  DEF_GO_RUNTIME(PANIC_EXTEND_INDEX_U, "runtime.goPanicExtendIndexU",
   555  	       P2(UINT64, INT), R0())
   556  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE_ALEN, "runtime.goPanicExtendSliceAlen",
   557  	       P2(INT64, INT), R0())
   558  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE_ALEN_U, "runtime.goPanicExtendSliceAlenU",
   559  	       P2(UINT64, INT), R0())
   560  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE_ACAP, "runtime.goPanicExtendSliceAcap",
   561  	       P2(INT64, INT), R0())
   562  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE_ACAP_U, "runtime.goPanicExtendSliceAcapU",
   563  	       P2(UINT64, INT), R0())
   564  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE_B, "runtime.goPanicExtendSliceB",
   565  	       P2(INT64, INT), R0())
   566  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE_B_U, "runtime.goPanicExtendSliceBU",
   567  	       P2(UINT64, INT), R0())
   568  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_ALEN, "runtime.goPanicExtendSlice3Alen",
   569  	       P2(INT64, INT), R0())
   570  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_ALEN_U, "runtime.goPanicExtendSlice3AlenU",
   571  	       P2(UINT64, INT), R0())
   572  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_ACAP, "runtime.goPanicExtendSlice3Acap",
   573  	       P2(INT64, INT), R0())
   574  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_ACAP_U, "runtime.goPanicExtendSlice3AcapU",
   575  	       P2(UINT64, INT), R0())
   576  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_B, "runtime.goPanicExtendSlice3B",
   577  	       P2(INT64, INT), R0())
   578  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_B_U, "runtime.goPanicExtendSlice3BU",
   579  	       P2(UINT64, INT), R0())
   580  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_C, "runtime.goPanicExtendSlice3C",
   581  	       P2(INT64, INT), R0())
   582  DEF_GO_RUNTIME(PANIC_EXTEND_SLICE3_C_U, "runtime.goPanicExtendSlice3CU",
   583  	       P2(UINT64, INT), R0())
   584  
   585  // Panic for conversion of slice to pointer-to-array if the slice is
   586  // too short.
   587  DEF_GO_RUNTIME(PANIC_SLICE_CONVERT, "runtime.goPanicSliceConvert",
   588  	       P2(INT, INT), R0())
   589  
   590  // Remove helper macros.
   591  #undef ABFT6
   592  #undef ABFT2
   593  #undef P0
   594  #undef P1
   595  #undef P2
   596  #undef P3
   597  #undef P4
   598  #undef P5
   599  #undef P6
   600  #undef R0
   601  #undef R1
   602  #undef R2