aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/runtime.cc
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-05-17 00:21:22 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-17 00:21:22 +0000
commit395389bf9492a69db79747943d32abd0b7ac36c3 (patch)
treec47f111e7291a1fc34360a96cd67dbdfe84dc56a /gcc/go/gofrontend/runtime.cc
parent6a362e1237fa3d7f2330181566eff02d83794475 (diff)
downloadgcc-395389bf9492a69db79747943d32abd0b7ac36c3.zip
gcc-395389bf9492a69db79747943d32abd0b7ac36c3.tar.gz
gcc-395389bf9492a69db79747943d32abd0b7ac36c3.tar.bz2
compiler: intrinsify runtime/internal/atomic functions
Currently runtime/internal/atomic functions are implemented in C using C compiler intrinsics. This CL lets the Go frontend recognize these functions and turn them into intrinsics directly. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176918 * go-gcc.cc (Gcc_backend::Gcc_backend): Define atomic builtins. From-SVN: r271308
Diffstat (limited to 'gcc/go/gofrontend/runtime.cc')
-rw-r--r--gcc/go/gofrontend/runtime.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/runtime.cc b/gcc/go/gofrontend/runtime.cc
index 289d6bf..28aca44 100644
--- a/gcc/go/gofrontend/runtime.cc
+++ b/gcc/go/gofrontend/runtime.cc
@@ -30,6 +30,8 @@ enum Runtime_function_type
RFT_BOOLPTR,
// Go type int, C type intgo.
RFT_INT,
+ // Go type uint8, C type uint8_t.
+ RFT_UINT8,
// Go type int32, C type int32_t.
RFT_INT32,
// Go type uint32, C type uint32_t.
@@ -109,6 +111,10 @@ runtime_function_type(Runtime_function_type bft)
t = Type::lookup_integer_type("int");
break;
+ case RFT_UINT8:
+ t = Type::lookup_integer_type("uint8");
+ break;
+
case RFT_INT32:
t = Type::lookup_integer_type("int32");
break;
@@ -250,6 +256,7 @@ convert_to_runtime_function_type(Runtime_function_type bft, Expression* e,
case RFT_BOOL:
case RFT_BOOLPTR:
case RFT_INT:
+ case RFT_UINT8:
case RFT_INT32:
case RFT_UINT32:
case RFT_INT64: