Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 879
Fuzzer: Add SIMD support to DeNaN#6318
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
aefdf0343bb8002a755207c7ff8144e6c8696469aa0cea4f4d195c0042e81f2d970d6ad4bfec966c2c50eaf35dcc08fa5dcf07915File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
| ;; RUN: foreach %s %t wasm-opt --denan -all -S -o - | filecheck %s | ||
| (module | ||
| ;; CHECK: (type $0 (func (param v128) (result v128))) | ||
| ;; CHECK: (type $1 (func (param f32) (result f32))) | ||
| ;; CHECK: (type $2 (func (param f64) (result f64))) | ||
| ;; CHECK: (func $foo128 (type $0) (param $x v128) (result v128) | ||
| ;; CHECK-NEXT: (local.set $x | ||
| ;; CHECK-NEXT: (call $deNan128 | ||
| ;; CHECK-NEXT: (local.get $x) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (drop | ||
| ;; CHECK-NEXT: (call $deNan128 | ||
| ;; CHECK-NEXT: (v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (drop | ||
| ;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (drop | ||
| ;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (call $deNan128 | ||
| ;; CHECK-NEXT: (call $foo128 | ||
| ;; CHECK-NEXT: (local.get $x) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| (func $foo128 (param $x v128) (result v128) | ||
| ;; The incoming param will be de-naned. | ||
| ;; This is not a NaN. (We do still emit a call for it atm, FIXME) | ||
| (drop | ||
| (v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be useful to write the tests using MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was actually thinking it is nice to see the actual bits because of how they are used in the pass (the explanation about the f32 and f64 bits overlapping etc.)? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be more specific, in this test code: ;; This is an f64 NaN and also an f32. It will become 0's.
(drop
(v128.consti32x40xffffffff0x000000020x000000030x00000004)
)
;; This is an f32 NaN and not an f64. It will also become 0's.
(drop
(v128.consti32x40x000000010xffffffff0x000000030x00000004)
)It is nice to see the bits, because that allows the comments to clarify how the same bits can be both f32 and f64 nans, or not. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be more convinced by this if readers were likely to know off the top of their heads what bit patterns correspond to NaNs. I know I don't :) MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heh, I don't know that either, but I mentioned it in the pass (8 vs 11 top non-sign bits). | ||
| ) | ||
| ;; This is an f64 NaN and also an f32. It will become 0's. | ||
| (drop | ||
| (v128.const i32x4 0xffffffff 0x00000002 0x00000003 0x00000004) | ||
| ) | ||
| ;; This is an f32 NaN and not an f64. It will also become 0's. | ||
| (drop | ||
| (v128.const i32x4 0x00000001 0xffffffff 0x00000003 0x00000004) | ||
| ) | ||
| (call $foo128 (local.get $x)) | ||
| ) | ||
| ) | ||
| ;; CHECK: (func $deNan32 (type $1) (param $0 f32) (result f32) | ||
| ;; CHECK-NEXT: (if (result f32) | ||
| ;; CHECK-NEXT: (f32.eq | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (then | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (else | ||
| ;; CHECK-NEXT: (f32.const 0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK: (func $deNan64 (type $2) (param $0 f64) (result f64) | ||
| ;; CHECK-NEXT: (if (result f64) | ||
| ;; CHECK-NEXT: (f64.eq | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (then | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (else | ||
| ;; CHECK-NEXT: (f64.const 0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK: (func $deNan128 (type $0) (param $0 v128) (result v128) | ||
| ;; CHECK-NEXT: (if (result v128) | ||
| ;; CHECK-NEXT: (i32.and | ||
| ;; CHECK-NEXT: (i32.and | ||
| ;; CHECK-NEXT: (f32.eq | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 0 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 0 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (f32.eq | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 1 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 1 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (i32.and | ||
| ;; CHECK-NEXT: (f32.eq | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 2 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 2 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (f32.eq | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 3 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (f32x4.extract_lane 3 | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (then | ||
| ;; CHECK-NEXT: (local.get $0) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (else | ||
| ;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
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.
Why does this happen?
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 good reason - that's what the code did for f32 and f64 before this PR. I can fix it later.