This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [lit] Add write tests for MM/XMM/r8-r15 registers
ClosedPublic

Authored by mgorny on Apr 30 2019, 4:12 AM.

Diff Detail

Event Timeline

mgorny created this revision.Apr 30 2019, 4:12 AM
labath accepted this revision.Apr 30 2019, 5:31 AM

The assembly looks perfectly fine to me. The only thing I'd consider changing is writing the displacements in the movq ... (%rbx) instructions in hex.

lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp
11

It looks like mm_fill is unused.

lldb/lit/Register/x86-mm-xmm-write.test
28

When looking at the jenkins output from the failed gp-write run, I realized that the failure message isn't very helpful because FileCheck suggests the "register write" line above as a "possible intended match".

I think it may be possible to improve on that by adding a CHECK: process continue here so that all subsequent checks only look at the process output, and not the commands setting the values.

This revision is now accepted and ready to land.Apr 30 2019, 5:31 AM
mgorny updated this revision to Diff 197306.Apr 30 2019, 6:11 AM
mgorny marked 2 inline comments as done.

Switched to hex offsets, and added match for 'process continue'.

mgorny updated this revision to Diff 197355.Apr 30 2019, 9:42 AM
mgorny marked an inline comment as done.
mgorny retitled this revision from [lldb] [lit] Add write tests for MM/XMM registers to [lldb] [lit] Add write tests for MM/XMM/r8-r15 registers.
mgorny edited the summary of this revision. (Show Details)

Inlined mm_fill, and added tests for r8-r15 & xmm8-xmm15.

JDevlieghere added inline comments.Apr 30 2019, 10:17 AM
lldb/lit/Register/x86-64-write.test
1 ↗(On Diff #197355)

This fails on Darwin for me:

# CHECK-DAG: xmm8 = 0x030507090b0d0f00020406080a0c0e01
             ^
<stdin>:38:1: note: scanning from here
r8 = 0x0102030405060708
^
<stdin>:46:1: note: possible intended match here
xmm8 = 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
mgorny marked an inline comment as done.Apr 30 2019, 10:22 AM
mgorny added inline comments.
lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp
11

It's used to fill xmm_fill ;-). Should I inline it?

lldb/lit/Register/x86-64-write.test
1 ↗(On Diff #197355)

Could you run it without FileCheck, and paste the full output? Manually would be something alike:

clang++ Inputs/x86-64-write.cpp
lldb -b -s x86-64-write.test a.out
JDevlieghere added inline comments.Apr 30 2019, 10:31 AM
lldb/lit/Register/x86-64-write.test
1 ↗(On Diff #197355)

Sure, here's the output: https://reviews.llvm.org/P8141

mgorny updated this revision to Diff 197376.Apr 30 2019, 10:55 AM

Ok, I see that Darwin doesn't implement writing to xmm* registers at the moment. Added XFAIL for it.

labath marked an inline comment as done.Apr 30 2019, 11:05 AM
labath added inline comments.
lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp
11

What I actually meant here was that I was expecting mm_fill to be used to initialize the mm registers, but you're initializing them with xmm_fill instead. However, that's not really important, as both are technically correct.

JDevlieghere accepted this revision.Apr 30 2019, 11:06 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2019, 6:55 AM