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

2024-03-14 Thread Nemanja Ivanovic via cfe-commits

nemanjai wrote:

Ah, I missed the fact that there is an option `-riscv-add-build-attributes` 
that the clang driver passes when invoking `cc1as`.  Perhaps that option should 
default to `true`? Thanks and sorry for the noise.

https://github.com/llvm/llvm-project/pull/85063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-03-14 Thread Nemanja Ivanovic via cfe-commits

https://github.com/nemanjai closed 
https://github.com/llvm/llvm-project/pull/85063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-03-13 Thread Jessica Clarke via cfe-commits

jrtc27 wrote:

Attributes are added automatically, unless you override it with your own 
.attribute arch.

https://github.com/llvm/llvm-project/pull/85063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-03-13 Thread Wang Pengcheng via cfe-commits

wangpc-pp wrote:

I think we will add attributes automatically?
```shell
~/workspace# cat a.S
.globl  foo 
.p2align1
.type   foo,@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: 
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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-03-13 Thread Nemanja Ivanovic via cfe-commits

nemanjai wrote:

This is a suggestion born out of a request from a user to have a way to emit 
the ISA attributes into objects produced from pre-processed asm files. Perhaps 
there is already a method to do this that I'm not aware of, but if not, I think 
this is a convenient and lightweight way to do so.

https://github.com/llvm/llvm-project/pull/85063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-03-13 Thread Nemanja Ivanovic via cfe-commits

https://github.com/nemanjai edited 
https://github.com/llvm/llvm-project/pull/85063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits