mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
some fix
This commit is contained in:
parent
92f9b93245
commit
3aea1647d0
@ -180,7 +180,7 @@ struct Type {
|
|||||||
#define PK_ASSERT(x) if(!(x)) PK_FATAL_ERROR();
|
#define PK_ASSERT(x) if(!(x)) PK_FATAL_ERROR();
|
||||||
|
|
||||||
struct PyObject;
|
struct PyObject;
|
||||||
#define PK_BITS(p) (reinterpret_cast<Number::int_t>(p))
|
#define PK_BITS(p) (reinterpret_cast<i64>(p))
|
||||||
#define PK_SMALL_INT(val) (reinterpret_cast<PyObject*>(val << 2 | 0b10))
|
#define PK_SMALL_INT(val) (reinterpret_cast<PyObject*>(val << 2 | 0b10))
|
||||||
|
|
||||||
inline PyObject* tag_float(f64 val){
|
inline PyObject* tag_float(f64 val){
|
||||||
|
@ -4,14 +4,14 @@ namespace pkpy{
|
|||||||
|
|
||||||
#define PREDICT_INT_OP(op) \
|
#define PREDICT_INT_OP(op) \
|
||||||
if(is_small_int(_0) && is_small_int(_1)){ \
|
if(is_small_int(_0) && is_small_int(_1)){ \
|
||||||
TOP() = VAR((i64)(PK_BITS(_0)>>2) op (i64)(PK_BITS(_1)>>2)); \
|
TOP() = VAR((PK_BITS(_0)>>2) op (PK_BITS(_1)>>2)); \
|
||||||
DISPATCH() \
|
DISPATCH() \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PREDICT_INT_DIV_OP(op) \
|
#define PREDICT_INT_DIV_OP(op) \
|
||||||
if(is_small_int(_0) && is_small_int(_1)){ \
|
if(is_small_int(_0) && is_small_int(_1)){ \
|
||||||
if(_1 == PK_SMALL_INT(0)) ZeroDivisionError(); \
|
if(_1 == PK_SMALL_INT(0)) ZeroDivisionError(); \
|
||||||
TOP() = VAR((i64)(PK_BITS(_0)>>2) op (i64)(PK_BITS(_1)>>2)); \
|
TOP() = VAR((PK_BITS(_0)>>2) op (PK_BITS(_1)>>2)); \
|
||||||
DISPATCH() \
|
DISPATCH() \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user