Dear OpenBLAS community,
We recently suffers from the Android default SoftFP link with hardfp OpenBLAS correctness issue while linking several libraries with OpenBLAS as #777 .
Within our team, we have successfully make the compiler and linker happy on Android by linking softfp library and hardfp OpenBLAS together with a inline assembly wrapper and a compiler wrapper. Meanwhile there is no correctness issue both in theory and by many existing tests.
I am wondering whether the upstream like such idea, and if yes, I'd like to find a way to contribute it back to OpenBLAS community.
The inline assembly wrapper is a simulator, which tries to prepare the hardfp OpenBLAS function call's register and stack parameter passing using embedd assembly when compiler compile the code with -mfloat-abi=softfp.
The reason of using inline assembly wrapper instead of direct softfp implementation are:
- The OpenBLAS of hardfp is written in assembly, implement a brand new softfp version requires lots of work (as @xianyi has already mentioned).
- Comparing to hardfp, softfp uses less register to pass the parameters, therefore even we implement the equivalent version of OpenBLAS in softfp, the performance will be a bit lower than hardfp.
- OpenBLAS does not depend on other libraries, therefore in theory there will be no correctness issue if we use softfp to call the interface while the OpenBLAS code is implemented as hardfp.
The compiler wrapper is basically used to get rid of the float-abi attribute in each object file within the libblas.a/libblas.so file, so that the linker does not complain the error uses VFP register arguments, output does not while link Android toolchain compiled object files with OpenBLAS on ARM.
Dear OpenBLAS community,
We recently suffers from the Android default SoftFP link with hardfp OpenBLAS correctness issue while linking several libraries with OpenBLAS as #777 .
Within our team, we have successfully make the compiler and linker happy on Android by linking softfp library and hardfp OpenBLAS together with a inline assembly wrapper and a compiler wrapper. Meanwhile there is no correctness issue both in theory and by many existing tests.
I am wondering whether the upstream like such idea, and if yes, I'd like to find a way to contribute it back to OpenBLAS community.
The inline assembly wrapper is a simulator, which tries to prepare the hardfp OpenBLAS function call's register and stack parameter passing using embedd assembly when compiler compile the code with
-mfloat-abi=softfp.The reason of using inline assembly wrapper instead of direct softfp implementation are:
The compiler wrapper is basically used to get rid of the float-abi attribute in each object file within the
libblas.a/libblas.sofile, so that the linker does not complain the erroruses VFP register arguments, output does notwhile link Android toolchain compiled object files with OpenBLAS on ARM.