summaryrefslogtreecommitdiff
path: root/target-ppc/op_helper.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-09 16:48:51 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-09 16:48:51 +0000
commitc5032b33643df64d1b8446021849396ad381e8bc (patch)
treead8a7302aeea380ce05722e6aeca921ff0028d09 /target-ppc/op_helper.c
parent7d10747bef4b120973a23d2aa76409ecd62eafba (diff)
downloadqemu-c5032b33643df64d1b8446021849396ad381e8bc.tar.gz
qemu-c5032b33643df64d1b8446021849396ad381e8bc.tar.bz2
qemu-c5032b33643df64d1b8446021849396ad381e8bc.zip
target-ppc: Add v{add,sub}fp instructions
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6569 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r--target-ppc/op_helper.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 674a21dfbb..6cf47a3576 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -2099,6 +2099,20 @@ VARITH(uwm, u32)
#undef VARITH_DO
#undef VARITH
+#define VARITHFP(suffix, func) \
+ void helper_v##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
+ { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(r->f); i++) { \
+ HANDLE_NAN2(r->f[i], a->f[i], b->f[i]) { \
+ r->f[i] = func(a->f[i], b->f[i], &env->vec_status); \
+ } \
+ } \
+ }
+VARITHFP(addfp, float32_add)
+VARITHFP(subfp, float32_sub)
+#undef VARITHFP
+
#define VARITHSAT_CASE(type, op, cvt, element) \
{ \
type result = (type)a->element[i] op (type)b->element[i]; \