Return the Cranelift IR [Type] for this [DataValue].
(&self)
| 77 | |
| 78 | /// Return the Cranelift IR [Type] for this [DataValue]. |
| 79 | pub fn ty(&self) -> Type { |
| 80 | match self { |
| 81 | DataValue::I8(_) => types::I8, |
| 82 | DataValue::I16(_) => types::I16, |
| 83 | DataValue::I32(_) => types::I32, |
| 84 | DataValue::I64(_) => types::I64, |
| 85 | DataValue::I128(_) => types::I128, |
| 86 | DataValue::F16(_) => types::F16, |
| 87 | DataValue::F32(_) => types::F32, |
| 88 | DataValue::F64(_) => types::F64, |
| 89 | DataValue::F128(_) => types::F128, |
| 90 | DataValue::V128(_) => types::I8X16, // A default type. |
| 91 | DataValue::V64(_) => types::I8X8, // A default type. |
| 92 | DataValue::V32(_) => types::I8X4, // A default type. |
| 93 | DataValue::V16(_) => types::I8X2, // A default type. |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | /// Return true if the value is a vector (i.e. `DataValue::V128`). |
| 98 | pub fn is_vector(&self) -> bool { |