Utilities and an initial webpack loader

This commit is contained in:
dcodeIO
2018-01-29 17:04:39 +01:00
parent 9e3b6f202d
commit 74498852f0
8 changed files with 113 additions and 2 deletions

View File

@ -99,12 +99,12 @@ export class Type {
}
/** Computes the sign-extending shift in the target type. */
computeSmallIntegerShift(targetType: Type) {
computeSmallIntegerShift(targetType: Type): u32 {
return targetType.size - this.size;
}
/** Computes the truncating mask in the target type. */
computeSmallIntegerMask(targetType: Type) {
computeSmallIntegerMask(targetType: Type): u32 {
return -1 >>> (targetType.size - this.size);
}