remove u128 (#11)

This commit is contained in:
folex
2021-04-23 18:04:08 +03:00
committed by GitHub
parent 34bf8a196a
commit 5df263876f
11 changed files with 1 additions and 26 deletions

View File

@@ -37,7 +37,6 @@ pub fn ser_type_size(ty: &IType) -> usize {
// Vec-like types are passed by pointer and size
IType::String | IType::ByteArray | IType::Array(_) => 2 * WASM_POINTER_SIZE,
IType::S64 | IType::U64 | IType::I64 | IType::F64 => 8,
IType::U128 => 16,
}
}
@@ -48,7 +47,6 @@ pub fn ser_value_size(value: &IValue) -> usize {
IValue::S16(_) | IValue::U16(_) => 2,
IValue::S32(_) | IValue::U32(_) | IValue::F32(_) | IValue::I32(_) => 4,
IValue::S64(_) | IValue::U64(_) | IValue::F64(_) | IValue::I64(_) => 8,
IValue::U128(_) => 16,
IValue::String(_) | IValue::ByteArray(_) | IValue::Array(_) => 2 * 4,
IValue::Record(_) => 4,
}
@@ -72,7 +70,6 @@ pub fn type_tag_form_itype(itype: &IType) -> u32 {
IType::U16 => 2, // u16
IType::U32 => 3, // u32
IType::U64 => 4, // u64
IType::U128 => 5, // u128
IType::S8 => 6, // i8
IType::S16 => 7, // i16
IType::S32 | IType::I32 => 8, // i32
@@ -92,7 +89,6 @@ pub fn type_tag_form_ivalue(itype: &IValue) -> u32 {
IValue::U16(_) => 2, // u16
IValue::U32(_) => 3, // u32
IValue::U64(_) => 4, // u64
IValue::U128(_) => 5, // u128
IValue::S8(_) => 6, // i8
IValue::S16(_) => 7, // i16
IValue::S32(_) | IValue::I32(_) => 8, // i32

View File

@@ -103,7 +103,6 @@ impl<'m> MemoryReader<'m> {
read_array_ty!(read_s64_array, i64, S64);
read_array_ty!(read_i64_array, i64, I64);
read_array_ty!(read_f64_array, f64, F64);
read_array_ty!(read_u128_array, u128, U128);
}
impl<'r, 'm> SequentialReader<'r, 'm> {
@@ -130,5 +129,4 @@ impl<'r, 'm> SequentialReader<'r, 'm> {
read_ty!(read_u64, u64, 8);
read_ty!(read_i64, i64, 8);
read_ty!(read_f64, f64, 8);
read_ty!(read_u128, u128, 16);
}

View File

@@ -29,7 +29,6 @@ where
IType::U64 => 0x07_u8.to_bytes(writer),
IType::F32 => 0x08_u8.to_bytes(writer),
IType::F64 => 0x09_u8.to_bytes(writer),
IType::U128 => 0x46_u8.to_bytes(writer),
IType::String => 0x0a_u8.to_bytes(writer),
IType::ByteArray => 0x3C_u8.to_bytes(writer),
IType::Array(ty) => {
@@ -88,7 +87,6 @@ mod keyword {
custom_keyword!(u16);
custom_keyword!(u32);
custom_keyword!(u64);
custom_keyword!(u128);
custom_keyword!(string);
custom_keyword!(array);
}
@@ -140,10 +138,6 @@ impl Parse<'_> for IType {
parser.parse::<keyword::f64>()?;
Ok(IType::F64)
} else if lookahead.peek::<keyword::u128>() {
parser.parse::<keyword::u128>()?;
Ok(IType::U128)
} else if lookahead.peek::<keyword::string>() {
parser.parse::<keyword::string>()?;

View File

@@ -48,6 +48,5 @@ native!(u32, U32);
native!(u64, U64);
native!(f32, F32);
native!(f64, F64);
native!(u128, U128);
native!(String, String);
native!(Vec<u8>, ByteArray);

View File

@@ -41,9 +41,6 @@ pub enum IType {
/// A 64-bits float.
F64,
/// A 128-bit unsigned integer.
U128,
/// A string.
String,
@@ -115,7 +112,6 @@ impl ToString for &IType {
IType::U64 => "u64".to_string(),
IType::F32 => "f32".to_string(),
IType::F64 => "f64".to_string(),
IType::U128 => "u128".to_string(),
IType::String => "string".to_string(),
IType::ByteArray => "array (u8)".to_string(),
IType::Array(ty) => format!("array ({})", ty.as_ref().to_string()),

View File

@@ -37,10 +37,7 @@ pub enum IValue {
/// A 64-bits float.
F64(f64),
/// A 128-bits integer.
U128(u128),
/// A string.
String(String),