Closed Bug 1467404 Opened 2 years ago Closed 2 years ago

[MIPS] Apply MacroAssembler::convertDoubleToInt32 fix form Bug 1465770 to MacroAssembler::convertDoubleToInt32 also

Categories

(Core :: JavaScript Engine: JIT, enhancement, P5)

61 Branch
Other
Linux
enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: dragan.mladjenovic, Assigned: dragan.mladjenovic)

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attached patch bug1467404.patch (obsolete) — Splinter Review
Assignee: nobody → dragan.mladjenovic
Status: NEW → ASSIGNED
Attachment #8984063 - Flags: review?(nicolas.b.pierron)
Comment on attachment 8984063 [details] [diff] [review]
bug1467404.patch

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

::: js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ +160,5 @@
>      as_truncws(ScratchFloat32Reg, src);
>      as_cfc1(ScratchRegister, Assembler::FCSR);
>      moveFromFloat32(ScratchFloat32Reg, dest);
> +    ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseI, 6);
> +    as_andi(ScratchRegister, ScratchRegister, 0x11);

If I understand this code correctly… This code that the result of the comparisons from the scratch register, and extract 6 bits starting from 17:12 (bit 12 being Assembler::CauseI) and then mask the last 2 bits with a andi instruction.

Why not doing?

> ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseI, 2);
(In reply to Nicolas B. Pierron [:nbp] {backlog: 39} from comment #2)
> Comment on attachment 8984063 [details] [diff] [review]
> bug1467404.patch
> 
> Review of attachment 8984063 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: js/src/jit/mips32/MacroAssembler-mips32.cpp
> @@ +160,5 @@
> >      as_truncws(ScratchFloat32Reg, src);
> >      as_cfc1(ScratchRegister, Assembler::FCSR);
> >      moveFromFloat32(ScratchFloat32Reg, dest);
> > +    ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseI, 6);
> > +    as_andi(ScratchRegister, ScratchRegister, 0x11);
> 
> If I understand this code correctly… This code that the result of the
> comparisons from the scratch register, and extract 6 bits starting from
> 17:12 (bit 12 being Assembler::CauseI) and then mask the last 2 bits with a
> andi instruction.
> 
> Why not doing?
> 
> > ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseI, 2);

The 0x11 is 0b10001 so it masks bits 12 and 16 (Assembler::CauseV).
(In reply to Dragan Mladjenovic from comment #3)
> > > ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseI, 2);
> 
> The 0x11 is 0b10001 so it masks bits 12 and 16 (Assembler::CauseV).

Oh, I miss read this mask because I am not used to think of bit-mask as hexadecimal unless you are doing a lot of bit-twiddling logic.
Comment on attachment 8984063 [details] [diff] [review]
bug1467404.patch

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

::: js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ +160,5 @@
>      as_truncws(ScratchFloat32Reg, src);
>      as_cfc1(ScratchRegister, Assembler::FCSR);
>      moveFromFloat32(ScratchFloat32Reg, dest);
> +    ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseI, 6);
> +    as_andi(ScratchRegister, ScratchRegister, 0x11);

nit: avoid unnamed magic numbers:

(a) replace `6` by `1 + int(Assembler::CauseV) - int(Assembler::CauseI)`

(b) replace `0x11` by the `causeIV` defined as follow:

  const int CauseIV = ((1 << int(Assembler::CauseI)) | (1 << int(Assembler::CauseV))) >> int(Assembler::CauseI);
Attachment #8984063 - Flags: review?(nicolas.b.pierron) → review+
Priority: -- → P5
Attachment #8984063 - Attachment is obsolete: true
Attachment #8989426 - Flags: review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e90b073a7269
[MIPS] Apply MacroAssembler::convertDoubleToInt32 fix form Bug 1465770 to MacroAssembler::convertDoubleToInt32 also. r=nbp
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e90b073a7269
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.