bench 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343
  1. #!/bin/sh
  2. # "bench", a shell script to benchmark Scheme implementations
  3. #
  4. # Please report any errors or extensions to the author:
  5. #
  6. # Marc Feeley (feeley@iro.umontreal.ca)
  7. #
  8. # The following have contributed to this benchmark suite:
  9. #
  10. # Harvey Stein (abel@netvision.net.il)
  11. # -----------------------------------------------------------------------------
  12. error ()
  13. {
  14. echo $1
  15. echo '
  16. Usage: bench [-r runs] [-c clean] [-i iterfile] [-s setting] [-o options] <scheme-systems> <benchmarks>
  17. <scheme-systems> is the abbreviated name of one or more
  18. language implementations to use, i.e.:
  19. gambit for Gambit-C compiler.
  20. gambit-int for Gambit-C interpreter.
  21. bigloo for Bigloo compiler.
  22. bigloo-int for Bigloo interpreter.
  23. chicken for Chicken compiler.
  24. chicken-int for Chicken interpreter.
  25. mzscheme for MzScheme.
  26. scheme48 for Scheme48.
  27. scheme48-opt-only for Scheme48 without JIT but with the optimizer
  28. scheme48-jit for Scheme48 with JIT and optimizer
  29. scheme48-jit-noopt for Scheme48 with JIT but without the optimizer
  30. larceny for Larceny.
  31. awk for AWK.
  32. cc for '"cc"' C compiler.
  33. gcc for '"gcc"' C compiler.
  34. java for Java.
  35. all for all of the above.
  36. all-interpreters for the above interpreters.
  37. all-compilers for the above compilers.
  38. <benchmarks> is the name of one or more benchmarks
  39. to use, i.e.:
  40. all for all the benchmarks
  41. fib for the fib benchmark
  42. "fib boyer" for fib & boyer.
  43. runs is the number of times to run each benchmark (default is 1).
  44. clean is whether or not to clean out the build directory.
  45. true = clean. Useful for testing or inspection.
  46. iterfile is the file which specifies the number of iterations in
  47. each benchmark. If not supplied, we use num-iters.scm for compilers
  48. and num-iters-int.scm for interpreters. For testing, you might
  49. want to use one-iter.scm, which runs each test once.
  50. setting is the benchmarking setting. The possible values are:
  51. r5rs (default):
  52. - generic arithmetic operations
  53. - optional overflow detection on fixnum arithmetic
  54. - mutable bindings for the definitions in the benchmark
  55. - mutable predefined bindings (for +, car, ...)
  56. r6rs:
  57. - generic arithmetic operations
  58. - overflow detection on fixnum arithmetic (either produce a
  59. bignum or signal an exception)
  60. - immutable bindings for the definitions in the benchmark
  61. - immutable predefined bindings (for +, car, ...)
  62. - safe execution (i.e. an exception must be signalled on errors)
  63. r6rs-unsafe:
  64. - like r6rs setting but errors are not checked, but
  65. fixnum arithmetic overflows are detected
  66. r6rs-fixflo:
  67. - arithmetic operations are specialized to fixnum or flonum
  68. arguments as appropriate and the fixnum operations may
  69. wrap on overflow
  70. - immutable bindings for the definitions in the benchmark
  71. - immutable predefined bindings (for +, car, ...)
  72. - safe execution (i.e. an exception must be signalled on errors)
  73. r6rs-fixflo-unsafe:
  74. - like r6rs-fixflo setting but errors are not checked'
  75. exit
  76. }
  77. # -----------------------------------------------------------------------------
  78. cleanup ()
  79. {
  80. if [ "$clean" = "true" ] ; then
  81. # It's true that technically speaking, we should be in the build
  82. # directory when this fcn is called. Thus, we should be able to
  83. # just do rm *. However, that's kind of dangerous, so instead,
  84. # we delete files newer than the mark file that evaluate () makes.
  85. for x in * ; do
  86. if [ $x -nt clean_newer_than_me ] ; then
  87. rm $x
  88. fi
  89. done
  90. fi
  91. rm clean_newer_than_me
  92. }
  93. evaluate ()
  94. {
  95. echo > clean_newer_than_me
  96. sleep 1
  97. {
  98. echo
  99. echo Testing $1 under ${NAME}-${setting}
  100. echo Compiling...
  101. make_src_code $1
  102. $COMP $1
  103. i=0
  104. while [ "$i" -lt "$NB_RUNS" ]
  105. do
  106. echo Running...
  107. $EXEC $1
  108. i=`expr $i + 1`
  109. done
  110. cleanup
  111. } 2>&1 | tee -a ../../results.${NAME}-${setting}
  112. }
  113. make_src_code ()
  114. {
  115. case "$extension" in
  116. ".awk")
  117. cat ../../src/$1.awk > $1.awk
  118. chmod +x $1.awk ;;
  119. ".c")
  120. cat ../../src/$1.c > $1.c ;;
  121. ".java")
  122. cat ../../src/$1.java > $1.java ;;
  123. ".scm")
  124. printf "$PREFIXCODE\n" "$1" "$1"> $1-prefix.scm
  125. cp $1-prefix.scm $1-prefix_foo.scm
  126. printf "$SUFFIXCODE\n" "$1" "$1" > $1-suffix.scm
  127. cat $1-prefix.scm ../../prefix/prefix-${system}.scm | sed "s/;INSERTCODE/$INSERTCODE/" | cat - ../../num-iters/${iterfile} ../../src/$1.scm ../../suffix/suffix-${system}.scm $1-suffix.scm > $1.scm ;;
  128. ".ss")
  129. printf "$PREFIXCODE\n" "$1" "$1" > $1-prefix.scm
  130. printf "$SUFFIXCODE\n" "$1" "$1" > $1-suffix.scm
  131. cat ../../prefix/prefix-${system}.scm | sed "s/;INSERTCODE/$INSERTCODE/" | cat - ../../num-iters/${iterfile} ../../src/$1.scm ../../suffix/suffix-${system}.scm > $1-body.ss
  132. cat $1-prefix.scm $1-suffix.scm > $1.ss ;;
  133. esac
  134. }
  135. # -----------------------------------------------------------------------------
  136. # For handling setting that does not exist for a given compiler
  137. nonexistent_comp ()
  138. {
  139. :
  140. }
  141. nonexistent_exec ()
  142. {
  143. :
  144. }
  145. # -----------------------------------------------------------------------------
  146. # Definitions specific to Gambit-C compiler
  147. gambit_comp ()
  148. {
  149. {
  150. echo gsc $COMPOPTS $1.scm
  151. } | /usr/bin/time sh
  152. }
  153. gambit_exec ()
  154. {
  155. if test -f ./$1.o1
  156. then gsi -:m10000,d- ./$1.o1
  157. fi
  158. }
  159. gambit_int_comp ()
  160. {
  161. :
  162. }
  163. gambit_int_exec ()
  164. {
  165. printf "$REPLCOMMANDS" "$1" | gsi -:m10000,d-
  166. }
  167. # -----------------------------------------------------------------------------
  168. # Definitions specific to bigloo compiler
  169. bigloo_comp ()
  170. {
  171. case $1 in
  172. ctak|dynamic|fibc|maze|puzzle|scheme) usecc="-call/cc" ;;
  173. *) usecc="" ;;
  174. esac
  175. /usr/bin/time bigloo $usecc $COMPOPTS $1.scm -o $1
  176. }
  177. bigloo_exec ()
  178. {
  179. if test -f ./$1
  180. then ./$1
  181. fi
  182. }
  183. bigloo_int_comp ()
  184. {
  185. :
  186. }
  187. bigloo_int_exec ()
  188. {
  189. printf "$REPLCOMMANDS" "$1" | /usr/bin/time bigloo -heapsize 10
  190. }
  191. # -----------------------------------------------------------------------------
  192. # Definitions specific to Chicken compiler
  193. chicken_comp ()
  194. {
  195. {
  196. echo csc $COMPOPTS $1.scm
  197. } | /usr/bin/time sh
  198. }
  199. chicken_exec ()
  200. {
  201. if test -f ./$1
  202. then ./$1 -:hi10M -:hs0
  203. fi
  204. }
  205. chicken_int_comp ()
  206. {
  207. :
  208. }
  209. chicken_int_exec ()
  210. {
  211. printf "$REPLCOMMANDS" "$1" | /usr/bin/time csi -:hi10M -:hs0
  212. }
  213. # -----------------------------------------------------------------------------
  214. # Definitions specific to MzScheme
  215. mzscheme_comp ()
  216. {
  217. :
  218. }
  219. mzscheme_exec ()
  220. {
  221. printf "$REPLCOMMANDS" "$1" | mzscheme $COMPOPTS
  222. }
  223. # -----------------------------------------------------------------------------
  224. # Definitions specific to Scheme48
  225. scheme48_comp ()
  226. {
  227. :
  228. }
  229. scheme48_exec ()
  230. {
  231. printf "$REPLCOMMANDS" "$1" "$1" | scheme48 $COMPOPTS
  232. }
  233. # -----------------------------------------------------------------------------
  234. # Definitions specific to Scheme48 with JIT-Compiler
  235. scheme48_jit_comp ()
  236. {
  237. :
  238. }
  239. scheme48_jit_exec ()
  240. {
  241. printf "$REPLCOMMANDS" "$1" "$1" "$1" | ~/sw/trunk/scheme48vm $COMPOPTS
  242. }
  243. # -----------------------------------------------------------------------------
  244. # Definitions specific to Larceny
  245. larceny_comp ()
  246. {
  247. :
  248. }
  249. larceny_exec ()
  250. {
  251. printf "$REPLCOMMANDS" "$1" | larceny $COMPOPTS
  252. }
  253. # -----------------------------------------------------------------------------
  254. # Definitions specific to Chez Scheme
  255. chez_comp ()
  256. {
  257. :
  258. }
  259. chez_exec ()
  260. {
  261. printf "$REPLCOMMANDS" "$1" | scheme
  262. }
  263. # -----------------------------------------------------------------------------
  264. # Definitions specific to Petite Chez
  265. petite_chez_comp ()
  266. {
  267. :
  268. }
  269. petite_chez_exec ()
  270. {
  271. printf "$REPLCOMMANDS" "$1" | /usr/bin/time petite
  272. }
  273. # -----------------------------------------------------------------------------
  274. # Definitions specific to stalin
  275. stalin_comp ()
  276. {
  277. mv $1.scm $1.sc
  278. /usr/bin/time stalin -copt -O2 -Ob -Om -On -Or -Ot -s $1
  279. }
  280. stalin_exec ()
  281. {
  282. if test -f ./$1
  283. then /usr/bin/time ./$1
  284. fi
  285. }
  286. # -----------------------------------------------------------------------------
  287. # Definitions specific to scm
  288. scm_comp ()
  289. {
  290. :
  291. }
  292. scm_exec ()
  293. {
  294. printf "$REPLCOMMANDS" "$1" | /usr/bin/time scm -f
  295. }
  296. # -----------------------------------------------------------------------------
  297. # Definitions specific to STk
  298. stk_comp ()
  299. {
  300. :
  301. }
  302. stk_exec ()
  303. {
  304. ### Need to send output to /dev/null so that it doesn't hang when there's
  305. ### an error...
  306. printf "$REPLCOMMANDS" "$1" | /usr/bin/time snow -f < /dev/null
  307. }
  308. # -----------------------------------------------------------------------------
  309. # Definitions specific to AWK
  310. awk_comp ()
  311. {
  312. :
  313. }
  314. awk_exec ()
  315. {
  316. /usr/bin/time ./$1.awk
  317. }
  318. # -----------------------------------------------------------------------------
  319. # Definitions specific to CC
  320. cc_comp ()
  321. {
  322. {
  323. echo cc -O -o $1 $1.c -lm -lpthread
  324. } | /usr/bin/time sh
  325. ls -l $1
  326. }
  327. cc_exec ()
  328. {
  329. if test -f ./$1
  330. then /usr/bin/time ./$1
  331. fi
  332. }
  333. # -----------------------------------------------------------------------------
  334. # Definitions specific to GCC
  335. gcc_comp ()
  336. {
  337. {
  338. echo gcc -O3 -o $1 $1.c -lm -lpthread
  339. } | /usr/bin/time sh
  340. ls -l $1
  341. }
  342. gcc_exec ()
  343. {
  344. if test -f ./$1
  345. then /usr/bin/time ./$1
  346. fi
  347. }
  348. # -----------------------------------------------------------------------------
  349. # Definitions specific to Java
  350. java_comp ()
  351. {
  352. {
  353. echo javac $1.java
  354. } | /usr/bin/time sh
  355. ls -l $1.class
  356. }
  357. java_exec ()
  358. {
  359. /usr/bin/time java $1
  360. }
  361. # -----------------------------------------------------------------------------
  362. GABRIEL_BENCHMARKS="boyer browse cpstak ctak dderiv deriv destruc diviter divrec puzzle takl triangl" # fft tak trav1 trav2
  363. KVW_BENCHMARKS="ack array1 cat string sum1 sumloop tail wc"
  364. #C_BENCHMARKS="fft fib fibfp mbrot nucleic pnpoly sum sumfp tak tfib $KVW_BENCHMARKS"
  365. C_BENCHMARKS="fft fib fibfp mbrot pnpoly sum sumfp tak $KVW_BENCHMARKS"
  366. #OTHER_BENCHMARKS="conform dynamic earley fibc graphs lattice matrix maze mazefun nqueens paraffins peval pi primes ray scheme simplex slatex"
  367. OTHER_BENCHMARKS="conform dynamic earley fibc graphs lattice matrix maze mazefun nqueens paraffins peval primes ray scheme simplex slatex perm9 nboyer sboyer gcbench"
  368. AWK_BENCHMARKS="$KVW_BENCHMARKS"
  369. JAVA_BENCHMARKS="tfib"
  370. #ALL_BENCHMARKS="succeed fail crash $GABRIEL_BENCHMARKS $C_BENCHMARKS $OTHER_BENCHMARKS"
  371. ALL_BENCHMARKS="$GABRIEL_BENCHMARKS $C_BENCHMARKS $OTHER_BENCHMARKS"
  372. ALL_INTERPRETERS='bigloo-int petite-chez gambit-int chicken-int scm stk'
  373. ALL_COMPILERS='gambit bigloo chicken mzscheme scheme48 scheme48-opt-only scheme48-jit scheme48-jit-noopt larceny'
  374. ALL_GAMBIT='gambit gambit-int'
  375. ALL_NON_SCHEME='awk cc gcc java'
  376. ALL_SYSTEMS="$ALL_COMPILERS $ALL_INTERPRETERS $ALL_NON_SCHEME"
  377. ## Arg processing...
  378. if [ "$#" -lt 2 ]; then
  379. error '>>> At least two command line arguments are needed'
  380. fi
  381. cmdline="$0"
  382. flagsdone=0
  383. NB_RUNS=1
  384. clean=true
  385. setting=r5rs
  386. options=""
  387. while [ $# -gt 2 ] ; do
  388. arg="$1"
  389. shift
  390. case $arg in
  391. -r) NB_RUNS=$1 ; shift ;;
  392. -c) clean=$1 ; shift ;;
  393. -i) forceiters=$1 ; shift ;;
  394. -s) setting=$1 ; shift ;;
  395. -o) options=$1 ; shift ;;
  396. *) error ">>> Unknown argument of $arg given." ;;
  397. esac
  398. done
  399. if [ "$#" -ne 2 ]; then
  400. error '>>> Last two arguments must be <systems> and <benchmarks>'
  401. fi
  402. case "$1" in
  403. all) systems="$ALL_SYSTEMS" ;;
  404. all-interpreters) systems="$ALL_INTERPRETERS" ;;
  405. all-compilers) systems="$ALL_COMPILERS" ;;
  406. all-gambit) systems="$ALL_GAMBIT" ;;
  407. *) systems="$1" ;;
  408. esac
  409. case "$2" in
  410. all) benchmarks="$ALL_BENCHMARKS" ;;
  411. gabriel) benchmarks="$GABRIEL_BENCHMARKS" ;;
  412. kvw) benchmarks="$KVW_BENCHMARKS" ;;
  413. other) benchmarks="$OTHER_BENCHMARKS" ;;
  414. awk) benchmarks="$AWK_BENCHMARKS" ;;
  415. c) benchmarks="$C_BENCHMARKS" ;;
  416. java) benchmarks="$JAVA_BENCHMARKS" ;;
  417. *) benchmarks="$2" ;;
  418. esac
  419. ## Run each benchmark under each system...
  420. for system in $systems ; do
  421. case "$system" in
  422. gambit) NAME='Gambit-C'
  423. COMP=gambit_comp
  424. EXEC=gambit_exec
  425. iterfile=num-iters.scm
  426. extension=".scm"
  427. case "$setting" in
  428. mostly-fixflo)
  429. COMPOPTS="-dynamic -cc-options '$options'"
  430. INSERTCODE="(declare (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)"
  431. PREFIXCODE="; %s %s"
  432. SUFFIXCODE="; %s %s"
  433. REPLCOMMANDS=""
  434. ;;
  435. mostly-flofix)
  436. COMPOPTS="-dynamic -cc-options '$options'"
  437. INSERTCODE="(declare (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)"
  438. PREFIXCODE="; %s %s"
  439. SUFFIXCODE="; %s %s"
  440. REPLCOMMANDS=""
  441. ;;
  442. mostly-fix)
  443. COMPOPTS="-dynamic -cc-options '$options'"
  444. INSERTCODE="(declare (mostly-fixnum))(define-macro (if-fixflo yes no) no)"
  445. PREFIXCODE="; %s %s"
  446. SUFFIXCODE="; %s %s"
  447. REPLCOMMANDS=""
  448. ;;
  449. mostly-flo)
  450. COMPOPTS="-dynamic -cc-options '$options'"
  451. INSERTCODE="(declare (mostly-flonum))(define-macro (if-fixflo yes no) no)"
  452. PREFIXCODE="; %s %s"
  453. SUFFIXCODE="; %s %s"
  454. REPLCOMMANDS=""
  455. ;;
  456. mostly-generic)
  457. COMPOPTS="-dynamic -cc-options '$options'"
  458. INSERTCODE="(declare (mostly-generic))(define-macro (if-fixflo yes no) no)"
  459. PREFIXCODE="; %s %s"
  460. SUFFIXCODE="; %s %s"
  461. REPLCOMMANDS=""
  462. ;;
  463. sb-mostly-fixflo)
  464. COMPOPTS="-dynamic -cc-options '$options'"
  465. INSERTCODE="(declare (standard-bindings) (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)"
  466. PREFIXCODE="; %s %s"
  467. SUFFIXCODE="; %s %s"
  468. REPLCOMMANDS=""
  469. ;;
  470. sb-mostly-flofix)
  471. COMPOPTS="-dynamic -cc-options '$options'"
  472. INSERTCODE="(declare (standard-bindings) (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)"
  473. PREFIXCODE="; %s %s"
  474. SUFFIXCODE="; %s %s"
  475. REPLCOMMANDS=""
  476. ;;
  477. sb-mostly-fix)
  478. COMPOPTS="-dynamic -cc-options '$options'"
  479. INSERTCODE="(declare (standard-bindings) (mostly-fixnum))(define-macro (if-fixflo yes no) no)"
  480. PREFIXCODE="; %s %s"
  481. SUFFIXCODE="; %s %s"
  482. REPLCOMMANDS=""
  483. ;;
  484. sb-mostly-flo)
  485. COMPOPTS="-dynamic -cc-options '$options'"
  486. INSERTCODE="(declare (standard-bindings) (mostly-flonum))(define-macro (if-fixflo yes no) no)"
  487. PREFIXCODE="; %s %s"
  488. SUFFIXCODE="; %s %s"
  489. REPLCOMMANDS=""
  490. ;;
  491. sb-mostly-generic)
  492. COMPOPTS="-dynamic -cc-options '$options'"
  493. INSERTCODE="(declare (standard-bindings) (mostly-generic))(define-macro (if-fixflo yes no) no)"
  494. PREFIXCODE="; %s %s"
  495. SUFFIXCODE="; %s %s"
  496. REPLCOMMANDS=""
  497. ;;
  498. r5rs)
  499. COMPOPTS="-dynamic -cc-options '$options'"
  500. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  501. PREFIXCODE="; %s %s"
  502. SUFFIXCODE="; %s %s"
  503. REPLCOMMANDS=""
  504. ;;
  505. r6rs)
  506. COMPOPTS="-dynamic -cc-options '$options'"
  507. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) no)"
  508. PREFIXCODE="; %s %s"
  509. SUFFIXCODE="; %s %s"
  510. REPLCOMMANDS=""
  511. ;;
  512. r6rs-unsafe)
  513. COMPOPTS="-dynamic -cc-options '$options'"
  514. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) no)"
  515. PREFIXCODE="; %s %s"
  516. SUFFIXCODE="; %s %s"
  517. REPLCOMMANDS=""
  518. ;;
  519. r6rs-fixflo)
  520. COMPOPTS="-dynamic -cc-options '$options'"
  521. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) yes)"
  522. PREFIXCODE="; %s %s"
  523. SUFFIXCODE="; %s %s"
  524. REPLCOMMANDS=""
  525. ;;
  526. r6rs-fixflo-unsafe)
  527. COMPOPTS="-dynamic -cc-options '$options'"
  528. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) yes)"
  529. PREFIXCODE="; %s %s"
  530. SUFFIXCODE="; %s %s"
  531. REPLCOMMANDS=""
  532. ;;
  533. esac
  534. ;;
  535. gambit-sp) NAME='Gambit-C-sp'
  536. COMP=gambit_comp
  537. EXEC=gambit_exec
  538. iterfile=num-iters.scm
  539. extension=".scm"
  540. case "$setting" in
  541. mostly-fixflo)
  542. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  543. INSERTCODE="(declare (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)"
  544. PREFIXCODE="; %s %s"
  545. SUFFIXCODE="; %s %s"
  546. REPLCOMMANDS=""
  547. ;;
  548. mostly-flofix)
  549. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  550. INSERTCODE="(declare (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)"
  551. PREFIXCODE="; %s %s"
  552. SUFFIXCODE="; %s %s"
  553. REPLCOMMANDS=""
  554. ;;
  555. mostly-fix)
  556. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  557. INSERTCODE="(declare (mostly-fixnum))(define-macro (if-fixflo yes no) no)"
  558. PREFIXCODE="; %s %s"
  559. SUFFIXCODE="; %s %s"
  560. REPLCOMMANDS=""
  561. ;;
  562. mostly-flo)
  563. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  564. INSERTCODE="(declare (mostly-flonum))(define-macro (if-fixflo yes no) no)"
  565. PREFIXCODE="; %s %s"
  566. SUFFIXCODE="; %s %s"
  567. REPLCOMMANDS=""
  568. ;;
  569. mostly-generic)
  570. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  571. INSERTCODE="(declare (mostly-generic))(define-macro (if-fixflo yes no) no)"
  572. PREFIXCODE="; %s %s"
  573. SUFFIXCODE="; %s %s"
  574. REPLCOMMANDS=""
  575. ;;
  576. sb-mostly-fixflo)
  577. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  578. INSERTCODE="(declare (standard-bindings) (mostly-fixnum-flonum))(define-macro (if-fixflo yes no) no)"
  579. PREFIXCODE="; %s %s"
  580. SUFFIXCODE="; %s %s"
  581. REPLCOMMANDS=""
  582. ;;
  583. sb-mostly-flofix)
  584. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  585. INSERTCODE="(declare (standard-bindings) (mostly-flonum-fixnum))(define-macro (if-fixflo yes no) no)"
  586. PREFIXCODE="; %s %s"
  587. SUFFIXCODE="; %s %s"
  588. REPLCOMMANDS=""
  589. ;;
  590. sb-mostly-fix)
  591. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  592. INSERTCODE="(declare (standard-bindings) (mostly-fixnum))(define-macro (if-fixflo yes no) no)"
  593. PREFIXCODE="; %s %s"
  594. SUFFIXCODE="; %s %s"
  595. REPLCOMMANDS=""
  596. ;;
  597. sb-mostly-flo)
  598. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  599. INSERTCODE="(declare (standard-bindings) (mostly-flonum))(define-macro (if-fixflo yes no) no)"
  600. PREFIXCODE="; %s %s"
  601. SUFFIXCODE="; %s %s"
  602. REPLCOMMANDS=""
  603. ;;
  604. sb-mostly-generic)
  605. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  606. INSERTCODE="(declare (standard-bindings) (mostly-generic))(define-macro (if-fixflo yes no) no)"
  607. PREFIXCODE="; %s %s"
  608. SUFFIXCODE="; %s %s"
  609. REPLCOMMANDS=""
  610. ;;
  611. r5rs)
  612. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  613. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  614. PREFIXCODE="; %s %s"
  615. SUFFIXCODE="; %s %s"
  616. REPLCOMMANDS=""
  617. ;;
  618. r6rs)
  619. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  620. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) no)"
  621. PREFIXCODE="; %s %s"
  622. SUFFIXCODE="; %s %s"
  623. REPLCOMMANDS=""
  624. ;;
  625. r6rs-unsafe)
  626. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  627. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) no)"
  628. PREFIXCODE="; %s %s"
  629. SUFFIXCODE="; %s %s"
  630. REPLCOMMANDS=""
  631. ;;
  632. r6rs-fixflo)
  633. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  634. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block))(define-macro (if-fixflo yes no) yes)"
  635. PREFIXCODE="; %s %s"
  636. SUFFIXCODE="; %s %s"
  637. REPLCOMMANDS=""
  638. ;;
  639. r6rs-fixflo-unsafe)
  640. COMPOPTS="-dynamic -cc-options -D___OPTIMIZE_SPACE"
  641. INSERTCODE="(declare (standard-bindings) (extended-bindings) (block) (not safe))(define-macro (if-fixflo yes no) yes)"
  642. PREFIXCODE="; %s %s"
  643. SUFFIXCODE="; %s %s"
  644. REPLCOMMANDS=""
  645. ;;
  646. esac
  647. ;;
  648. gambit-int) NAME='Gambit-C-int'
  649. COMP=gambit_int_comp
  650. COMPOPTS=""
  651. EXEC=gambit_int_exec
  652. iterfile=num-iters-int.scm
  653. extension=".scm"
  654. case "$setting" in
  655. r5rs)
  656. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  657. PREFIXCODE="; %s %s"
  658. SUFFIXCODE="; %s %s"
  659. REPLCOMMANDS="(load \"%s.scm\")"
  660. ;;
  661. r6rs)
  662. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  663. PREFIXCODE="; %s %s"
  664. SUFFIXCODE="; %s %s"
  665. REPLCOMMANDS="(load \"%s.scm\")"
  666. ;;
  667. r6rs-unsafe)
  668. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  669. PREFIXCODE="; %s %s"
  670. SUFFIXCODE="; %s %s"
  671. REPLCOMMANDS="(load \"%s.scm\")"
  672. ;;
  673. r6rs-fixflo)
  674. INSERTCODE="(define-macro (if-fixflo yes no) yes)"
  675. PREFIXCODE="; %s %s"
  676. SUFFIXCODE="; %s %s"
  677. REPLCOMMANDS="(load \"%s.scm\")"
  678. ;;
  679. r6rs-fixflo-unsafe)
  680. INSERTCODE="(define-macro (if-fixflo yes no) yes)"
  681. PREFIXCODE="; %s %s"
  682. SUFFIXCODE="; %s %s"
  683. REPLCOMMANDS="(load \"%s.scm\")"
  684. ;;
  685. esac
  686. ;;
  687. bigloo) NAME='Bigloo'
  688. COMP=bigloo_comp
  689. EXEC=bigloo_exec
  690. iterfile=num-iters.scm
  691. extension=".scm"
  692. case "$setting" in
  693. r5rs)
  694. COMPOPTS="-O6 -copt -O3 -copt -fomit-frame-pointer"
  695. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  696. PREFIXCODE="; %s %s"
  697. SUFFIXCODE="; %s %s"
  698. REPLCOMMANDS=""
  699. COMP=nonexistent_comp
  700. EXEC=nonexistent_exec
  701. ;;
  702. r6rs)
  703. COMPOPTS="-O6 -copt -O3 -copt -fomit-frame-pointer"
  704. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  705. PREFIXCODE="; %s %s"
  706. SUFFIXCODE="; %s %s"
  707. REPLCOMMANDS=""
  708. ;;
  709. r6rs-unsafe)
  710. COMPOPTS="-Obench -copt -O3 -copt -fomit-frame-pointer"
  711. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  712. PREFIXCODE="; %s %s"
  713. SUFFIXCODE="; %s %s"
  714. REPLCOMMANDS=""
  715. ;;
  716. r6rs-fixflo)
  717. COMPOPTS="-O6 -copt -O3 -copt -fomit-frame-pointer"
  718. INSERTCODE="(define-macro (if-fixflo yes no) yes)"
  719. PREFIXCODE="; %s %s"
  720. SUFFIXCODE="; %s %s"
  721. REPLCOMMANDS=""
  722. ;;
  723. r6rs-fixflo-unsafe)
  724. COMPOPTS="-Obench -copt -O3 -copt -fomit-frame-pointer"
  725. INSERTCODE="(define-macro (if-fixflo yes no) yes)"
  726. PREFIXCODE="; %s %s"
  727. SUFFIXCODE="; %s %s"
  728. REPLCOMMANDS=""
  729. ;;
  730. esac
  731. ;;
  732. bigloo-int) NAME='Bigloo-int'
  733. COMP=bigloo_int_comp
  734. COMPOPTS=""
  735. EXEC=bigloo_int_exec
  736. iterfile=num-iters-int.scm
  737. extension=".scm"
  738. INSERTCODE=""
  739. PREFIXCODE="; %s %s"
  740. SUFFIXCODE="; %s %s"
  741. REPLCOMMANDS="(load \"%s.scm\")"
  742. ;;
  743. chicken) NAME='Chicken'
  744. COMP=chicken_comp
  745. EXEC=chicken_exec
  746. iterfile=num-iters.scm
  747. extension=".scm"
  748. # Possible improvement: should -disable-interrupts be used? What
  749. # is lost when -disable-interrupts is used? Is that a normal
  750. # mode of execution?
  751. case "$setting" in
  752. r5rs)
  753. COMPOPTS="-w -d0 -no-trace -no-usual-integrations"
  754. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  755. PREFIXCODE="; %s %s"
  756. SUFFIXCODE="; %s %s"
  757. REPLCOMMANDS=""
  758. ;;
  759. r6rs)
  760. COMPOPTS="-w -d0 -O3 -no-trace -block"
  761. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  762. PREFIXCODE="; %s %s"
  763. SUFFIXCODE="; %s %s"
  764. REPLCOMMANDS=""
  765. ;;
  766. r6rs-unsafe)
  767. COMPOPTS="-w -d0 -O3 -no-trace -block -unsafe -unsafe-libraries"
  768. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  769. PREFIXCODE="; %s %s"
  770. SUFFIXCODE="; %s %s"
  771. REPLCOMMANDS=""
  772. ;;
  773. r6rs-fixflo)
  774. # It is impossible to use the fixnum/flonum specific
  775. # procedures in this setting because they are unsafe.
  776. COMPOPTS="-w -d0 -O3 -no-trace -block"
  777. INSERTCODE="(define-macro (if-fixflo yes no) no)"
  778. PREFIXCODE="; %s %s"
  779. SUFFIXCODE="; %s %s"
  780. REPLCOMMANDS=""
  781. COMP=nonexistent_comp
  782. EXEC=nonexistent_exec
  783. ;;
  784. r6rs-fixflo-unsafe)
  785. COMPOPTS="-w -d0 -O3 -no-trace -block -unsafe -unsafe-libraries"
  786. INSERTCODE="(define-macro (if-fixflo yes no) yes)"
  787. PREFIXCODE="; %s %s"
  788. SUFFIXCODE="; %s %s"
  789. REPLCOMMANDS=""
  790. ;;
  791. esac
  792. ;;
  793. chicken-int) NAME='Chicken-int'
  794. COMP=chicken_int_comp
  795. COMPOPTS=""
  796. EXEC=chicken_int_exec
  797. iterfile=num-iters.scm
  798. extension=".scm"
  799. INSERTCODE=""
  800. PREFIXCODE="; %s %s"
  801. SUFFIXCODE="; %s %s"
  802. REPLCOMMANDS="(load \"%s.scm\")"
  803. ;;
  804. mzscheme) NAME='MzScheme'
  805. COMP=mzscheme_comp
  806. EXEC=mzscheme_exec
  807. iterfile=num-iters.scm
  808. extension=".ss"
  809. case "$setting" in
  810. r5rs)
  811. COMPOPTS="-q"
  812. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  813. PREFIXCODE="; %s %s"
  814. SUFFIXCODE="(require (lib \"include.ss\")) (include \"%s-body.ss\") (main) ; %s"
  815. REPLCOMMANDS="(load \"%s.ss\")"
  816. ;;
  817. r6rs)
  818. COMPOPTS="-q"
  819. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  820. PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")"
  821. SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s"
  822. REPLCOMMANDS="(require \"%s.ss\")"
  823. ;;
  824. r6rs-unsafe)
  825. # MzScheme does not seem to have an unsafe mode.
  826. COMPOPTS="-q"
  827. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  828. PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")"
  829. SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s"
  830. REPLCOMMANDS="(require \"%s.ss\")"
  831. COMP=nonexistent_comp
  832. EXEC=nonexistent_exec
  833. ;;
  834. r6rs-fixflo)
  835. # MzScheme does not seem to have fixnum/flonum specific arithmetic operators.
  836. COMPOPTS="-q"
  837. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  838. PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")"
  839. SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s"
  840. REPLCOMMANDS="(require \"%s.ss\")"
  841. COMP=nonexistent_comp
  842. EXEC=nonexistent_exec
  843. ;;
  844. r6rs-fixflo-unsafe)
  845. # MzScheme does not seem to have fixnum/flonum specific arithmetic operators.
  846. # MzScheme does not seem to have an unsafe mode.
  847. COMPOPTS="-q"
  848. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  849. PREFIXCODE="(module %s mzscheme (define-syntax body-src \"%s-body.ss\")"
  850. SUFFIXCODE="(require (lib \"include.ss\")) (define-syntax (include-body stx) #\`(begin (include #,(syntax-local-value #'body-src)) (main))) (include-body)) ; %s %s"
  851. REPLCOMMANDS="(require \"%s.ss\")"
  852. COMP=nonexistent_comp
  853. EXEC=nonexistent_exec
  854. ;;
  855. esac
  856. ;;
  857. scheme48) NAME='Scheme48'
  858. COMP=scheme48_comp
  859. EXEC=scheme48_exec
  860. iterfile=num-iters.scm
  861. extension=".scm"
  862. case "$setting" in
  863. r5rs)
  864. COMPOPTS="-h 20000000"
  865. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  866. PREFIXCODE="; %s %s"
  867. SUFFIXCODE="; %s %s"
  868. REPLCOMMANDS=",bench off\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n;%s"
  869. ;;
  870. r6rs)
  871. COMPOPTS="-h 20000000"
  872. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  873. PREFIXCODE="(define-structure %s (export main) (open scheme time posix bitwise ascii) (optimize auto-integrate) (begin ; %s"
  874. SUFFIXCODE=")) ; %s %s"
  875. REPLCOMMANDS=",config ,load %s.scm\n,open %s,exit\n"
  876. ;;
  877. r6rs-unsafe)
  878. # Scheme48 does not seem to have an unsafe mode.
  879. COMPOPTS="-h 20000000"
  880. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  881. PREFIXCODE="; %s %s"
  882. SUFFIXCODE="; %s %s"
  883. REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n;%s"
  884. COMP=nonexistent_comp
  885. EXEC=nonexistent_exec
  886. ;;
  887. r6rs-fixflo)
  888. # Scheme48 does not seem to have fixnum/flonum specific arithmetic operators.
  889. COMPOPTS="-h 20000000"
  890. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  891. PREFIXCODE="; %s %s"
  892. SUFFIXCODE="; %s %s"
  893. REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n;%s"
  894. COMP=nonexistent_comp
  895. EXEC=nonexistent_exec
  896. ;;
  897. r6rs-fixflo-unsafe)
  898. # Scheme48 does not seem to have fixnum/flonum specific arithmetic operators.
  899. # Scheme48 does not seem to have an unsafe mode.
  900. COMPOPTS="-h 20000000"
  901. PREFIXCODE="; %s %s"
  902. SUFFIXCODE="; %s %s"
  903. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  904. REPLCOMMANDS=",bench on\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n"
  905. COMP=nonexistent_comp
  906. EXEC=nonexistent_exec
  907. ;;
  908. esac
  909. ;;
  910. scheme48-opt-only) NAME='Scheme48-opt-only'
  911. COMP=scheme48_jit_comp
  912. EXEC=scheme48_jit_exec
  913. iterfile=num-iters.scm
  914. extension=".scm"
  915. case "$setting" in
  916. r5rs)
  917. COMPOPTS="-h 20000000"
  918. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  919. PREFIXCODE="; %s %s"
  920. SUFFIXCODE="; %s %s"
  921. REPLCOMMANDS=",bench off\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n;%s"
  922. ;;
  923. r6rs)
  924. COMPOPTS="-h 20000000 -i ../../comp.image"
  925. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  926. PREFIXCODE="(define-structure %s (export main) (open scheme time posix bitwise ascii) (optimize auto-integrate) (begin ; %s"
  927. SUFFIXCODE=")) ; %s %s"
  928. REPLCOMMANDS=",batch\n,config ,load %s.scm\n,open %s\n(compile-structure '%s 'optimize)(newline)(main)\n,exit\n"
  929. ;;
  930. r6rs-unsafe)
  931. # Scheme48 does not have an unsafe mode.
  932. COMPOPTS="-h 20000000"
  933. INSERTCODE=""
  934. PREFIXCODE="; %s %s"
  935. SUFFIXCODE="; %s %s"
  936. REPLCOMMANDS=";%s %s"
  937. COMP=nonexistent_comp
  938. EXEC=nonexistent_exec
  939. ;;
  940. r6rs-fixflo)
  941. # Scheme48 does not have fixnum/flonum specific arithmetic operators.
  942. COMPOPTS="-h 20000000"
  943. INSERTCODE=""
  944. PREFIXCODE="; %s %s"
  945. SUFFIXCODE="; %s %s"
  946. REPLCOMMANDS=";%s %s"
  947. COMP=nonexistent_comp
  948. EXEC=nonexistent_exec
  949. ;;
  950. r6rs-fixflo-unsafe)
  951. # Scheme48 does not have fixnum/flonum specific arithmetic operators.
  952. # Scheme48 does not have an unsafe mode.
  953. COMPOPTS="-h 20000000"
  954. PREFIXCODE="; %s %s"
  955. SUFFIXCODE="; %s %s"
  956. INSERTCODE=""
  957. REPLCOMMANDS=";%s %s"
  958. COMP=nonexistent_comp
  959. EXEC=nonexistent_exec
  960. ;;
  961. esac
  962. ;;
  963. scheme48-jit) NAME='Scheme48-jit'
  964. COMP=scheme48_jit_comp
  965. EXEC=scheme48_jit_exec
  966. iterfile=num-iters.scm
  967. extension=".scm"
  968. case "$setting" in
  969. r5rs)
  970. COMPOPTS="-h 20000000"
  971. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  972. PREFIXCODE="; %s %s"
  973. SUFFIXCODE="; %s %s"
  974. REPLCOMMANDS=",bench off\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n;%s"
  975. ;;
  976. r6rs)
  977. COMPOPTS="-h 20000000 -i ../../comp.image"
  978. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  979. PREFIXCODE="(define-structure %s (export main) (open scheme time posix bitwise ascii) (optimize auto-integrate) (begin ; %s"
  980. SUFFIXCODE=")) ; %s %s"
  981. REPLCOMMANDS=",batch\n,config ,load %s.scm\n,open %s\n(compile-structure '%s)(newline)(main)\n,exit\n"
  982. ;;
  983. r6rs-unsafe)
  984. # Scheme48 does not have an unsafe mode.
  985. COMPOPTS="-h 20000000"
  986. INSERTCODE=""
  987. PREFIXCODE="; %s %s"
  988. SUFFIXCODE="; %s %s"
  989. REPLCOMMANDS=";%s %s"
  990. COMP=nonexistent_comp
  991. EXEC=nonexistent_exec
  992. ;;
  993. r6rs-fixflo)
  994. # Scheme48 does not have fixnum/flonum specific arithmetic operators.
  995. COMPOPTS="-h 20000000"
  996. INSERTCODE=""
  997. PREFIXCODE="; %s %s"
  998. SUFFIXCODE="; %s %s"
  999. REPLCOMMANDS=";%s %s"
  1000. COMP=nonexistent_comp
  1001. EXEC=nonexistent_exec
  1002. ;;
  1003. r6rs-fixflo-unsafe)
  1004. # Scheme48 does not have fixnum/flonum specific arithmetic operators.
  1005. # Scheme48 does not have an unsafe mode.
  1006. COMPOPTS="-h 20000000"
  1007. PREFIXCODE="; %s %s"
  1008. SUFFIXCODE="; %s %s"
  1009. INSERTCODE=""
  1010. REPLCOMMANDS=";%s %s"
  1011. COMP=nonexistent_comp
  1012. EXEC=nonexistent_exec
  1013. ;;
  1014. esac
  1015. ;;
  1016. scheme48-jit-noopt) NAME='Scheme48-jit-noopt'
  1017. COMP=scheme48_jit_comp
  1018. EXEC=scheme48_jit_exec
  1019. iterfile=num-iters.scm
  1020. extension=".scm"
  1021. case "$setting" in
  1022. r5rs)
  1023. COMPOPTS="-h 20000000"
  1024. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  1025. PREFIXCODE="; %s %s"
  1026. SUFFIXCODE="; %s %s"
  1027. REPLCOMMANDS=",bench off\n,open time posix bitwise ascii\n,load %s.scm\n,exit\n;%s"
  1028. ;;
  1029. r6rs)
  1030. COMPOPTS="-h 20000000 -i ../../comp.image"
  1031. INSERTCODE="(define-syntax if-fixflo (syntax-rules () ((if-fixflo yes no) no)))"
  1032. PREFIXCODE="(define-structure %s (export main) (open scheme time posix bitwise ascii) (optimize auto-integrate) (begin ; %s"
  1033. SUFFIXCODE=")) ; %s %s"
  1034. REPLCOMMANDS=",batch\n,config ,load %s.scm\n,open %s\n(compile-structure '%s 'native-code)(newline)(main)\n,exit\n"
  1035. ;;
  1036. r6rs-unsafe)
  1037. # Scheme48 does not have an unsafe mode.
  1038. COMPOPTS="-h 20000000"
  1039. INSERTCODE=""
  1040. PREFIXCODE="; %s %s"
  1041. SUFFIXCODE="; %s %s"
  1042. REPLCOMMANDS=";%s %s"
  1043. COMP=nonexistent_comp
  1044. EXEC=nonexistent_exec
  1045. ;;
  1046. r6rs-fixflo)
  1047. # Scheme48 does not have fixnum/flonum specific arithmetic operators.
  1048. COMPOPTS="-h 20000000"
  1049. INSERTCODE=""
  1050. PREFIXCODE="; %s %s"
  1051. SUFFIXCODE="; %s %s"
  1052. REPLCOMMANDS=";%s %s"
  1053. COMP=nonexistent_comp
  1054. EXEC=nonexistent_exec
  1055. ;;
  1056. r6rs-fixflo-unsafe)
  1057. # Scheme48 does not have fixnum/flonum specific arithmetic operators.
  1058. # Scheme48 does not have an unsafe mode.
  1059. COMPOPTS="-h 20000000"
  1060. PREFIXCODE="; %s %s"
  1061. SUFFIXCODE="; %s %s"
  1062. INSERTCODE=""
  1063. REPLCOMMANDS=";%s %s"
  1064. COMP=nonexistent_comp
  1065. EXEC=nonexistent_exec
  1066. ;;
  1067. esac
  1068. ;;
  1069. larceny) NAME='Larceny'
  1070. COMP=larceny_comp
  1071. COMPOPTS=""
  1072. EXEC=larceny_exec
  1073. iterfile=num-iters.scm
  1074. extension=".scm"
  1075. INSERTCODE=""
  1076. PREFIXCODE="; %s %s"
  1077. SUFFIXCODE="; %s %s"
  1078. REPLCOMMANDS="(load \"%s.scm\")"
  1079. ;;
  1080. chez) NAME='Chez-Scheme'
  1081. COMP=chez_comp
  1082. COMPOPTS=""
  1083. EXEC=chez_exec
  1084. iterfile=num-iters.scm
  1085. extension=".scm"
  1086. INSERTCODE=""
  1087. PREFIXCODE="; %s %s"
  1088. SUFFIXCODE="; %s %s"
  1089. REPLCOMMANDS="(load \"%s.scm\")"
  1090. ;;
  1091. petite-chez) NAME='Petite-Chez-Scheme'
  1092. COMP=petite_chez_comp
  1093. COMPOPTS=""
  1094. EXEC=petite_chez_exec
  1095. iterfile=num-iters-int.scm
  1096. extension=".scm"
  1097. INSERTCODE=""
  1098. PREFIXCODE="; %s %s"
  1099. SUFFIXCODE="; %s %s"
  1100. REPLCOMMANDS="(load \"%s.scm\")"
  1101. ;;
  1102. mit) NAME='MIT-Scheme'
  1103. COMP=mit_comp
  1104. COMPOPTS=""
  1105. EXEC=mit_exec
  1106. iterfile=num-iters.scm
  1107. extension=".scm"
  1108. INSERTCODE=""
  1109. PREFIXCODE="; %s %s"
  1110. SUFFIXCODE="; %s %s"
  1111. REPLCOMMANDS=""
  1112. ;;
  1113. mit-int) NAME='MIT-Scheme-int'
  1114. COMP=mit_int_comp
  1115. COMPOPTS=""
  1116. EXEC=mit_int_exec
  1117. iterfile=num-iters-int.scm
  1118. extension=".scm"
  1119. INSERTCODE=""
  1120. PREFIXCODE="; %s %s"
  1121. SUFFIXCODE="; %s %s"
  1122. REPLCOMMANDS="(load \"%s.scm\")"
  1123. ;;
  1124. scm) NAME='SCM'
  1125. COMP=scm_comp
  1126. COMPOPTS=""
  1127. EXEC=scm_exec
  1128. iterfile=num-iters-int.scm
  1129. extension=".scm"
  1130. INSERTCODE=""
  1131. PREFIXCODE="; %s %s"
  1132. SUFFIXCODE="; %s %s"
  1133. REPLCOMMANDS="(load \"%s.scm\")"
  1134. ;;
  1135. stalin) NAME='Stalin'
  1136. COMP=stalin_comp
  1137. COMPOPTS=""
  1138. INSERTCODE=""
  1139. EXEC=stalin_exec
  1140. iterfile=num-iters.scm
  1141. extension=".scm"
  1142. INSERTCODE=""
  1143. PREFIXCODE="; %s %s"
  1144. SUFFIXCODE="; %s %s"
  1145. REPLCOMMANDS=""
  1146. ;;
  1147. stk) NAME='STk'
  1148. COMP=stk_comp
  1149. COMPOPTS=""
  1150. INSERTCODE=""
  1151. EXEC=stk_exec
  1152. iterfile=num-iters-int.scm
  1153. extension=".scm"
  1154. INSERTCODE=""
  1155. PREFIXCODE="; %s %s"
  1156. SUFFIXCODE="; %s %s"
  1157. REPLCOMMANDS="(load \"%s.scm\")"
  1158. ;;
  1159. awk) NAME='AWK'
  1160. COMP=awk_comp
  1161. COMPOPTS=""
  1162. INSERTCODE=""
  1163. EXEC=awk_exec
  1164. iterfile=
  1165. extension=".awk"
  1166. ;;
  1167. cc) NAME='CC'
  1168. COMP=cc_comp
  1169. COMPOPTS=""
  1170. INSERTCODE=""
  1171. EXEC=cc_exec
  1172. iterfile=
  1173. extension=".c"
  1174. ;;
  1175. gcc) NAME='GCC'
  1176. COMP=gcc_comp
  1177. COMPOPTS=""
  1178. INSERTCODE=""
  1179. EXEC=gcc_exec
  1180. iterfile=
  1181. extension=".c"
  1182. ;;
  1183. java) NAME='Java'
  1184. COMP=java_comp
  1185. COMPOPTS=""
  1186. INSERTCODE=""
  1187. EXEC=java_exec
  1188. iterfile=
  1189. extension=".java"
  1190. ;;
  1191. *) error '>>> Unknown system'
  1192. ;;
  1193. esac
  1194. if [ -n "$forceiters" ] ; then iterfile="$forceiters" ; fi
  1195. cd sys/$system
  1196. if [ $? != 0 ] ; then
  1197. echo "ERROR: Can't change to directory sys/$system."
  1198. exit 1
  1199. fi
  1200. {
  1201. echo
  1202. echo '****************************'
  1203. echo Benchmarking ${NAME}-${setting} on `date` under `uname -a`
  1204. } >> ../../results.${NAME}-${setting}
  1205. for program in $benchmarks ; do
  1206. evaluate $program
  1207. done
  1208. cd ../..
  1209. if [ $? != 0 ] ; then
  1210. echo "ERROR: Can't change back to benchmark directory."
  1211. exit 1
  1212. fi
  1213. done