Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#5365: Add AArch64 SVE support to the core (part 1) #5835

Merged
merged 71 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
10a0907
i#5365: Add AArch64 SVE vector length support (part 1)
AssadHashmi Jan 24, 2023
462ae72
Fix source format non-compliances.
AssadHashmi Jan 24, 2023
ec3b2d0
Remove spurious TAB.
AssadHashmi Jan 24, 2023
c1d0c06
Multi-line body error in core/arch/aarchxx/mangle.c
AssadHashmi Jan 24, 2023
e30f977
Address some minor review issues, see below:
AssadHashmi Feb 23, 2023
f5d15fd
Fix reg_type enum declarations.
AssadHashmi Feb 23, 2023
cbcb088
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Mar 10, 2023
734b78e
Resolve merge conflicts due to OPSZ_SVE_VL and OPSZ_SVE_VL_BYTES
AssadHashmi Mar 10, 2023
3e80e83
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Mar 20, 2023
e65b836
Update dr_get_sve_vl() to dr_get_sve_vector_length() after latest bra…
AssadHashmi Mar 20, 2023
9d2d1df
Fix format non-conformances in instr_create_api.h
AssadHashmi Mar 20, 2023
69de817
Set VL for test builds and revert BUILD_TESTS changes in codec.c and …
AssadHashmi Mar 21, 2023
85f2110
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Mar 31, 2023
d0d7d71
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Apr 11, 2023
e08b143
Add save/restore code for SVE in emit_utils.c
AssadHashmi Apr 12, 2023
565b8f7
Fix source format non-compliances.
AssadHashmi Apr 12, 2023
c8c602c
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Apr 13, 2023
6916889
Use dr_get_sve_vector_length() to read current VL in append_save_simd…
AssadHashmi Apr 13, 2023
799e4af
Use proc_get_vector_length_bytes() NOT dr_get_sve_vector_length()!
AssadHashmi Apr 13, 2023
8dfb2aa
Add predicate register bank and first pass at predicate register hand…
AssadHashmi Apr 13, 2023
2317012
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Apr 14, 2023
02d83f0
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Apr 16, 2023
36bd7cf
Adjust machine context size and dstack offset for predicate register …
AssadHashmi Apr 16, 2023
6863799
Add FFR and supporting emitter code for SVE
AssadHashmi Apr 18, 2023
10ea2ac
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Apr 20, 2023
c131ef8
Add SVE predicates and FFR to clean-call register usage handling
AssadHashmi Apr 20, 2023
7b28840
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi May 4, 2023
779eeb8
Out-of-line clean call SVE saving/restoring
cmannett85-arm May 18, 2023
f37817e
Formatting and ARM fix
cmannett85-arm May 22, 2023
a588503
Define SVE predicate and FFR counts for ARM.
cmannett85-arm May 23, 2023
7448887
Avoid calling proc_has_features on ARM
cmannett85-arm May 23, 2023
0150ae5
Missing char...
cmannett85-arm May 23, 2023
e6d0e7d
Formatting fixes
cmannett85-arm May 23, 2023
af22417
Formatting fixes
cmannett85-arm May 23, 2023
1e1227f
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jun 1, 2023
1a7e369
Fix X86 regression caused by thread stack size mismatch
AssadHashmi Jun 9, 2023
87d952a
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jun 11, 2023
3319351
Add FEATURE_ overrides for SVE2 unit tests.
AssadHashmi Jun 12, 2023
40099ad
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jun 18, 2023
6177944
Updates after predicate register size change (PR6148)
AssadHashmi Jun 20, 2023
4e81382
Fix client.signal regression due to stack size
AssadHashmi Jun 27, 2023
998a952
Fix source code format non-conformance
AssadHashmi Jun 27, 2023
7f2d7ce
Added proc_get_vector_length_bytes() to release.dox
AssadHashmi Jun 28, 2023
911fbe1
Fix source code format non-conformance
AssadHashmi Jun 28, 2023
84a8451
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jun 29, 2023
93ab221
Addressed some review comments.
AssadHashmi Jun 29, 2023
4c603b2
Addressed second set of review comments.
AssadHashmi Jul 4, 2023
14154ea
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jul 9, 2023
33c6e27
Skip SVE mem operands in drcachesim
cmannett85-arm Jul 20, 2023
a97cb88
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jul 25, 2023
c7aef1c
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Jul 27, 2023
0c6c9a9
Update emitter and mangler to use byte offsets for SVE load/store.
AssadHashmi Jul 27, 2023
a337e8a
Fix source format non-compliance.
AssadHashmi Jul 27, 2023
da93d7e
Fix SVE regression caused by PR 6230
AssadHashmi Jul 27, 2023
b4c64c6
Fixes drcacheoff.burst_traceopts and v86 unit test regression
AssadHashmi Jul 28, 2023
69cec8b
More accurate name usage of SIMD slot constants.
AssadHashmi Jul 28, 2023
533b5ee
Fix simd[] array size initilisation error enc end punctuation in comm…
AssadHashmi Jul 28, 2023
f7365cf
Fix non-AArch64 build failures.
AssadHashmi Jul 28, 2023
0109e57
Fix AArch32 and Android build failure due to SIMD num slots naming er…
AssadHashmi Jul 31, 2023
4bc96bb
Remove #if defined(BUILD_TESTS) clause around proc_set_feature()
AssadHashmi Aug 3, 2023
2c0410a
Address another batch of review comments:
AssadHashmi Aug 4, 2023
1adb10d
Set test VL in AArch64 unit tests only.
AssadHashmi Aug 4, 2023
68a68f8
Added binary compatibile copier in priv_mcontext_to_dr_mcontext().
AssadHashmi Aug 8, 2023
3c03659
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Aug 9, 2023
a57fb68
Addressed final set of review comments:
AssadHashmi Aug 10, 2023
a3c794e
Remove spurious TABs in runsuite_wrapper.pl
AssadHashmi Aug 10, 2023
0532404
Multi-line body needs {} in priv_mcontext_to_dr_mcontext()
AssadHashmi Aug 10, 2023
3c72817
Re-worded and moved binary compatibility text to relevant section in …
AssadHashmi Aug 11, 2023
b48a441
Re-worded binary compatibility comment in priv_mcontext_to_dr_mcontext()
AssadHashmi Aug 11, 2023
95be63a
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Aug 11, 2023
1564258
Merge branch 'master' into i5365-aarch64-sve-veclen-part1
AssadHashmi Aug 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -450,7 +450,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -535,7 +535,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER="9.93.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export VERSION_NUMBER="9.94.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ endif (EXISTS "${PROJECT_SOURCE_DIR}/.svn")

