Commit 7872bee7 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1024 from crimsonwoods/remove_bitshifted_constants_larger_than_16bit

remove bit-shift operation.
parents 526f4bf6 83ddef68
...@@ -541,11 +541,11 @@ for_body(codegen_scope *s, node *tree) ...@@ -541,11 +541,11 @@ for_body(codegen_scope *s, node *tree)
// generate loop variable // generate loop variable
n2 = tree->car; n2 = tree->car;
if (n2->car && !n2->car->cdr && !n2->cdr) { if (n2->car && !n2->car->cdr && !n2->cdr) {
genop(s, MKOP_Ax(OP_ENTER, 1<<18)); genop(s, MKOP_Ax(OP_ENTER, 0x40000));
gen_assignment(s, n2->car->car, 1, NOVAL); gen_assignment(s, n2->car->car, 1, NOVAL);
} }
else { else {
genop(s, MKOP_Ax(OP_ENTER, 1<<18)); genop(s, MKOP_Ax(OP_ENTER, 0x40000));
gen_vmassignment(s, n2, 1, VAL); gen_vmassignment(s, n2, 1, VAL);
} }
codegen(s, tree->cdr->cdr->car, VAL); codegen(s, tree->cdr->cdr->car, VAL);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// carry // carry
#define CRC_16_CCITT 0x11021ul //x^16+x^12+x^5+1 #define CRC_16_CCITT 0x11021ul //x^16+x^12+x^5+1
#define CRC_XOR_PATTERN (CRC_16_CCITT << 8) #define CRC_XOR_PATTERN (CRC_16_CCITT << 8)
#define CRC_CARRY_BIT (1 << 24) #define CRC_CARRY_BIT (0x01000000)
uint16_t uint16_t
calc_crc_16_ccitt(unsigned char *src, int nbytes) calc_crc_16_ccitt(unsigned char *src, int nbytes)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef OPCODE_H #ifndef OPCODE_H
#define OPCODE_H #define OPCODE_H
#define MAXARG_Bx ((1<<16)-1) #define MAXARG_Bx (0xffff)
#define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */ #define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */
/* instructions OP:A:B:C = 7:9:9:7 (32 bits) */ /* instructions OP:A:B:C = 7:9:9:7 (32 bits) */
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/* Maximum stack depth. Should be set lower on memory constrained systems. /* Maximum stack depth. Should be set lower on memory constrained systems.
The value below allows about 60000 recursive calls in the simplest case. */ The value below allows about 60000 recursive calls in the simplest case. */
#ifndef MRB_STACK_MAX #ifndef MRB_STACK_MAX
#define MRB_STACK_MAX ((1<<18) - MRB_STACK_GROWTH) #define MRB_STACK_MAX (0x40000 - MRB_STACK_GROWTH)
#endif #endif
#ifdef VM_DEBUG #ifdef VM_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment