From ab80f55fb9bc042c115479c3b5debd86d3b72a6f Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Thu, 8 Nov 2012 07:18:03 -0800 Subject: Add @nacl.read.tp() intrinsic, a fast version of NaCl's tls_get() IRT interface This is in preparation for adding an LLVM pass that will expand out TLS (thread_local) variable accesses into calls to nacl.read.tp. On ARM, there is already an arm.thread.pointer intrinsic. We reuse the code for that. On x86, we have to add an implementation. The added code is based on x86's LowerToTLSExecModel() for the %gs:0 case, and on NaCl-MIPS' LowerGlobalTLSAddress() for the __nacl_read_tp() case. (In contrast, X86NaClRewritePass.cpp inserts a __nacl_read_tp() call at the lower MI level; we don't use that approach here.) We convert LowerINTRINSIC_WO_CHAIN() into a method in order to access the Subtarget member. This is consistent with other x86 Lower methods and with the ARM version. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2837 TEST="llvm-lit test/NaCl" Review URL: https://codereview.chromium.org/11383002 --- include/llvm/CodeGen/ISDOpcodes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/llvm/CodeGen/ISDOpcodes.h') diff --git a/include/llvm/CodeGen/ISDOpcodes.h b/include/llvm/CodeGen/ISDOpcodes.h index 95aafb324d..47170e4e58 100644 --- a/include/llvm/CodeGen/ISDOpcodes.h +++ b/include/llvm/CodeGen/ISDOpcodes.h @@ -643,6 +643,9 @@ namespace ISD { // @LOCALMOD-BEGIN // NACL_* - Native Client instrinsics. + // NACL_READ_TP is a fast built-in version of NaCl's tls_get() IRT + // interface. + NACL_READ_TP, // These correspond to functions in: // native_client/src/untrusted/nacl/tls_params.h NACL_TP_TLS_OFFSET, -- cgit v1.2.3-18-g5258