plan9fox/sys/src/ape/lib/ap/spim/vlop.s
2015-10-04 19:50:24 +02:00

20 lines
423 B
ArmAsm

/*
* from https://bitbucket.org/cherry9/plan9-loongson
*/
TEXT _mulv(SB), $0
MOVW 8(FP), R2 /* hi1 */
MOVW 4(FP), R3 /* lo1 */
MOVW 16(FP), R4 /* hi2 */
MOVW 12(FP), R5 /* lo2 */
MULU R5, R3 /* lo1*lo2 -> hi:lo*/
MOVW LO, R6
MOVW HI, R7
MULU R3, R4 /* lo1*hi2 -> _:hi */
MOVW LO, R8
ADDU R8, R7
MULU R2, R5 /* hi1*lo2 -> _:hi */
MOVW LO, R8
ADDU R8, R7
MOVW R6, 0(R1) /* lo */
MOVW R7, 4(R1) /* hi */
RET