From: Daniel Jacobowitz <drow@false.org>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 3/4] decimal floating point support for expressions
Date: Thu, 11 Oct 2007 16:18:00 -0000 [thread overview]
Message-ID: <20071011161645.GD22982@caradoc.them.org> (raw)
In-Reply-To: <20070920215539.891263549@br.ibm.com>
On Thu, Sep 20, 2007 at 06:54:13PM -0300, Thiago Jung Bauermann wrote:
> + putithere->typed_val_decfloat.type =
> + builtin_type (current_gdbarch)->builtin_decfloat;
Equals sign on next line please.
> @@ -1376,6 +1376,20 @@ value_neg (struct value *arg1)
>
> type = check_typedef (value_type (arg1));
>
> + if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
> + {
> + struct value *val = allocate_value (result_type);
> + int len = TYPE_LENGTH (type);
> + gdb_byte *decbytes = (gdb_byte *) value_contents (arg1);
> +
> + if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
> + decbytes[len-1] = decbytes[len - 1] | 0x80;
> + else
> + decbytes[0] = decbytes[0] | 0x80;
> + memcpy (value_contents_raw (val), decbytes, 16);
> + return val;
> + }
> +
The reason we allocate a new value is to leave the existing value
unchanged, so you shouldn't modify the contents of arg1. The casts
are probably there because otherwise GCC complained you were removing
a const. Don't do that :-)
> +#include "dfp.h"
If you add an #include, update Makefile.in.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-10-11 16:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-20 21:57 [patch 0/4] decimal floating point support Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 2/4] decimal floating point types Thiago Jung Bauermann
2007-10-11 16:00 ` Daniel Jacobowitz
2007-10-15 18:12 ` Thiago Jung Bauermann
2007-10-24 20:11 ` Daniel Jacobowitz
2007-10-25 18:24 ` Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 1/4] libdecnumber support Thiago Jung Bauermann
2007-10-11 15:57 ` Daniel Jacobowitz
2007-10-11 16:07 ` Daniel Jacobowitz
2007-10-15 18:32 ` Thiago Jung Bauermann
2007-10-15 18:11 ` Thiago Jung Bauermann
2007-10-15 18:38 ` Daniel Jacobowitz
2007-10-25 18:23 ` Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 3/4] decimal floating point support for expressions Thiago Jung Bauermann
2007-10-11 16:18 ` Daniel Jacobowitz [this message]
2007-10-15 18:12 ` Thiago Jung Bauermann
2007-10-24 20:12 ` Daniel Jacobowitz
2007-10-25 18:40 ` Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 4/4] decimal floating point testcases Thiago Jung Bauermann
2007-10-11 16:19 ` Daniel Jacobowitz
2007-10-15 18:12 ` Thiago Jung Bauermann
2007-10-25 18:22 ` Thiago Jung Bauermann
[not found] <20070323030737.475073862@br.ibm.com>
2007-03-27 16:30 ` [patch 3/4] decimal floating point support for expressions Thiago Jung Bauermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071011161645.GD22982@caradoc.them.org \
--to=drow@false.org \
--cc=bauerman@br.ibm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox