binutils-gdb/sim/testsuite/frv/nudivi.cgs
Mike Frysinger 1368b914e9 sim: testsuite: flatten tree
Now that all port tests live under testsuite/sim/*/, and none live
in testsuite/ directly, flatten the structure by moving all of the
dirs under testsuite/sim/ to testsuite/ directly.

We need to stop passing --tool to dejagnu so that it searches all
dirs and not just ones that start with "sim".  Since we have no
other dirs in this tree, and no plans to add any, should be fine.
2021-01-15 19:18:34 -05:00

52 lines
1.1 KiB
Plaintext

# frv testcase for nudivi $GRi,$s12,$GRk
# mach: fr500 fr550 frv
.include "testutils.inc"
start
.global nudivi
nudivi:
set_spr_immed 0,gner0
set_spr_immed 0,gner1
; simple division 12 / 3
set_gr_immed 0x0000000c,gr3
nudivi gr3,3,gr3
test_gr_immed 0x00000004,gr3
test_spr_immed 0,gner0
test_spr_immed 0,gner1
; random example
set_gr_limmed 0xfedc,0xba98,gr3
nudivi gr3,0x7ff,gr3
test_gr_limmed 0x001f,0xdf93,gr3
test_spr_immed 0,gner0
test_spr_immed 0,gner1
; random example
set_gr_limmed 0xffff,0xffff,gr3
nudivi gr3,-2048,gr3
test_gr_immed 1,gr3
test_spr_immed 0,gner0
test_spr_immed 0,gner1
or_spr_immed 0x20,isr ; turn on isr.edem
nudivi gr1,0,gr32 ; divide by zero
test_spr_immed 1,gner0
test_spr_immed 0,gner1
and_spr_immed -33,isr ; turn off isr.edem
nudivi gr1,0,gr10 ; divide by zero
test_spr_immed 1,gner0
test_spr_immed 0x00000400,gner1
; simple division 12 / 3 -- should turn off ne flag
set_gr_immed 12,gr1
nudivi gr1,3,gr10
test_gr_immed 4,gr10
test_spr_immed 1,gner0
test_spr_immed 0,gner1
pass