Search
lxdream.org :: lxdream/test/sh4/ftrc.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/ftrc.s
changeset 358:65043a8f5785
prev357:3592a10b3242
next393:5e5335b61373
author nkeynes
date Thu Aug 23 12:31:31 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Add tests for mac.l and mac.w
Start test cases for fmov
Update exception tests
file annotate diff log raw
nkeynes@357
     1
	.section .text
nkeynes@357
     2
.include "sh4/inc.s"
nkeynes@357
     3
!
nkeynes@357
     4
! Test ftrc
nkeynes@357
     5
nkeynes@357
     6
.global _test_ftrc
nkeynes@357
     7
_test_ftrc:	
nkeynes@357
     8
	start_test
nkeynes@357
     9
nkeynes@357
    10
	xor r0,r0
nkeynes@357
    11
	lds r0, fpscr
nkeynes@357
    12
	
nkeynes@357
    13
test_ftrc_1:  ! Load 1.0 single precision
nkeynes@357
    14
	add #1, r12
nkeynes@357
    15
	mov.l test_ftrc_1_input, r0
nkeynes@357
    16
	lds r0, fpul
nkeynes@357
    17
	fsts fpul, fr0
nkeynes@357
    18
	ftrc fr0, fpul
nkeynes@357
    19
	sts fpul, r0
nkeynes@357
    20
	mov.l test_ftrc_1_result, r1
nkeynes@357
    21
	cmp/eq r0,r1
nkeynes@357
    22
	bt test_ftrc_2
nkeynes@357
    23
test_ftrc_1_fail:	
nkeynes@357
    24
	fail test_ftrc_str_k
nkeynes@357
    25
	bra test_ftrc_2
nkeynes@357
    26
	nop
nkeynes@357
    27
nkeynes@357
    28
.align 4
nkeynes@357
    29
test_ftrc_1_input:
nkeynes@357
    30
	.long 0x3F800000
nkeynes@357
    31
test_ftrc_1_result:
nkeynes@357
    32
	.long 0x00000001
nkeynes@357
    33
nkeynes@357
    34
test_ftrc_2:	! Load -1.0 double precision
nkeynes@357
    35
	add #1, r12
nkeynes@357
    36
	setpr
nkeynes@357
    37
	mov.l test_ftrc_2_input_a, r0
nkeynes@357
    38
	lds r0, fpul
nkeynes@357
    39
	fsts fpul, fr0
nkeynes@357
    40
	mov.l test_ftrc_2_input_b, r0
nkeynes@357
    41
	lds r0, fpul
nkeynes@357
    42
	fsts fpul, fr1
nkeynes@357
    43
	ftrc fr0, fpul
nkeynes@357
    44
	sts fpul, r0
nkeynes@357
    45
	mov.l test_ftrc_2_result, r1
nkeynes@357
    46
	cmp/eq r0,r1
nkeynes@357
    47
	bt test_ftrc_3
nkeynes@357
    48
test_ftrc_2_fail:	
nkeynes@357
    49
	fail test_ftrc_str_k
nkeynes@357
    50
	bra test_ftrc_3
nkeynes@357
    51
	nop
nkeynes@357
    52
nkeynes@357
    53
test_ftrc_2_input_a:
nkeynes@357
    54
	.long 0xBFF00000
nkeynes@357
    55
test_ftrc_2_input_b:
nkeynes@357
    56
	.long 0x00000000
nkeynes@357
    57
test_ftrc_2_result:
nkeynes@357
    58
	.long 0xFFFFFFFF
nkeynes@357
    59
nkeynes@357
    60
test_ftrc_3:   ! pr=0, sz=1
nkeynes@357
    61
	add #1, r12
nkeynes@357
    62
	clrpr
nkeynes@357
    63
	mov.l test_ftrc_3_input, r0
nkeynes@357
    64
	lds r0, fpul
nkeynes@357
    65
	fsts fpul, fr0
nkeynes@357
    66
	fschg
nkeynes@357
    67
	ftrc fr0, fpul
nkeynes@357
    68
	sts fpul, r0
nkeynes@357
    69
	mov.l test_ftrc_3_result, r1
nkeynes@357
    70
	cmp/eq r0, r1
nkeynes@357
    71
	bt test_ftrc_4
nkeynes@357
    72
test_ftrc_3_fail:	
nkeynes@357
    73
	fail test_ftrc_str_k
nkeynes@357
    74
	bra test_ftrc_4
nkeynes@357
    75
	nop
nkeynes@357
    76
	
nkeynes@357
    77
test_ftrc_3_input:
nkeynes@357
    78
	.long 0xCE4CCCCD
nkeynes@357
    79
test_ftrc_3_result:
nkeynes@357
    80
	.long 0xCCCCCCC0
nkeynes@357
    81
nkeynes@357
    82
test_ftrc_4:	! pr=1, sz=1
nkeynes@357
    83
	add #1, r12
nkeynes@357
    84
	fldi0 fr0
nkeynes@357
    85
	fldi1 fr1
nkeynes@357
    86
	setpr
nkeynes@357
    87
	mov.l test_ftrc_4_input_a, r0
nkeynes@357
    88
	lds r0, fpul
nkeynes@357
    89
	fsts fpul, fr0
nkeynes@357
    90
	mov.l test_ftrc_4_input_b, r0
nkeynes@357
    91
	lds r0, fpul
nkeynes@357
    92
	fsts fpul, fr1
nkeynes@357
    93
	ftrc fr0, fpul
nkeynes@357
    94
	sts fpul, r0
nkeynes@357
    95
	mov.l test_ftrc_4_result, r1
nkeynes@357
    96
	cmp/eq r0,r1
nkeynes@357
    97
	bt test_ftrc_5
nkeynes@357
    98
test_ftrc_4_fail:	
nkeynes@357
    99
	fail test_ftrc_str_k
nkeynes@357
   100
	bra test_ftrc_5
nkeynes@357
   101
	nop
nkeynes@357
   102
nkeynes@357
   103
test_ftrc_4_input_a:
nkeynes@358
   104
	.long 0x40FFFF11
nkeynes@357
   105
test_ftrc_4_input_b:
nkeynes@358
   106
	.long 0x11111111
nkeynes@357
   107
test_ftrc_4_result:
nkeynes@358
   108
	.long 0x0001FFF1
nkeynes@357
   109
nkeynes@357
   110
nkeynes@357
   111
test_ftrc_5:	! test w/ max +int, sz=0, pr=0, fr=1
nkeynes@357
   112
	add #1, r12
nkeynes@357
   113
	xor r0,r0
nkeynes@357
   114
	lds r0, fpscr
nkeynes@357
   115
	fldi0 fr0
nkeynes@357
   116
	fldi0 fr1
nkeynes@357
   117
	frchg
nkeynes@357
   118
	fldi0 fr0
nkeynes@357
   119
	fldi0 fr1
nkeynes@357
   120
	mov.l test_ftrc_5_input, r0
nkeynes@357
   121
	lds r0, fpul
nkeynes@357
   122
	fsts fpul, fr0
nkeynes@357
   123
	ftrc fr0, fpul
nkeynes@357
   124
	sts fpul, r0
nkeynes@357
   125
	mov.l test_ftrc_5_result, r1
nkeynes@357
   126
	cmp/eq r0, r1
nkeynes@357
   127
	bf test_ftrc_5_fail
nkeynes@357
   128
	flds fr1, fpul
nkeynes@357
   129
	sts fpul, r0
nkeynes@357
   130
	tst r0, r0
nkeynes@357
   131
	bf test_ftrc_5_fail
nkeynes@357
   132
	lds r0, fpscr
nkeynes@357
   133
	flds fr0, fpul
nkeynes@357
   134
	sts fpul, r0
nkeynes@357
   135
	tst r0, r0
nkeynes@357
   136
	bt test_ftrc_6
nkeynes@357
   137
test_ftrc_5_fail:
nkeynes@357
   138
	fail test_ftrc_str_k
nkeynes@357
   139
	bra test_ftrc_6
nkeynes@357
   140
	nop
nkeynes@357
   141
	
nkeynes@357
   142
test_ftrc_5_input:
nkeynes@357
   143
	.long 0x4F000000
nkeynes@357
   144
test_ftrc_5_result:
nkeynes@357
   145
	.long 0x7FFFFFFF
nkeynes@357
   146
nkeynes@357
   147
test_ftrc_6: ! Test max -int
nkeynes@357
   148
	add #1, r12
nkeynes@357
   149
	mov.l test_ftrc_6_input, r0
nkeynes@357
   150
	lds r0, fpul
nkeynes@357
   151
	fsts fpul, fr5
nkeynes@357
   152
	ftrc fr5, fpul
nkeynes@357
   153
	sts fpul, r2
nkeynes@357
   154
	mov.l test_ftrc_6_result, r1
nkeynes@357
   155
	cmp/eq r1, r2
nkeynes@357
   156
	bt test_ftrc_7
nkeynes@357
   157
nkeynes@357
   158
test_ftrc_6_fail:
nkeynes@357
   159
	fail test_ftrc_str_k
nkeynes@357
   160
	bra test_ftrc_7
nkeynes@357
   161
	nop
nkeynes@357
   162
	
nkeynes@357
   163
test_ftrc_6_input:
nkeynes@357
   164
	.long 0xCF000000
nkeynes@357
   165
test_ftrc_6_result:
nkeynes@357
   166
	.long 0x80000000
nkeynes@357
   167
nkeynes@357
   168
test_ftrc_7:	! Test >max +int
nkeynes@357
   169
	add #1, r12
nkeynes@357
   170
	mov.l test_ftrc_7_input, r0
nkeynes@357
   171
	lds r0, fpul
nkeynes@357
   172
	fsts fpul, fr7
nkeynes@357
   173
	ftrc fr7, fpul
nkeynes@357
   174
	sts fpul, r2
nkeynes@357
   175
	mov.l test_ftrc_7_result, r1
nkeynes@357
   176
	cmp/eq r1, r2
nkeynes@357
   177
	bt test_ftrc_8
nkeynes@357
   178
test_ftrc_7_fail:
nkeynes@357
   179
	fail test_ftrc_str_k
nkeynes@358
   180
	bra test_ftrc_8
nkeynes@357
   181
	nop
nkeynes@357
   182
	
nkeynes@357
   183
test_ftrc_7_input:
nkeynes@357
   184
	.long 0x7E111111
nkeynes@357
   185
test_ftrc_7_result:
nkeynes@357
   186
	.long 0x7FFFFFFF
nkeynes@357
   187
nkeynes@357
   188
test_ftrc_8: ! test < min -int
nkeynes@357
   189
	add #1, r12
nkeynes@357
   190
	mov.l test_ftrc_8_input, r0
nkeynes@357
   191
	lds r0, fpul
nkeynes@357
   192
	fsts fpul, fr9
nkeynes@357
   193
	ftrc fr9, fpul
nkeynes@357
   194
	sts fpul, r2
nkeynes@357
   195
	mov.l test_ftrc_8_result, r1
nkeynes@357
   196
	cmp/eq r1, r2
nkeynes@358
   197
	bt test_ftrc_9
nkeynes@357
   198
test_ftrc_8_fail:
nkeynes@357
   199
	fail test_ftrc_str_k
nkeynes@358
   200
	bra test_ftrc_9
nkeynes@357
   201
	nop
nkeynes@357
   202
	
nkeynes@357
   203
test_ftrc_8_input:
nkeynes@357
   204
	.long 0xFE111111
nkeynes@357
   205
test_ftrc_8_result:
nkeynes@357
   206
	.long 0x80000000
nkeynes@357
   207
nkeynes@358
   208
test_ftrc_9:	! Test >max +int pr=1
nkeynes@358
   209
	add #1, r12
nkeynes@358
   210
	setpr
nkeynes@358
   211
	mov.l test_ftrc_9_input_a, r0
nkeynes@358
   212
	lds r0, fpul
nkeynes@358
   213
	fsts fpul, fr6
nkeynes@358
   214
	mov.l test_ftrc_9_input_b, r0
nkeynes@358
   215
	lds r0, fpul
nkeynes@358
   216
	fsts fpul, fr7
nkeynes@358
   217
	ftrc fr6, fpul
nkeynes@358
   218
	sts fpul, r2
nkeynes@358
   219
	mov.l test_ftrc_9_result, r1
nkeynes@358
   220
	cmp/eq r1, r2
nkeynes@358
   221
	bt test_ftrc_10
nkeynes@358
   222
test_ftrc_9_fail:
nkeynes@358
   223
	fail test_ftrc_str_k
