[llvm] [llvm][mc][riscv] MC support of T-Head vector extension (xtheadvector) (PR #84447)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 19:38:03 PDT 2024


kata-ark wrote:

> Hi @kata-ark, welcome to the LLVM project and thank you for posting your first PR.
> 
> I'm afraid I have to raise a pretty important issue here - you note that you've directly ported a gas test case as part of your work. Due to [LLVM's copyright and license policy](https://llvm.org/docs/DeveloperPolicy.html#copyright-license-patents) this isn't something that can be accepted due to GNU as source code and tests being under a different license. Please create original MC layer tests that are not adapted/copied from GNU.

Thanks for your reply. I will delete that test. 

But I have to clarify that, by "ported" I mean:
- I first converted [the GNU AS test source](https://github.com/riscvarchive/riscv-binutils-gdb/blob/rvv-0.7.1/gas/testsuite/gas/riscv/vector-insns.d) to a normal assembly source file (using some shell commands)
- and then compiled the GNU AS test source using LLVM assembler (to test this MC layer), 
- then decompiled it to assembly source code (to test the disassembler and pretty-printer), 
- then, I wrote a script to compare the decompiled source with the GNU AS test source to see if there's a mismatch,
- finally, pretty-print the decompiled source to LLVM test format, which is available [here](https://github.com/llvm/llvm-project/blob/2e05b9b7c5146dbe3cf84129fd0ffba6e0e29a4c/llvm/test/MC/RISCV/xtheadvector/vector-insns.s).

I am not sure if decompiling a program that is compiled from a source file licensed under the GPL violates [LLVM's copyright and license policy](https://llvm.org/docs/DeveloperPolicy.html#copyright-license-patents) or general GPL rules. But to avoid misunderstanding, I will still delete this test. As the remaining tests can already cover the new assembly instructions very well. The test from GNU AS is added just to ensure the consistency of behavior between LLVM and GCC.


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


More information about the llvm-commits mailing list