Bug 152693

Summary: [mips] Lower immediates of logical operations.
Product: WebKit Reporter: Konstantin Tokarev <annulen>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, guijemont, jbriance, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Lower immediates of andi and andp
none
Patch
none
Patch none

Description Konstantin Tokarev 2016-01-04 09:50:46 PST
On MIPS immediate operand of andi is required to be 16-bit non-negative number.
Comment 1 Konstantin Tokarev 2016-01-04 10:01:00 PST
Created attachment 268200 [details]
Lower immediates of andi and andp
Comment 2 Julien Brianceau 2016-01-05 07:03:45 PST
Comment on attachment 268200 [details]
Lower immediates of andi and andp

View in context: https://bugs.webkit.org/attachment.cgi?id=268200&action=review

LGTM

> Source/JavaScriptCore/offlineasm/mips.rb:525
> +            when "andi", "andp"

Please add other logical operations having this limitation (ori, orp, xori and xorp)
Comment 3 Konstantin Tokarev 2016-01-07 09:25:52 PST
Created attachment 268455 [details]
Patch
Comment 4 Julien Brianceau 2016-01-07 09:32:50 PST
Great, thanks
Comment 5 Konstantin Tokarev 2016-01-07 13:35:53 PST
Michael, could you take a look at this?
Comment 6 Michael Saboff 2016-01-07 14:09:35 PST
Comment on attachment 268455 [details]
Patch

r=me
Comment 7 WebKit Commit Bot 2016-01-07 14:13:56 PST
Comment on attachment 268455 [details]
Patch

Clearing flags on attachment: 268455

Committed r194725: <http://trac.webkit.org/changeset/194725>
Comment 8 WebKit Commit Bot 2016-01-07 14:13:59 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Julien Brianceau 2016-01-15 00:51:25 PST
*** Bug 150376 has been marked as a duplicate of this bug. ***
Comment 10 Guillaume Emont 2016-01-18 18:35:30 PST
(In reply to comment #3)
> Created attachment 268455 [details]
> Patch

Sorry, I'm a bit late here ;). I understood that the andi, ori and xori instructions interpret the 16 bit immediate as unsigned, so I understand that we could use the instruction for the range 0x0..0xffff, and not only for 0x0..0x7fff. Or did I miss something?
Comment 11 Julien Brianceau 2016-01-19 02:02:13 PST
(In reply to comment #10)
> Sorry, I'm a bit late here ;). I understood that the andi, ori and xori
> instructions interpret the 16 bit immediate as unsigned, so I understand
> that we could use the instruction for the range 0x0..0xffff, and not only
> for 0x0..0x7fff. Or did I miss something?

You're right. However if this case happens (immediate value in 0x7fff..0xffff), we'll also have to update the mipsOperand method of Immediate class to accept this range.
Comment 12 Konstantin Tokarev 2016-01-19 02:16:46 PST
Guillaume: you ar right, thanks for the gotcha.

Julien: Immediate.mipsOperand allows -0x7fff <= value <= 0xffff, so it is already accepted.
Comment 13 Konstantin Tokarev 2016-01-19 02:30:15 PST
Reopening to attach new patch.
Comment 14 Konstantin Tokarev 2016-01-19 02:30:18 PST
Created attachment 269263 [details]
Patch
Comment 15 Julien Brianceau 2016-01-19 02:47:58 PST
(In reply to comment #12)
> Julien: Immediate.mipsOperand allows -0x7fff <= value <= 0xffff, so it is
> already accepted.
Indeed, I read too quickly :)
Comment 16 Michael Saboff 2016-01-19 08:12:40 PST
Comment on attachment 269263 [details]
Patch

r=me
Comment 17 WebKit Commit Bot 2016-01-19 09:03:25 PST
Comment on attachment 269263 [details]
Patch

Clearing flags on attachment: 269263

Committed r195290: <http://trac.webkit.org/changeset/195290>
Comment 18 WebKit Commit Bot 2016-01-19 09:03:28 PST
All reviewed patches have been landed.  Closing bug.