URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 24 |
Rev 33 |
# fr30 testcase for div0s $Ri
|
# fr30 testcase for div0s $Ri
|
# mach(): fr30
|
# mach(): fr30
|
|
|
.include "testutils.inc"
|
.include "testutils.inc"
|
|
|
START
|
START
|
|
|
.text
|
.text
|
.global div0s
|
.global div0s
|
div0s:
|
div0s:
|
; Test div0s $Rj,$Ri
|
; Test div0s $Rj,$Ri
|
; example from the manual - negative dividend
|
; example from the manual - negative dividend
|
mvi_h_gr 0x0fffffff,r2
|
mvi_h_gr 0x0fffffff,r2
|
mvi_h_dr 0x00000000,mdh
|
mvi_h_dr 0x00000000,mdh
|
mvi_h_dr 0xfffffff0,mdl
|
mvi_h_dr 0xfffffff0,mdl
|
set_dbits 0x0 ; Set opposite of expected
|
set_dbits 0x0 ; Set opposite of expected
|
set_cc 0x0f ; Condition codes should not change
|
set_cc 0x0f ; Condition codes should not change
|
div0s r2
|
div0s r2
|
test_cc 1 1 1 1
|
test_cc 1 1 1 1
|
test_h_gr 0x0fffffff,r2
|
test_h_gr 0x0fffffff,r2
|
test_h_dr 0xffffffff,mdh
|
test_h_dr 0xffffffff,mdh
|
test_h_dr 0xfffffff0,mdl
|
test_h_dr 0xfffffff0,mdl
|
test_dbits 0x3
|
test_dbits 0x3
|
|
|
; negative divisor
|
; negative divisor
|
mvi_h_gr 0xffffffff,r2
|
mvi_h_gr 0xffffffff,r2
|
mvi_h_dr 0xffffffff,mdh
|
mvi_h_dr 0xffffffff,mdh
|
mvi_h_dr 0x7fffffff,mdl
|
mvi_h_dr 0x7fffffff,mdl
|
set_dbits 0x1 ; Set opposite of expected
|
set_dbits 0x1 ; Set opposite of expected
|
set_cc 0x0f ; Condition codes should not change
|
set_cc 0x0f ; Condition codes should not change
|
div0s r2
|
div0s r2
|
test_cc 1 1 1 1
|
test_cc 1 1 1 1
|
test_h_gr 0xffffffff,r2
|
test_h_gr 0xffffffff,r2
|
test_h_dr 0x00000000,mdh
|
test_h_dr 0x00000000,mdh
|
test_h_dr 0x7fffffff,mdl
|
test_h_dr 0x7fffffff,mdl
|
test_dbits 0x2
|
test_dbits 0x2
|
|
|
; Both sign bits 0
|
; Both sign bits 0
|
mvi_h_gr 0x0fffffff,r2
|
mvi_h_gr 0x0fffffff,r2
|
mvi_h_dr 0xffffffff,mdh
|
mvi_h_dr 0xffffffff,mdh
|
mvi_h_dr 0x7ffffff0,mdl
|
mvi_h_dr 0x7ffffff0,mdl
|
set_dbits 0x3 ; Set opposite of expected
|
set_dbits 0x3 ; Set opposite of expected
|
set_cc 0x0f ; Condition codes should not change
|
set_cc 0x0f ; Condition codes should not change
|
div0s r2
|
div0s r2
|
test_cc 1 1 1 1
|
test_cc 1 1 1 1
|
test_h_gr 0x0fffffff,r2
|
test_h_gr 0x0fffffff,r2
|
test_h_dr 0x00000000,mdh
|
test_h_dr 0x00000000,mdh
|
test_h_dr 0x7ffffff0,mdl
|
test_h_dr 0x7ffffff0,mdl
|
test_dbits 0x0
|
test_dbits 0x0
|
|
|
; Both sign bits 1
|
; Both sign bits 1
|
mvi_h_gr 0xffffffff,r2
|
mvi_h_gr 0xffffffff,r2
|
mvi_h_dr 0x00000000,mdh
|
mvi_h_dr 0x00000000,mdh
|
mvi_h_dr 0xffffffff,mdl
|
mvi_h_dr 0xffffffff,mdl
|
set_dbits 0x2 ; Set opposite of expected
|
set_dbits 0x2 ; Set opposite of expected
|
set_cc 0x0f ; Condition codes should not change
|
set_cc 0x0f ; Condition codes should not change
|
div0s r2
|
div0s r2
|
test_cc 1 1 1 1
|
test_cc 1 1 1 1
|
test_h_gr 0xffffffff,r2
|
test_h_gr 0xffffffff,r2
|
test_h_dr 0xffffffff,mdh
|
test_h_dr 0xffffffff,mdh
|
test_h_dr 0xffffffff,mdl
|
test_h_dr 0xffffffff,mdl
|
test_dbits 0x1
|
test_dbits 0x1
|
|
|
pass
|
pass
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.