// result types.
// The standard C memcmp function, used for struct comparisons.
-DEF_GO_RUNTIME(MEMCMP, "__go_memcmp", P3(POINTER, POINTER, UINTPTR), R1(INT))
+DEF_GO_RUNTIME(MEMCMP, "__builtin_memcmp", P3(POINTER, POINTER, UINTPTR), R1(INT32))
// Decode a non-ASCII rune from a string.
DEF_GO_RUNTIME(DECODERUNE, "runtime.decoderune", P2(STRING, INT),
DEF_GO_RUNTIME(CONCATSTRINGS, "runtime.concatstrings",
P3(POINTER, POINTER, INT), R1(STRING))
-// Compare two strings for equality.
-DEF_GO_RUNTIME(EQSTRING, "runtime.eqstring", P2(STRING, STRING), R1(BOOL))
-
// Compare two strings.
DEF_GO_RUNTIME(CMPSTRING, "runtime.cmpstring", P2(STRING, STRING), R1(INT))
DEF_GO_RUNTIME(SELECTGO, "runtime.selectgo", P3(POINTER, POINTER, INT),
R2(INT, BOOL))
+// Non-blocking send a value on a channel, used for two-case select
+// statement with a default case.
+DEF_GO_RUNTIME(SELECTNBSEND, "runtime.selectnbsend", P2(CHAN, POINTER), R1(BOOL))
+
+// Non-blocking receive a value from a channel, used for two-case select
+// statement with a default case.
+DEF_GO_RUNTIME(SELECTNBRECV, "runtime.selectnbrecv", P2(POINTER, CHAN), R1(BOOL))
+
+// Non-blocking tuple receive from a channel, used for two-case select
+// statement with a default case.
+DEF_GO_RUNTIME(SELECTNBRECV2, "runtime.selectnbrecv2", P3(POINTER, POINTER, CHAN),
+ R1(BOOL))
+
+// Block execution. Used for zero-case select.
+DEF_GO_RUNTIME(BLOCK, "runtime.block", P0(), R0())
+
// Panic.
DEF_GO_RUNTIME(GOPANIC, "runtime.gopanic", P1(EFACE), R0())
DEF_GO_RUNTIME(DEFERPROC, "runtime.deferproc", P3(BOOLPTR, UINTPTR, POINTER),
R0())
+// Defer a function, with stack-allocated defer structure.
+DEF_GO_RUNTIME(DEFERPROCSTACK, "runtime.deferprocStack",
+ P4(POINTER, BOOLPTR, UINTPTR, POINTER), R0())
+
// Convert an empty interface to an empty interface, returning ok.
DEF_GO_RUNTIME(IFACEE2E2, "runtime.ifaceE2E2", P1(EFACE), R2(EFACE, BOOL))
DEF_GO_RUNTIME(TYPEDMEMMOVE, "runtime.typedmemmove",
P3(TYPE, POINTER, POINTER), R0())
-// Clear memory that contains no pointer.
-DEF_GO_RUNTIME(MEMCLRNOPTR, "runtime.memclrNoHeapPointers",
- P2(POINTER, UINTPTR), R0())
-
// Clear memory that contains pointer.
DEF_GO_RUNTIME(MEMCLRHASPTR, "runtime.memclrHasPointers",
P2(POINTER, UINTPTR), R0())
// Print a uint64 (for print/println).
DEF_GO_RUNTIME(PRINTUINT, "runtime.printuint", P1(UINT64), R0())
+// Print a uint64 in hex (for print/println, used for runtime.hex type).
+DEF_GO_RUNTIME(PRINTHEX, "runtime.printhex", P1(UINT64), R0())
+
// Print a int64 (for print/println).
DEF_GO_RUNTIME(PRINTINT, "runtime.printint", P1(INT64), R0())
DEF_GO_RUNTIME(BUILTIN_MEMMOVE, "__builtin_memmove",
P3(POINTER, POINTER, UINTPTR), R0())
+// Memset, used for zeroing memory.
+DEF_GO_RUNTIME(BUILTIN_MEMSET, "__builtin_memset",
+ P3(POINTER, INT32, UINTPTR), R0())
+
// Various intrinsics.
// Get the caller's PC, used for runtime.getcallerpc.
R1(POINTER))
// Swap bytes.
+DEF_GO_RUNTIME(BUILTIN_BSWAP16, "__builtin_bswap16", P1(UINT16),
+ R1(UINT16))
DEF_GO_RUNTIME(BUILTIN_BSWAP32, "__builtin_bswap32", P1(UINT32),
R1(UINT32))
DEF_GO_RUNTIME(BUILTIN_BSWAP64, "__builtin_bswap64", P1(UINT64),
DEF_GO_RUNTIME(BUILTIN_CTZ, "__builtin_ctz", P1(UINT32), R1(INT32))
DEF_GO_RUNTIME(BUILTIN_CTZLL, "__builtin_ctzll", P1(UINT64), R1(INT32))
+// Count leading zeros.
+DEF_GO_RUNTIME(BUILTIN_CLZ, "__builtin_clz", P1(UINT32), R1(INT32))
+DEF_GO_RUNTIME(BUILTIN_CLZLL, "__builtin_clzll", P1(UINT64), R1(INT32))
+
+// Count one bits.
+DEF_GO_RUNTIME(BUILTIN_POPCOUNT, "__builtin_popcount", P1(UINT32), R1(INT32))
+DEF_GO_RUNTIME(BUILTIN_POPCOUNTLL, "__builtin_popcountll", P1(UINT64), R1(INT32))
+
// Atomics.
DEF_GO_RUNTIME(ATOMIC_LOAD_4, "__atomic_load_4", P2(POINTER, INT32),
R1(UINT32))