[PATCH] D83760: [AMDGPU][MC] Corrected MTBUF parsing and decoding

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 22:56:23 PDT 2020


uabelho added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4929
+
+  Dfmt = (Dfmt == DFMT_UNDEF)? DFMT_DEFAULT : Dfmt;
+  Nfmt = (Nfmt == NFMT_UNDEF)? NFMT_DEFAULT : Nfmt;
----------------
gcc (7.4.0) warns here about

```
../lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4929:30: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
   Dfmt = (Dfmt == DFMT_UNDEF)? DFMT_DEFAULT : Dfmt;
          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
```
It can be silenced with e.g.

```
  Dfmt = (Dfmt == DFMT_UNDEF)? (int64_t)DFMT_DEFAULT : Dfmt;
```


================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4930
+  Dfmt = (Dfmt == DFMT_UNDEF)? DFMT_DEFAULT : Dfmt;
+  Nfmt = (Nfmt == NFMT_UNDEF)? NFMT_DEFAULT : Nfmt;
+
----------------
Same kind of warning here as above.


================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4956
+
+  int64_t Format = isGFX10() ? UFMT_DEFAULT : DFMT_NFMT_DEFAULT;
+  OperandMatchResultTy Res;
----------------
gcc (7.4.0) warns here about

```
../lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4956:30: warning: enumeral mismatch in conditional expression: 'llvm::AMDGPU::MTBUFFormat::UnifiedFormat' vs 'llvm::AMDGPU::MTBUFFormat::MergedFormat' [-Wenum-compare]
   int64_t Format = isGFX10() ? UFMT_DEFAULT : DFMT_NFMT_DEFAULT;
                    ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Can be silenced with e.g.

```
  int64_t Format = isGFX10() ? (int64_t)UFMT_DEFAULT : (int64_t)DFMT_NFMT_DEFAULT;
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83760/new/

https://reviews.llvm.org/D83760





More information about the llvm-commits mailing list