Skip to content

Commit 96d8f14

Browse files
raw string literals
1 parent 7738433 commit 96d8f14

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

libc/src/setjmp/arm/longjmp.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ namespace LIBC_NAMESPACE {
1414

1515
[[gnu::naked]]
1616
LLVM_LIBC_FUNCTION(void, longjmp, (__jmp_buf * buf, int val)) {
17-
asm("ldm.w r0!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}\n\t"
18-
"mov sp, r12\n\t"
19-
"movs r0, r1\n\t"
20-
"it eq\n\t"
21-
"moveq r0, 1\n\t"
22-
"bx lr");
17+
asm(R"(
18+
ldm r0, {r4-r12, lr}
19+
mov sp, r12
20+
movs r0, r1
21+
it eq
22+
moveq r0, #1
23+
bx lr)");
2324
}
2425

2526
} // namespace LIBC_NAMESPACE

libc/src/setjmp/arm/setjmp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ namespace LIBC_NAMESPACE {
1313

1414
[[gnu::naked]]
1515
LLVM_LIBC_FUNCTION(int, setjmp, (__jmp_buf * buf)) {
16-
asm("mov r12, sp\n\t"
17-
"stm.w r0!, {r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}\n\t"
18-
"mov.w r0, 0\n\t"
19-
"bx lr");
16+
asm(R"(
17+
mov r12, sp
18+
stm r0, {r4-r12, lr}
19+
mov r0, #0
20+
bx lr)");
2021
}
2122

2223
} // namespace LIBC_NAMESPACE

0 commit comments

Comments
 (0)