Skip to content

[gen] Add pair-cell offset annotation for AArch64. - #1886

Open
ShaleXIONG wants to merge 7 commits into
herd:masterfrom
ShaleXIONG:pair-offset-read-write
Open

[gen] Add pair-cell offset annotation for AArch64.#1886
ShaleXIONG wants to merge 7 commits into
herd:masterfrom
ShaleXIONG:pair-offset-read-write

Conversation

@ShaleXIONG

@ShaleXIONG ShaleXIONG commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Expose a non-mixed AArch64 offset annotation to generate ordinary accesses to the second cell of a pair-backed location. The surface spelling follows the current natural type size.

  • with the default 32-bit int, the added annotation is w4
  • with -type int64_t, it is q8.

We also remove the synthetic ADD after AArch64 pair loads but check both register values in the final condition.
Given the new annotation and change, we can generate test, e.g. diyone7 -metadata false -arch AArch64 -oneloc Rfe PaIQ Fre w4 PosWW

AArch64 WW+R+posw4p+PaIQ
{
 int x[2]={0,0};
 uint32_t 0:X0=0; 0:X1=x;
 1:X1=x;
}
 P0                                                      | P1                ;
 MOV W0,#2                                               | LDIAPP W0,W2,[X1] ;
 STR W0,[X1,#4] (* w4 annotation to access second cell *)|                   ; (* Add W0,W0,W2 is removed *)
 MOV W2,#1                                               |                   ;
 STR W2,[X1]                                             |                   ;

exists (x={1,2} /\ 1:X0=1 /\ 1:X2=0) (* Value check for both 1:X0 and 1:X2 *)

@ShaleXIONG
ShaleXIONG requested a review from relokin June 25, 2026 13:55
@ShaleXIONG
ShaleXIONG force-pushed the pair-offset-read-write branch from bb96221 to 4aeba6b Compare June 29, 2026 16:16
Expose a non-mixed AArch64 offset annotation to generate
ordinary accesses to the second cell of a pair-backed location.
The surface spelling follows the current natural type size.
With the default 32-bit `int`, the added annotation is `w4`;
with `-type int64_t`, it is `q8`.
@ShaleXIONG
ShaleXIONG force-pushed the pair-offset-read-write branch from 4aeba6b to fb93e88 Compare August 5, 2026 09:06
Stop combining pair-load results with an `ADD` after `LDP**` but check
registers' values separately in the final condition.
@ShaleXIONG
ShaleXIONG force-pushed the pair-offset-read-write branch from fb93e88 to 27deb92 Compare August 5, 2026 09:51
@ShaleXIONG
ShaleXIONG force-pushed the pair-offset-read-write branch from fb65a22 to c90041b Compare August 11, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant