[llvm] [AMDGPU][RFC] Combine asm and disasm tests. (PR #90214)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 10:36:08 PDT 2024


MaskRay wrote:

> > Can you give an example that llvm-objdump is insufficient for your case?
> 
> Using `llvm-objdump` would require having two separate check lines for every instruction, avoiding which is the point of the patch.
> 
> ```
> v_bfrev_b32_e32 v5, v1
> // GFX12-ASM: v_bfrev_b32_e32 v5, v1                  ; encoding: [0x01,0x71,0x0a,0x7e]
> // GFX12-DIS: v_bfrev_b32_e32 v5, v1                                     // 000000000000: 7E0A7101
> ```

Utilize `-SAME:` directives?
```
# RUN: llvm-mc ... %s | FileCheck
# RUN: llvm-mc -filetype=obj ... %s | llvm-objdump -d - | FileCheck --check-prefixes=CHECK,ENCODING

# CHECK: nop
# ENCODING-SAME: [0,0,0,0]
nop
```

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


More information about the llvm-commits mailing list