mirror of
https://github.com/janet-lang/janet
synced 2025-07-11 22:42:53 +00:00
Format.
This commit is contained in:
parent
3cbdf26aa2
commit
c9305a0a42
@ -1087,8 +1087,7 @@ static int check_const_valid(JanetSysIR *sysir, Janet constant, uint32_t t) {
|
|||||||
switch (janet_type(constant)) {
|
switch (janet_type(constant)) {
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
case JANET_TUPLE:
|
case JANET_TUPLE: {
|
||||||
{
|
|
||||||
const Janet *elements = janet_unwrap_tuple(constant);
|
const Janet *elements = janet_unwrap_tuple(constant);
|
||||||
int32_t len = janet_tuple_length(elements);
|
int32_t len = janet_tuple_length(elements);
|
||||||
if (p != JANET_PRIM_ARRAY) return 0;
|
if (p != JANET_PRIM_ARRAY) return 0;
|
||||||
@ -1104,8 +1103,7 @@ static int check_const_valid(JanetSysIR *sysir, Janet constant, uint32_t t) {
|
|||||||
case JANET_SYMBOL:
|
case JANET_SYMBOL:
|
||||||
case JANET_POINTER:
|
case JANET_POINTER:
|
||||||
return p == JANET_PRIM_POINTER;
|
return p == JANET_PRIM_POINTER;
|
||||||
case JANET_NUMBER:
|
case JANET_NUMBER: {
|
||||||
{
|
|
||||||
double x = janet_unwrap_number(constant);
|
double x = janet_unwrap_number(constant);
|
||||||
if (p == JANET_PRIM_F64) return 1;
|
if (p == JANET_PRIM_F64) return 1;
|
||||||
if (p == JANET_PRIM_F32) return 1;
|
if (p == JANET_PRIM_F32) return 1;
|
||||||
@ -1120,8 +1118,7 @@ static int check_const_valid(JanetSysIR *sysir, Janet constant, uint32_t t) {
|
|||||||
if (p == JANET_PRIM_S64 && (x >= INT64_MIN && x <= INT64_MAX)) return 1;
|
if (p == JANET_PRIM_S64 && (x >= INT64_MIN && x <= INT64_MAX)) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case JANET_ABSTRACT:
|
case JANET_ABSTRACT: {
|
||||||
{
|
|
||||||
void *point = janet_unwrap_abstract(constant);
|
void *point = janet_unwrap_abstract(constant);
|
||||||
const JanetAbstractType *at = janet_abstract_type(point);
|
const JanetAbstractType *at = janet_abstract_type(point);
|
||||||
if (at == &janet_s64_type && p == JANET_PRIM_S64) return 1;
|
if (at == &janet_s64_type && p == JANET_PRIM_S64) return 1;
|
||||||
|
@ -363,7 +363,9 @@ static void e_mov_to_reg(JanetSysx64Context *ctx, x64Reg d, x64Reg s, MoveMode m
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mm == MOV_LOAD || s.storage != JANET_SYSREG_REGISTER) {
|
if (mm == MOV_LOAD || s.storage != JANET_SYSREG_REGISTER) {
|
||||||
x64Reg t = d; d = s; s = t; /* swap */
|
x64Reg t = d;
|
||||||
|
d = s;
|
||||||
|
s = t; /* swap */
|
||||||
flip = 1;
|
flip = 1;
|
||||||
}
|
}
|
||||||
assert(s.storage == JANET_SYSREG_REGISTER);
|
assert(s.storage == JANET_SYSREG_REGISTER);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user