Skip to content

Commit 91f46ec

Browse files
committed
[lldb][AArch64] Document how to control the SVE/SSVE tests
A lot of these use defines that I made up for this purpose, which is not obvious at first glance. Document that at the top of each file.
1 parent 2616c27 commit 91f46ec

File tree

4 files changed

+21
-0
lines changed
  • lldb/test/API/commands/register/register
    • aarch64_dynamic_regset
    • aarch64_sve_registers
    • aarch64_sve_simd_registers

4 files changed

+21
-0
lines changed

lldb/test/API/commands/register/register/aarch64_dynamic_regset/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include <sys/auxv.h>
22

3+
// If this program receives 0 arguments, it will use non-streaming SVE
4+
// registers. If the number of arguments is >= 1, it will use streaming SVE
5+
// registers.
6+
37
#ifndef HWCAP2_SME
48
#define HWCAP2_SME (1 << 23)
59
#endif

lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#include <stdbool.h>
33
#include <sys/prctl.h>
44

5+
// If USE_SSVE is defined, this program will use streaming mode SVE registers
6+
// instead of non-streaming mode SVE registers.
7+
58
#ifndef PR_SME_SET_VL
69
#define PR_SME_SET_VL 63
710
#endif

lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_static_config/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include <stdbool.h>
22
#include <sys/prctl.h>
33

4+
// If START_SSVE is defined, this program will start in streaming SVE mode
5+
// (it will later enter and exit streaming mode a few times). Otherwise, it
6+
// will start in non-streaming SVE mode.
7+
48
#ifndef PR_SME_SET_VL
59
#define PR_SME_SET_VL 63
610
#endif

lldb/test/API/commands/register/register/aarch64_sve_simd_registers/main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#include <stdint.h>
22
#include <sys/prctl.h>
33

4+
// If SSVE is defined, this program will start in streaming SVE mode. Otherwise,
5+
// if SVE is defined, it will start in non-streaming mode and activate the SVE
6+
// registers by writing to one of them. If neither SSVE or SVE are defined,
7+
// the program will start in non-streaming mode, with the SVE registers
8+
// inactive.
9+
//
10+
// For most programs the difference between inactive non-streaming SVE and
11+
// active is transparent. For lldb, there are some differences in how we use
12+
// ptrace in either scenario.
13+
414
// base is added to each value. If base = 2, then v0 = 2, v1 = 3, etc.
515
void write_simd_regs(unsigned base) {
616
#define WRITE_SIMD(NUM) \

0 commit comments

Comments
 (0)