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

Handling of extended guard point and sizes of power-of-two+1 tables #1864

Closed
vlazzarini opened this issue Apr 5, 2024 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@vlazzarini
Copy link
Member

Two related issues have been identified

  1. There is no mechanism to request an extended guard point to a GEN
  2. Tables using power-of-two+1 size have power-of-two length, which is confusing for users expecting the length to be equal to the size requested.

Proposed solutions

  1. Use a non-zero fractional value for table size to request an extended guard point
f1 0 2000.1 7 0 2000 1   ; extended guard point
  1. Use a negative size to request an actual size, disregarding the power-of-two+1 size mechanism.
f1 0 -1025 7 0 2000 1   ; flen = 1025 with standard guard point
@vlazzarini vlazzarini self-assigned this Apr 5, 2024
@vlazzarini vlazzarini added this to the 7.0.0 milestone Apr 5, 2024
vlazzarini pushed a commit that referenced this issue Apr 16, 2024
@vlazzarini
Copy link
Member Author

I did a code review and the description of the problem was slightly wrong. Currently (e.g. 6.x)

  1. Negative size tables always set an extended guard point.
  2. Negative size tables keep their requested size (e.g. no change from pow2 + 1 to pow2).

So the problem is just how to give the user an option to suppress (1), and set a normal guard point with a copy of the value at position 0. This is done by using a table size with decimal part > 0 as proposed.
Note that fractional sizes are rounded to the nearest integer and this behaviour has not been touched.

Implemented in PR #1872

@joachimheintz
Copy link
Contributor

joachimheintz commented Apr 16, 2024 via email

@vlazzarini
Copy link
Member Author

No, I mean negative in both.

ifn ftgen  1,0,-1025,10,1
print ftlen(ifn)

gives currently

ftable 1:
instr 0:  #i2 = 1025.000

@joachimheintz
Copy link
Contributor

joachimheintz commented Apr 16, 2024 via email

@vlazzarini
Copy link
Member Author

That is it. The power of 2 + 1 case was traditionally treated as a flag for extended guard point. Once other sizes became possible, this is less clear.

yes, I am not proposing to change anything because of backwards compatibility. I would not go as far as making a blank recommendation for negative sizes unless a power of two + 1 size is requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants