[Patch Doc] Update documentation for __fp16 type
[official-gcc.git] / libgo / runtime / go-type-identity.c
blob842fa249bd0c482b47949d31bc4d5045c2c11d26
1 /* go-type-identity.c -- hash and equality identity functions.
3 Copyright 2009 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. */
7 #include <stddef.h>
9 #include "runtime.h"
10 #include "go-type.h"
12 /* The hash functions for types that can compare as identity is
13 written in Go. */
15 extern uintptr runtime_memhash(void *, uintptr, uintptr)
16 __asm__ (GOSYM_PREFIX "runtime.memhash");
18 const FuncVal __go_type_hash_identity_descriptor =
19 { (void *) runtime_memhash };
21 /* An identity equality function for a type. This is used for types
22 where we can check for equality by checking that the values have
23 the same bits. */
25 _Bool
26 __go_type_equal_identity (const void *k1, const void *k2, uintptr_t key_size)
28 return __builtin_memcmp (k1, k2, key_size) == 0;
31 const FuncVal __go_type_equal_identity_descriptor =
32 { (void *) __go_type_equal_identity };