aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/aarch64/fcmp.s
blob: fd826c4873d2e18eaee0eb0888977fe6cf84c950 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# mach: aarch64

# Check the FP compare instructions: fcmps, fcmpzs, fcmpes, fcmpzes, fcmpd,
# fcmpzd, fcmped, fcmpzed.
# For 1 operand compares, check 0, 1, -1, +Inf, -Inf.
# For 2 operand compares, check 1/1, 1/-2, -1/2, +Inf/+Inf, +Inf/-Inf.
# FIXME: Check for qNaN and sNaN when exception raising support added.

.include "testutils.inc"

	start
	fmov s0, wzr
	fcmp s0, #0.0
	bne .Lfailure
	fcmpe s0, #0.0
	bne .Lfailure
	fmov d0, xzr
	fcmp d0, #0.0
	bne .Lfailure
	fcmpe d0, #0.0
	bne .Lfailure

	fmov s0, #1.0
	fcmp s0, #0.0
	blo .Lfailure
	fcmpe s0, #0.0
	blo .Lfailure
	fmov d0, #1.0
	fcmp d0, #0.0
	blo .Lfailure
	fcmpe d0, #0.0
	blo .Lfailure

	fmov s0, #-1.0
	fcmp s0, #0.0
	bpl .Lfailure
	fcmpe s0, #0.0
	bpl .Lfailure
	fmov d0, #-1.0
	fcmp d0, #0.0
	bpl .Lfailure
	fcmpe d0, #0.0
	bpl .Lfailure

	fmov s0, #1.0
	fmov s1, wzr
	fdiv s0, s0, s1
	fcmp s0, #0.0
	blo .Lfailure
	fcmpe s0, #0.0
	blo .Lfailure
	fmov d0, #1.0
	fmov d1, xzr
	fdiv d0, d0, d1
	fcmp d0, #0.0
	blo .Lfailure
	fcmpe d0, #0.0
	blo .Lfailure

	fmov s0, #-1.0
	fmov s1, wzr
	fdiv s0, s0, s1
	fcmp s0, #0.0
	bpl .Lfailure
	fcmpe s0, #0.0
	bpl .Lfailure
	fmov d0, #-1.0
	fmov d1, xzr
	fdiv d0, d0, d1
	fcmp d0, #0.0
	bpl .Lfailure
	fcmpe d0, #0.0
	bpl .Lfailure

	fmov s0, #1.0
	fmov s1, #1.0
	fcmp s0, s1
	bne .Lfailure
	fcmpe s0, s1
	bne .Lfailure
	fmov d0, #1.0
	fmov d1, #1.0
	fcmp d0, d1
	bne .Lfailure
	fcmpe d0, d1
	bne .Lfailure

	fmov s0, #1.0
	fmov s1, #-2.0
	fcmp s0, s1
	blo .Lfailure
	fcmpe s0, s1
	blo .Lfailure
	fmov d0, #1.0
	fmov d1, #-2.0
	fcmp d0, d1
	blo .Lfailure
	fcmpe d0, d1
	blo .Lfailure

	fmov s0, #-1.0
	fmov s1, #2.0
	fcmp s0, s1
	bpl .Lfailure
	fcmpe s0, s1
	bpl .Lfailure
	fmov d0, #-1.0
	fmov d1, #2.0
	fcmp d0, d1
	bpl .Lfailure
	fcmpe d0, d1
	bpl .Lfailure

	fmov s0, #1.0
	fmov s1, wzr
	fdiv s0, s0, s1
	fcmp s0, s0
	bne .Lfailure
	fcmpe s0, s0
	bne .Lfailure
	fmov s1, #-1.0
	fmov s2, wzr
	fdiv s1, s1, s2
	fcmp s0, s1
	blo .Lfailure
	fcmpe s0, s1
	blo .Lfailure

	fmov d0, #1.0
	fmov d1, xzr
	fdiv d0, d0, d1
	fcmp d0, d0
	bne .Lfailure
	fcmpe d0, d0
	bne .Lfailure
	fmov d1, #-1.0
	fmov d2, xzr
	fdiv d1, d1, d2
	fcmp d0, d1
	blo .Lfailure
	fcmpe d0, d1
	blo .Lfailure

	pass
.Lfailure:
	fail