Note: Support for 64-bit inline literals TBD
Added: Support of abs/neg modifiers for literals (incomplete; parsing TBD).
Added: Some TODO comments.
Reworked/clarity: rename isInlineImm() to isInlinableImm()
Reworked/robustness: disallow BitsToFloat() with undefined value in isInlinableImm()
Reworked/reuse: isSSrc32/64(), isVSrc32/64()
Tests added.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Are source modifiers really allowed with immediates? The only case I can think of where that might be useful is for -0. There are a few assertions lying around that assume there are no modifiers for any immediate.
Does this happen to fix this bug? : http://lists.llvm.org/pipermail/llvm-dev/2015-October/091715.html
If so there should be some tests for it.
lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | ||
---|---|---|
153–158 | Why the name change? | |
154 | Comments should be capitalized. Also this looks like it goes over the 80 character line limit | |
156 | We should avoid using host float here. It would be better to check the float bit values which is what a few other places do. We've had bot failures before due to weird NaN support on mips hosts. | |
209 | Indentation looks off |
lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | ||
---|---|---|
153–158 | If immediate is inline or not depends on how the actual instruction is encoded. The function only answers the question "is it possible to inline an immediate". I believe this name better reflects that. | |
156 | That code was there before my change. I would prefer to fix it separately. |
I would prefer to do that separately. Please assign the bug to me, I will check, update the bug and submit regression tests. Is it OK?
That's right, the only case which makes sense is -0.0. And it can be useful in some cases. I am going to double-check if modifiers are really allowed; that is the one of the reasons why I got pause in the middle of implementation and didn't implement parsing of modifiers for immediates.
Going to update diff with fresh llvm master and also to satisfy recent Matt's comments.
Added: Test for http://lists.llvm.org/pipermail/llvm-dev/2015-October/091715.html
Added: Test for FP value specified as a hex.
Added: Some TODO comments.
Updated/style: Some comments (80 chars line limit).
Updated/style: Single quotes for '<'.
lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | ||
---|---|---|
156 | TODO comment added |
Comments should be capitalized. Also this looks like it goes over the 80 character line limit