Closed Bug 1251140 Opened 8 years ago Closed 8 years ago

Baldr: Implement CtzI.

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: mbx, Assigned: mbx)

References

Details

Attachments

(1 file, 3 obsolete files)

Patch coming up.
Summary: Baldr: Implement Ctz. → Baldr: Implement CtzI.
Attached patch ctz.patch (obsolete) — Splinter Review
Attachment #8723397 - Flags: review?(jdemooij)
Assignee: nobody → mbebenita
Blocks: wasm
Comment on attachment 8723397 [details] [diff] [review]
ctz.patch

Review of attachment 8723397 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!

::: js/src/asmjs/WasmIonCompile.cpp
@@ +2781,5 @@
>          return EmitUnary<MTruncateToInt32>(f, ExprType::F64, def);
>        case Expr::I32Clz:
>          return EmitUnary<MClz>(f, ExprType::I32, def);
> +      case Expr::I32Ctz:
> +          return EmitUnary<MCtz>(f, ExprType::I32, def);

Nit: switch case/default labels are indented with 2 spaces and their bodies with 2 more (instead of 4)

::: js/src/jit-test/tests/wasm/basic-integer.js
@@ +17,5 @@
>  }
>  
>  testUnary('i32', 'clz', 40, 26);
> +testUnary('i32', 'ctz', 40, 3);
> +testUnary('i32', 'ctz', 0, 32);

Nit: another case that might be interesting:

testUnary('i32', 'ctz', -2147483648, 31);

::: js/src/jit/MIR.h
@@ +6028,5 @@
>      void collectRangeInfoPreTrunc() override;
>  };
>  
> +class MCtz
> +    : public MUnaryInstruction

Nit: indent with 2 spaces
Attachment #8723397 - Flags: review?(jdemooij) → review+
Attached patch ctz.patch (obsolete) — Splinter Review
Fixed nits.
Attachment #8723397 - Attachment is obsolete: true
Blocks: 1242803
No longer blocks: wasm
Attached patch ctz.patch (obsolete) — Splinter Review
Rebased patch:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=23ca49c14962
Attachment #8724327 - Attachment is obsolete: true
Attached patch ctz.patchSplinter Review
Fixed arm64 build.
Attachment #8725456 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/b1766ac255d5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: