Search
lxdream.org :: lxdream/test/sh4/fmov.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/fmov.s
changeset 358:65043a8f5785
next732:f05753bbe723
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@358
     1
.section .text
nkeynes@358
     2
.include "sh4/inc.s"
nkeynes@358
     3
!
nkeynes@358
     4
! Test fmov (all variants)
nkeynes@358
     5
! (not arithmetic)
nkeynes@358
     6
nkeynes@358
     7
.global _test_fmov
nkeynes@358
     8
_test_fmov:	
nkeynes@358
     9
	start_test
nkeynes@358
    10
nkeynes@358
    11
	xor r0,r0
nkeynes@358
    12
	lds r0, fpscr
nkeynes@358
    13
	
nkeynes@358
    14
test_fmov_1:  ! single precision reg-to-reg
nkeynes@358
    15
	add #1, r12
nkeynes@358
    16
nkeynes@358
    17
	fldi0 fr0
nkeynes@358
    18
	fldi1 fr1
nkeynes@358
    19
	flds fr0, fpul
nkeynes@358
    20
	sts fpul, r0
nkeynes@358
    21
	tst r0, r0
nkeynes@358
    22
	bf test_fmov_1_fail
nkeynes@358
    23
	fmov fr1, fr0
nkeynes@358
    24
	flds fr0, fpul
nkeynes@358
    25
	sts fpul, r0
nkeynes@358
    26
	mov.l test_fmov_1_result, r1
nkeynes@358
    27
	cmp/eq r0, r1
nkeynes@358
    28
	bt test_fmov_2
nkeynes@358
    29
test_fmov_1_fail:
nkeynes@358
    30
	fail test_fmov_str_k
nkeynes@358
    31
	bra test_fmov_2
nkeynes@358
    32
	nop
nkeynes@358
    33
nkeynes@358
    34
test_fmov_1_result:
nkeynes@358
    35
	.long 0x3F800000
nkeynes@358
    36
nkeynes@358
    37
test_fmov_2:	! reg-to-reg double prec
nkeynes@358
    38
	add #1, r12
nkeynes@358
    39
	mov.l test_fmov_2_input_a, r1
nkeynes@358
    40
	lds r1, fpul
nkeynes@358
    41
	fsts fpul, fr4
nkeynes@358
    42
	mov.l test_fmov_2_input_b, r3
nkeynes@358
    43
	lds r3, fpul
nkeynes@358
    44
	fsts fpul, fr5
nkeynes@358
    45
	fldi0 fr8
nkeynes@358
    46
	fldi0 fr9
nkeynes@358
    47
	fschg
nkeynes@358
    48
	flds fr8, fpul
nkeynes@358
    49
	sts fpul, r0
nkeynes@358
    50
	tst r0, r0
nkeynes@358
    51
	bf test_fmov_2_fail
nkeynes@358
    52
	flds fr9, fpul
nkeynes@358
    53
	sts fpul, r0
nkeynes@358
    54
	tst r0, r0
nkeynes@358
    55
	bf test_fmov_2_fail
nkeynes@358
    56
	fmov fr4, fr8
nkeynes@358
    57
	flds fr8, fpul
nkeynes@358
    58
	sts fpul, r0
nkeynes@358
    59
	flds fr9, fpul
nkeynes@358
    60
	sts fpul, r2
nkeynes@358
    61
	cmp/eq r0, r1
nkeynes@358
    62
	bf test_fmov_2_fail
nkeynes@358
    63
	cmp/eq r2, r3
nkeynes@358
    64
	bt test_fmov_3
nkeynes@358
    65
test_fmov_2_fail:
nkeynes@358
    66
	fail test_fmov_str_k
nkeynes@358
    67
	bra test_fmov_3
nkeynes@358
    68
	nop
nkeynes@358
    69
test_fmov_2_input_a:
nkeynes@358
    70
	.long 0x12345678
nkeynes@358
    71
test_fmov_2_input_b:
nkeynes@358
    72
	.long 0x9ABCDEF0
nkeynes@358
    73
nkeynes@358
    74
test_fmov_3: ! double size DRm to XDn
nkeynes@358
    75
	add #1, r12
nkeynes@358
    76
	frchg
nkeynes@358
    77
	fldi0 fr8
nkeynes@358
    78
	fldi0 fr9
nkeynes@358
    79
	frchg
nkeynes@358
    80
	fldi0 fr8
nkeynes@358
    81
	fldi0 fr9
nkeynes@358
    82
	mov.l test_fmov_3_input_a, r2
