Bitwise operators

This commit is contained in:
Ian Gulliver
2021-11-19 16:43:59 -10:00
parent 50f986fb13
commit cc8e4a8ccb
4 changed files with 102 additions and 18 deletions

View File

@@ -19,6 +19,11 @@ var opCodeByName = map[string]vm.OpCodeType{
"dividesigned": vm.OpDivideSigned,
"divs": vm.OpDivS,
"not": vm.OpNot,
"and": vm.OpAnd,
"or": vm.OpOr,
"xor": vm.OpXor,
"isequal": vm.OpIsEqual,
"eq": vm.OpEq,
"islessthanunsigned": vm.OpIsLessThanUnsigned,
@@ -79,6 +84,11 @@ var operandsByOpCode = map[vm.OpCodeType][]operandType{
vm.OpDivU: []operandType{r, u},
vm.OpDivS: []operandType{r, s},
vm.OpNot: []operandType{r},
vm.OpAnd: []operandType{r, u},
vm.OpOr: []operandType{r, u},
vm.OpXor: []operandType{r, u},
vm.OpEq: []operandType{us, us},
vm.OpLTU: []operandType{u, u},
vm.OpLTS: []operandType{s, s},