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

Subarrays for stkptr #929

Open
eponier opened this issue Oct 15, 2024 · 1 comment
Open

Subarrays for stkptr #929

eponier opened this issue Oct 15, 2024 · 1 comment

Comments

@eponier
Copy link
Contributor

eponier commented Oct 15, 2024

I tested whether we could access and assign subarrays of stkptr, and it appears that it is accepted by stack alloc, but fails at linearization.

param int N = 4;

// we want to do pointer arithmetic with stk ptr, but this fails

export fn main (reg ptr u64[N] r) -> reg u64 {
  reg u64 res = 0;

  stack ptr u64[N] s;
  stack ptr u64[1] s1;
  reg ptr u64[1] r1;
  
  s = r;
  s1 = s[1:1];
  r1 = s1;

  res = r1[0];

  return res;
}

Do we want to allow such a thing?

@eponier
Copy link
Contributor Author

eponier commented Oct 15, 2024

(it probably makes sense only on x86, but I think it does make sense there)

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

No branches or pull requests

1 participant