diff options
author | David S. Miller <davem@davemloft.net> | 2017-06-05 21:28:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-05 21:30:33 +0300 |
commit | 1b4af13ff2cc6897557bb0b8d9e2fad4fa4d67aa (patch) | |
tree | 11914e45eb675ca6ede5e69e2a005d3485f03946 /arch/sparc/lib/multi3.S | |
parent | 0fde7ad71ee371ede73b3f326e58f9e8d102feb6 (diff) | |
download | linux-1b4af13ff2cc6897557bb0b8d9e2fad4fa4d67aa.tar.xz |
sparc64: Add __multi3 for gcc 7.x and later.
Reported-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/lib/multi3.S')
-rw-r--r-- | arch/sparc/lib/multi3.S | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/sparc/lib/multi3.S b/arch/sparc/lib/multi3.S new file mode 100644 index 000000000000..d6b6c97fe3c7 --- /dev/null +++ b/arch/sparc/lib/multi3.S @@ -0,0 +1,35 @@ +#include <linux/linkage.h> +#include <asm/export.h> + + .text + .align 4 +ENTRY(__multi3) /* %o0 = u, %o1 = v */ + mov %o1, %g1 + srl %o3, 0, %g4 + mulx %g4, %g1, %o1 + srlx %g1, 0x20, %g3 + mulx %g3, %g4, %g5 + sllx %g5, 0x20, %o5 + srl %g1, 0, %g4 + sub %o1, %o5, %o5 + srlx %o5, 0x20, %o5 + addcc %g5, %o5, %g5 + srlx %o3, 0x20, %o5 + mulx %g4, %o5, %g4 + mulx %g3, %o5, %o5 + sethi %hi(0x80000000), %g3 + addcc %g5, %g4, %g5 + srlx %g5, 0x20, %g5 + add %g3, %g3, %g3 + movcc %xcc, %g0, %g3 + addcc %o5, %g5, %o5 + sllx %g4, 0x20, %g4 + add %o1, %g4, %o1 + add %o5, %g3, %g2 + mulx %g1, %o2, %g1 + add %g1, %g2, %g1 + mulx %o0, %o3, %o0 + retl + add %g1, %o0, %o0 +ENDPROC(__multi3) +EXPORT_SYMBOL(__multi3) |