From: Jim Blandy Date: Mon, 28 Jun 2004 19:02:49 +0000 (+0000) Subject: * e500_registers.h (EVR): Cast the 32-bit value of the GPR to an X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71d39cfcfd3409f3746a20edc34f2106900ae1cb;p=binutils-gdb.git * e500_registers.h (EVR): Cast the 32-bit value of the GPR to an unsigned type before or-ing it with a 64-bit value. --- diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 55b18cceec3..f2f1aa8014c 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2004-06-28 Jim Blandy + + * e500_registers.h (EVR): Cast the 32-bit value of the GPR to an + unsigned type before or-ing it with a 64-bit value. + 2004-06-15 Alan Modra * hw_htab.c (htab_sum_binary(bfd): Use bfd_get_section_size diff --git a/sim/ppc/e500_registers.h b/sim/ppc/e500_registers.h index cd12ab5ec27..ccf5e0f88c0 100644 --- a/sim/ppc/e500_registers.h +++ b/sim/ppc/e500_registers.h @@ -79,5 +79,8 @@ struct e500_regs { /* e500 register high bits */ #define GPRH(N) cpu_registers(processor)->e500.gprh[N] -/* e500 unified vector register */ -#define EVR(N) ((((unsigned64)GPRH(N)) << 32) | GPR(N)) +/* e500 unified vector register + We need to cast the gpr value to an unsigned type so that it + doesn't get sign-extended when it's or-ed with a 64-bit value; that + would wipe out the upper 32 bits of the register's value. */ +#define EVR(N) ((((unsigned64)GPRH(N)) << 32) | (unsigned32) GPR(N))