Fix padding of x when literal is sized and unsigned.
This commit is contained in:
parent
8e1c7e2891
commit
2de8bafb5c
|
|
@ -21,7 +21,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
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: lexor.lex,v 1.92 2006/07/31 03:50:17 steve Exp $"
|
#ident "$Id: lexor.lex,v 1.93 2007/01/27 05:36:11 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -460,7 +460,7 @@ static verinum*make_unsized_binary(const char*txt)
|
||||||
ptr += 1;
|
ptr += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
verinum*out = new verinum(bits, size);
|
verinum*out = new verinum(bits, size, false);
|
||||||
out->has_sign(sign_flag);
|
out->has_sign(sign_flag);
|
||||||
delete[]bits;
|
delete[]bits;
|
||||||
return out;
|
return out;
|
||||||
|
|
@ -520,7 +520,7 @@ static verinum*make_unsized_octal(const char*txt)
|
||||||
ptr += 1;
|
ptr += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
verinum*out = new verinum(bits, size);
|
verinum*out = new verinum(bits, size, false);
|
||||||
out->has_sign(sign_flag);
|
out->has_sign(sign_flag);
|
||||||
delete[]bits;
|
delete[]bits;
|
||||||
return out;
|
return out;
|
||||||
|
|
@ -590,7 +590,7 @@ static verinum*make_unsized_hex(const char*txt)
|
||||||
ptr += 1;
|
ptr += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
verinum*out = new verinum(bits, size);
|
verinum*out = new verinum(bits, size, false);
|
||||||
out->has_sign(sign_flag);
|
out->has_sign(sign_flag);
|
||||||
delete[]bits;
|
delete[]bits;
|
||||||
return out;
|
return out;
|
||||||
|
|
|
||||||
7
pform.cc
7
pform.cc
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: pform.cc,v 1.138 2007/01/16 05:44:15 steve Exp $"
|
#ident "$Id: pform.cc,v 1.139 2007/01/27 05:36:11 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -199,7 +199,7 @@ verinum* pform_verinum_with_size(verinum*siz, verinum*val,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
verinum*res = new verinum(pad, size);
|
verinum*res = new verinum(pad, size, true);
|
||||||
|
|
||||||
unsigned copy = val->len();
|
unsigned copy = val->len();
|
||||||
if (res->len() < copy)
|
if (res->len() < copy)
|
||||||
|
|
@ -1744,6 +1744,9 @@ int pform_parse(const char*path, FILE*file)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.cc,v $
|
* $Log: pform.cc,v $
|
||||||
|
* Revision 1.139 2007/01/27 05:36:11 steve
|
||||||
|
* Fix padding of x when literal is sized and unsigned.
|
||||||
|
*
|
||||||
* Revision 1.138 2007/01/16 05:44:15 steve
|
* Revision 1.138 2007/01/16 05:44:15 steve
|
||||||
* Major rework of array handling. Memories are replaced with the
|
* Major rework of array handling. Memories are replaced with the
|
||||||
* more general concept of arrays. The NetMemory and NetEMemory
|
* more general concept of arrays. The NetMemory and NetEMemory
|
||||||
|
|
|
||||||
11
verinum.cc
11
verinum.cc
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: verinum.cc,v 1.50 2007/01/19 05:42:04 steve Exp $"
|
#ident "$Id: verinum.cc,v 1.51 2007/01/27 05:36:11 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -352,6 +352,12 @@ verinum pad_to_width(const verinum&that, unsigned width)
|
||||||
verinum::V pad = that[that.len()-1];
|
verinum::V pad = that[that.len()-1];
|
||||||
if (pad==verinum::V1 && !that.has_sign())
|
if (pad==verinum::V1 && !that.has_sign())
|
||||||
pad = verinum::V0;
|
pad = verinum::V0;
|
||||||
|
if (that.has_len()) {
|
||||||
|
if (pad==verinum::Vx)
|
||||||
|
pad = verinum::V0;
|
||||||
|
if (pad==verinum::Vz)
|
||||||
|
pad = verinum::V0;
|
||||||
|
}
|
||||||
|
|
||||||
verinum val(pad, width, that.has_len());
|
verinum val(pad, width, that.has_len());
|
||||||
|
|
||||||
|
|
@ -1056,6 +1062,9 @@ verinum::V operator ^ (verinum::V l, verinum::V r)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: verinum.cc,v $
|
* $Log: verinum.cc,v $
|
||||||
|
* Revision 1.51 2007/01/27 05:36:11 steve
|
||||||
|
* Fix padding of x when literal is sized and unsigned.
|
||||||
|
*
|
||||||
* Revision 1.50 2007/01/19 05:42:04 steve
|
* Revision 1.50 2007/01/19 05:42:04 steve
|
||||||
* Fix calculation of verinum pow operation.
|
* Fix calculation of verinum pow operation.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue