[PATCH] D134365: [LoongArch] Add support for llvm.trap and llvm.debugtrap

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 02:24:47 PDT 2022


SixWeining added a comment.

In D134365#3806160 <https://reviews.llvm.org/D134365#3806160>, @xry111 wrote:

> In D134365#3806143 <https://reviews.llvm.org/D134365#3806143>, @xry111 wrote:
>
>> I have some doubt here: on x86_64 a `trap` leads to SIGILL, but a `debugtrap` leads to SIGTRAP.  Not sure if they have a good reason or this is just for satisfying some "habit" of x86 programmers.
>>
>> If we want a SIGILL we can `amswap.w $r0, $r0, $r0`.
>
> I used `amswap.w $r0, $r0, $r1` in my early work <https://github.com/xry111/llvm-project/blob/1f1a3723c2614033e97e28ccee8438f1421bb4da/llvm/lib/Target/LoongArch/LoongArchInstrInfo.td#L1358>.  But again I'm not sure if we want a SIGTRAP of SIGILL (or something else) here.

Do you mean when `rd == rj` (but not `rd == rk`)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134365/new/

https://reviews.llvm.org/D134365



More information about the llvm-commits mailing list