nkeynes@358
    83
	lds r2, fpul
nkeynes@358
    84
	fsts fpul, fr2
nkeynes@358
    85
	mov.l test_fmov_3_input_b, r3
nkeynes@358
    86
	lds r3, fpul
nkeynes@358
    87
	fsts fpul, fr3
nkeynes@358
    88
nkeynes@358
    89
	fmov fr2, fr9
nkeynes@358
    90
	flds fr8, fpul
nkeynes@358
    91
	sts fpul, r0
nkeynes@358
    92
	flds fr9, fpul
nkeynes@358
    93
	sts fpul, r1
nkeynes@358
    94
	tst r0, r0
nkeynes@358
    95
	bf test_fmov_3_fail
nkeynes@358
    96
	tst r1, r1
nkeynes@358
    97
	bf test_fmov_3_fail
nkeynes@358
    98
	frchg
nkeynes@358
    99
	flds fr8, fpul
nkeynes@358
   100
	sts fpul, r0
nkeynes@358
   101
	flds fr9, fpul
nkeynes@358
   102
	sts fpul, r1
nkeynes@358
   103
	cmp/eq r0, r2
nkeynes@358
   104
	bf test_fmov_3_fail
nkeynes@358
   105
	cmp/eq r1, r3
nkeynes@358
   106
	bt test_fmov_4
nkeynes@358
   107
nkeynes@358
   108
test_fmov_3_fail:
nkeynes@358
   109
	fail test_fmov_str_k
nkeynes@358
   110
	bra test_fmov_4
nkeynes@358
   111
	nop
nkeynes@358
   112
nkeynes@358
   113
test_fmov_3_input_a:
nkeynes@358
   114
	.long 0x86421357
nkeynes@358
   115
test_fmov_3_input_b:
nkeynes@358
   116
	.long 0x97532468
nkeynes@358
   117
	
nkeynes@358
   118
test_fmov_4: ! double size XDm to DRn
nkeynes@358
   119
	add #1, r12
nkeynes@358
   120
	mov.l test_fmov_4_input_a, r2
nkeynes@358
   121
	lds r2, fpul
nkeynes@358
   122
	fsts fpul, fr6
nkeynes@358
   123
	mov.l test_fmov_4_input_b, r3
nkeynes@358
   124
	lds r3, fpul
nkeynes@358
   125
	fsts fpul, fr7
nkeynes@358
   126
	fldi0 fr0
nkeynes@358
   127
	fldi0 fr1
nkeynes@358
   128
	frchg
nkeynes@358
   129
	fldi0 fr6
nkeynes@358
   130
	fldi0 fr7
nkeynes@358
   131
nkeynes@358
   132
	fmov fr7, fr0
nkeynes@358
   133
	flds fr0, fpul
nkeynes@358
   134
	sts fpul, r0
nkeynes@358
   135
	flds fr1, fpul
nkeynes@358
   136
	sts fpul, r1
nkeynes@358
   137
	cmp/eq r0, r2
nkeynes@358
   138
	bf test_fmov_4_fail
nkeynes@358
   139
	cmp/eq r1, r3
nkeynes@358
   140
	bf test_fmov_4_fail
nkeynes@358
   141
	frchg
nkeynes@358
   142
	flds fr0, fpul
nkeynes@358
   143
	sts fpul, r0
nkeynes@358
   144
	flds fr1, fpul
nkeynes@358
   145
	sts fpul, r1
nkeynes@358
   146
	tst r0, r0
nkeynes@358
   147
	bf test_fmov_4_fail
nkeynes@358
   148
	tst r1, r1
nkeynes@358
   149
	bt test_fmov_5
nkeynes@358
   150
	
nkeynes@358
   151
test_fmov_4_fail:
nkeynes@358
   152
	fail test_fmov_str_k
nkeynes@358
   153
	bra test_fmov_5
nkeynes@358
   154
	nop
nkeynes@358
   155
nkeynes@358
   156
test_fmov_4_input_a:
nkeynes@358
   157
	.long 0xACADACA0
nkeynes@358
   158
test_fmov_4_input_b:
nkeynes@358
   159
	.long 0x12233445
nkeynes@358
   160
	
nkeynes@358
   161
nkeynes@358
   162
test_fmov_5: ! double size @Rm to DRn, DRm to @Rn
nkeynes@358
   163
	add #1, r12
nkeynes@358
   164
	mova test_fmov_5_data_a, r0
nkeynes@358
   165
	mov r0, r4
