Bug 114495

Summary: LLInt should not use d8 register as scratch register
Product: WebKit Reporter: SangGyu Lee <sg5.lee>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ctruta, fpizlo, mark.lam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description SangGyu Lee 2013-04-12 00:11:01 PDT
Currently, LLInt uses d8 register as scratch register as followings:

ARM_SCRATCH_FPR = SpecialRegister.new("d8")    in arm.rb
C_LOOP_SCRATCH_FPR = SpecialRegister.new("d8") in cloop.rb

However, AAPCS ยง5.1.2.1 says

Registers s16-s31 (d8-d15, q4-q7) must be preserved across subroutine calls; registers s0-s15 (d0-d7, q0-q3) do not need to be preserved (and can be used for passing arguments or returning results in standard procedure-call variants). Registers d16-d31 (q8-q15), if present, do not need to be preserved.

Therefore it should not use d8 for that purpose.

I think it would be safe to use d6.
(Register d7 is already in use for other purpose. )

ARM_SCRATCH_FPR = SpecialRegister.new("d6")    in arm.rb
C_LOOP_SCRATCH_FPR = SpecialRegister.new("d6") in cloop.rb
Comment 1 Cosmin Truta 2013-05-10 11:49:31 PDT
Duplicate of bug 114811.
Comment 2 Mark Lam 2013-07-22 15:21:10 PDT

*** This bug has been marked as a duplicate of bug 114811 ***