Search
lxdream.org :: lxdream/test/sh4/fmov.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/fmov.s
changeset 732:f05753bbe723
prev358:65043a8f5785
author nkeynes
date Sun Jul 20 11:37:47 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Commit testta changes for sort-dma tests
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     3 !
     4 ! Test fmov (all variants)
     5 ! (not arithmetic)
     7 .global _test_fmov
     8 _test_fmov:	
     9 	start_test
    11 	xor r0,r0
    12 	lds r0, fpscr
    14 test_fmov_1:  ! single precision reg-to-reg
    15 	add #1, r12
    17 	fldi0 fr0
    18 	fldi1 fr1
    19 	flds fr0, fpul
    20 	sts fpul, r0
    21 	tst r0, r0
    22 	bf test_fmov_1_fail
    23 	fmov fr1, fr0
    24 	flds fr0, fpul
    25 	sts fpul, r0
    26 	mov.l test_fmov_1_result, r1
    27 	cmp/eq r0, r1
    28 	bt test_fmov_2
    29 test_fmov_1_fail:
    30 	fail test_fmov_str_k
    31 	bra test_fmov_2
    32 	nop
    34 test_fmov_1_result:
    35 	.long 0x3F800000
    37 test_fmov_2:	! reg-to-reg double prec
    38 	add #1, r12
    39 	mov.l test_fmov_2_input_a, r1
    40 	lds r1, fpul
    41 	fsts fpul, fr4
    42 	mov.l test_fmov_2_input_b, r3
    43 	lds r3, fpul
    44 	fsts fpul, fr5
    45 	fldi0 fr8
    46 	fldi0 fr9
    47 	fschg
    48 	flds fr8, fpul
    49 	sts fpul, r0
    50 	tst r0, r0
    51 	bf test_fmov_2_fail
    52 	flds fr9, fpul
    53 	sts fpul, r0
    54 	tst r0, r0
    55 	bf test_fmov_2_fail
    56 	fmov fr4, fr8
    57 	flds fr8, fpul
    58 	sts fpul, r0
    59 	flds fr9, fpul
    60 	sts fpul, r2
    61 	cmp/eq r0, r1
    62 	bf test_fmov_2_fail
    63 	cmp/eq r2, r3
    64 	bt test_fmov_3
    65 test_fmov_2_fail:
    66 	fail test_fmov_str_k
    67 	bra test_fmov_3
    68 	nop
    69 test_fmov_2_input_a:
    70 	.long 0x12345678
    71 test_fmov_2_input_b:
    72 	.long 0x9ABCDEF0
    74 test_fmov_3: ! double size DRm to XDn
    75 	add #1, r12
    76 	frchg
    77 	fldi0 fr8
    78 	fldi0 fr9
    79 	frchg
    80 	fldi0 fr8
    81 	fldi0 fr9
    82 	mov.l test_fmov_3_input_a, r2
    83 	lds r2, fpul
    84 	fsts fpul, fr2
    85 	mov.l test_fmov_3_input_b, r3
    86 	lds r3, fpul
    87 	fsts fpul, fr3
    89 	fmov fr2, fr9
    90 	flds fr8, fpul
    91 	sts fpul, r0
    92 	flds fr9, fpul
    93 	sts fpul, r1
    94 	tst r0, r0
    95 	bf test_fmov_3_fail
    96 	tst r1, r1
    97 	bf test_fmov_3_fail
    98 	frchg
    99 	flds fr8, fpul
   100 	sts fpul, r0
   101 	flds fr9, fpul
   102 	sts fpul, r1
   103 	cmp/eq r0, r2
   104 	bf test_fmov_3_fail
   105 	cmp/eq r1, r3
   106 	bt test_fmov_4
   108 test_fmov_3_fail:
   109 	fail test_fmov_str_k
   110 	bra test_fmov_4
   111 	nop
   113 test_fmov_3_input_a:
   114 	.long 0x86421357
   115 test_fmov_3_input_b:
   116 	.long 0x97532468
   118 test_fmov_4: ! double size XDm to DRn
   119 	add #1, r12
   120 	mov.l test_fmov_4_input_a, r2
   121 	lds r2, fpul
   122 	fsts fpul, fr6
   123 	mov.l test_fmov_4_input_b, r3
   124 	lds r3, fpul
   125 	fsts fpul, fr7
   126 	fldi0 fr0
   127 	fldi0 fr1
   128 	frchg
   129 	fldi0 fr6
   130 	fldi0 fr7
   132 	fmov fr7, fr0
   133 	flds fr0, fpul
   134 	sts fpul, r0
   135 	flds fr1, fpul
   136 	sts fpul, r1
   137 	cmp/eq r0, r2
   138 	bf test_fmov_4_fail
   139 	cmp/eq r1, r3
   140 	bf test_fmov_4_fail
   141 	frchg
   142 	flds fr0, fpul
   143 	sts fpul, r0
   144 	flds fr1, fpul
   145 	sts fpul, r1
   146 	tst r0, r0
   147 	bf test_fmov_4_fail
   148 	tst r1, r1
   149 	bt test_fmov_5
   151 test_fmov_4_fail:
   152 	fail test_fmov_str_k
   153 	bra test_fmov_5
   154 	nop
   156 test_fmov_4_input_a:
   157 	.long 0xACADACA0
   158 test_fmov_4_input_b:
   159 	.long 0x12233445
   162 test_fmov_5: ! double size @Rm to DRn, DRm to @Rn
   163 	add #1, r12
   164 	mova test_fmov_5_data_a, r0
   165 	mov r0, r4
   166 	xor r1, r1
   167 	mov.l r1, @r0
   168 	add #4, r0
   169 	mov.l r1, @r0
   170 	mova test_fmov_5_input_a, r0
   171 	fmov @r0, fr8
   172 	mov.l test_fmov_5_input_a, r0
   173 	mov.l test_fmov_5_input_b, r1
   174 	flds fr8, fpul
   175 	sts fpul, r5
   176 	flds fr9, fpul
   177 	sts fpul, r6
   178 	cmp/eq r0, r5
   179 	bf test_fmov_5_fail
   180 	cmp/eq r1, r6
   181 	bf test_fmov_5_fail
   182 	fmov fr8, @r4
   183 	mov.l test_fmov_5_data_a, r2
   184 	mov.l test_fmov_5_data_b, r3
   185 	cmp/eq r0, r2
   186 	bf test_fmov_5_fail
   187 	cmp/eq r1, r3
   188 	bt test_fmov_6
   189 test_fmov_5_fail:
   190 	fail test_fmov_str_k
   191 	bra test_fmov_6
   192 	nop
   194 test_fmov_5_input_a:
   195 	.long 0xFEEDBEEF
   196 test_fmov_5_input_b:
   197 	.long 0xDEAD1234
   198 test_fmov_5_data_a:
   199 	.long 0
   200 test_fmov_5_data_b:	
   201 	.long 0
   203 test_fmov_6:	! double size @Rm+ to DRn, DRm to @-Rn
   204 	add #1, r12
   205 	mova test_fmov_6_data_a, r0
   206 	mov r0, r4
   207 	xor r1, r1
   208 	mov.l r1, @r4
   209 	add #4, r4
   210 	mov.l r1, @r4
   211 	add #4, r4
   212 	mova test_fmov_6_input_a, r0
   213 	mov r0, r7
   214 	fmov @r7+, fr10
   215 	mov.l test_fmov_6_input_a, r0
   216 	mov.l test_fmov_6_input_b, r1
   217 	flds fr10, fpul
   218 	sts fpul, r5
   219 	flds fr11, fpul
   220 	sts fpul, r6
   221 	cmp/eq r0, r5
   222 	bf test_fmov_6_fail
   223 	cmp/eq r1, r6
   224 	bf test_fmov_6_fail
   225 	fmov fr10, @-r4
   226 	mov.l test_fmov_6_data_a, r2
   227 	mov.l test_fmov_6_data_b, r3
   228 	cmp/eq r0, r2
   229 	bf test_fmov_6_fail
   230 	cmp/eq r1, r3
   231 	bf test_fmov_6_fail
   232 	mova test_fmov_6_data_a, r0
   233 	cmp/eq r0, r4
   234 	bf test_fmov_6_fail
   235 	cmp/eq r0, r7
   236 	bt test_fmov_7
   237 test_fmov_6_fail:
   238 	fail test_fmov_str_k
   239 	bra test_fmov_7
   240 	nop
   242 test_fmov_6_input_a:
   243 	.long 0x42318576
   244 test_fmov_6_input_b:
   245 	.long 0xF0AFD34F
   246 test_fmov_6_data_a:
   247 	.long 0
   248 test_fmov_6_data_b:	
   249 	.long 0
   251 test_fmov_7:	! double size @Rm,@R0 to DRn, DRm to @Rn,@R0
   252 	add #1, r12
   253 	mova test_fmov_7_data_a, r0
   254 	mov r0, r4
   255 	xor r1, r1
   256 	mov.l r1, @r4
   257 	add #4, r4
   258 	mov.l r1, @r4
   259 	add #48, r4
   260 	mova test_fmov_7_input_a, r0
   261 	mov r0, r7
   262 	xor r0, r0
   263 	add #-31, r7
   264 	add #31, r0
   265 	fmov @(r0,r7), fr10
   266 	mov.l test_fmov_7_input_a, r0
   267 	mov.l test_fmov_7_input_b, r1
   268 	flds fr10, fpul
   269 	sts fpul, r5
   270 	flds fr11, fpul
   271 	sts fpul, r6
   272 	cmp/eq r0, r5
   273 	bf test_fmov_7_fail
   274 	cmp/eq r1, r6
   275 	bf test_fmov_7_fail
   276 	xor r0, r0
   277 	add #-52, r0
   278 	fmov fr10, @(r0,r4)
   279 	mov.l test_fmov_7_input_a, r0
   280 	mov.l test_fmov_7_data_a, r2
   281 	mov.l test_fmov_7_data_b, r3
   282 	cmp/eq r0, r2
   283 	bf test_fmov_7_fail
   284 	cmp/eq r1, r3
   285 	bf test_fmov_7_fail
   286 	mova test_fmov_7_data_a, r0
   287 	add #52, r0
   288 	cmp/eq r0, r4
   289 	bf test_fmov_7_fail
   290 	mova test_fmov_7_input_a, r0
   291 	add #-31, r0
   292 	cmp/eq r0, r7
   293 	bt test_fmov_8
   294 test_fmov_7_fail:
   295 	fail test_fmov_str_k
   296 	bra test_fmov_8
   297 	nop
   299 test_fmov_7_input_a:
   300 	.long 0xABBACADA
   301 test_fmov_7_input_b:
   302 	.long 0x43546576
   303 test_fmov_7_data_a:
   304 	.long 0
   305 test_fmov_7_data_b:	
   306 	.long 0
   307 test_fmov_str_k:
   308 	.long test_fmov_str
   310 ! Test non-64-bit aligned memory read/writes with FMOV variants
   312 test_fmov_8: ! @Rm to DRn
   313 	add #1, r12
   314 	mova test_fmov_ua64_a, r0
   315 	expect_exc 0x000000E0
   316 test_fmov_8_exc_pc:	
   317 	fmov @r0, fr8
   318 	assert_exc_caught test_fmov_str_k_2 test_fmov_8_exc_pc
   320 test_fmov_9: ! DRm to @Rm
   321 	add #1, r12
   322 	mova test_fmov_ua64_a, r0
   323 	expect_exc 0x00000100
   324 test_fmov_9_exc_pc:
   325 	fmov fr8, @r0
   326 	assert_exc_caught test_fmov_str_k_2 test_fmov_9_exc_pc
   328 test_fmov_10: ! @Rm+ to DRn
   329 	add #1, r12
   330 	mova test_fmov_ua64_a, r0
   331 	expect_exc 0x000000E0
   332 test_fmov_10_exc_pc:	
   333 	fmov @r0+, fr8
   334 	assert_exc_caught test_fmov_str_k_2 test_fmov_10_exc_pc
   336 test_fmov_11: ! DRm to @Rm-
   337 	add #1, r12
   338 	mova test_fmov_ua64_a, r0
   339 	expect_exc 0x00000100
   340 test_fmov_11_exc_pc:
   341 	fmov fr8, @-r0
   342 	assert_exc_caught test_fmov_str_k_2 test_fmov_11_exc_pc
   344 test_fmov_12: ! @(R0,Rm) to DRn
   345 	add #1, r12
   346 	mova test_fmov_ua64_pad, r0
   347 	mov #4, r4
   348 	expect_exc 0x000000E0
   349 test_fmov_12_exc_pc:	
   350 	fmov @(r0,r4), fr8
   351 	assert_exc_caught test_fmov_str_k_2 test_fmov_12_exc_pc
   353 test_fmov_13: ! DRm to @(R0,Rn)
   354 	add #1, r12
   355 	mova test_fmov_ua64_pad, r0
   356 	mov #4, r4
   357 	expect_exc 0x00000100
   358 test_fmov_13_exc_pc:
   359 	fmov fr8, @(r0,r4)
   360 	assert_exc_caught test_fmov_str_k_2 test_fmov_13_exc_pc
   363 	bra test_fmov_end
   366 .align 8
   367 test_fmov_ua64_pad:
   368 	.long 0  ! ensure not aligned on 64-bit boundaries
   369 test_fmov_ua64_a:
   370 	.long 0x09080706
   371 test_fmov_u64_b:
   372 	.long 0x14253647
   375 test_fmov_end:
   376 	xor r0, r0
   377 	lds r0, fpscr
   378 	end_test test_fmov_str_k_2
   380 test_fmov_str:
   381 	.string "FMOV"
   383 .align 4
   384 test_fmov_str_k_2:
   385 	.long test_fmov_str
.