Commit 910f54f
authored
i#7779: Store Aarch64 SVE registers in arrays of dr_simd_t and dr_svp_t. (#7780)
SVE registers (Z0-Z31) and predicate registers (P0-P15) are encapsulated
within arrays of dr_simd_t and dr_sve_t types, respectively.
When the SVE registers are written to the dstack using
insert_save_or_restore_sve_registers(),
create_base_disp_for_save_restore() is used to compute the offset of the
SVE registers, i.e.
```
case SVE_ZREG_TYPE:
opsz = opnd_size_from_bytes(proc_get_vector_length_bytes());
offset = num_saved * proc_get_vector_length_bytes();
break;
case SVE_PREG_TYPE:
opsz = opnd_size_from_bytes(proc_get_vector_length_bytes() / 8);
offset = num_saved * (proc_get_vector_length_bytes() / 8);
break;
```
The offset calculation considers the size of the register supported on
the platform based on roc_get_vector_length_bytes(), but not arrays of
dr_simd_t and dr_sve_t. In effect, all the registers are packed together
without considering the size of dr_simd_t and dr_svep_t.
When other functions retrieve the register values based on the arrays,
they get incorrect values (except for z0).
This PR changes the code to use the size of the array element to compute
the offset, so that register values are stored in the corresponding
elements.
Add a test to verify SVE registers are saved and restored properly using
dr_redirect_ececution().
Fixes: #77791 parent b54c434 commit 910f54f
File tree
5 files changed
+413
-3
lines changed- core/arch/aarchxx
- suite/tests
- client-interface
- common
5 files changed
+413
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
| 529 | + | |
529 | 530 | | |
530 | 531 | | |
531 | 532 | | |
| |||
6111 | 6112 | | |
6112 | 6113 | | |
6113 | 6114 | | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
| 6118 | + | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
| 6124 | + | |
| 6125 | + | |
6114 | 6126 | | |
6115 | 6127 | | |
6116 | 6128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments