# sh testcase for mulu.l $rm, $rn, $rd -*- Asm -*-
# mach: all
# as: -isa=shmedia
# ld: -m shelf64

	.include "media/testutils.inc"

	start

	.global mulul
init:
	pta wrong, tr0
	
mulul1:
	movi 0, r0
	mulu.l r0, r0, r1
	bnei r1, 0, tr0

mulul2:
	movi 0, r0
	movi 1, r1
	mulu.l r0, r1, r2
	bnei r2, 0, tr0

mulul3:
	movi 1, r0
	movi 0, r1
	mulu.l r0, r1, r2
	bnei r2, 0, tr0

mulul4:
	movi 1, r0
	movi 1, r1
	mulu.l r0, r1, r2
	bnei r2, 1, tr0

mulul5:
	movi 2, r0
	movi 9, r1
	mulu.l r0, r1, r2
	bnei r2, 18, tr0

mulul6:
	movi 2, r0
	movi -9, r1
	mulu.l r0, r1, r2
	beqi r2, -18, tr0

okay:
	pass

wrong:
	fail
	