nkeynes@358
   166
	xor r1, r1
nkeynes@358
   167
	mov.l r1, @r0
nkeynes@358
   168
	add #4, r0
nkeynes@358
   169
	mov.l r1, @r0
nkeynes@358
   170
	mova test_fmov_5_input_a, r0
nkeynes@358
   171
	fmov @r0, fr8
nkeynes@358
   172
	mov.l test_fmov_5_input_a, r0
nkeynes@358
   173
	mov.l test_fmov_5_input_b, r1
nkeynes@358
   174
	flds fr8, fpul
nkeynes@358
   175
	sts fpul, r5
nkeynes@358
   176
	flds fr9, fpul
nkeynes@358
   177
	sts fpul, r6
nkeynes@358
   178
	cmp/eq r0, r5
nkeynes@358
   179
	bf test_fmov_5_fail
nkeynes@358
   180
	cmp/eq r1, r6
nkeynes@358
   181
	bf test_fmov_5_fail
nkeynes@358
   182
	fmov fr8, @r4
nkeynes@358
   183
	mov.l test_fmov_5_data_a, r2
nkeynes@358
   184
	mov.l test_fmov_5_data_b, r3
nkeynes@358
   185
	cmp/eq r0, r2
nkeynes@358
   186
	bf test_fmov_5_fail
nkeynes@358
   187
	cmp/eq r1, r3
nkeynes@358
   188
	bt test_fmov_6
nkeynes@358
   189
test_fmov_5_fail:
nkeynes@358
   190
	fail test_fmov_str_k
nkeynes@358
   191
	bra test_fmov_6
nkeynes@358
   192
	nop
nkeynes@358
   193
	
nkeynes@358
   194
test_fmov_5_input_a:
nkeynes@358
   195
	.long 0xFEEDBEEF
nkeynes@358
   196
test_fmov_5_input_b:
nkeynes@358
   197
	.long 0xDEAD1234
nkeynes@358
   198
test_fmov_5_data_a:
nkeynes@358
   199
	.long 0
nkeynes@358
   200
test_fmov_5_data_b:	
nkeynes@358
   201
	.long 0
nkeynes@358
   202
nkeynes@358
   203
test_fmov_6:	! double size @Rm+ to DRn, DRm to @-Rn
nkeynes@358
   204
	add #1, r12
nkeynes@358
   205
	mova test_fmov_6_data_a, r0
nkeynes@358
   206
	mov r0, r4
nkeynes@358
   207
	xor r1, r1
nkeynes@358
   208
	mov.l r1, @r4
nkeynes@358
   209
	add #4, r4
nkeynes@358
   210
	mov.l r1, @r4
nkeynes@358
   211
	add #4, r4
nkeynes@358
   212
	mova test_fmov_6_input_a, r0
nkeynes@358
   213
	mov r0, r7
nkeynes@358
   214
	fmov @r7+, fr10
nkeynes@358
   215
	mov.l test_fmov_6_input_a, r0
nkeynes@358
   216
	mov.l test_fmov_6_input_b, r1
nkeynes@358
   217
	flds fr10, fpul
nkeynes@358
   218
	sts fpul, r5
nkeynes@358
   219
	flds fr11, fpul
nkeynes@358
   220
	sts fpul, r6
nkeynes@358
   221
	cmp/eq r0, r5
nkeynes@358
   222
	bf test_fmov_6_fail
nkeynes@358
   223
	cmp/eq r1, r6
nkeynes@358
   224
	bf test_fmov_6_fail
nkeynes@358
   225
	fmov fr10, @-r4
nkeynes@358
   226
	mov.l test_fmov_6_data_a, r2
nkeynes@358
   227
	mov.l test_fmov_6_data_b, r3
nkeynes@358
   228
	cmp/eq r0, r2
nkeynes@358
   229
	bf test_fmov_6_fail
nkeynes@358
   230
	cmp/eq r1, r3
nkeynes@358
   231
	bf test_fmov_6_fail
nkeynes@358
   232
	mova test_fmov_6_data_a, r0
nkeynes@358
   233
	cmp/eq r0, r4
nkeynes@358
   234
	bf test_fmov_6_fail
nkeynes@358
   235
	cmp/eq r0, r7
nkeynes@358
   236
	bt test_fmov_7
nkeynes@358
   237
test_fmov_6_fail:
nkeynes@358
   238
	fail test_fmov_str_k
nkeynes@358
   239
	bra test_fmov_7
nkeynes@358
   240
	nop
