Skip to content

Conversation

@yosoyubik
Copy link
Collaborator

No description provided.

@yosoyubik yosoyubik requested a review from a team as a code owner October 31, 2025 12:16
@yosoyubik yosoyubik changed the base branch from develop to pkova/yet-another-mirror October 31, 2025 13:19
Base automatically changed from pkova/yet-another-mirror to develop October 31, 2025 13:32
// frame size, in words
//
c3_w wor_w = (len_w + 3) >> 2;
c3_w wor_w = (len_w + 3 + pad_w) >> 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want or need to change the frame size to accomplish alignment. The frame size (in words) is the sizeof (in bytes), so it already accounts for any padding necessary to align an array of these frames. What's missing is the initial alignment of the base pointer (ie, cap_p). That needs to happen, and the result stored in top_p. The pile also needs an additional member to track and restore (in u3a_pile_done() the original, un-aligned cap.

@joemfb
Copy link
Collaborator

joemfb commented Oct 31, 2025

We need u3R->cap_p += pil_u->mov_ws to be aligned per lin_w (converted from bytes to words). Something like this in pile_prep (untested):

c3_dessert( lin_w & (lin_w - 1) ); 
c3_w lig_w = lin_w >> 2;
c3_w pad_w;

pil_u->bas_p = u3R->cap_p;

c3_w pad_w = (u3R->cap_p + pil_u->off_ws) & (lig_w - 1);

u3R->cap_p += wor_w - pad_w; // north?
u3R->cap_p -= pad_w; // south?

pil_u->top_p = u3R->cap_p;

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.

3 participants