[PATCH] D140883: [AMDGPU] Simplify getNumFlatOffsetBits. NFC.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 03:47:56 PST 2023
foad added a comment.
> So on generating the error particularly the new code translates the signed non-negatives back to the precision-and-signedness representation.
I only did that to make the patch NFC //including the text of error messages//. Really I'd prefer to reword the error message too, to something like "expected an N-bit signed offset" or "expected a non-negative N-bit signed offset".
================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4122
// For FLAT segment the offset must be positive;
// MSB is ignored and forced to zero.
+ unsigned OffsetSize = AMDGPU::getNumFlatOffsetBits(getSTI());
----------------
scott.linder wrote:
> If the MSB is not always ignored, this comment should be updated/deleted
In the absence of hardware bugs this //might// be true; I really don't know. I will see if I can find some good documentation.
OTOH it is not a very useful comment for us, since the compiler never needs to rely on the bit being "ignored and forced to zero".
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140883/new/
https://reviews.llvm.org/D140883
More information about the llvm-commits
mailing list