public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* cgen-ibld.in 64-bit extract bug
@ 2001-07-16 22:38 Richard Henderson
  2001-07-17  4:13 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2001-07-16 22:38 UTC (permalink / raw)
  To: cgen

CGEN_INSN_INT is usually an unsigned int, while valuep is a long.
Under these conditions, the masking and sign-extension done at the
end of the function is incorrect unless sizeof(int)==sizeof(long).

Ok?


r~


	* cgen-ibld.in (extract_normal): Make value and mask a long.

Index: cgen-ibld.in
===================================================================
RCS file: /cvs/cvsfiles/devo/opcodes/cgen-ibld.in,v
retrieving revision 1.15
diff -c -p -d -r1.15 cgen-ibld.in
*** cgen-ibld.in	2001/07/01 02:49:14	1.15
--- cgen-ibld.in	2001/07/17 05:32:18
*************** extract_normal (cd, ex_info, insn_value,
*** 415,421 ****
  #endif
       long *valuep;
  {
!   CGEN_INSN_INT value, mask;
  
    /* If LENGTH is zero, this operand doesn't contribute to the value
       so give it a standard value of zero.  */
--- 415,421 ----
  #endif
       long *valuep;
  {
!   long value, mask;
  
    /* If LENGTH is zero, this operand doesn't contribute to the value
       so give it a standard value of zero.  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cgen-ibld.in 64-bit extract bug
  2001-07-16 22:38 cgen-ibld.in 64-bit extract bug Richard Henderson
@ 2001-07-17  4:13 ` Frank Ch. Eigler
  2001-07-17  8:53   ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2001-07-17  4:13 UTC (permalink / raw)
  To: Richard Henderson; +Cc: cgen

Hi -

rth wrote:
: CGEN_INSN_INT is usually an unsigned int, while valuep is a long.
: [...]
: Ok?
: 	* cgen-ibld.in (extract_normal): Make value and mask a long.

Sure, that, or changing CGEN_INSN_INT to (unsigned?) long instead.
Are you dealing with a 64-bit host or a 64-bit target?

- FChE
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7VB22VZbdDOm/ZT0RAkKaAJ9x+V4WihDaexCN8TVt2REA5ZJoSACffzF2
OrN1dGa4LiPdDJX11IFs6/U=
=0eH1
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cgen-ibld.in 64-bit extract bug
  2001-07-17  4:13 ` Frank Ch. Eigler
@ 2001-07-17  8:53   ` Richard Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2001-07-17  8:53 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: cgen

On Tue, Jul 17, 2001 at 07:12:54AM -0400, Frank Ch. Eigler wrote:
> Sure, that, or changing CGEN_INSN_INT to (unsigned?) long instead.

Whichever you prefer.

> Are you dealing with a 64-bit host or a 64-bit target?

64-bit host, 32-bit target (as it happens).


r~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-17  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-16 22:38 cgen-ibld.in 64-bit extract bug Richard Henderson
2001-07-17  4:13 ` Frank Ch. Eigler
2001-07-17  8:53   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).