# N.B.: When updating this, update all the default versions in ci-package.yml
# and ci-docs.yml. We should find a way to share (xref i#1565).
set(VERSION_NUMBER_DEFAULT "9.93.${VERSION_NUMBER_PATCHLEVEL}")
set(VERSION_NUMBER_DEFAULT "9.94.${VERSION_NUMBER_PATCHLEVEL}")
# do not store the default VERSION_NUMBER in the cache to prevent a stale one
# from preventing future version updates in a pre-existing build dir
set(VERSION_NUMBER "" CACHE STRING "Version number: leave empty for default")
Expand Down Expand Up @@ -1381,7 +1381,7 @@ math(EXPR VERSION_NUMBER_INTEGER
# 5.0 broke backcompat in drsyms and xmm opnd sizes
# 4.1 broke backcompat in drsyms + 64-bit core (opcodes + reachability)
# 4.0 broke backcompat in drmgr, drsyms, drinjectlib, and dr_get_milliseconds()
set(OLDEST_COMPATIBLE_VERSION_DEFAULT "990")
set(OLDEST_COMPATIBLE_VERSION_DEFAULT "994")
set(OLDEST_COMPATIBLE_VERSION "" CACHE STRING
"Oldest compatible version: leave empty for default")
if ("${OLDEST_COMPATIBLE_VERSION}" STREQUAL "")
Expand Down
8 changes: 8 additions & 0 deletions api/docs/release.dox
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ changes:
their precise counterparts int64_t and uint64_t.
- The #dynamorio::drmemtrace::memref_t structure has a new field appended for
holding the actual target of each indirect branch.
- Increased the size of dr_simd_t to accommodate AArch64's Scalable Vector
Extension (SVE) as well as adding two new dr_simd_t instances to
#dr_mcontext_t: SVE predicate registers svep[] and the SVE first-fault
register, ffr. This is a significant binary compatibility change and will
require re-building clients built before SVE was added.

Further non-compatibility-affecting changes include:
- Added new drmemtrace option -L0_filter_until_instrs which enables filtering
Expand Down Expand Up @@ -279,6 +284,9 @@ Further non-compatibility-affecting changes include:
- Added a new drmemtrace analysis tool: syscall_mix, to count frequency of system
AssadHashmi marked this conversation as resolved.
Show resolved Hide resolved
calls in a trace. This tool works in both the online and offline modes of
drmemtrace.
- Added proc_get_vector_length_bytes() for AArch64. This returns the current
AssadHashmi marked this conversation as resolved.
Show resolved Hide resolved
vector length on all ARMv8 hardware including hardware which supports the
Scalable Vector Extension (SVE).

**************************************************
<hr>
Expand Down
46 changes: 42 additions & 4 deletions api/samples/memtrace_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ static int tls_idx;

#define MINSERT instrlist_meta_preinsert

#ifdef AARCH64
static bool reported_sg_warning = false;
#endif

static void
memtrace(void *drcontext)
{
Expand Down Expand Up @@ -314,13 +318,47 @@ event_app_instruction(void *drcontext, void *tag, instrlist_t *bb, instr_t *wher
DR_ASSERT(instr_is_app(instr_operands));

for (i = 0; i < instr_num_srcs(instr_operands); i++) {
if (opnd_is_memory_reference(instr_get_src(instr_operands, i)))
instrument_mem(drcontext, bb, where, instr_get_src(instr_operands, i), false);
const opnd_t src = instr_get_src(instr_operands, i);
if (opnd_is_memory_reference(src)) {
#ifdef AARCH64
/* TODO i#5844: Memory references involving SVE registers are not
* supported yet. To be implemented as part of scatter/gather work.
*/
if (opnd_is_base_disp(src) &&
(reg_is_z(opnd_get_base(src)) || reg_is_z(opnd_get_index(src)))) {
if (!reported_sg_warning) {
dr_fprintf(STDERR,
"WARNING: Scatter/gather is not supported, results will "
"be inaccurate\n");
reported_sg_warning = true;
}
continue;
}
#endif
instrument_mem(drcontext, bb, where, src, false);
}
}

for (i = 0; i < instr_num_dsts(instr_operands); i++) {
if (opnd_is_memory_reference(instr_get_dst(instr_operands, i)))
instrument_mem(drcontext, bb, where, instr_get_dst(instr_operands, i), true);
const opnd_t dst = instr_get_dst(instr_operands, i);
if (opnd_is_memory_reference(dst)) {
#ifdef AARCH64
/* TODO i#5844: Memory references involving SVE registers are not
* supported yet. To be implemented as part of scatter/gather work.
*/
if (opnd_is_base_disp(dst) &&
(reg_is_z(opnd_get_base(dst)) || reg_is_z(opnd_get_index(dst)))) {
if (!reported_sg_warning) {
dr_fprintf(STDERR,
"WARNING: Scatter/gather is not supported, results will "
"be inaccurate\n");
reported_sg_warning = true;
}
continue;
}
#endif
instrument_mem(drcontext, bb, where, dst, true);
}
}

/* insert code to call clean_call for processing the buffer */
Expand Down
50 changes: 43 additions & 7 deletions api/samples/memval_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ static int tls_idx;
static drx_buf_t *write_buffer;
static drx_buf_t *trace_buffer;

#ifdef AARCH64
static bool reported_sg_warning = false;
#endif

/* Requires that hex_buf be at least as long as 2*memref->size + 1. */
static char *
write_hexdump(char *hex_buf, byte *write_base, mem_ref_t *mem_ref)
Expand Down Expand Up @@ -322,14 +326,31 @@ handle_post_write(void *drcontext, instrlist_t *ilist, instr_t *where, reg_id_t
* this.
*/
for (i = 0; i < instr_num_dsts(prev_instr); ++i) {
if (opnd_is_memory_reference(instr_get_dst(prev_instr, i))) {
const opnd_t dst = instr_get_dst(prev_instr, i);
if (opnd_is_memory_reference(dst)) {
if (seen_memref) {
DR_ASSERT_MSG(false, "Found inst with multiple memory destinations");
break;
}

#ifdef AARCH64
/* TODO i#5844: Memory references involving SVE registers are not
* supported yet. To be implemented as part of scatter/gather work.
*/
if (opnd_is_base_disp(dst) &&
(reg_is_z(opnd_get_base(dst)) || reg_is_z(opnd_get_index(dst)))) {
if (!reported_sg_warning) {
dr_fprintf(STDERR,
"WARNING: Scatter/gather is not supported, results "
"will be inaccurate\n");
reported_sg_warning = true;
}
continue;
}
#endif

seen_memref = true;
instrument_post_write(drcontext, ilist, where, instr_get_dst(prev_instr, i),
prev_instr, reg_addr);
instrument_post_write(drcontext, ilist, where, dst, prev_instr, reg_addr);
}
}
}
Expand Down Expand Up @@ -377,14 +398,29 @@ event_app_instruction(void *drcontext, void *tag, instrlist_t *bb, instr_t *wher
* we assume no instruction has multiple distinct memory destination operands.
*/
for (i = 0; i < instr_num_dsts(instr_operands); ++i) {
if (opnd_is_memory_reference(instr_get_dst(instr_operands, i))) {
const opnd_t dst = instr_get_dst(instr_operands, i);
if (opnd_is_memory_reference(dst)) {
if (seen_memref) {
DR_ASSERT_MSG(false, "Found inst with multiple memory destinations");
break;
}
data->reg_addr = instrument_pre_write(drcontext, bb, where,
data->last_opcode, instr_operands,
instr_get_dst(instr_operands, i));
#ifdef AARCH64
/* TODO i#5844: Memory references involving SVE registers are not
* supported yet. To be implemented as part of scatter/gather work.
*/
if (opnd_is_base_disp(dst) &&
(reg_is_z(opnd_get_base(dst)) || reg_is_z(opnd_get_index(dst)))) {
if (!reported_sg_warning) {
dr_fprintf(STDERR,
"WARNING: Scatter/gather is not supported, results "
"will be inaccurate\n");
reported_sg_warning = true;
}
continue;
}
#endif
data->reg_addr = instrument_pre_write(
drcontext, bb, where, data->last_opcode, instr_operands, dst);
seen_memref = true;
}
}
Expand Down
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/burst_gencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ class code_generator_t {
#ifdef X86
replace = INSTR_CREATE_lahf(dc);
#elif defined(AARCH64)
// OP_psb requires SPE feature.
proc_set_feature(FEATURE_SPE, true);
replace = INSTR_CREATE_psb_csync(dc);
#elif defined(ARM)
replace = INSTR_CREATE_yield(dc);
Expand Down
52 changes: 44 additions & 8 deletions clients/drcachesim/tracer/tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ static void *trace_thread_cb_user_data;
static bool thread_filtering_enabled;
bool attached_midway;

#ifdef AARCH64
static bool reported_sg_warning = false;
#endif

static bool
bbdup_instr_counting_enabled()
{
Expand Down Expand Up @@ -1304,18 +1308,50 @@ event_app_instruction(void *drcontext, void *tag, instrlist_t *bb, instr_t *inst

/* insert code to add an entry for each memory reference opnd */
for (i = 0; i < instr_num_srcs(instr_operands); i++) {
if (opnd_is_memory_reference(instr_get_src(instr_operands, i))) {
adjust = instrument_memref(
drcontext, ud, bb, where, reg_ptr, adjust, instr_operands,
instr_get_src(instr_operands, i), i, false, pred, mode);
const opnd_t src = instr_get_src(instr_operands, i);
if (opnd_is_memory_reference(src)) {
#ifdef AARCH64
/* TODO i#5844: Memory references involving SVE registers are not
* supported yet. To be implemented as part of scatter/gather work.
*/
if (opnd_is_base_disp(src) &&
(reg_is_z(opnd_get_base(src)) || reg_is_z(opnd_get_index(src)))) {
if (!reported_sg_warning) {
NOTIFY(
0,
"WARNING: Scatter/gather is not supported, results will be "
"inaccurate\n");
reported_sg_warning = true;
}
continue;
}
#endif
adjust = instrument_memref(drcontext, ud, bb, where, reg_ptr, adjust,
instr_operands, src, i, false, pred, mode);
}
}

for (i = 0; i < instr_num_dsts(instr_operands); i++) {
if (opnd_is_memory_reference(instr_get_dst(instr_operands, i))) {
adjust = instrument_memref(
drcontext, ud, bb, where, reg_ptr, adjust, instr_operands,
instr_get_dst(instr_operands, i), i, true, pred, mode);
const opnd_t dst = instr_get_dst(instr_operands, i);
if (opnd_is_memory_reference(dst)) {
#ifdef AARCH64
/* TODO i#5844: Memory references involving SVE registers are not
* supported yet. To be implemented as part of scatter/gather work.
*/
if (opnd_is_base_disp(dst) &&
(reg_is_z(opnd_get_base(dst)) || reg_is_z(opnd_get_index(dst)))) {
if (!reported_sg_warning) {
NOTIFY(
0,
"WARNING: Scatter/gather is not supported, results will be "
"inaccurate\n");
reported_sg_warning = true;
}
continue;
}
#endif
adjust = instrument_memref(drcontext, ud, bb, where, reg_ptr, adjust,
instr_operands, dst, i, true, pred, mode);
}
}
if (adjust != 0)
Expand Down
2 changes: 1 addition & 1 deletion clients/drdisas/drdisas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ main(int argc, const char *argv[])
#endif

#ifdef AARCH64
dr_set_sve_vl(op_sve_vl.get_value());
dr_set_sve_vector_length(op_sve_vl.get_value());
#endif

// XXX i#4021: arm not yet supported.
Expand Down
14 changes: 5 additions & 9 deletions core/arch/aarch64/aarch64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ START_FILE
#endif

/* sizeof(priv_mcontext_t) rounded up to a multiple of 16 */
#define PRIV_MCONTEXT_SIZE 800

/* offset of priv_mcontext_t in dr_mcontext_t */
#define PRIV_MCONTEXT_OFFSET 16

#if PRIV_MCONTEXT_OFFSET < 16 || PRIV_MCONTEXT_OFFSET % 16 != 0
# error PRIV_MCONTEXT_OFFSET
#endif
#define PRIV_MCONTEXT_SIZE 3424

/* offsetof(spill_state_t, r0) */
#define spill_state_r0_OFFSET 0
Expand All @@ -76,7 +69,7 @@ START_FILE
/* offsetof(priv_mcontext_t, simd) */
#define simd_OFFSET (16 * ARG_SZ*2 + 32)
/* offsetof(dcontext_t, dstack) */
#define dstack_OFFSET 0x368
#define dstack_OFFSET 0xda8
/* offsetof(dcontext_t, is_exiting) */
#define is_exiting_OFFSET (dstack_OFFSET+1*ARG_SZ)
/* offsetof(struct tlsdesc_t, arg) */
Expand Down Expand Up @@ -252,6 +245,9 @@ save_priv_mcontext_helper:
st1 {v20.2d-v23.2d}, [x4], #64
st1 {v24.2d-v27.2d}, [x4], #64
st1 {v28.2d-v31.2d}, [x4], #64
/* TODO i#5365: Save Z/P regs as well? Will require runtime check of
* ID_AA64PFR0_EL1 for FEAT_SVE.
*/
ret

DECLARE_EXPORTED_FUNC(dr_app_start)
Expand Down
Loading
Loading