Improve the state of building, moving towards addition working for signed numbers.

This commit is contained in:
2020-01-23 16:09:11 -08:00
parent ac01aad415
commit 89c297525a
6 changed files with 199 additions and 64 deletions

View File

@@ -157,9 +157,9 @@ declareSignedShiftOperators bitsize _ =
let mut l = $$struct_name::from_bytes(lbytes);
let mut r = $$struct_name::from_bytes(rbytes);
if neg0 { x = x.negate() }
if neg2 { l = l.negate() }
if neg3 { r = r.negate() }
if *neg0 { x = -x }
if *neg2 { l = -l }
if *neg3 { r = -r }
let s = usize::try_from($$struct_name::from_bytes(sbytes)).unwrap();
assert_eq!(l, &x << s);