Hi all,
I am after a instruction set with limited or no floating-point instructions. Why I want this is to get a compiler of this certain architecture and compile code (one with floating-point and the other without). With the resulting assembly I wanted to compare the two and do some analysis.

So what I need exactly is a compiler with access to compiling with/without floating-point.

Any help is welcome, thanks in advance.

Not sure what you mean. Either a processor has a built in capability to do floating point calculations (as all Intel processors nowadays have), or it hasn't. If it does have that capability, it would take a fairly eccentric compiler writer not to take advantage of it. On the other hand, if the processor does not have that capability there is, by definition, no possibility of a compiler producing code which contains floating point (machine code) instructions.

Possibly you are thinking of a situation which existed many years ago. In those days Intel processors did not have a built in floating point unit, but there was a seperate maths co-processor which was sometimes to be found on the mother board, and sometimes not. In those days compilers had to take account of both possibilities. But today the situation is different, and a floating point capability is always to be found in the processor.

I'm not actually after a processor for this. All I need is a compiler to emulate a situation with/without an extensive floating-point instruction set.

That's what I'm saying. Given that all processors do nowadays have an extensive floating point instruction set you are unlikely to find a compiler which makes life difficult (and slow) for itself by doing in software what is far better done in hardware.

If you were a compiler writer would you be able to see any point in not using the available capabilities of the hardware? What would be the point of having a software implementation even available as an option?

Almost all early DOS C compilers can generate hard 87 stuff or emulated 87'. Most assemblers can do it too.

Hi all,
I am after a instruction set with limited or no floating-point instructions. Why I want this is to get a compiler of this certain architecture and compile code (one with floating-point and the other without). With the resulting assembly I wanted to compare the two and do some analysis.

So what I need exactly is a compiler with access to compiling with/without floating-point.

Any help is welcome, thanks in advance.

The old compilers for 16-bit DOS and 16-bit Windows (that would be Windows versions 3.0, 3.1, and 3.11, etc.) provided such functionality. You can still download compilers like that. Two that I know of:

GFA BASIC

http://en.wikipedia.org/wiki/GFA_BASIC

Digital Mars C/C++

http://www.digitalmars.com/

Nathan.

Back in DOS days the FPU was software emulated by an interrupt which a modern processor should never interrupt to. In otherwords you'll need the CPU to trigger that interrupt, a ancient system that does not have a FPU which is pretty rare to have..

It did or may even still have a interrupt number reserved for this purpose, however my other point is if your going to emulate this case, modern operating systems won't allow you to install ISR's which sturs up a problem, unless your satisfied on doing this in DOS.

modern operating systems won't allow you to install ISR's

You can hook the NPX exception on almost anything. Its not anything that requires ring 0 interactions within an OS.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.