[llvm] [clang] [RISCV] Support constraint "s" (PR #80201)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 14:11:29 PST 2024


MaskRay wrote:

The discussion with GCC seems to suggest we should encourage "s" for metadata section usage.

I have some notes about these constraints https://maskray.me/blog/2024-01-30-raw-symbol-names-in-inline-assembly 

> While the default implementation (gcc/defaults.h) is permissive (used by MIPS, PowerPC, and RISC-V), many ports impose stricter restrictions, often disallowing preemptible symbols under PIC.
> ...
> Nevertheless, I think this symbol preemptibility limitation for "s" is unfortunate. Ideally, we could retain the current "i" for immediate integer operand (after linking), and design "s" for a raw symbol name with a constant offset, ignoring symbol preemptibility. This architecture-agnostic "s" would simplify metadata section utilization and boost code portability.

https://github.com/llvm/llvm-project/pull/80201


More information about the cfe-commits mailing list