Mercurial > repos > tabletprog
diff cbackend.js @ 134:34e0befbdd77
Add bitwise operations to int32 in the C backend
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 08 Aug 2013 19:19:19 -0700 |
parents | 9820ecd4eed4 |
children | f98790d8a53d |
line wrap: on
line diff
--- a/cbackend.js Wed Aug 07 23:22:09 2013 -0700 +++ b/cbackend.js Thu Aug 08 19:19:19 2013 -0700 @@ -607,6 +607,11 @@ addBinaryOp(int32, 'MUL_', '*', 'obj_int32'); addBinaryOp(int32, 'DIV_', '/', 'obj_int32'); addBinaryOp(int32, 'MOD_', '%', 'obj_int32'); + addBinaryOp(int32, 'or', '|', 'obj_int32'); + addBinaryOp(int32, 'xor', '^', 'obj_int32'); + addBinaryOp(int32, 'and', '&', 'obj_int32'); + addBinaryOp(int32, 'lshift:by', '<<', 'obj_int32'); + addBinaryOp(int32, 'rshift:by', '>>', 'obj_int32'); addCompOp(int32, 'LT_', '<', 'obj_int32'); addCompOp(int32, 'GT_', '>', 'obj_int32'); addCompOp(int32, 'EQ_', '==', 'obj_int32');