<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/setjmp, branch users/nico/python-1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] implement sigsetjmp for thumb/thumb2/armv7-a (#138147)</title>
<updated>2025-06-30T16:32:14+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-06-30T16:32:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a8f460d1dcc246319870c7bf4ab86c19e779578c'/>
<id>a8f460d1dcc246319870c7bf4ab86c19e779578c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix setjmp build order. (#144917)</title>
<updated>2025-06-19T16:05:58+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-19T16:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1ac87b327861a7387c1ab9e1ffb1c002acbcd6a'/>
<id>c1ac87b327861a7387c1ab9e1ffb1c002acbcd6a</id>
<content type='text'>
Fix build order issue from
https://github.com/llvm/llvm-project/pull/139555.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix build order issue from
https://github.com/llvm/llvm-project/pull/139555.</pre>
</div>
</content>
</entry>
<entry>
<title>Implement `sigsetjmp` and `siglongjmp` for darwin/aarch64 (#139555)</title>
<updated>2025-06-19T13:15:59+00:00</updated>
<author>
<name>Aly ElAshram</name>
<email>71949028+AlyElashram@users.noreply.github.com</email>
</author>
<published>2025-06-19T13:15:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5645d6710904107d66a45f1c3ee0ee25924ff08a'/>
<id>5645d6710904107d66a45f1c3ee0ee25924ff08a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] implement sigsetjmp/siglongjmp for riscv (#137992)</title>
<updated>2025-05-04T20:21:48+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-05-04T20:21:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a1803ea063c06c005ba50053f0e2cdb8f852871f'/>
<id>a1803ea063c06c005ba50053f0e2cdb8f852871f</id>
<content type='text'>
See https://godbolt.org/z/jo7s6j7sq for compiled code.

```c++
#if __riscv_xlen == 64
#define STORE(A, B, C) "sd " #A ", %c[" #B "](" #C ")\n\t"
#define LOAD(A, B, C) "ld " #A ", %c[" #B "](" #C ")\n\t"
#elif __riscv_xlen == 32
#define STORE(A, B, C) "sw " #A ", %c[" #B "](" #C ")\n\t"
#define LOAD(A, B, C) "lw " #A ", %c[" #B "](" #C ")\n\t"
#else
#error "Unsupported RISC-V architecture"
#endif

namespace LIBC_NAMESPACE_DECL {
[[gnu::naked]]
LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
  // clang-format off
  asm("beqz a1, .Lnosave\n\t"
      STORE(ra, retaddr, a0)
      STORE(s0, extra, a0)
      "mv s0, a0\n\t"
      "call %c[setjmp]\n\t"
      "mv a1, a0\n\t"
      "mv a0, s0\n\t"
      LOAD(s0, extra, a0)
      LOAD(ra, retaddr, a0)
      "tail %c[epilogue]\n"
".Lnosave:\n\t"
      "tail %c[setjmp]"
      // clang-format on
      ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
      [extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "i"(setjmp),
      [epilogue] "i"(sigsetjmp_epilogue)
      : "a0", "a1", "s0");
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://godbolt.org/z/jo7s6j7sq for compiled code.

```c++
#if __riscv_xlen == 64
#define STORE(A, B, C) "sd " #A ", %c[" #B "](" #C ")\n\t"
#define LOAD(A, B, C) "ld " #A ", %c[" #B "](" #C ")\n\t"
#elif __riscv_xlen == 32
#define STORE(A, B, C) "sw " #A ", %c[" #B "](" #C ")\n\t"
#define LOAD(A, B, C) "lw " #A ", %c[" #B "](" #C ")\n\t"
#else
#error "Unsupported RISC-V architecture"
#endif

namespace LIBC_NAMESPACE_DECL {
[[gnu::naked]]
LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
  // clang-format off
  asm("beqz a1, .Lnosave\n\t"
      STORE(ra, retaddr, a0)
      STORE(s0, extra, a0)
      "mv s0, a0\n\t"
      "call %c[setjmp]\n\t"
      "mv a1, a0\n\t"
      "mv a0, s0\n\t"
      LOAD(s0, extra, a0)
      LOAD(ra, retaddr, a0)
      "tail %c[epilogue]\n"
".Lnosave:\n\t"
      "tail %c[setjmp]"
      // clang-format on
      ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
      [extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "i"(setjmp),
      [epilogue] "i"(sigsetjmp_epilogue)
      : "a0", "a1", "s0");
}
```</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] add remarks to the setjmp implementation (#137066)</title>
<updated>2025-05-01T14:41:33+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-05-01T14:41:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=80233751f9f3c9c8c5b1d66cd93399615f4d3ba2'/>
<id>80233751f9f3c9c8c5b1d66cd93399615f4d3ba2</id>
<content type='text'>
We use naked functions to avoid compiler-generated prologue and
epilogue.

Despite GCC documentation listing this as an unsupported case for
extended asm, the generated code is not wrong as we only pass in
constant operands to extended asm.

See https://github.com/llvm/llvm-project/issues/137055 for related
remarks.

---------

Co-authored-by: Copilot &lt;175728472+Copilot@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We use naked functions to avoid compiler-generated prologue and
epilogue.

Despite GCC documentation listing this as an unsupported case for
extended asm, the generated code is not wrong as we only pass in
constant operands to extended asm.

See https://github.com/llvm/llvm-project/issues/137055 for related
remarks.

---------

Co-authored-by: Copilot &lt;175728472+Copilot@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] implement aarch64 sigsetjmp (#136706)</title>
<updated>2025-04-29T20:37:25+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-04-29T20:37:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ebaa9d483740b1e9a796e9e3b40a2ab70a4efb5'/>
<id>9ebaa9d483740b1e9a796e9e3b40a2ab70a4efb5</id>
<content type='text'>
- **[libc][aarch64] implement sigsetjmp**

On top of https://github.com/llvm/llvm-project/pull/136072
See also https://github.com/llvm/llvm-project/issues/137055 for remarks
on naked attributes.

```c++
//===-- Implementation of setjmp ------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "src/setjmp/sigsetjmp.h"
#include "hdr/offsetof_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/setjmp/setjmp_impl.h"
#include "src/setjmp/sigsetjmp_epilogue.h"

namespace LIBC_NAMESPACE_DECL {
[[gnu::naked]]
LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
  asm(R"(
      cbz w1, %c[setjmp]
      str x30, [x0, %c[retaddr]]
      str x19, [x0, %c[extra]]
      mov x19, x0
      bl %c[setjmp]
      mov w1, w0
      mov x0, x19
      ldr x30, [x0, %c[retaddr]]
      ldr x19, [x0, %c[extra]]
      b %c[epilogue])" ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
      [extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "i"(setjmp),
      [epilogue] "i"(sigsetjmp_epilogue)
      : "x0", "x1", "x19", "x30");
}
} // namespace LIBC_NAMESPACE_DECL
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- **[libc][aarch64] implement sigsetjmp**

On top of https://github.com/llvm/llvm-project/pull/136072
See also https://github.com/llvm/llvm-project/issues/137055 for remarks
on naked attributes.

```c++
//===-- Implementation of setjmp ------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "src/setjmp/sigsetjmp.h"
#include "hdr/offsetof_macros.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/setjmp/setjmp_impl.h"
#include "src/setjmp/sigsetjmp_epilogue.h"

namespace LIBC_NAMESPACE_DECL {
[[gnu::naked]]
LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
  asm(R"(
      cbz w1, %c[setjmp]
      str x30, [x0, %c[retaddr]]
      str x19, [x0, %c[extra]]
      mov x19, x0
      bl %c[setjmp]
      mov w1, w0
      mov x0, x19
      ldr x30, [x0, %c[retaddr]]
      ldr x19, [x0, %c[extra]]
      b %c[epilogue])" ::[retaddr] "i"(offsetof(__jmp_buf, sig_retaddr)),
      [extra] "i"(offsetof(__jmp_buf, sig_extra)), [setjmp] "i"(setjmp),
      [epilogue] "i"(sigsetjmp_epilogue)
      : "x0", "x1", "x19", "x30");
}
} // namespace LIBC_NAMESPACE_DECL
```</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[libc] build fix for sigsetjmp (#137047)" (#137214)</title>
<updated>2025-04-29T13:28:42+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-04-29T13:28:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6695976d16d02d72afc249bb5b46d267c1eee458'/>
<id>6695976d16d02d72afc249bb5b46d267c1eee458</id>
<content type='text'>
Reland `sigsetjmp` patches with build fixes.

We wrap every target replying on the epilogue library into conditional
checks.

---------

Co-authored-by: Petr Hosek &lt;phosek@google.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reland `sigsetjmp` patches with build fixes.

We wrap every target replying on the epilogue library into conditional
checks.

---------

Co-authored-by: Petr Hosek &lt;phosek@google.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] build fix for sigsetjmp (#137047)" (#137077)</title>
<updated>2025-04-23T22:49:55+00:00</updated>
<author>
<name>gulfemsavrun</name>
<email>gulfem@google.com</email>
</author>
<published>2025-04-23T22:49:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0d00b6bc3b459122de47d16c5153887063f4ea4b'/>
<id>0d00b6bc3b459122de47d16c5153887063f4ea4b</id>
<content type='text'>
This reverts commit f07511a0e0d2ac9bee9ae12a9ad68e279e352634.

This reverts commit 5bb4cf9d9189c41de50adffd960eb2188140eb9c.

It caused a CMake configuration issue.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit f07511a0e0d2ac9bee9ae12a9ad68e279e352634.

This reverts commit 5bb4cf9d9189c41de50adffd960eb2188140eb9c.

It caused a CMake configuration issue.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] build fix for sigsetjmp (#137047)</title>
<updated>2025-04-23T19:50:55+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-04-23T19:50:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f07511a0e0d2ac9bee9ae12a9ad68e279e352634'/>
<id>f07511a0e0d2ac9bee9ae12a9ad68e279e352634</id>
<content type='text'>
This PR fixes the build failure due to the `sigsetjmp` implementation.

1. Use a most relaxed input constraint to fix `clang` build.
2. Avoid create alias target if os directory for `sigsetjmp_epilogue`
does not exist.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR fixes the build failure due to the `sigsetjmp` implementation.

1. Use a most relaxed input constraint to fix `clang` build.
2. Avoid create alias target if os directory for `sigsetjmp_epilogue`
does not exist.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] implement sigsetjmp/siglongjmp for x86-64 (#136072)</title>
<updated>2025-04-23T18:19:47+00:00</updated>
<author>
<name>Schrodinger ZHU Yifan</name>
<email>yifanzhu@rochester.edu</email>
</author>
<published>2025-04-23T18:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5bb4cf9d9189c41de50adffd960eb2188140eb9c'/>
<id>5bb4cf9d9189c41de50adffd960eb2188140eb9c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