nkeynes@358
   241
	
nkeynes@358
   242
test_fmov_6_input_a:
nkeynes@358
   243
	.long 0x42318576
nkeynes@358
   244
test_fmov_6_input_b:
nkeynes@358
   245
	.long 0xF0AFD34F
nkeynes@358
   246
test_fmov_6_data_a:
nkeynes@358
   247
	.long 0
nkeynes@358
   248
test_fmov_6_data_b:	
nkeynes@358
   249
	.long 0
nkeynes@358
   250
	
nkeynes@358
   251
test_fmov_7:	! double size @Rm,@R0 to DRn, DRm to @Rn,@R0
nkeynes@358
   252
	add #1, r12
nkeynes@358
   253
	mova test_fmov_7_data_a, r0
nkeynes@358
   254
	mov r0, r4
nkeynes@358
   255
	xor r1, r1
nkeynes@358
   256
	mov.l r1, @r4
nkeynes@358
   257
	add #4, r4
nkeynes@358
   258
	mov.l r1, @r4
nkeynes@358
   259
	add #48, r4
nkeynes@358
   260
	mova test_fmov_7_input_a, r0
nkeynes@358
   261
	mov r0, r7
nkeynes@358
   262
	xor r0, r0
nkeynes@358
   263
	add #-31, r7
nkeynes@358
   264
	add #31, r0
nkeynes@358
   265
	fmov @(r0,r7), fr10
nkeynes@358
   266
	mov.l test_fmov_7_input_a, r0
nkeynes@358
   267
	mov.l test_fmov_7_input_b, r1
nkeynes@358
   268
	flds fr10, fpul
nkeynes@358
   269
	sts fpul, r5
nkeynes@358
   270
	flds fr11, fpul
nkeynes@358
   271
	sts fpul, r6
nkeynes@358
   272
	cmp/eq r0, r5
nkeynes@358
   273
	bf test_fmov_7_fail
nkeynes@358
   274
	cmp/eq r1, r6
nkeynes@358
   275
	bf test_fmov_7_fail
nkeynes@358
   276
	xor r0, r0
nkeynes@358
   277
	add #-52, r0
nkeynes@358
   278
	fmov fr10, @(r0,r4)
nkeynes@358
   279
	mov.l test_fmov_7_input_a, r0
nkeynes@358
   280
	mov.l test_fmov_7_data_a, r2
nkeynes@358
   281
	mov.l test_fmov_7_data_b, r3
nkeynes@358
   282
	cmp/eq r0, r2
nkeynes@358
   283
	bf test_fmov_7_fail
nkeynes@358
   284
	cmp/eq r1, r3
nkeynes@358
   285
	bf test_fmov_7_fail
nkeynes@358
   286
	mova test_fmov_7_data_a, r0
nkeynes@358
   287
	add #52, r0
nkeynes@358
   288
	cmp/eq r0, r4
nkeynes@358
   289
	bf test_fmov_7_fail
nkeynes@358
   290
	mova test_fmov_7_input_a, r0
nkeynes@358
   291
	add #-31, r0
nkeynes@358
   292
	cmp/eq r0, r7
nkeynes@358
   293
	bt test_fmov_8
nkeynes@358
   294
test_fmov_7_fail:
nkeynes@358
   295
	fail test_fmov_str_k
nkeynes@358
   296
	bra test_fmov_8
nkeynes@358
   297
	nop
nkeynes@358
   298
	
nkeynes@358
   299
test_fmov_7_input_a:
nkeynes@358
   300
	.long 0xABBACADA
nkeynes@358
   301
test_fmov_7_input_b:
nkeynes@358
   302
	.long 0x43546576
nkeynes@358
   303
test_fmov_7_data_a:
nkeynes@358
   304
	.long 0
nkeynes@358
   305
test_fmov_7_data_b:	
nkeynes@358
   306
	.long 0
nkeynes@358
   307
nkeynes@358
   308
test_fmov_8:
nkeynes@358
   309
	
nkeynes@358
   310
test_fmov_end:
nkeynes@358
   311
	xor r0, r0
nkeynes@358
   312
	lds r0, fpscr
nkeynes@358
   313
	end_test test_fmov_str_k
nkeynes@358
   314
	
nkeynes@358
   315
test_fmov_str:
nkeynes@358
   316
	.string "FMOV"
nkeynes@358
   317
	
nkeynes@358
   318
.align 4
nkeynes@358
   319
test_fmov_str_k:
nkeynes@358
   320
	.long test_fmov_str
.