[all-commits] [llvm/llvm-project] 3d89fb: [RISCV] Support machine constraint "S"

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Jul 13 09:30:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d89fb4d13bc3af1c3643a310b90fce51a649119
      https://github.com/llvm/llvm-project/commit/3d89fb4d13bc3af1c3643a310b90fce51a649119
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-07-13 (Tue, 13 Jul 2021)

  Changed paths:
    M clang/lib/Basic/Targets/RISCV.cpp
    M clang/test/CodeGen/RISCV/riscv-inline-asm.c
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    A llvm/test/CodeGen/RISCV/inline-asm-S-constraint.ll

  Log Message:
  -----------
  [RISCV] Support machine constraint "S"

Similar to D46745, "S" represents an absolute symbolic operand, which
can be used to specify the access models, e.g.

  extern int var;
  void *addr_via_asm() {
    void *ret;
    asm("lui %0, %%hi(%1)\naddi %0,%0,%%lo(%1)" : "=r"(ret) : "S"(&var));
    return ret;
  }

'S' is documented in trunk GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101275

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D105254




More information about the All-commits mailing list