Can C default to float? Are there float regs?

Web Dove dove at mit-bug.UUCP
Thu Sep 12 23:54:54 AEST 1985


Many people in our group find it frustrating that C converts floating
arithmetic to double.  Converting float variables to double, doing the
calculation and converting back to float is usually so costly that it
is faster to do it in double.  Unfortunately, this wastes space.
Also, our machines (vax 750/4.2bsd) would be faster if the
computations were done in straight float.  Many people resort to
fortran/assembler to accomplish this, but it is unfortunate to need to use
two languages.

I realize that this violates the standard for C, but has anyone ever
changed the compiler to accomplish this?

On a related note, it appears that register declarations for float variables 
have no effect on our compiler (they don't cause the variables to be stored
in registers).  It has been hypothesized that those who write the compiler
don't feel that making "register float" do something is worth the effort.

Is there anyone who has made "register float" work?  Is it impossible?



More information about the Comp.lang.c mailing list