# sh testcase for fipr.s $fvg, $fvh, $frf -*- Asm -*-
# mach: all
# as: -isa=shmedia
# ld: -m shelf64

	.include "media/testutils.inc"

	.macro _load val, fpreg
	# This macro clobbers r0.
	movi \val, r0
	fmov.ls r0, \fpreg 
	float.ls \fpreg, \fpreg
	.endm

	start

	.global fiprs
init:
	pta wrong, tr0

	_load 1, fr0
	_load 2, fr1
	_load 3, fr2
	_load 4, fr3
	_load 1, fr4
	_load 2, fr5
	_load 3, fr6
	_load 4, fr7

fiprs:
	fipr.s fv0, fv4, fr9

check:
	_load 30, fr10
	fcmpeq.s fr9, fr10, r7
	bnei r7, 1, tr0

okay:
	pass

wrong:
	fail
