-
Notifications
You must be signed in to change notification settings - Fork 456
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
Parsing, testing infrastructure, and tests for f32 and f64 #104
Conversation
sunfishcode
commented
Oct 1, 2015
- support for infinity, NaN with arbitrary bit pattern, and hexadecimal float literals
- assert_eq_bits and assert_nan for testing floating point results
- tests for all floating point operators
05452e3
to
8d3831a
Compare
let float = (num '.' digit+) | num ('.' digit+)? ('e' | 'E') num | ||
let float = (num '.' digit+) | ||
| num ('.' digit+)? ('e' | 'E') num | ||
| sign "0x" hexdigit* '.'? hexdigit* 'p' sign digit* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would allow weird things like 0xp
or 0x.p
to be valid float literals. Is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No; I've now updated this to require at least one leading significand digit and at least one exponent digit, and added a test for a significand with a trailing dot, as in 0x1.p4
.
I would prefer kicking out the existing |
8d3831a
to
312dbd4
Compare
Ok. I updated this PR to merge |
How about naming it |
Support Infinity, NaN with arbitrary bit patterns, and C99-style hexadecimal floating point literals.
"eq" on floating point types is true for 0 and -0, and false for x and y when either is NaN. assert_same compares for bit-identical values.
Require hexadecimal float literals to have at least one leading significand digit and at least one exponent digit. This is consistent with the C99 syntax.
312dbd4
to
4537a9a
Compare
|
lgtm |
Parsing, testing infrastructure, and tests for f32 and f64
* Polish table.init exec spec * table.set and table.init don't have the same imm. * Update document/core/exec/instructions.rst Co-Authored-By: Andreas Rossberg <[email protected]>
Clarify that shift count is modulo lane width
Update binary encodings