aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorPetar Jovanovic <petar.jovanovic@rt-rk.com>2013-10-05 20:21:54 +0200
committerPetar Jovanovic <petar.jovanovic@rt-rk.com>2013-10-05 20:21:54 +0200
commit0588a8b5d075090adb3bd16fafd16a43d6125784 (patch)
tree15248e9a409224a0165726f8c1e8a4eac24f015e /lib/Transforms
parented6b15283ff5f9d13cb48f88ba6e189be11291e8 (diff)
[MIPS] Define PnaclTargetArchitectureMips_32
LowerNaClTargetArch has to return const PnaclTargetArchitectureMips_32 for MIPS. The constant is later used in ResolvePNaClIntrinsics pass. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3602 R=jfb@chromium.org Review URL: https://codereview.chromium.org/25887007
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp b/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
index 3550cd9aca..428caef2b5 100644
--- a/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
+++ b/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
@@ -160,13 +160,14 @@ private:
/// Resolve __nacl_atomic_is_lock_free to true/false at translation
/// time. PNaCl's currently supported platforms all support lock-free
-/// atomics at byte sizes {1,2,4,8}, and the alignment of the pointer is
-/// always expected to be natural (as guaranteed by C11 and
+/// atomics at byte sizes {1,2,4,8} except for MIPS arch that supports
+/// lock-free atomics at byte sizes {1,2,4}, and the alignment of the
+/// pointer is always expected to be natural (as guaranteed by C11 and
/// C++11). PNaCl's Module-level ABI verification checks that the byte
/// size is constant and in {1,2,4,8}.
struct IsLockFreeToConstant {
Constant *operator()(CallInst *Call) {
- const uint64_t MaxLockFreeByteSize = 8;
+ uint64_t MaxLockFreeByteSize = 8;
const APInt &ByteSize =
cast<Constant>(Call->getOperand(0))->getUniqueInteger();
@@ -176,11 +177,16 @@ struct IsLockFreeToConstant {
case PnaclTargetArchitectureX86_64:
case PnaclTargetArchitectureARM_32:
break;
+ case PnaclTargetArchitectureMips_32:
+ MaxLockFreeByteSize = 4;
+ break;
default:
return false;
}
# elif defined(__i386__) || defined(__x86_64__) || defined(__arm__)
// Continue.
+# elif defined(__mips__)
+ MaxLockFreeByteSize = 4;
# else
# error "Unknown architecture"
# endif