Overcautious assert in shift is removed.
This commit is contained in:
parent
0f13af2ea1
commit
38b4de87ad
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: vvm_func.cc,v 1.8 2000/04/29 01:19:47 steve Exp $"
|
#ident "$Id: vvm_func.cc,v 1.9 2000/05/18 20:23:40 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "vvm_func.h"
|
# include "vvm_func.h"
|
||||||
|
|
@ -149,7 +149,7 @@ void vvm_binop_shiftl(vvm_bitset_t&v,
|
||||||
const vvm_bitset_t&l,
|
const vvm_bitset_t&l,
|
||||||
const vvm_bitset_t&r)
|
const vvm_bitset_t&r)
|
||||||
{
|
{
|
||||||
assert(v.nbits == l.nbits);
|
assert(v.nbits <= l.nbits);
|
||||||
vvm_u32 s = r.as_unsigned();
|
vvm_u32 s = r.as_unsigned();
|
||||||
for (unsigned idx = 0 ; idx < v.nbits; idx += 1)
|
for (unsigned idx = 0 ; idx < v.nbits; idx += 1)
|
||||||
v[idx] = (idx < s) ? St0 : l[idx-s];
|
v[idx] = (idx < s) ? St0 : l[idx-s];
|
||||||
|
|
@ -159,8 +159,8 @@ void vvm_binop_shiftr(vvm_bitset_t&v,
|
||||||
const vvm_bitset_t&l,
|
const vvm_bitset_t&l,
|
||||||
const vvm_bitset_t&r)
|
const vvm_bitset_t&r)
|
||||||
{
|
{
|
||||||
assert(v.nbits == l.nbits);
|
|
||||||
vvm_u32 s = r.as_unsigned();
|
vvm_u32 s = r.as_unsigned();
|
||||||
|
|
||||||
for (unsigned idx = 0 ; idx < v.nbits ; idx += 1)
|
for (unsigned idx = 0 ; idx < v.nbits ; idx += 1)
|
||||||
v[idx] = ((idx+s) < l.nbits) ? l[idx+s] : St0;
|
v[idx] = ((idx+s) < l.nbits) ? l[idx+s] : St0;
|
||||||
}
|
}
|
||||||
|
|
@ -496,6 +496,9 @@ void vvm_ternary(vvm_bitset_t&v, vpip_bit_t c,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vvm_func.cc,v $
|
* $Log: vvm_func.cc,v $
|
||||||
|
* Revision 1.9 2000/05/18 20:23:40 steve
|
||||||
|
* Overcautious assert in shift is removed.
|
||||||
|
*
|
||||||
* Revision 1.8 2000/04/29 01:19:47 steve
|
* Revision 1.8 2000/04/29 01:19:47 steve
|
||||||
* Proper bounds checking of the left operator of right shift.
|
* Proper bounds checking of the left operator of right shift.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue