Commit Graph

4 Commits

Author SHA1 Message Date
Michal Gorny acbaa496ec [lldb] [lit] Use more readable consts and arrays in register read tests
Replace the constants used for r8/mm/xmm/ymm/zmm tests with something
more readable to ease debugging in case of failures (0x00 0x01 ...).
While at it, put the constants in array and copy them from memory
to simplify inline asm.

The original constants grew out of necessity.  The xmm constants were
'weird' because they were intended to be different from mm constants
(as that was necessary to catch NetBSD implementation bug).  The ymm
constants were made even weirded to not even partially collide with
other xmm registers (not saying it made sense, just how it was done).
Then, zmm constants were once again designed to avoid accidental
collisions with xmm and ymm constants, and at the same the 16 extra
registers required even more shuffling.

The new constants are meant to be more user-readable, so that a mistake
could be easily spotted.  All of xmm, ymm and zmm tests use a sequence
of {0x00 0x01 0x02 ...}, shifted by 1 for every register.  This should
provide enough uniquity, and space for future increase in number of
registers.  Since mm and r8..r15 are printed as uint64_t rather than
byte-by-byte, they use 0x000102...  As a result, on x86 endianness takes
care of making mm different than xmm.

The use of arrays is something I had to learn for zmm write tests.  It
avoids having to specify all the input values separately, and makes
GCC happy about zmm-read test (it was rejected previously because of
hitting a limit of 30 constraints).

llvm-svn: 360041
2019-05-06 13:06:43 +00:00
Michal Gorny b907c44265 [lldb] [lit] Cleanly terminate Register tests
Continue the Register test processes, and let them terminate cleanly
rather than implicitly terminating them along with lldb.

llvm-svn: 359375
2019-04-27 07:43:29 +00:00
Michal Gorny 8879bba679 [lldb] [lit] Un-XFAIL Register/x86-64-read.test for Darwin
llvm-svn: 359221
2019-04-25 18:38:58 +00:00
Michal Gorny 19376ebd1a [lldb] [lit] Add tests for reading new x86_64 registers
Add tests covering read operations for the general-purpose and XMM
registers added in x86_64 (r8-r15 and xmm8-xmm15).

Differential Revision: https://reviews.llvm.org/D61072

llvm-svn: 359210
2019-04-25 17:42:49 +00:00