Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
155 user(s) are online (133 user(s) are browsing Forums)

Members: 0
Guests: 155

more...

Support us!

Headlines

 
  Register To Post  

A1222 FPU thoughts
Just popping in
Just popping in


See User information
I've been thinking about how the floating point could be handled on the P1022.

One thing I don't believe was discussed is a dynamic patching of the ELF binaries at load time. I've done a bit of reading online on ELF - there are a lot of cool ideas out there for patching binaries. But please I'm no expert.

First thought is simply patching the incompatible calls to instead jump into a compatibility library/shared object, or even some extra compatibility code patched directly into the memory space of the program at run time. This could be done each time the binary is loaded.

Second thought is patching and saving the patched version either into the EXE (fat binary) or into a side file. However it may not be worth the effort if the load-time patching is fast enough. I expect this to be true.

I expect patching of the binaries would perform better than working with the trap instructions. The ELF modules already go though a relocation phase - how hard could patching be on top of that?? <evil grin>

Thoughts?

Go to top
Re: A1222 FPU thoughts
Amigans Defender
Amigans Defender


See User information
@gregthecanuck

Since the math Library is doing the floating point math, there is no point in patching any program.

Te audire no possum. Musa sapientum fixa est in aure.
Ad eundum quo nemo ante iit.
Go to top
Re: A1222 FPU thoughts
Home away from home
Home away from home


See User information
@gregthecanuck

I have no looked at data-sheet for that CPU, on what instructions are missing and what is not.
It really depends on how many are missing and if they are normally used by the compiler or not.

FPU instructions, are compiled into ELF binary, there are no JMP's to patch, unless there is special math function that are in library, in that case there are two possibility, the math function was linked into the ELF file, when program was compiled, or is liked at run time .so files. Or the it uses a .library file.

So there is a MIX of things,
1. FPU instructions in the program.
2. FPU instructions included in .a files that was linked in, as part of the program.
3. FPU instructions that are liked in at runtime .so files.
4. FPU instructions in external .library files. (no linking)

You accidentally have to dis-compile the binary, replace FPU instructions and then recompile the binary.

Every time you emulate a instruction its not like replace-ing one instruction with another, normally need to replace one instruction with 4 or more instructions, this means that code size will change, all relative offsets will be wrong, has be corrected fore.

And naturally no matter what you do, always have to do 4 or more for 1, so it will be slower.

If you wont speed you need to recompile the programs for that specific CPU target.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: A1222 FPU thoughts
Home away from home
Home away from home


See User information
@SLayeRDK

Where did you get that idea from, have you tried to dis-compile a program to see what instructions it contains?

Just make tiny test program, that uses double or float, that does some multiplication or divisions.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: A1222 FPU thoughts
Home away from home
Home away from home


See User information
@SLayeRDK
Quote:
Since the math Library is doing the floating point math, there is no point in patching any program.

Not any more. PowerPC programs use the FPU directly.

@LiveForIt
Quote:
I have no looked at data-sheet for that CPU, on what instructions are missing and what is not.
It really depends on how many are missing and if they are normally used by the compiler or not.

The P1022 CPU doesn't have a standard PowerPC FPU, so all FPU instructions are missing. Instead, it has its own floating point instructions in a signal-processing engine which are incompatible with the standard FPU.

@gregthecanuck
I personally think that dynamically patching binaries on loading is an interesting idea. If done well (and the P1022's signal processing engine is good enough), it should be faster than emulating the instructions in an exception trap/handler. Having said that, I'm certainly not an expert in this area.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project