aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/sh/fadd.s
blob: 72431f0f871d0b3512f27d2406be36b3d605de63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# sh testcase for fadd
# mach: sh
# as(sh):	-defsym sim_cpu=0

	.include "testutils.inc"

	start
fadd_freg_freg_b0:
	set_grs_a5a5
	set_fprs_a5a5
	bank0

	fldi1 fr0
	fldi1 fr1
	fadd fr0, fr1
	assert_fpreg_i 2 fr1

	fldi0 fr0
	fldi1 fr1
	fadd fr0, fr1
	assert_fpreg_i 1 fr1

	fldi1 fr0
	fldi0 fr1
	fadd fr0, fr1
	assert_fpreg_i 1 fr1
	test_grs_a5a5
	assert_fpreg_i 1 fr0
	test_fpr_a5a5  fr2
	test_fpr_a5a5  fr3
	test_fpr_a5a5  fr4
	test_fpr_a5a5  fr5
	test_fpr_a5a5  fr6
	test_fpr_a5a5  fr7
	test_fpr_a5a5  fr8
	test_fpr_a5a5  fr9
	test_fpr_a5a5  fr10
	test_fpr_a5a5  fr11
	test_fpr_a5a5  fr12
	test_fpr_a5a5  fr13
	test_fpr_a5a5  fr14
	test_fpr_a5a5  fr15

fadd_dreg_dreg_b0:
	set_grs_a5a5
	set_fprs_a5a5
	double_prec
	fldi1	fr0
	fldi1	fr2
	flds	fr0, fpul
	fcnvsd	fpul, dr0
	flds	fr2, fpul
	fcnvsd	fpul, dr2
	fadd dr0, dr2
	fcnvds	dr2, fpul
	fsts	fpul, fr0

	test_grs_a5a5
	assert_fpreg_i	2, fr0
	assert_dpreg_i	2, dr2
	test_fpr_a5a5	fr4
	test_fpr_a5a5	fr5
	test_fpr_a5a5	fr6
	test_fpr_a5a5	fr7
	test_fpr_a5a5	fr8
	test_fpr_a5a5	fr9
	test_fpr_a5a5	fr10
	test_fpr_a5a5	fr11
	test_fpr_a5a5	fr12
	test_fpr_a5a5	fr13
	test_fpr_a5a5	fr14
	test_fpr_a5a5	fr15

	pass
	exit 0