|
|
@@ -10,12 +10,11 @@ namespace pkpy{
|
|
|
|
|
|
#define PREDICT_INT_DIV_OP(op) \
|
|
|
if(is_small_int(_0) && is_small_int(_1)){ \
|
|
|
- if(_1 == reinterpret_cast<PyObject*>(0b10)) ZeroDivisionError(); \
|
|
|
+ if(_1 == PK_SMALL_INT(0)) ZeroDivisionError(); \
|
|
|
TOP() = VAR((i64)(PK_BITS(_0)>>2) op (i64)(PK_BITS(_1)>>2)); \
|
|
|
DISPATCH() \
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#define BINARY_F_COMPARE(func, op, rfunc) \
|
|
|
PyObject* ret; \
|
|
|
const PyTypeInfo* _ti = _inst_type_info(_0); \
|
|
|
@@ -119,7 +118,30 @@ __NEXT_STEP:;
|
|
|
TARGET(LOAD_NONE) PUSH(None); DISPATCH();
|
|
|
TARGET(LOAD_TRUE) PUSH(True); DISPATCH();
|
|
|
TARGET(LOAD_FALSE) PUSH(False); DISPATCH();
|
|
|
- TARGET(LOAD_INTEGER) PUSH(VAR((int16_t)byte.arg)); DISPATCH();
|
|
|
+ /*****************************************/
|
|
|
+ TARGET(LOAD_INT_NEG_5) PUSH(PK_SMALL_INT(-5)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_NEG_4) PUSH(PK_SMALL_INT(-4)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_NEG_3) PUSH(PK_SMALL_INT(-3)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_NEG_2) PUSH(PK_SMALL_INT(-2)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_NEG_1) PUSH(PK_SMALL_INT(-1)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_0) PUSH(PK_SMALL_INT(0)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_1) PUSH(PK_SMALL_INT(1)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_2) PUSH(PK_SMALL_INT(2)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_3) PUSH(PK_SMALL_INT(3)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_4) PUSH(PK_SMALL_INT(4)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_5) PUSH(PK_SMALL_INT(5)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_6) PUSH(PK_SMALL_INT(6)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_7) PUSH(PK_SMALL_INT(7)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_8) PUSH(PK_SMALL_INT(8)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_9) PUSH(PK_SMALL_INT(9)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_10) PUSH(PK_SMALL_INT(10)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_11) PUSH(PK_SMALL_INT(11)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_12) PUSH(PK_SMALL_INT(12)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_13) PUSH(PK_SMALL_INT(13)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_14) PUSH(PK_SMALL_INT(14)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_15) PUSH(PK_SMALL_INT(15)); DISPATCH();
|
|
|
+ TARGET(LOAD_INT_16) PUSH(PK_SMALL_INT(16)); DISPATCH();
|
|
|
+ /*****************************************/
|
|
|
TARGET(LOAD_ELLIPSIS) PUSH(Ellipsis); DISPATCH();
|
|
|
TARGET(LOAD_FUNCTION) {
|
|
|
FuncDecl_ decl = co->func_decls[byte.arg];
|
|
|
@@ -856,8 +878,8 @@ __NEXT_STEP:;
|
|
|
*p = VAR(CAST(i64, *p) - 1);
|
|
|
} DISPATCH();
|
|
|
/*****************************************/
|
|
|
- static_assert(OP_DEC_GLOBAL == 112);
|
|
|
- case 113: case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: case 122: case 123: case 124: case 125: case 126: case 127: case 128: case 129: case 130: case 131: case 132: case 133: case 134: case 135: case 136: case 137: case 138: case 139: case 140: case 141: case 142: case 143: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 151: case 152: case 153: case 154: case 155: case 156: case 157: case 158: case 159: case 160: case 161: case 162: case 163: case 164: case 165: case 166: case 167: case 168: case 169: case 170: case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: case 192: case 193: case 194: case 195: case 196: case 197: case 198: case 199: case 200: case 201: case 202: case 203: case 204: case 205: case 206: case 207: case 208: case 209: case 210: case 211: case 212: case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: case 239: case 240: case 241: case 242: case 243: case 244: case 245: case 246: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: PK_UNREACHABLE() break;
|
|
|
+ static_assert(OP_DEC_GLOBAL == 133);
|
|
|
+ case 134: case 135: case 136: case 137: case 138: case 139: case 140: case 141: case 142: case 143: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 151: case 152: case 153: case 154: case 155: case 156: case 157: case 158: case 159: case 160: case 161: case 162: case 163: case 164: case 165: case 166: case 167: case 168: case 169: case 170: case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: case 192: case 193: case 194: case 195: case 196: case 197: case 198: case 199: case 200: case 201: case 202: case 203: case 204: case 205: case 206: case 207: case 208: case 209: case 210: case 211: case 212: case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: case 239: case 240: case 241: case 242: case 243: case 244: case 245: case 246: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: PK_UNREACHABLE() break;
|
|
|
}
|
|
|
|
|
|
}
|