Trying out a new style of JIT pattern matching.

This commit is contained in:
Ben Vanik
2014-05-26 20:28:21 -07:00
parent a001714fb0
commit 5a85263e5f
38 changed files with 6403 additions and 5160 deletions

View File

@@ -560,6 +560,26 @@ void Value::ByteSwap() {
}
}
void Value::CountLeadingZeros(const ConstantValue& src) {
switch (type) {
case INT8_TYPE:
constant.i8 = __lzcnt16(src.i8) - 8;
break;
case INT16_TYPE:
constant.i8 = __lzcnt16(src.i16);
break;
case INT32_TYPE:
constant.i8 = __lzcnt(src.i32);
break;
case INT64_TYPE:
constant.i8 = __lzcnt64(src.i64);
break;
default:
XEASSERTALWAYS();
break;
}
}
bool Value::Compare(Opcode opcode, Value* other) {
// TODO(benvanik): big matrix.
XEASSERTALWAYS();