Commit 3dbc7586 authored by Ilija.Pavlovic's avatar Ilija.Pavlovic Committed by Commit bot

MIPS64: Fix compilation issues on MIPS64R6 with Clang.

This patch enables V8 build with Clang without errors for MIPS64
release R6.

TEST=
BUG=

Review-Url: https://codereview.chromium.org/2062713002
Cr-Commit-Position: refs/heads/master@{#36948}
parent 85e5567d
...@@ -91,18 +91,19 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, ...@@ -91,18 +91,19 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) { Atomic32 increment) {
Atomic32 temp, temp2; Atomic32 temp, temp2;
__asm__ __volatile__(".set push\n" __asm__ __volatile__(
".set noreorder\n" ".set push\n"
"1:\n" ".set noreorder\n"
"ll %0, %2\n" // temp = *ptr "1:\n"
"addu %1, %0, %3\n" // temp2 = temp + increment "ll %0, %2\n" // temp = *ptr
"sc %1, %2\n" // *ptr = temp2 (with atomic check) "addu %1, %0, %3\n" // temp2 = temp + increment
"beqz %1, 1b\n" // start again on atomic error "sc %1, %2\n" // *ptr = temp2 (with atomic check)
"addu %1, %0, %3\n" // temp2 = temp + increment "beqz %1, 1b\n" // start again on atomic error
".set pop\n" "addu %1, %0, %3\n" // temp2 = temp + increment
: "=&r" (temp), "=&r" (temp2), "=m" (*ptr) ".set pop\n"
: "Ir" (increment), "m" (*ptr) : "=&r"(temp), "=&r"(temp2), "=ZC"(*ptr)
: "memory"); : "Ir"(increment), "m"(*ptr)
: "memory");
// temp2 now holds the final value. // temp2 now holds the final value.
return temp2; return temp2;
} }
...@@ -228,18 +229,19 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, ...@@ -228,18 +229,19 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) { Atomic64 increment) {
Atomic64 temp, temp2; Atomic64 temp, temp2;
__asm__ __volatile__(".set push\n" __asm__ __volatile__(
".set noreorder\n" ".set push\n"
"1:\n" ".set noreorder\n"
"lld %0, %2\n" // temp = *ptr "1:\n"
"daddu %1, %0, %3\n" // temp2 = temp + increment "lld %0, %2\n" // temp = *ptr
"scd %1, %2\n" // *ptr = temp2 (with atomic check) "daddu %1, %0, %3\n" // temp2 = temp + increment
"beqz %1, 1b\n" // start again on atomic error "scd %1, %2\n" // *ptr = temp2 (with atomic check)
"daddu %1, %0, %3\n" // temp2 = temp + increment "beqz %1, 1b\n" // start again on atomic error
".set pop\n" "daddu %1, %0, %3\n" // temp2 = temp + increment
: "=&r" (temp), "=&r" (temp2), "=m" (*ptr) ".set pop\n"
: "Ir" (increment), "m" (*ptr) : "=&r"(temp), "=&r"(temp2), "=ZC"(*ptr)
: "memory"); : "Ir"(increment), "m"(*ptr)
: "memory");
// temp2 now holds the final value. // temp2 now holds the final value.
return temp2; return temp2;
} }
......
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