![]() |
|
#1
|
|||
|
|||
Ignoring FPU interrupts from the processorHi
I am working on a C++ program that generates random machinecode instructions that is stored in an byte-array and then directly executed. The instructions are all FPU-instructions (Floating Point Unit), for example, fadd, fsub, fmul, etc. When the instructions have been executed I read the top value from the FPU-stack, this is my "output". The problem is that since the instructions are created randomly they often result in illegal values, overflow, NANs, etc. I have masked all the exeptions in the FPU control word but these instructions still take a _very_ long time to handle. So what I'm asking is if there is a way to tell the processor that it should completely ignore any illegal values in the FPU and just continue with the execution? /Gustav |
|||
|
#2
|
|||
|
|||
Re: Ignoring FPU interrupts from the processorQuote:
So: You are searching for a computer language and a CPU that implements a "Branch on Bug" instruction. Mathematicians, Computer Scientists, and Engineers have been searching for that ever since Eniac. "My Life with the ENIAC - a Worm's Eye View". Maybe farther back than that. (I didn't check for specifics on Babbage's Analytical Engine or Blaise Pascal's Arithmetic Machine.) Lacking any computer language construct that prevents you from even trying to execute an illegal instruction, you could include an analysis function in your program that looks at each op code and its arguments and tests whether it is going to try to divide by zero, for example. The function that I am referring to is sometimes called an "instruction set simulator". Maybe you can find something about such programs and decide whether to implement one in your program. Or, maybe one exists for modern floating-point processors (more recent than the 8087) and is available for your use; I haven't looked recently.) Regards, Dave Footnote: Looking at the mythical "Branch on bug" instruction somehow made me think of Microsoft's "Bob" product of a few years ago. Microsoft Bob --- "widely considered one of Microsoft's least successful products". Coincidence??? Or did Bob just go nuts looking at all of the bugs so that he never had time to do anything that really helped the user? |
|
#3
|
||||
|
||||
Re: Ignoring FPU interrupts from the processorQuote:
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#4
|
|||
|
|||
Re: Ignoring FPU interrupts from the processorQuote:
Unfortunately I can't have any functions that checks for illegal output before I get them since it is very important that my program is as fast as possible. And I will never get any illegal instructions in the FPU, because I choose the instructions from a list of valid FPU instructions, but the result of the functions can be illegal. I'm guessing that each illegal value causes some kind of interrupt that takes a long time to handle, and it is those interrupts that I would like to block in some way Regards Gustav |
|
#5
|
|||
|
|||
Re: Ignoring FPU interrupts from the processorQuote:
My intent was to indicate illegal operations (divide by zero, overflow, etc.), not just illegal instructions. Since you indicated that you already know how to mask the interrupts from the FPU and the results are still unsatisfactory (long delay handling the "bad boy" instructions), I assumed that a solution would be to somehow trap illegal operations and not call the FPU in the first place. Since I wasn't able to come up with anything useful, I am hopeful that someone else browsing through the thread might have suggestions. Regards, Dave |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Payment Processor | News Guru | eCommerce / Merchant Account Forum | 8 | 27-Feb-2007 03:43 |
| Processor Overclocking query... | sirantonycartwr | Computer Hardware Forum | 5 | 08-Nov-2005 20:27 |
| VC++ .NET Windows and interrupts / watchdogs question. | bmwrob | MS Visual C++ / MFC Forum | 0 | 30-Jun-2004 21:06 |
| Which processor? | Mick | Computer Hardware Forum | 19 | 23-Mar-2004 20:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The