開發紀錄(B)
  • Architecture: i686
 
  • make後在jit-x64的部份會產生error
lua dynasm/dynasm.lua -o jit-x64.h jit-x64.dasc
cc -Wall -Werror -std=gnu99 -I. -o jit-x64 -DJIT=\"jit-x64.h\" \
        dynasm-driver.c
In file included from dynasm-driver.c:21:0:
jit-x64.dasc: In function ‘main’:
jit-x64.dasc:56:4: error: right shift count >= width of type [-Werror]
    break;
    ^
In file included from dynasm-driver.c:21:0:
jit-x64.dasc:60:4: error: right shift count >= width of type [-Werror]
    break;
    ^
cc1: all warnings being treated as errors
Makefile:44: recipe for target 'jit-x64' failed
make: *** [jit-x64] Error 1
推測可能是系統為32 bit的關係,先將CFLAGS = -Wall -Werror -std=gnu99 -I.-Werror拿掉
 
  • make run-compiler  
./compiler-x86 progs/hello.b > hello.s
cc -m32 -o hello-x86 hello.s
x86:  Hello World!
 
./compiler-x64 progs/hello.b > hello.s
cc -o hello-x64 hello.s
hello.s: Assembler messages:
hello.s:4: Error: bad register name `%rbp'
hello.s:5: Error: bad register name `%rsp'
hello.s:6: Error: bad register name `%r12'
hello.s:7: Error: bad register name `%rsp'
......
同樣在x64的部份有error,先將Makefile,run-compiler x64的部份註解
#   ./compiler-x64 progs/hello.b > hello.s
#   $(CC) -o hello-x64 hello.s
#   @echo 'x64: ' ./hello-x64 
#   @echo
 
  • make bench-jit-x64 
Executing Brainf*ck benchmark suite. Be patient.
 
progs/awib.b             bad output: expected 3b4f9a78ec3ee32e05969e108916a4affa0c2bba got da39a3ee5e6b4b0d3255bfef95601890afd80709
 
progs/mandelbrot.b       bad output: expected b77a017f811831f0b74e0d69c08b78e620dbda2b got da39a3ee5e6b4b0d3255bfef95601890afd80709
 
progs/hanoi.b            bad output: expected 32cdfe329039ce63531dcd4b340df269d4fd8f7f got da39a3ee5e6b4b0d3255bfef95601890afd80709
 
Optimization