URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 24 |
Rev 157 |
# Support macros for the assembly test cases.
|
# Support macros for the assembly test cases.
|
|
|
.macro start
|
.macro start
|
.text
|
.text
|
.global start
|
.global start
|
start:
|
start:
|
.endm
|
.endm
|
|
|
# Perform a single to double precision floating point conversion.
|
# Perform a single to double precision floating point conversion.
|
.macro _s2d fpr dpr
|
.macro _s2d fpr dpr
|
flds \fpr, fpul
|
flds \fpr, fpul
|
_setpr
|
_setpr
|
fcnvsd fpul, \dpr
|
fcnvsd fpul, \dpr
|
_clrpr
|
_clrpr
|
.endm
|
.endm
|
|
|
# Set the PR (PRecision) bit in the FPSCR.
|
# Set the PR (PRecision) bit in the FPSCR.
|
.macro _setpr
|
.macro _setpr
|
sts fpscr, r7
|
sts fpscr, r7
|
mov #8, r8
|
mov #8, r8
|
shll16 r8
|
shll16 r8
|
or r8, r7
|
or r8, r7
|
lds r7, fpscr
|
lds r7, fpscr
|
.endm
|
.endm
|
|
|
# Clear the PR bit.
|
# Clear the PR bit.
|
.macro _clrpr
|
.macro _clrpr
|
sts fpscr, r7
|
sts fpscr, r7
|
mov #8, r8
|
mov #8, r8
|
shll16 r8
|
shll16 r8
|
not r8, r8
|
not r8, r8
|
and r8, r7
|
and r8, r7
|
lds r7, fpscr
|
lds r7, fpscr
|
.endm
|
.endm
|
|
|
# nb: this macro clobbers R7.
|
# nb: this macro clobbers R7.
|
.macro assert reg value
|
.macro assert reg value
|
mov \value, r7
|
mov \value, r7
|
cmp/eq \reg, r7
|
cmp/eq \reg, r7
|
bf wrong
|
bf wrong
|
.endm
|
.endm
|
|
|
.macro pass
|
.macro pass
|
trapa #253
|
trapa #253
|
.endm
|
.endm
|
|
|
.macro fail
|
.macro fail
|
trapa #254
|
trapa #254
|
.endm
|
.endm
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.