Commit b4cf8b87 by Martin

daiteq binutils for SPARCv8 and RISC-V targets, incl. new FPU and SWAR instructions

0 parents
GNU binutils for RISC-V and Sparc/LEON
======================================
This project contains
- scripts for downloading and building patched GNU binutils
- patches for RISC-V and Sparc architectures with new instructions
binutils version
----------------
This package uses binutils v2.37.
SPARC
-----
Building
''''''''
Run script './run_sparc.sh all' to build binutils for Sparc/LEON target.
Binutils will be prepared in subdirectory 'install-sparc'.
Using
'''''
- add directory 'install-sparc/bin' to PATH or copy directory 'install-sparc'
- all tools from binutils starts with prefix 'sparc-daiteq-elf-'
- new assembler instructions can be used with options '--has-swar','--has-fhalf','--has-fcplx','--has-fpack'
RISC-V
------
Building
''''''''
Run script './run_riscv.sh all' to build binutils for RISC-V target.
Binutils will be prepared in subdirectory 'install-riscv'.
Using
'''''
- add directory 'install-riscv/bin' to PATH or copy directory 'install-riscv'
- all tools from binutils starts with prefix 'riscv64-daiteq-elf-'
- currently all new assembler instructions are enabled without any special RV extension
This folder contains all patches applyed to downloaded original package.
#!/bin/bash
BU_NAME=binutils
BU_VERSION=2.37
BU_SERVER=https://ftp.gnu.org/gnu
TGT_TRIPLE=riscv64-daiteq-elf
HOST_TRIPLE=x86_64-linux-gnu
ENB_TARGETS=${TGT_TRIPLE}
CURDIR="$(pwd)"
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BU_PACKAGE=${BU_NAME}-${BU_VERSION}.tar.bz2
DIR_SRCS=${CURDIR}/source
DIR_UPCK=${CURDIR}/unpacked
DIR_BLD=${CURDIR}/build-riscv
DIR_INST=${CURDIR}/install-riscv
DIR_PTCH=${SCRIPTDIR}/patches
GENDIRS="${DIR_SRCS} ${DIR_UPCK} ${DIR_BLD} ${DIR_INST}"
FN_BUPKG=${DIR_SRCS}/${BU_PACKAGE}
DN_BUUNP=${DIR_UPCK}/${BU_NAME}-${BU_VERSION}
CFG_ARGS="--prefix=${DIR_INST} --build=${HOST_TRIPLE} --host=${HOST_TRIPLE} \
--target=${TGT_TRIPLE} --enable-targets=${ENB_TARGETS} \
--disable-nls --disable-multilib"
prepare_dirs() {
for d in ${GENDIRS}
do
echo "Create directory ${d}"
mkdir -p ${d}
done
}
download_source() {
mkdir -p ${DIR_SRCS}
DOWN=1
if [ -f ${FN_BUPKG} ]
then
echo "Original package is already downloaded ... check consistency"
bzip2 -t ${FN_BUPKG} 2>/dev/null
if [ $? -ne 0 ]
then
echo " The package is invalid."
else
echo " Package is usable"
DOWN=0
fi
fi
if [ ${DOWN} -eq 1 ]
then
echo "Download original package"
wget ${BU_SERVER}/binutils/${BU_PACKAGE} -O ${FN_BUPKG}
fi
}
unpack_source() {
mkdir -p ${DIR_UPCK}
UNP=1
if [ ! -f ${FN_BUPKG} ]
then
echo "Original package isn't downloaded"
UNP=0
fi
if [ -e ${DN_BUUNP} ]
then
echo "Package is already unpacked"
UNP=0
fi
if [ ${UNP} -eq 1 ]
then
echo "Unpack original package"
tar -C ${DIR_UPCK} -xjf ${FN_BUPKG}
fi
}
apply_patches() {
if [ ! -e ${DIR_PTCH} ]
then
echo "There is not a directory with patches"
exit 1
fi
for p in `ls -v ${DIR_PTCH}/*.patch`
do
echo "Use patch ${p}"
patch -d ${DN_BUUNP} -p1 < ${p}
done
}
build_source() {
if [ ! -e ${DN_BUUNP} ]
then
echo "There is no unpacked files with source codes"
exit 1
fi
mkdir -p ${DIR_BLD}
cd ${DIR_BLD}
CONF=1
if [ -f Makefile ]
then
echo "Compilation is already configured - skip."
CONF=0
fi
if [ ${CONF} -eq 1 ]
then
${DN_BUUNP}/configure ${CFG_ARGS}
if [ $? -ne 0 ]
then
echo "E: configure failed"
exit 1
fi
fi
make
if [ $? -ne 0 ]
then
echo "E: make failed"
exit 1
fi
cd ${CURDIR}
}
install_pkg() {
mkdir -p ${DIR_INST}
cd ${DIR_BLD}
make install
cd ${CURDIR}
}
clean_build() {
echo "Removing build and install directories."
rm -rf ${DIR_BLD} ${DIR_INST}
}
clean_unpacked() {
echo "Removing unpacked directory."
rm -rf ${DIR_UPCK}
}
distclean_all() {
echo "Removing all generated files and directories."
rm -rf ${GENDIRS}
}
# ##############################################################################
print_help() {
echo "The script needs one argument - required operation:"
echo " all - do all steps"
echo " get - download source package if it doesn't exist"
echo " unpack - unpack downloaded package only"
echo " patch - patch original package"
echo " build - build binutils package"
echo " install - install binutils to the output directory"
echo " clean - remove generated files (build and install dirs.)"
echo " packclean - remove unpacked files (unpack dir.)"
echo " distclean - remove all generated files and directories"
}
# ##############################################################################
# main ...
echo "Script for preparing package of patched binutils for NOEL-V IP core extensions."
if [ "$#" -ne 1 ]
then
print_help
exit 0
fi
case $1 in
"all" )
#echo "do all"
download_source
clean_unpacked
unpack_source
apply_patches
build_source
install_pkg
;;
"get" )
#echo "do download"
download_source
;;
"unpack" )
#echo "do unpack"
unpack_source
;;
"patch" )
#echo "do patch"
apply_patches
;;
"build" )
#echo "do build"
build_source
;;
"install" )
#echo "do install"
install_pkg
;;
"clean" )
#echo "do clean"
clean_build
;;
"packclean" )
#echo "do packclean"
clean_unpacked
;;
"distclean" )
#echo "do distclean"
distclean_all
;;
* )
echo "E: Unsupported operation"
print_help
exit 1
;;
esac
#!/bin/bash
BU_NAME=binutils
BU_VERSION=2.37
BU_SERVER=https://ftp.gnu.org/gnu
TGT_TRIPLE=sparc-daiteq-elf
HOST_TRIPLE=x86_64-linux-gnu
CURDIR="$(pwd)"
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BU_PACKAGE=${BU_NAME}-${BU_VERSION}.tar.bz2
DIR_SRCS=${CURDIR}/source
DIR_UPCK=${CURDIR}/unpacked
DIR_BLD=${CURDIR}/build-sparc
DIR_INST=${CURDIR}/install-sparc
DIR_PTCH=${SCRIPTDIR}/patches
GENDIRS="${DIR_SRCS} ${DIR_UPCK} ${DIR_BLD} ${DIR_INST}"
FN_BUPKG=${DIR_SRCS}/${BU_PACKAGE}
DN_BUUNP=${DIR_UPCK}/${BU_NAME}-${BU_VERSION}
CFG_ARGS="--prefix=${DIR_INST} --build=${HOST_TRIPLE} --host=${HOST_TRIPLE} \
--target=${TGT_TRIPLE} --enable-targets=${TGT_TRIPLE} \
--disable-nls --disable-multilib"
prepare_dirs() {
for d in ${GENDIRS}
do
echo "Create directory ${d}"
mkdir -p ${d}
done
}
download_source() {
mkdir -p ${DIR_SRCS}
DOWN=1
if [ -f ${FN_BUPKG} ]
then
echo "Original package is already downloaded ... check consistency"
bzip2 -t ${FN_BUPKG} 2>/dev/null
if [ $? -ne 0 ]
then
echo " The package is invalid."
else
echo " Package is usable"
DOWN=0
fi
fi
if [ ${DOWN} -eq 1 ]
then
echo "Download original package"
wget ${BU_SERVER}/binutils/${BU_PACKAGE} -O ${FN_BUPKG}
fi
}
unpack_source() {
mkdir -p ${DIR_UPCK}
UNP=1
if [ ! -f ${FN_BUPKG} ]
then
echo "Original package isn't downloaded"
UNP=0
fi
if [ -e ${DN_BUUNP} ]
then
echo "Package is already unpacked"
UNP=0
fi
if [ ${UNP} -eq 1 ]
then
echo "Unpack original package"
tar -C ${DIR_UPCK} -xjf ${FN_BUPKG}
fi
}
apply_patches() {
if [ ! -e ${DIR_PTCH} ]
then
echo "There is not a directory with patches"
exit 1
fi
for p in `ls -v ${DIR_PTCH}/*.patch`
do
echo "Use patch ${p}"
patch -d ${DN_BUUNP} -p1 < ${p}
done
}
build_source() {
if [ ! -e ${DN_BUUNP} ]
then
echo "There is no unpacked files with source codes"
exit 1
fi
mkdir -p ${DIR_BLD}
cd ${DIR_BLD}
CONF=1
if [ -f Makefile ]
then
echo "Compilation is already configured - skip."
CONF=0
fi
if [ ${CONF} -eq 1 ]
then
${DN_BUUNP}/configure ${CFG_ARGS}
if [ $? -ne 0 ]
then
echo "E: configure failed"
exit 1
fi
fi
make
if [ $? -ne 0 ]
then
echo "E: make failed"
exit 1
fi
cd ${CURDIR}
}
install_pkg() {
mkdir -p ${DIR_INST}
cd ${DIR_BLD}
make install
cd ${CURDIR}
}
clean_build() {
echo "Removing build and install directories."
rm -rf ${DIR_BLD} ${DIR_INST}
}
clean_unpacked() {
echo "Removing unpacked directory."
rm -rf ${DIR_UPCK}
}
distclean_all() {
echo "Removing all generated files and directories."
rm -rf ${GENDIRS}
}
# ##############################################################################
print_help() {
echo "The script needs one argument - required operation:"
echo " all - do all steps"
echo " get - download source package if it doesn't exist"
echo " unpack - unpack downloaded package only"
echo " patch - patch original package"
echo " build - build binutils package"
echo " install - install binutils to the output directory"
echo " clean - remove generated files (build and install dirs.)"
echo " packclean - remove unpacked files (unpack dir.)"
echo " distclean - remove all generated files and directories"
}
# ##############################################################################
# main ...
echo "Script for preparing package of patched binutils for LEON IP core extensions."
if [ "$#" -ne 1 ]
then
print_help
exit 0
fi
case $1 in
"all" )
#echo "do all"
download_source
clean_unpacked
unpack_source
apply_patches
build_source
install_pkg
;;
"get" )
#echo "do download"
download_source
;;
"unpack" )
#echo "do unpack"
unpack_source
;;
"patch" )
#echo "do patch"
apply_patches
;;
"build" )
#echo "do build"
build_source
;;
"install" )
#echo "do install"
install_pkg
;;
"clean" )
#echo "do clean"
clean_build
;;
"packclean" )
#echo "do packclean"
clean_unpacked
;;
"distclean" )
#echo "do distclean"
distclean_all
;;
* )
echo "E: Unsupported operation"
print_help
exit 1
;;
esac
Test of added instructions
==========================
riscv64-daiteq-elf-as -o test_h.o ./test_fp_half.s
riscv64-daiteq-elf-objdump -S ./test_h.o > test_h.dis
riscv64-daiteq-elf-as -o test_ph.o ./test_fp_ph.s
riscv64-daiteq-elf-objdump -S ./test_ph.o > test_ph.dis
riscv64-daiteq-elf-as -o test_ps.o ./test_fp_ps.s
riscv64-daiteq-elf-objdump -S ./test_ps.o > test_ps.dis
riscv64-daiteq-elf-as -march=rv64gq -o test_pd.o ./test_fp_pd.s
riscv64-daiteq-elf-objdump -S ./test_pd.o > test_pd.dis
# test all added instructions for half precision FP data
.section .text
.global test_half
test_half:
la a0, half_a
flh ft0, 0(a0)
la a0, half_y
fsh ft0, 0(a0)
fmv.x.h t0, ft0 # move ft1->t0
fmv.h.x ft0, t0
fmv.h ft0, ft1
fneg.h ft0, ft1
fabs.h ft0, ft1
fsgnj.h ft0, ft1, ft2
fsgnjn.h ft0, ft1, ft2
fsgnjx.h ft0, ft1, ft2
fadd.h ft0, ft1, ft2
fadd.h ft0, ft1, ft2, rtz
fsub.h ft0, ft1, ft2
fsub.h ft0, ft1, ft2, rtz
fmul.h ft0, ft1, ft2
fmul.h ft0, ft1, ft2, rtz
fdiv.h ft0, ft1, ft2
fdiv.h ft0, ft1, ft2, rtz
fsqrt.h ft0, ft1
fsqrt.h ft0, ft1, rtz
fmin.h ft0, ft1, ft2
fmax.h ft0, ft1, ft2
fmadd.h ft0, ft1, ft2, ft3
fmadd.h ft0, ft1, ft2, ft3, rtz
fnmadd.h ft0, ft1, ft2, ft3
fnmadd.h ft0, ft1, ft2, ft3, rtz
fmsub.h ft0, ft1, ft2, ft3
fmsub.h ft0, ft1, ft2, ft3, rtz
fnmsub.h ft0, ft1, ft2, ft3
fnmsub.h ft0, ft1, ft2, ft3, rtz
fcvt.w.h t0, ft1
fcvt.w.h t0, ft1, rtz
fcvt.wu.h t0, ft1
fcvt.wu.h t0, ft1, rtz
fcvt.h.w ft0, t1
fcvt.h.w ft0, t1, rtz
fcvt.h.wu ft0, t1
fcvt.h.wu ft0, t1, rtz
fcvt.l.h t0, ft1
fcvt.l.h t0, ft1, rtz
fcvt.lu.h t0, ft1
fcvt.lu.h t0, ft1, rtz
fcvt.h.l ft0, t1
fcvt.h.l ft0, t1, rtz
fcvt.h.lu ft0, t1
fcvt.h.lu ft0, t1, rtz
fclass.h t1, ft0
feq.h t0, ft0, ft1
flt.h t0, ft0, ft1
fle.h t0, ft0, ft1
fgt.h t0, ft0, ft1
fge.h t0, ft0, ft1
.section .rodata
half_a:
.half 0x1234
.section .data
half_y:
.half 0
# test all added instructions for packed double FP data
.section .text
.global test_packed
test_packed:
la a0, packdouble_a
flpd ft0, 0(a0)
la a0, packdouble_y
fspd ft0, 0(a0)
fmv.x.pd t0, ft0 # move ft1->t0
fmv.pd.x ft0, t0
fmv.pd ft0, ft1
fneg.pd ft0, ft1
fabs.pd ft0, ft1
fsgnj.pd ft0, ft1, ft2
fsgnjn.pd ft0, ft1, ft2
fsgnjx.pd ft0, ft1, ft2
fclass.pd t0, ft1
feq.pd t0, ft0, ft1
flt.pd t0, ft0, ft1
fle.pd t0, ft0, ft1
fgt.pd t0, ft0, ft1
fge.pd t0, ft0, ft1
fadd.pd ft0, ft1, ft2
fadd.pd ft0, ft1, ft2, rtz
fsub.pd ft0, ft1, ft2
fsub.pd ft0, ft1, ft2, rtz
fmul.pd ft0, ft1, ft2
fmul.pd ft0, ft1, ft2, rtz
fdiv.pd ft0, ft1, ft2
fdiv.pd ft0, ft1, ft2, rtz
fsqrt.pd ft0, ft1
fsqrt.pd ft0, ft1, rtz
fmin.pd ft0, ft1, ft2
fmax.pd ft0, ft1, ft2
faddx.pd ft0, ft1, ft2
faddx.pd ft0, ft1, ft2, rtz
fsubx.pd ft0, ft1, ft2
fsubx.pd ft0, ft1, ft2, rtz
fmulx.pd ft0, ft1, ft2
fmulx.pd ft0, ft1, ft2, rtz
fdivx.pd ft0, ft1, ft2
fdivx.pd ft0, ft1, ft2, rtz
faddr.pd ft0, ft1, ft2
faddr.pd ft0, ft1, ft2, rtz
fsubr.pd ft0, ft1, ft2
fsubr.pd ft0, ft1, ft2, rtz
fmulr.pd ft0, ft1, ft2
fmulr.pd ft0, ft1, ft2, rtz
fdivr.pd ft0, ft1, ft2
fdivr.pd ft0, ft1, ft2, rtz
faddsubr.pd ft0, ft1, ft2
faddsubr.pd ft0, ft1, ft2, rtz
fsubaddr.pd ft0, ft1, ft2
fsubaddr.pd ft0, ft1, ft2, rtz
fmvuu.pd ft0, ft1, ft2
fmvll.pd ft0, ft1, ft2
fmvul.pd ft0, ft1, ft2
fmvlu.pd ft0, ft1, ft2
fmvzu.pd ft0, ft1
fmvzl.pd ft0, ft1
fswap.pd ft0, ft1
.section .rodata
packdouble_a:
.dword 0x123456789ABCDEF0,0x1122334455667788
.section .data
packdouble_y:
.dword 0,0
# test all added instructions for packed half FP data
.section .text
.global test_half
test_half:
la a0, packhalf_a
flph ft0, 0(a0)
la a0, packhalf_y
fsph ft0, 0(a0)
fmv.x.ph t0, ft0 # move ft1->t0
fmv.ph.x ft0, t0
fmv.ph ft0, ft1
fneg.ph ft0, ft1
fabs.ph ft0, ft1
fsgnj.ph ft0, ft1, ft2
fsgnjn.ph ft0, ft1, ft2
fsgnjx.ph ft0, ft1, ft2
fclass.ph t0, ft1
feq.ph t0, ft0, ft1
flt.ph t0, ft0, ft1
fle.ph t0, ft0, ft1
fgt.ph t0, ft0, ft1
fge.ph t0, ft0, ft1
fadd.ph ft0, ft1, ft2
fadd.ph ft0, ft1, ft2, rtz
fsub.ph ft0, ft1, ft2
fsub.ph ft0, ft1, ft2, rtz
fmul.ph ft0, ft1, ft2
fmul.ph ft0, ft1, ft2, rtz
fdiv.ph ft0, ft1, ft2
fdiv.ph ft0, ft1, ft2, rtz
fsqrt.ph ft0, ft1
fsqrt.ph ft0, ft1, rtz
fmin.ph ft0, ft1, ft2
fmax.ph ft0, ft1, ft2
faddx.ph ft0, ft1, ft2
faddx.ph ft0, ft1, ft2, rtz
fsubx.ph ft0, ft1, ft2
fsubx.ph ft0, ft1, ft2, rtz
fmulx.ph ft0, ft1, ft2
fmulx.ph ft0, ft1, ft2, rtz
fdivx.ph ft0, ft1, ft2
fdivx.ph ft0, ft1, ft2, rtz
faddr.ph ft0, ft1, ft2
faddr.ph ft0, ft1, ft2, rtz
fsubr.ph ft0, ft1, ft2
fsubr.ph ft0, ft1, ft2, rtz
fmulr.ph ft0, ft1, ft2
fmulr.ph ft0, ft1, ft2, rtz
fdivr.ph ft0, ft1, ft2
fdivr.ph ft0, ft1, ft2, rtz
faddsubr.ph ft0, ft1, ft2
faddsubr.ph ft0, ft1, ft2, rtz
fsubaddr.ph ft0, ft1, ft2
fsubaddr.ph ft0, ft1, ft2, rtz
fmvuu.ph ft0, ft1, ft2
fmvll.ph ft0, ft1, ft2
fmvul.ph ft0, ft1, ft2
fmvlu.ph ft0, ft1, ft2
fmvzu.ph ft0, ft1
fmvzl.ph ft0, ft1
fswap.ph ft0, ft1
.section .rodata
packhalf_a:
.word 0x12345678
.section .data
packhalf_y:
.word 0
# test all added instructions for packed single FP data
.section .text
.global test_packed
test_packed:
la a0, packsingle_a
flps ft0, 0(a0)
la a0, packsingle_y
fsps ft0, 0(a0)
fmv.x.ps t0, ft0 # move ft1->t0
fmv.ps.x ft0, t0
fmv.ps ft0, ft1
fneg.ps ft0, ft1
fabs.ps ft0, ft1
fsgnj.ps ft0, ft1, ft2
fsgnjn.ps ft0, ft1, ft2
fsgnjx.ps ft0, ft1, ft2
fclass.ps t0, ft1
feq.ps t0, ft0, ft1
flt.ps t0, ft0, ft1
fle.ps t0, ft0, ft1
fgt.ps t0, ft0, ft1
fge.ps t0, ft0, ft1
fadd.ps ft0, ft1, ft2
fadd.ps ft0, ft1, ft2, rtz
fsub.ps ft0, ft1, ft2
fsub.ps ft0, ft1, ft2, rtz
fmul.ps ft0, ft1, ft2
fmul.ps ft0, ft1, ft2, rtz
fdiv.ps ft0, ft1, ft2
fdiv.ps ft0, ft1, ft2, rtz
fsqrt.ps ft0, ft1
fsqrt.ps ft0, ft1, rtz
fmin.ps ft0, ft1, ft2
fmax.ps ft0, ft1, ft2
faddx.ps ft0, ft1, ft2
faddx.ps ft0, ft1, ft2, rtz
fsubx.ps ft0, ft1, ft2
fsubx.ps ft0, ft1, ft2, rtz
fmulx.ps ft0, ft1, ft2
fmulx.ps ft0, ft1, ft2, rtz
fdivx.ps ft0, ft1, ft2
fdivx.ps ft0, ft1, ft2, rtz
faddr.ps ft0, ft1, ft2
faddr.ps ft0, ft1, ft2, rtz
fsubr.ps ft0, ft1, ft2
fsubr.ps ft0, ft1, ft2, rtz
fmulr.ps ft0, ft1, ft2
fmulr.ps ft0, ft1, ft2, rtz
fdivr.ps ft0, ft1, ft2
fdivr.ps ft0, ft1, ft2, rtz
faddsubr.ps ft0, ft1, ft2
faddsubr.ps ft0, ft1, ft2, rtz
fsubaddr.ps ft0, ft1, ft2
fsubaddr.ps ft0, ft1, ft2, rtz
fmvuu.ps ft0, ft1, ft2
fmvll.ps ft0, ft1, ft2
fmvul.ps ft0, ft1, ft2
fmvlu.ps ft0, ft1, ft2
fmvzu.ps ft0, ft1
fmvzl.ps ft0, ft1
fswap.ps ft0, ft1
.section .rodata
packsingle_a:
.dword 0x123456789ABCDEF0
.section .data
packsingle_y:
.dword 0
# test all added instructions for SWAR extension
.section .text
.global test_swar
test_swar:
swar t0, t1, t2
swar t0, t1, 0x123
swari t0, t1, 0x123
swarcc t0, t1, t2
swarcc t0, t1, 0x123
swarcci t0, t1, 0x123
csrw swarctrlstat, t0
csrw swaracc0, t0
csrw swaracc0hi, t0
csrw swaracc1, t0
csrw swaracc1hi, t0
csrw swaracc2, t0
csrw swaracc2hi, t0
csrw swaracc3, t0
csrw swaracc3hi, t0
.section .rodata
swar_a:
.word 0x12345678
.section .data
swar_y:
.word 0
# Test SPARC old FPU instructions for double precision
.text
# fmovd %f0, %f1
# fnegd %f0, %f1
# fabsd %f0, %f1
faddd %f0, %f2, %f4
fsubd %f0, %f2, %f4
fmuld %f0, %f2, %f4
fdivd %f0, %f2, %f4
fsqrtd %f0, %f2
fsmuld %f0, %f1, %f2
fdtoi %f0, %f2
fitod %f0, %f2
fstod %f0, %f2
fdtos %f2, %f0
fcmpd %f0, %f2
fcmped %f0, %f2
# Test SPARC new FPU instructions for half precision
.text
fmovh %f0, %f1
fnegh %f0, %f1
fabsh %f0, %f1
faddh %f0, %f1, %f2
fsubh %f0, %f1, %f2
fmulh %f0, %f1, %f2
fdivh %f0, %f1, %f2
fhmuls %f0, %f1, %f2
fsqrth %f0, %f1
fhtoi %f0, %f1
fitoh %f0, %f1
fstoh %f0, %f1
fhtos %f0, %f1
fcmph %f0, %f1
fcmpeh %f0, %f1
sethi %hi(halfarr),%i0
ldh [%i0+%lo(halfarr)],%f0
sth %f0,[%fp-4]
.section .rodata
halfarr:
.half 15600 ! half 1.2344
.p2align 2
# Test SPARC new FPU instructions for packed FP numbers (half precision)
.text
fmovhu %f0, %f1, %f2
fmovhl %f0, %f1, %f2
fmovhul %f0, %f1, %f2
fmovhlu %f0, %f1, %f2
fswaph %f0, %f1
fmovhzu %f0, %f1
fmovhzl %f0, %f1
faddph %f0, %f1, %f2
faddrph %f0, %f1, %f2
faddxph %f0, %f1, %f2
fsubph %f0, %f1, %f2
fsubrph %f0, %f1, %f2
fsubxph %f0, %f1, %f2
fmulph %f0, %f1, %f2
fmulrph %f0, %f1, %f2
fmulxph %f0, %f1, %f2
fdivph %f0, %f1, %f2
fdivrph %f0, %f1, %f2
fdivxph %f0, %f1, %f2
fsqrtph %f0, %f1
fcmpph %f0, %f1
fcmpeph %f0, %f1
# fpabsh %f0, %f1
# faddps %f0, %f2, %f4
# fsubps %f0, %f2, %f4
# fmulps %f0, %f2, %f4
# fdivps %f0, %f2, %f4
# fsqrtps %f0, %f2
# fmovhl %f0, %f1
# fmovhu %f0, %f1
# fswaph %f0, %f1
# Test SPARC new FPU instructions for packed FP numbers (single precision)
.text
fmovs %f0, %f1
fmovs %f0, %f2
fmovs %f1, %f3
faddps %f0, %f2, %f4
faddrps %f0, %f2, %f4
faddxps %f0, %f2, %f4
fsubps %f0, %f2, %f4
fsubrps %f0, %f2, %f4
fsubxps %f0, %f2, %f4
fmulps %f0, %f2, %f4
fmulrps %f0, %f2, %f4
fmulxps %f0, %f2, %f4
fdivps %f0, %f2, %f4
fdivrps %f0, %f2, %f4
fdivxps %f0, %f2, %f4
fsqrtps %f0, %f2
fcmpps %f0, %f2
fcmpeps %f0, %f2
# Test SPARC old FPU instructions for single precision
.text
fmovs %f0, %f1
fnegs %f0, %f1
fabss %f0, %f1
fadds %f0, %f1, %f2
fsubs %f0, %f1, %f2
fmuls %f0, %f1, %f2
fdivs %f0, %f1, %f2
fsqrts %f0, %f1
fstoi %f0, %f1
fitos %f0, %f1
fcmps %f0, %f1
fcmpes %f0, %f1
# Test SPARC new SWAR options
.text
swar %r1, %r2, %r3
swar %r1, 0x1fff, %r2
swar 0x1fff, %r1, %r2
swarcc %r1, %r2, %r3
swarcc %r1, 0x1fff, %r2
swarcc 0x1fff, %r1, %r2
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!