Forum Discussion
Altera_Forum
Honored Contributor
15 years agoTake a look at this one, it's really old but should still be applicable:
http://www.alterawiki.com/wiki/custom_floating_point_unit Assuming you supplied all the logical operators then I don't think you are seeing things like A > B optimized into B < A. However are you sure you are actually performing a single precision floating point comparison? For example if you did something like this I would expect it to turn into a double precision compare: if (my_float < 2.3) // 2.3 by default is double precision unless you use 2.3f or pass in a compiler flag to treat all constants as single precision values. If you post the flags you are passing to the compiler and the code you are seeing issues with (C and the objdump that accompanies it) we might have more pointers. Also if you are using gcc4 try the same compilation using gcc3. It could be a bug with the gcc4 port.