This patch adds mips16 wrappers for floating-point arithmetic, comparison and type-conversion operations.
Background: mips16 code is not aware of floating point registers and call-conventions. For platforms equipped with hardware floating point, mips16 code resorts to calling an appropriate libgcc function with the float arguments in general purpose registers. The low-level function copies the arguments to FP registers, performs the operation and returns the result to the caller in a GP register.
Operations provided in this patch are:
Arithmetic(single & double precision): add, sub, mul, div
Comparison(single & double precision): eq, ne, gt, ge, lt, le, unord
Type conversions:
- To signed integer: fix_truncXfsi
- To float: floatunsiXf, floatsiXf
- Within float formats: truncdfsf, extendsfdf
Patch for unit tests is: http://reviews.llvm.org/D4453
Shouldn't gtdf2 and gedf2 be the same function and return -2, -1, 0, or 1 for unordered, less-than, equal, or greater-than respectively (like glibc's soft float does)?
Similarly for ltdf2/ledf2 and the single precision equivalents.