19 April 2010, 14:05 | #1 |
Zone Friend
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
|
Using FPU registers?
I'm running out of registers in my application! However I was thinking of beginning to use FPU registers, just for temporary storage. Imagine this scenario:
fmove d0,fp0 -- do calculations -- fmove fp0,d0 Is the above faster than using a simple variable in RAM? Like move.l d0,temp --- do calculations -- move.l temp,d0 |
19 April 2010, 14:17 | #2 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
move.l d0,-(a7)
move.l (a7)+,d0 'nuff said. |
19 April 2010, 14:27 | #3 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
LOL.
Never one to mince words is Stinger. |
19 April 2010, 14:29 | #4 |
Zone Friend
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
|
@Stingray: Yeah but is it really faster? Your way involves a memory read/write, which the fmove doesn't (?)
|
19 April 2010, 14:32 | #5 |
hastala vista winny vista
|
well, why don't you just test and see with a simple code ?
|
19 April 2010, 14:36 | #6 |
Zone Friend
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
|
My environment is currently consisting of WinUAE only (sadly) so..
|
19 April 2010, 14:37 | #7 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
First of all, using the FPU for temporary storage is really really stupid, your program will require an FPU only because you used it to store registers. Also, writing to the FPU requires a fair amount of time (convert to 80bit, convert to 32 bit integer again etc).
|
19 April 2010, 14:43 | #8 |
Zone Friend
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
|
Yes of course it will require an FPU. I was just curious if there was any obvious "performance-improvement" compared to storing data in RAM...
|
19 April 2010, 17:24 | #9 |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
The integer <-> fp conversion is too slow. Even if the data were single precision fp in the integer register it wouldn't be worth using the fp register. If you don't need fp operations then don't use the floating point registers. Operate directly on variables in memory or use the stack.
|
19 April 2010, 17:30 | #10 | ||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
15000 x fmove d0,fp0 fmove fp0,d0: : 147 raster lines (143 raster lines for fmove.s) 15000 x move.l d0,-(a7) move.l (a7)+,d0: 126 raster lines It'll be even worse on 030/FPU systems. Quote:
|
||
19 April 2010, 17:36 | #11 |
uber cool demi god
Join Date: Jun 2006
Location: Kent/England
Posts: 2,073
|
If you don't listen to Sting you'll only get stung!
|
19 April 2010, 19:17 | #12 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Well, he could have been using the FPU already in another part of the program. No need to call coders stupid, especially those coding advanced things are usually highly intelligent. And it makes sense to not rely on WinUAE timings. So.
But when you get bitten by the coding bug (again) I think you should get a real Amiga, then you can test things like this easily. btw, orbit=orbiter? |
19 April 2010, 19:52 | #13 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Dear Photon, please learn to read, thank you! I said using FPU registers for temporary storage is stupid and not that oRBIT is stupid!
|
19 April 2010, 20:08 | #14 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Yes, you're correct. But I also think there's no need to accuse someone of doing stupid things before you know the reason why. He had two good reasons why he even asked about it, and since the stack and FPU method were so close, speed-wise it was not obvious that one was faster than the other. What if, for example, the FPU register method had been the fastest by 1 scanline for the AGA-060 platform? Then he would have found a faster method which all AGA 060 coders could use, and as we all know, "if it's faster it's faster" , and this 'standard demo platform' has a built in FPU.
Whether it feels correct to do this, well, I agree. But if it had been slightly faster, then all coders would have used this new method (where applicable). So. |
19 April 2010, 20:24 | #15 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
|
|
19 April 2010, 21:35 | #16 |
The 1 who ribbits
|
heheheh
fight fight don`t think anyone got called stupid, idea may have been shot down in flames though with proof to back it up |
26 April 2010, 13:34 | #17 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
|
Quote:
You can use up to 17 Motorola registers, and if no longword values you can split 8 data registers via SWAP command, this is enough for almost all routines. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modifying blitter registers while it's running | mc6809e | Coders. Asm / Hardware | 8 | 30 June 2013 15:57 |
Need DA8000-DAFFFF registers documentation | BlueAchenar | Coders. General | 2 | 13 December 2008 15:39 |
Amiga Inc. registers new brands in Germany | viddi | Amiga scene | 7 | 27 February 2007 00:35 |
Gayle Hardware Registers | bluea | support.Hardware | 5 | 09 July 2006 17:07 |
blizzard 1230iv scsi no longer registers :( | Boot_WB | support.Hardware | 5 | 24 November 2004 02:26 |
|
|