Number: 1095

Date: 11-May-84 17':01':47

Submitter: purcell.pa

Source: Purcell

Subject: Floating Point WITHOUT BOXING

Assigned To: 

Attn: masinter

Status: Open

In/By: 

Problem Type: Performance

Impact: Serious

Difficulty: Hard

Frequency: 

Priority: Absolutely

System: Language Support

Subsystem: Arithmetic

Machine: 

Disk: 

Lisp Version: 

Source Files: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Disposition: [some of this is in the system but untested, the rest doesn''t work.]'
["masinter" "12-Sep-84 16':35':52" Disposition': Description':]

Description: Boxing of floating point numbers is a major bottleneck for arithmetic performance affecting many potential users.  Possible solutions include compiler changes or lisp representation changes to include immediate floating points.'
'
-------'
FROM MASINTER'
'
for real floatingpoint performance, we need a mode of the '
compiler that uses unboxed numbers on the stack. Now, how to get that?'
'
Design': add FIXP, FLOATP declarations. Variables declared that way are '
automatically made localvars and renamed. All access to the variable in '
non-arithmetic cases are made into BOX references (so this can '
NEGATIVELY IMPACT performance because of upward funarg number problem can''t handle any other way).'
'
E.g., bind X ← N turns into bind XUNBOX ← (VAG N) ; reference to X turnsinto (LOC X). Optimization, (FPLUS A B) turns into (LOC (UBFPLUS (VAG A)(VAG B))) and (VAG (LOC Z)) turns into Z. The FPLUS transformation should be taken only if A or B are known to be forms which generate LOCs.'
'
-----'
Date': 24 Aug 84 10':51 PDT'
From': Kaplan.pa'
Subject': Turning on unboxed floating point'
To': Masinter'
'
If we aren''t initially going to compile floating point expression trees into unboxed opcode sequences by default, then setting the following variable to T should cause this effect':'
'
UNBOXEDFLOATINGCOMPILEFLG'
'
When this variable is T, the intermediate floating point box from the quotient in'
(FTIMES (FQUOTIENT X Y) Z) should be suppressed.'
'
If Q were declared of type floating then the box of the FTIMES in'
(SETQ Q (FTIMES (FQUOTIENT X Y) Z)) would also be suppressed.'
'
If M is a FLOATP field of a datatype or blockrecord, then'
(replace M of FOO with (SETQ Q (FTIMES (FQUOTIENT X Y) Z)))'
should also generate no boxes.'
'
If the variable is NIL and Q is declared of type floatp, then I suggest that the compiler act as if the variable were T when compiling the expression whose value was going to be bound to Q.'
'
--Ron'
'
'


Workaround: 

Test Case: 

Edit-By: masinter

Edit-Date: 12-Sep-84 16':35':54