Commit 758796a4 by Nicolas Capens Committed by Nicolas Capens

Add GN build file for LLVM 7.0

This enables supporting ARM64 for Chromium. Bug b/115344057 Bug chromium:881334 Change-Id: I45020e826684c6fa6e663a90b75703193ad670c3 Reviewed-on: https://swiftshader-review.googlesource.com/c/21451Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent a2d15d1a
......@@ -15,7 +15,7 @@
#define MAJOR_VERSION 4
#define MINOR_VERSION 1
#define BUILD_VERSION 0
#define BUILD_REVISION 3
#define BUILD_REVISION 4
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -15,7 +15,8 @@
import("../swiftshader.gni")
declare_args() {
use_swiftshader_with_subzero = true
# Subzero produces smaller binaries, but doesn't support ARM64.
use_swiftshader_with_subzero = (target_cpu != "arm64")
}
# Need a separate config to ensure the warnings are added to the end.
......@@ -287,7 +288,11 @@ swiftshader_source_set("swiftshader_reactor") {
include_dirs = [
]
} else {
deps += [ "../../third_party/LLVM:swiftshader_llvm" ]
llvm7_dir = "../../third_party/llvm-7.0"
deps += [ "$llvm7_dir:swiftshader_llvm" ]
defines = [ "REACTOR_LLVM_VERSION=7" ]
sources += [
"LLVMReactor.cpp",
......@@ -299,7 +304,18 @@ swiftshader_source_set("swiftshader_reactor") {
configs = [ ":swiftshader_reactor_private_config" ]
include_dirs = [
"../../third_party/LLVM/include/",
"$llvm7_dir/llvm/include/",
"$llvm7_dir/configs/common/include/",
]
if (is_linux) {
include_dirs += [ "$llvm7_dir/configs/linux/include/" ]
} else if (is_windows) {
include_dirs += [ "$llvm7_dir/configs/windows/include/" ]
} else if (is_android) {
include_dirs += [ "$llvm7_dir/configs/android/include/" ]
} else {
assert(false, "llvm-7.0 not configured for target platform")
}
}
}
......@@ -114,9 +114,9 @@ namespace rr
#if PERF_PROFILE
int64_t atomicExchange(int64_t volatile *target, int64_t value);
int atomicExchange(int volatile *target, int value);
#endif
int atomicExchange(int volatile *target, int value);
int atomicIncrement(int volatile *value);
int atomicDecrement(int volatile *value);
int atomicAdd(int volatile *target, int value);
......@@ -241,11 +241,10 @@ namespace rr
return InterlockedExchange64(target, value);
#else
int ret;
__asm__ __volatile__("lock; xchg8 %0,(%1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
__asm__ __volatile__("lock; xchg8 %x0,(%x1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
return ret;
#endif
}
#endif
inline int atomicExchange(volatile int *target, int value)
{
......@@ -253,10 +252,11 @@ namespace rr
return InterlockedExchange((volatile long*)target, (long)value);
#else
int ret;
__asm__ __volatile__("lock; xchgl %0,(%1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
__asm__ __volatile__("lock; xchgl %x0,(%x1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
return ret;
#endif
}
#endif
inline int atomicIncrement(volatile int *value)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment