This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/Utility] Declare register overlaps between ST and MM
ClosedPublic

Authored by mgorny on Nov 18 2020, 11:17 AM.

Details

Summary

Explicitly declare register overlaps/invalidation between ST(i) and MMi
registers.

Diff Detail

Event Timeline

mgorny requested review of this revision.Nov 18 2020, 11:17 AM
mgorny created this revision.
mgorny retitled this revision from [lldb] [Process/Utility] Declare register overlaps between ST and MM to [lldb] [Process/Utility] Declare register overlaps between ST and MM [WIP].

@labath, what do you think about this approach? What really sucks is that we have to repeat the whole voodoo for i386 and amd64 separately.

lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
92–93

To be honest, I completely don't get the indentation below.

labath accepted this revision.Nov 19 2020, 12:28 AM

I don't know omitting this had any practical effects (my experiments with rax were... inconclusive) , but it definitely sounds like the right to do.

lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
92–93

Yeah... You could try explicitly re-indenting the block to see whether it produces something better. If not, it's likely a clang-format bug (though I can't really blame it for getting this mess wrong)

This revision is now accepted and ready to land.Nov 19 2020, 12:28 AM
mgorny added inline comments.Nov 19 2020, 1:06 AM
lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
92–93

Actually, clang-format produces something like this, for the whole file:

#define DEFINE_FP_MM(reg, i, streg)                                            \
  {                                                                            \
#reg #i, nullptr, sizeof(uint64_t), LLVM_EXTENSION FPR_OFFSET(stmm[i]),    \
        eEncodingUint, eFormatHex,                                             \
        {dwarf_mm##i##_x86_64, dwarf_mm##i##_x86_64, LLDB_INVALID_REGNUM,      \
         LLDB_INVALID_REGNUM, lldb_mm##i##_x86_64 },                           \
         RegisterContextPOSIX_x86::g_contained_##streg,                        \
         RegisterContextPOSIX_x86::g_invalidate_##streg, nullptr, 0            \
  }

Note that the #reg line gets \ wrong — if I add 4 spaces to the beginning, it starts looking sane-ish, so it probably gets that wrong.

mgorny updated this revision to Diff 306363.Nov 19 2020, 4:04 AM

Updated to cover i386, reformatted the macro.

mgorny retitled this revision from [lldb] [Process/Utility] Declare register overlaps between ST and MM [WIP] to [lldb] [Process/Utility] Declare register overlaps between ST and MM.Nov 21 2020, 8:10 AM
labath accepted this revision.Nov 23 2020, 12:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2020, 12:24 AM