[clang] [DRAFT][RISCV] Emit arch string macro to facilitate ASM programming (PR #85063)

Wang Pengcheng via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 13 20:43:19 PDT 2024


wangpc-pp wrote:

I think we will add attributes automatically?
```shell
~/workspace# cat a.S
        .globl  foo 
        .p2align        1
        .type   foo, at function
foo:
   ret
~/workspace# clang -march=rv64gcv -c a.S
~/workspace# llvm-readobj -A a.o
File: a.o
Format: elf64-littleriscv
Arch: riscv64
AddressSize: 64bit
LoadName: <Not found>
BuildAttributes {
  FormatVersion: 0x41
  Section 1 {
    SectionLength: 157
    Vendor: riscv
    Tag: Tag_File (0x1)
    Size: 147
    FileAttributes {
      Attribute {
        Tag: 5
        TagName: arch
        Value: rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v1p0_zicsr2p0_zifencei2p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0                                                                            
      }
    }
  }
}
```

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


More information about the cfe-commits mailing list