This is an archive of the discontinued LLVM Phabricator instance.

[llvm][AArch64] Add missing FPCR, H and B registers to Codeview mapping
ClosedPublic

Authored by DavidSpickett on Jul 14 2022, 7:08 AM.

Details

Summary

Fixes https://github.com/llvm/llvm-project/issues/56484

H registers are 16 bit views of AArch64's Neon registers and
B are the 8 bit views.

msvc does not support 16 bit float (some mention in DirectX but I
couldn't find a way to get to it) so for lack of a better reference
I'm using:
https://github.com/MicrosoftEdge/JsDbg/blob/85c9b41b33bb8f3496dbe400d912c32bb7cc496b/server/references/dia/include/cvconst.h
(the other microsoft-pdb repo is no longer up to date)

Luckily clang does support fp16 so a test is added for that.

There is no 8 bit float type so I had to get creative with the
test case. We're not testing for correct debug info here just
that we can select the B register and not crash in the process.

For FPCR it's never going to be passed as an argument so I've
not added a test for it. It is included to keep our list looking
the same as the reference.

Diff Detail

Event Timeline

DavidSpickett created this revision.Jul 14 2022, 7:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 7:08 AM
DavidSpickett requested review of this revision.Jul 14 2022, 7:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 7:08 AM

If you're not familiar with the naming: https://developer.arm.com/documentation/102374/0100/Registers-in-AArch64---general-purpose-registers

llvm does use the B registers, or at least can but usually for an instruction operand not for a variable you'd get debug info for. H was easy because __fp16 arguments end up there.

I think testing with MIR is the way to go to be after register allocation, and I did test that my hacks for the B test work with expensive checks. If there's a better way I'm happy to change it though.

This revision is now accepted and ready to land.Jul 18 2022, 10:06 AM
This revision was landed with ongoing or failed builds.Jul 19 2022, 2:33 AM
This revision was automatically updated to reflect the committed changes.