nkeynes@358
   224
	bra test_ftrc_10
nkeynes@358
   225
	nop
nkeynes@357
   226
	
nkeynes@358
   227
test_ftrc_9_input_a:
nkeynes@358
   228
	.long 0x41DFFFFF
nkeynes@358
   229
test_ftrc_9_input_b:
nkeynes@358
   230
	.long 0xFFC00000
nkeynes@358
   231
test_ftrc_9_result:
nkeynes@358
   232
	.long 0x7FFFFFFF
nkeynes@358
   233
nkeynes@358
   234
test_ftrc_10: ! test < min -int
nkeynes@358
   235
	add #1, r12
nkeynes@358
   236
	mov.l test_ftrc_10_input_a, r0
nkeynes@358
   237
	lds r0, fpul
nkeynes@358
   238
	fsts fpul, fr8
nkeynes@358
   239
	mov.l test_ftrc_10_input_b, r0
nkeynes@358
   240
	lds r0, fpul
nkeynes@358
   241
	fsts fpul, fr9
nkeynes@358
   242
	ftrc fr8, fpul
nkeynes@358
   243
	sts fpul, r2
nkeynes@358
   244
	mov.l test_ftrc_10_result, r1
nkeynes@358
   245
	cmp/eq r1, r2
nkeynes@358
   246
	bt test_ftrc_11
nkeynes@358
   247
test_ftrc_10_fail:
nkeynes@358
   248
	fail test_ftrc_str_k
nkeynes@358
   249
	bra test_ftrc_11
nkeynes@358
   250
	nop
nkeynes@358
   251
	
nkeynes@358
   252
test_ftrc_10_input_a:
nkeynes@358
   253
	.long 0xFE111111
nkeynes@358
   254
test_ftrc_10_input_b:
nkeynes@358
   255
	.long 0x11111111
nkeynes@358
   256
test_ftrc_10_result:
nkeynes@358
   257
	.long 0x80000000
nkeynes@358
   258
nkeynes@358
   259
test_ftrc_11: ! test undefined instruction, pr=1
nkeynes@358
   260
	add #1, r12
nkeynes@358
   261
	mov.l test_ftrc_11_input_a, r0
nkeynes@358
   262
	lds r0, fpul
nkeynes@358
   263
	fsts fpul, fr0
nkeynes@358
   264
	mov.l test_ftrc_11_input_b, r1
nkeynes@358
   265
	lds r1, fpul
nkeynes@358
   266
	fsts fpul, fr1
nkeynes@358
   267
	mov.l test_ftrc_11_input_c, r0
nkeynes@358
   268
	lds r0, fpul
nkeynes@358
   269
	fsts fpul, fr2
nkeynes@358
   270
	xor r0, r0
nkeynes@358
   271
	not r0, r0
nkeynes@358
   272
	lds r0, fpul
nkeynes@358
   273
	ftrc fr1, fpul 
nkeynes@358
   274
	sts fpul, r1
nkeynes@358
   275
	mov.l test_ftrc_11_result, r2
nkeynes@358
   276
	cmp/eq r1, r2
nkeynes@358
   277
	bt test_ftrc_end
nkeynes@358
   278
test_ftrc_11_fail:
nkeynes@358
   279
	fail test_ftrc_str_k
nkeynes@358
   280
	bra test_ftrc_end
nkeynes@358
   281
	nop
nkeynes@358
   282
test_ftrc_11_input_a:
nkeynes@358
   283
	.long 0x40FFFF11
nkeynes@358
   284
test_ftrc_11_input_b:
nkeynes@358
   285
	.long 0x11111111
nkeynes@358
   286
test_ftrc_11_input_c:
nkeynes@358
   287
	.long 0x42FFFF11
nkeynes@358
   288
test_ftrc_11_result:
nkeynes@358
   289
	.long 0x00000000
nkeynes@358
   290
nkeynes@357
   291
test_ftrc_end:
nkeynes@357
   292
	end_test test_ftrc_str_k
nkeynes@357
   293
	
nkeynes@357
   294
test_ftrc_str:
nkeynes@357
   295
	.string "FTRC"
nkeynes@357
   296
	
nkeynes@357
   297
.align 4
nkeynes@357
   298
test_ftrc_str_k:
nkeynes@357
   299
	.long test_ftrc_str
.