TCE

tcedisasm prints unsigned immediates incorrectly

Bug #1250451 reported by Heikki Kultala
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TCE
Fix Committed
Low
Jesper Hjorth

Bug Description

Bus has for example 8-bit unsigned short immediate (values 0..255).

Values 255 is being transferred via the bus.
tcedisasm shows the immediate value as -1 instead of 255, it always interprets them as signed.

Revision history for this message
Heikki Kultala (hkultala) wrote :

It seems sometimes also -1 gets printed as UINT_MAX

Changed in tce:
assignee: nobody → Jesper Hjorth (jesper-hjorth)
status: New → In Progress
Changed in tce:
status: In Progress → Fix Committed
Revision history for this message
Jesper Hjorth (jesper-hjorth) wrote :

Ended up fixing the code to be similar to the one used in dumptpef since it seems to work:

TPEFProgramFactory.cc
784 if (imm->isInline()) {
785
786 // should use bus width, but universal machine messes this up
787 // (since it has 64 busses)
788 SimValue simValue(32);
789 simValue = imm->word();

the bug should fix also by using the bus width, but then universal machine breaks the tests. Probably some bugs in simvalue are also responsible (e.g. when using SimValue operator= the bit width is not always reassigned, but it's clear whether or not this is intentional)

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

This needs more attention. Where does the magic 32 number come from? If you suspect a bug elsewhere, it should be fixed elsewhere not trying to workaround it somewhere else with a potentially new issue. Why is UM a problem, can you explain a bit more?

It should not be the bus width, but the short immediate slot width of the bus (move slot in the instruction) in question, as far as I understood from a quick look.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.