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

Need a checker to ensure that inline if is not propagated to low level #150

Closed
basavesh opened this issue May 19, 2022 · 0 comments
Closed

Comments

@basavesh
Copy link
Collaborator

Branch: glob_array3_slh

We allow #inline annotation for if inside a for loop for SCT checking. We need a checker which will ensure that these inline if's are resolved and removed before generating assembly code.

inline fn __keccak_rho_offsets(inline int i, #msf reg u64 ms) -> inline int, #msf reg u64
{
  inline int r x y z t;

  r = 0;
  x = 1;
  y = 0;

  for t = 0 to 24 {
    #inline if (i == x + 5 * y) {        // this inline if should not be present in late stages of compilation
      r = ((t + 1) * (t + 2) / 2) % 64;
    }
    z = (2 * x + 3 * y) % 5;
    x = y;
    y = z;
  }

  return r, ms;
}
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