This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: MAC instructions on H8300S [H8S/2600]
- From: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>
- To: gnuh8 at gnuh8 dot org dot uk, gdb at sources dot redhat dot com, binutils at sources dot redhat dot com, Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>
- Date: Tue, 18 Feb 2003 16:57:16 +0530
- Subject: Re: MAC instructions on H8300S [H8S/2600]
Hi All,
(Subsequent to earlier mails on this subject)
The test case gcc.c-torture/execute/va-arg-22.c fails:
FAIL: gcc.c-torture/execute/va-arg-22.c execution, -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions
This failure is specific to
Running target h8300-sim/-O2 -mint32 -ms -ms2600
The culprits were MAC-related instructions. being
generated by the compiler. The simulator does not
recognise these instruction and aborts. I was
trying to add the support to the simulator.
In the file include/opcode/h8300.h, in the
const struct h8_opcode h8_opcodes[] definition:
The definition for ldmac and stmac should be
NEW_SOP(O(O_LDMAC,SL),1,2,"ldmac"),{{RS32,MD32,E}},{{0x0,0x3,MD32,RS32,E}}
EOP,
NEW_SOP(O(O_STMAC,SL),1,2,"stmac"),{{MS32,RD32,E}},{{0x0,0x2,MS32,RD32,E}}
EOP,
where MS32 and MD32 are defined as :
#define MS32 (SRC|L_32|MACREG)
#define MD32 (DST|L_32|MACREG)
instead of :
NEW_SOP(O(O_LDMAC,SL),1,2,"ldmac"),{{RS32,MACREG,E}},{{0x0,0x3,MACREG,RS32,E
}} EOP,
NEW_SOP(O(O_STMAC,SL),1,2,"stmac"),{{MACREG,RD32,E}},{{0x0,0x2,MACREG,RD32,E
}} EOP,
This way, the simulator will be able to recognize
that MD32 specifies a destination register and
MS32 specifies a source register.
Could someone comment whether this is correct.
Anyways, this change would not break anything
that has been running until now.
Thanks and Regards,
Venky
PS : As the H8300 Simulator is totally undocumented,
could the original author add some comments to the
code if he could find the time. Many things remain
unclear still.
[venkat@peacock Bug19]$ h8300-elf-gcc -v
Reading specs from
/export/venkat/gcc_release_3_3/h8300-elf/tools/lib/gcc-lib/h8300-elf/3.3/spe
cs
Configured with: /home/GCC_RELEASE/configure --target=h8300-elf
--prefix=/export/venkat/gcc_release_3_3/h8300-elf/tools --enable-languages=c
--with-newlib --with-headers=/home/GCC_RELEASE/newlib/libc/include/
Thread model: single
gcc version 3.3 20030127 (prerelease)