Summary: | Bfin simulator - error in handling >>> (S), when shift value > 16 | ||
---|---|---|---|
Product: | gdb | Reporter: | Igor Rayak <igorr> |
Component: | sim | Assignee: | Mike Frysinger <vapier> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | igorr, vapier |
Priority: | P2 | ||
Version: | 7.9 | ||
Target Milestone: | --- | ||
Host: | Target: | bfin-elf | |
Build: | Last reconfirmed: | ||
Attachments: | suggested patch |
Description
Igor Rayak
2015-05-13 11:02:35 UTC
Created attachment 8310 [details]
suggested patch
which CPU are you running this against ? historically, we dropped support for BF535 and only went for newer processors as customers had already moved away from it and it had too many quirks wrt all other versions. r u asking which CPU I'm simulating on visualDSP++? It gives the same results on both simulators supplied with visualDSP++, e.g. bf535 and all others. If I recall correctly I've checked it on bf532. in any case it's strange that objdump creates something which cannot be compiled: e.g. R1 = R1 >>> 1 (S) after compiled, converted to R1 = R1 << 0x3f (S) by objdump, and later cannot be compiled by gcc. Which seems to be wrong, unrelated to CPU type. i'm not terribly interested in how the vdsp sim operates :). the gnu sim should match the hardware. if you're seeing a diff between bf532 in the sim and real hardware, then that def needs fixing. unfortunately i'm traveling atm and won't have access to bfin hardware for a while to run some tests. wrt objdump, i agree it's a bit weird. i'll take a look at that too. there are some cases where the hardware actually respects the full shift amount even though it's not documented in the PRM. the disassembler can also be pretty basic in its decoding ... i've been meaning to sync the sim & opcodes at some point. The master branch has been updated by Michael Frysinger <vapier@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3f946aa82518e878aea2cba4b6a9bcc651412c5c commit 3f946aa82518e878aea2cba4b6a9bcc651412c5c Author: Mike Frysinger <vapier@gentoo.org> Date: Sun Oct 11 03:32:11 2015 -0400 sim: bfin: handle negative left saturated shifts as ashifts [BZ #18407] When handling left saturated ashifts with negative immediates, they should be treated as right ashifts. This matches hardware behavior. Reported-by: Igor Rayak <igorr@gitatechnologies.com> thanks, i've committed a fix to the master branch now |