This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
simulation; vliw targets; writeback tracking bitstring overflow
- To: cgen at sources dot redhat dot com
- Subject: simulation; vliw targets; writeback tracking bitstring overflow
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Thu, 25 Jan 2001 17:39:54 -0500
Hi -
For an under-development cgen-based simulator port, we have a VLIW-type
machine that uses the "parallel-write?" method of concurrency modelling.
That means that during the semantic stage, a parexec struct is filled up
with write-queued operand values, and a bitmask field ("written") is
tweaked to indicate that a given field in the struct was in fact enqueued.
The problem is that this indicator bitfield is hard-coded as an "unsigned
int", meaning that it can be used to track just 32 operands. My port of
interest manages to overflow this humble limit, and uses bit numbers on
the order 35 .. 37. That obviously won't fit, and leads to failures.
(Actually, only the compiler warnings "left shift amount >= width" gave
away that something suspicious was going on!)
Anyway, this needs to get fixed. A couple of alternatives are:
- widening the bitfield to "unsigned long long"
- adopting a separate per-field indicator variable
- (since I'm interested in sid -> C++) adopting a std::bitset<N> type
I'm tempted to do #1 for now, though #2 sounds straightforward too.
Opinions?
- FChE
PGP signature