Closed Bug 921490 Opened 6 years ago Closed 6 years ago

Ionmonkey ARM: fix the negative zero check path in convertFloat32ToInt32

Categories

(Core :: JavaScript Engine, defect)

ARM
All
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: dougc, Assigned: dougc)

References

Details

Attachments

(1 file)

The current code generates the following for convertFloat32ToInt32
with the error noted:

   0x405137b8:	vcvt.s32.f32	s2, s0
   0x405137bc:	vmov	r1, s2
   0x405137c0:	vcvt.f32.s32	s2, s2
   0x405137c4:	vcmp.f32	s0, s2
   0x405137c8:	vmrs	APSR_nzcv, fpscr
   0x405137cc:	bne	0x405138e4
   0x405137d0:	cmp	r1, #0
   0x405137d4:	vmoveq.32	r1, d0[0]     <<<< error
   0x405137d8:	cmpeq	r1, #-2147483648	; 0x80000000
   0x405137ec:	beq	0x405138e4
   0x405137e0:	cmp	r1, #7

The follow appears to be what is needed:

   0x40513a44:	vldr	s0, [pc, #204]	; 0x40513b18
   0x40513a48:	vcvt.s32.f32	s2, s0
   0x40513a4c:	vmov	r1, s2
   0x40513a50:	vcvt.f32.s32	s2, s2
   0x40513a54:	vcmp.f32	s0, s2
   0x40513a58:	vmrs	APSR_nzcv, fpscr
   0x40513a5c:	bne	0x40513bc8
   0x40513a60:	cmp	r1, #0
   0x40513a64:	vmoveq	r1, s0           <<<< Correction
   0x40513a68:	cmpeq	r1, #-2147483648	; 0x80000000
   0x40513a6c:	beq	0x40513bc8
Comment on attachment 811143 [details] [diff] [review]
Fix the negative zero check path in convertFloat32ToInt32

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

I clearly think Marty is more qualified for this review than I am.
Attachment #811143 - Flags: review?(bbouvier) → review?(mrosenberg)
Comment on attachment 811143 [details] [diff] [review]
Fix the negative zero check path in convertFloat32ToInt32

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

I swear, I'm actually on vacation.
Attachment #811143 - Flags: review?(mrosenberg) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3e90742978ec
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.