├── gen ├── x86i.discards ├── sparc.discards ├── .gitignore ├── sparcmkasm.mli ├── x86imkasm.mli └── mkfile.normal ├── include └── .empty ├── interp ├── test │ ├── cut.2 │ ├── data.2 │ ├── factorial.2 │ ├── simple.1 │ ├── dayofweek.cmm.2 │ ├── factorial-tail.2 │ ├── factorial.cmm.2 │ ├── mult-returns.2 │ ├── multasgn.cmm.2 │ ├── print-loop.2 │ ├── reverse.cmm.2 │ ├── rounding.cmm.2 │ ├── safedivide.cmm.2 │ ├── factorial-tail.cmm.2 │ ├── factorial-args.script.2 │ ├── dayofweek.cmm.1 │ ├── factorial.cmm.1 │ ├── factorial-tail.cmm.1 │ ├── rounding.cmm.1 │ ├── data.1 │ ├── factorial.1 │ ├── mult-returns.1 │ ├── multasgn.cmm.1 │ ├── factorial-tail.1 │ ├── safedivide.cmm.1 │ ├── .gitignore │ ├── factorial-args.script.1 │ ├── print-loop.1 │ ├── factorial-args.script │ ├── cut-bad.1 │ ├── cut.1 │ ├── simple.2 │ ├── encoding.script.2 │ ├── cut2.c-- │ ├── cut-bad.2 │ ├── multasgn.c-- │ └── stackd.c-- ├── libinclude │ └── .gitignore ├── samples │ └── mkfile ├── clients │ └── .gitignore ├── assert.c ├── mkfile.user ├── include │ └── cii │ │ ├── assert.h │ │ ├── atom.h │ │ └── arena.h ├── mkfile.developer └── .gitignore ├── lua ├── xinterp-std.nw ├── test │ ├── 09.lua │ ├── 12.lua │ ├── 16.lua │ ├── 18.lua │ ├── 19.lua │ ├── 21.lua │ ├── README │ └── 07.lua ├── old │ └── .gitignore ├── std │ └── .gitignore ├── camlboxval ├── texboxval ├── .gitignore └── log.nw ├── test2 ├── ppc │ ├── add.2 │ ├── add.s1 │ ├── add.s2 │ ├── altret.2 │ ├── bool.2 │ ├── bool.s1 │ ├── bool.s2 │ ├── call3.s │ ├── call3.s1 │ ├── call3.s2 │ ├── conj.2 │ ├── conj.s1 │ ├── conj.s2 │ ├── const.2 │ ├── const.s │ ├── const.s1 │ ├── cut.2 │ ├── cut.s │ ├── cut.s1 │ ├── cut.s2 │ ├── divmod.2 │ ├── f2.2 │ ├── f2.s │ ├── f2.s1 │ ├── f2.s2 │ ├── fadd.2 │ ├── fadd.s │ ├── fadd.s1 │ ├── fadd.s2 │ ├── global.2 │ ├── global.s │ ├── hello.2 │ ├── hello.s1 │ ├── hello.s2 │ ├── hex.2 │ ├── hex.s1 │ ├── hex.s2 │ ├── incn.s │ ├── incn.s1 │ ├── incn.s2 │ ├── ladd.2 │ ├── ladd.s │ ├── ladd.s1 │ ├── ladd.s2 │ ├── not.2 │ ├── not.s1 │ ├── not.s2 │ ├── r64.2 │ ├── r64.s │ ├── r64.s1 │ ├── r64.s2 │ ├── rnd2.2 │ ├── rnd2.s │ ├── rnd2.s1 │ ├── rnd2.s2 │ ├── spdemo.2 │ ├── spdemo.s │ ├── sub.2 │ ├── sub.s1 │ ├── sub.s2 │ ├── switch.2 │ ├── switch.s │ ├── tadd.2 │ ├── tadd.s │ ├── tadd.s1 │ ├── tadd.s2 │ ├── tadd11.2 │ ├── tadd22.2 │ ├── taddov.2 │ ├── tail.2 │ ├── tail.s │ ├── tail.s1 │ ├── tail.s2 │ ├── tail2.2 │ ├── tail2.s │ ├── tail2.s1 │ ├── tail2.s2 │ ├── unwind.s │ ├── altret.s1 │ ├── altret.s2 │ ├── altret2.2 │ ├── altret2.s1 │ ├── altret2.s2 │ ├── altret3.s │ ├── altret3.s1 │ ├── altret3.s2 │ ├── arglist.2 │ ├── arglist.s1 │ ├── arglist.s2 │ ├── bits-bug.2 │ ├── bits-bug.s1 │ ├── bits-bug.s2 │ ├── blockcpy.2 │ ├── blockcpy.s │ ├── blockcpy.s1 │ ├── blockcpy.s2 │ ├── divmod.s1 │ ├── divmod.s2 │ ├── emptyifbody.2 │ ├── emptyifbody.s │ ├── exp-000.2 │ ├── exp-000.s │ ├── exp-000.s1 │ ├── exp-000.s2 │ ├── exp-001.s1 │ ├── exp-001.s2 │ ├── exp-002.s │ ├── exp-002.s1 │ ├── exp-003.s │ ├── exp-003.s1 │ ├── fargres.2 │ ├── fargres.s │ ├── fargres.s1 │ ├── fargres.s2 │ ├── float-000.2 │ ├── float-000.s │ ├── float-000.s1 │ ├── float-000.s2 │ ├── float-001.s │ ├── float-001.s1 │ ├── float-002.2 │ ├── float-002.s │ ├── float-002.s1 │ ├── float-002.s2 │ ├── float-003.2 │ ├── float-003.s │ ├── float-003.s1 │ ├── float-003.s2 │ ├── global.s1 │ ├── global.s2 │ ├── if-false.1 │ ├── if-false.2 │ ├── if-false.s1 │ ├── if-false.s2 │ ├── if-false2.1 │ ├── if-false2.2 │ ├── if-false2.s1 │ ├── if-false2.s2 │ ├── ovrflow.2 │ ├── ovrflow.s │ ├── ovrflow.s1 │ ├── ovrflow.s2 │ ├── ralloc-000.s1 │ ├── ralloc-000.s2 │ ├── spdemo.s1 │ ├── spdemo.s2 │ ├── switch.s1 │ ├── switch.s2 │ ├── tadd100-.2 │ ├── tail_from_c.2 │ ├── tail_from_c.s │ ├── tailnot.2 │ ├── tailnot.s │ ├── tailnot.s1 │ ├── tailnot.s2 │ ├── test-050.2 │ ├── test-050.s1 │ ├── test-050.s2 │ ├── unwind.s1 │ ├── unwind.s2 │ ├── x86-000.s │ ├── x86-000.s1 │ ├── x86-000.s2 │ ├── x86-001.s │ ├── x86-001.s1 │ ├── x86-001.s2 │ ├── cut.1 │ ├── emptyifbody.s1 │ ├── emptyifbody.s2 │ ├── eqasolve-000.s │ ├── eqasolve-000.s1 │ ├── eqasolve-000.s2 │ ├── non-local-cut.s │ ├── non-local-cut.s1 │ ├── tail_from_c.s1 │ ├── tail_from_c.s2 │ ├── add.1 │ ├── bits-bug.1 │ ├── hello.1 │ ├── const.1 │ ├── float-003.1 │ ├── fadd.1 │ ├── conj.1 │ ├── f2.1 │ ├── spdemo.1 │ ├── bool.1 │ ├── float-000.1 │ ├── rnd2.1 │ ├── test-050.1 │ ├── exp-000.1 │ ├── not.1 │ ├── r64.1 │ ├── altret2.1 │ ├── emptyifbody.1 │ ├── sub.1 │ ├── hex.1 │ ├── altret3.2 │ ├── tadd22.1 │ ├── tadd.1 │ ├── tadd.11 │ ├── tadd11.1 │ ├── divmod.1 │ ├── ladd.1 │ ├── tadd.100- │ ├── tadd100-.1 │ ├── fargres.1 │ ├── global.1 │ ├── taddov.1 │ ├── blockcpy.1 │ ├── switch.1 │ ├── exp-002.s2 │ ├── float-001.s2 │ ├── non-local-cut.s2 │ ├── tail2.1 │ ├── tailnot.1 │ ├── tail_from_c.1 │ ├── tail.1 │ ├── arglist.1 │ ├── const.s2 │ ├── altret.1 │ ├── if-false.s │ └── if-false2.s ├── x86 │ ├── err-000.s │ ├── const.s │ ├── err-002.s │ ├── non-local-cut.s │ ├── carry.5 │ ├── ladd.5 │ ├── r64.5 │ ├── fargres.5 │ ├── lit8.5 │ ├── exp-002.s │ ├── err-001.s │ ├── incn.s │ ├── fact.5 │ ├── fork.5 │ ├── incn-color.s │ ├── nest.5 │ ├── trace.5 │ ├── unwind.5 │ └── deadcontvar.5 ├── output │ ├── cut.1 │ ├── sparcerr.1 │ ├── zerou.1 │ ├── add.1 │ ├── bits-bug.1 │ ├── exp-001.1 │ ├── failedcase.1 │ ├── hello.1 │ ├── tailbug.1 │ ├── x86-000.1 │ ├── ralloc-000.1 │ ├── const.1 │ ├── float-003.1 │ ├── ratail.1 │ ├── round2.1 │ ├── unwind.1 │ ├── fadd.1 │ ├── nest.1 │ ├── spdemo.1 │ ├── conj.1 │ ├── deadcontvar.1 │ ├── f2.1 │ ├── fork.1 │ ├── test-050.1 │ ├── bool.1 │ ├── float-000.1 │ ├── float-001.1 │ ├── jtab.1 │ ├── rnd2.1 │ ├── tf.1 │ ├── altread.2 │ ├── float-001-coward.1 │ ├── float-001-hero.1 │ ├── not.1 │ ├── r64.1 │ ├── wtizzy.1 │ ├── altret2.1 │ ├── emptyifbody.1 │ ├── exp-000.1 │ ├── sub.1 │ ├── tail.1 │ ├── hex.1 │ ├── altret3.2 │ ├── tail2.1 │ ├── tailnot.1 │ ├── x86-001.1 │ ├── tadd22.1 │ ├── divmod.1 │ ├── ladd.1 │ ├── tadd.1 │ ├── tadd.11 │ ├── tadd11.1 │ ├── tadd.100- │ ├── tadd100-.1 │ ├── fargres.1 │ ├── global.1 │ ├── taddov.1 │ ├── blockcpy.1 │ ├── switch.1 │ ├── test-042.s2 │ ├── err-000.s2 │ ├── test-013.s2 │ ├── exp-002.s2 │ ├── non-local-cut.s2 │ ├── test-036.s2 │ ├── test-014.s2 │ ├── test-019.s2 │ ├── test-024.s2 │ ├── test-012.s2 │ ├── err-001.s2 │ ├── test-018.s2 │ ├── test-022.s2 │ ├── test-029.s2 │ ├── test-030.s2 │ ├── test-037.s2 │ ├── test-017.s2 │ ├── test-026.s2 │ ├── test-027.s2 │ ├── test-031.s2 │ ├── test-016.s2 │ ├── tail_from_c.1 │ ├── test-039.1 │ ├── exp-003.s2 │ ├── test-051.s2 │ ├── test-005.s2 │ ├── test-002.s2 │ ├── test-001.s2 │ ├── test-011.s2 │ ├── test-006.s2 │ ├── test-020.s2 │ ├── test-021.s2 │ ├── test-023.s2 │ ├── arglist.1 │ ├── test-015.s2 │ ├── test-035.s2 │ ├── test-007.s2 │ ├── test-025.s2 │ ├── err-002.s2 │ ├── test-033.s2 │ ├── test-008.s2 │ ├── test-034.s2 │ ├── const.s2 │ ├── test-000.s2 │ ├── round.1 │ ├── altread.1 │ ├── altret.1 │ ├── test-048.s2 │ ├── test-004.s2 │ ├── test-032.s2 │ ├── multasgn.1 │ ├── test-041.s2 │ ├── test-047.s2 │ ├── test-028.s2 │ └── test-049.s2 ├── sparc │ ├── float-003.1 │ ├── incn.s │ ├── if-false.s │ └── if-false2.s ├── tiger │ ├── merge.0 │ ├── output │ │ ├── hello.1 │ │ ├── merge.1 │ │ ├── forloop.1 │ │ ├── funcall.1 │ │ ├── arrays.1 │ │ ├── rbshort.1 │ │ ├── exceptions.1 │ │ ├── qsort.1 │ │ └── rc4.1 │ ├── rbshort.0 │ ├── rc4.0 │ ├── stdlib-x86.a │ ├── README │ └── mkfile ├── quest │ ├── globals.c │ ├── .gitignore │ └── globals.c-- ├── src │ ├── altret2.0 │ ├── errno.c │ ├── ops64.c │ ├── sub.pp │ ├── incn.c-- │ ├── double.c │ ├── live_rtd.c-- │ ├── test-051.c-- │ ├── test-043.c-- │ ├── call3.c-- │ ├── test-036.c-- │ ├── test-005.c-- │ ├── test-027.c-- │ ├── test-031.c-- │ ├── test-026.c-- │ ├── test-028.c-- │ ├── test-030.c-- │ ├── test-000.c-- │ ├── test-029.c-- │ ├── test-004.c-- │ ├── r64main.c │ ├── test-001.c-- │ ├── test-025.c-- │ ├── test-033.c-- │ ├── if-false.c-- │ ├── test-009.c-- │ ├── test-012.c-- │ ├── test-034.c-- │ ├── err-000.c-- │ ├── test-032.c-- │ ├── test-013.c-- │ ├── test-035.c-- │ ├── test-022.c-- │ ├── infloop.c-- │ ├── test-011.c-- │ ├── deadcut.c-- │ ├── test-037.c-- │ ├── test-045.c-- │ ├── test-002.c-- │ ├── test-006.c-- │ ├── test-014.c-- │ ├── inf.c-- │ ├── test-007.c-- │ ├── test-048.c-- │ ├── test-016.c-- │ ├── test-020.c-- │ ├── availexprs.c-- │ ├── test-008.c-- │ ├── test-017.c-- │ ├── test-018.c-- │ ├── test-024.c-- │ ├── hello.c-- │ ├── test-021.c-- │ ├── test-019.c-- │ ├── test-015.c-- │ ├── test-023.c-- │ ├── zerou.c-- │ ├── r64.c-- │ ├── nestmain.c │ ├── test-046.c-- │ ├── test-049.c-- │ ├── if-false2.c-- │ ├── deadcontvar-unwind.c │ ├── test-050.c-- │ ├── sub.c-- │ ├── err-001.c-- │ ├── bool.c-- │ ├── exp-000.c-- │ ├── nest.c-- │ ├── fork.c-- │ ├── hex.c-- │ ├── float-000.c-- │ ├── sparcerr.c-- │ ├── badlit8.c-- │ ├── non-local-cut.c-- │ ├── tf.c-- │ ├── float-001.c-- │ ├── ratail.c-- │ ├── rnd2.c-- │ ├── global.c-- │ ├── unwind.c-- │ ├── float-001-hero.c-- │ ├── float-001-coward.c-- │ ├── exp-001.c-- │ ├── not.c-- │ ├── conj.c-- │ ├── divmod.c-- │ ├── fadd.c-- │ ├── unwindt.c │ ├── ladd.c-- │ ├── test-047.c-- │ ├── const.c-- │ └── lit8main.c ├── here.lua ├── lcc │ ├── output │ │ ├── fields.1 │ │ ├── struct.1 │ │ ├── array.1 │ │ ├── init.1 │ │ ├── sort.1 │ │ ├── limits.1 │ │ ├── cf.1 │ │ └── cvt.1 │ └── juliet.txt ├── dummy │ ├── non-local-cut.s2 │ ├── exp-002.s2 │ ├── fadd.s2 │ ├── rnd2.s2 │ ├── float-000.s2 │ └── float-001.s2 ├── .gitignore ├── all.x86.tst ├── all.ppc.tst └── all.sparc.tst ├── debian ├── compat ├── docs ├── files ├── dirs ├── changelog └── qcmm.doc-base.EX ├── mk ├── debian │ ├── compat │ ├── docs │ ├── patches │ │ └── 00list │ ├── dirs │ ├── README.Debian │ ├── mk.doc-base │ └── control ├── .gitignore ├── mk.pdf ├── mk-a4.pdf ├── mk-usl.pdf ├── lib │ ├── 9 │ │ ├── newprint.c │ │ ├── dirstat-Inferno.c │ │ ├── getuser-Inferno.c │ │ ├── errstr-Inferno.c │ │ ├── getuser-Nt.c │ │ ├── runestrlen.c │ │ ├── setbinmode-Nt.c │ │ ├── seek.c │ │ ├── dirwstat.c │ │ ├── exits.c │ │ ├── log-Nt.c │ │ ├── strdup.c │ │ └── utflen.c │ ├── bio │ │ ├── bfildes.c │ │ ├── bbuffered.c │ │ └── bputrune.c │ └── regexp │ │ ├── regerror.c │ │ └── Makefile └── include │ └── ar.h ├── src ├── DATE ├── peephole.lua ├── loadfiles ├── cfgx.nw ├── strip.lua └── ep.nw ├── config ├── aux │ └── .gitignore ├── .gitignore ├── nocond ├── man.mk ├── install.mk ├── c.mk └── lrtl.mk ├── aug99 ├── .gitignore └── util.nw ├── doc ├── release.pdf ├── lcc ├── restrictions.tex ├── PORTABILITY └── .gitignore ├── tdpe ├── .gitignore ├── one01RtlMk.mli ├── one02RtlMk.mli ├── sparcRtlMk.mli ├── one01TreesBuild.mli ├── one02TreesBuild.mli ├── sparcTreesBuild.mli ├── one01RtlRec.mli ├── one02RtlRec.mli ├── sparcRtlRec.mli ├── one02Nbe.mli ├── one01Nbe.mli ├── one01Syntax.mli ├── one02Syntax.mli ├── one01Trees.mli ├── todo ├── sparcNbe.mli ├── tools.nw ├── one02Constructors.mli ├── one02Constructors.ml └── one02Trees.mli ├── asdl ├── .gitignore ├── share.nw └── stdPrims.nw ├── ccl-suite ├── iconx.m68k ├── iconx.mips ├── tgen.m68k ├── tgen.mips ├── tgen.sparc └── iconx.sparc ├── lua-bench ├── .gitignore ├── hello.lua ├── sumcol.lua ├── fibo.lua ├── strcat2.lua ├── reversefile.lua ├── mkjgraph ├── ackermann.lua ├── hash.lua ├── spellcheck.lua ├── mkfile ├── ary3.lua ├── nestedloop.lua ├── ary.lua ├── wc.lua ├── random.lua └── hash2.lua ├── cllib └── .gitignore ├── figures ├── README └── mkfile ├── TODO ├── runtime ├── overflow │ ├── clientbuildsclosure │ │ └── mkfile │ ├── runtimebuildsclosure │ │ ├── mkfile │ │ └── getspan.c │ └── directreturn │ │ └── getspan.c ├── .gitignore └── doc.tex ├── testcc ├── .gitignore ├── gensigs.lua └── README ├── camlburg ├── run_twelf ├── TODO ├── .gitignore └── parseerror.nw ├── tools └── .gitignore ├── mkdirs └── .gitignore /gen/x86i.discards: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /include/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/cut.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/data.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lua/xinterp-std.nw: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/add.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/add.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/add.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/bool.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/bool.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/bool.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/call3.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/call3.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/call3.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/conj.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/conj.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/conj.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/const.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/const.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/const.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/cut.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/cut.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/cut.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/cut.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/divmod.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/f2.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/f2.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/f2.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/f2.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fadd.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fadd.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fadd.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fadd.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/global.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/global.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/hello.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/hello.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/hello.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/hex.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/hex.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/hex.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/incn.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/incn.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/incn.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ladd.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ladd.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ladd.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ladd.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/not.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/not.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/not.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/r64.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/r64.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/r64.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/r64.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/rnd2.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/rnd2.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/rnd2.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/rnd2.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/spdemo.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/spdemo.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/sub.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/sub.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/sub.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/switch.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/switch.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd11.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd22.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/taddov.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail2.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail2.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail2.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail2.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/unwind.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /interp/test/factorial.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/simple.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mk/debian/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /src/DATE: -------------------------------------------------------------------------------- 1 | 20060821 2 | -------------------------------------------------------------------------------- /test2/ppc/altret.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret2.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret2.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret2.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret3.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret3.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/altret3.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/arglist.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/arglist.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/arglist.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/bits-bug.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/bits-bug.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/bits-bug.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/blockcpy.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/blockcpy.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/blockcpy.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/blockcpy.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/divmod.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/divmod.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/emptyifbody.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/emptyifbody.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-000.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-000.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-000.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-000.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-001.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-001.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-002.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-002.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-003.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/exp-003.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fargres.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fargres.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fargres.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/fargres.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-000.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-000.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-000.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-000.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-001.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-001.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-002.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-002.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-002.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-002.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-003.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-003.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-003.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/float-003.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/global.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/global.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false2.1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false2.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false2.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/if-false2.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ovrflow.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ovrflow.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ovrflow.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ovrflow.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ralloc-000.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/ralloc-000.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/spdemo.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/spdemo.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/switch.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/switch.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tadd100-.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail_from_c.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail_from_c.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tailnot.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tailnot.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tailnot.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tailnot.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/test-050.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/test-050.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/test-050.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/unwind.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/unwind.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/x86-000.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/x86-000.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/x86-000.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/x86-001.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/x86-001.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/x86-001.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/x86/err-000.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README 2 | 3 | -------------------------------------------------------------------------------- /interp/test/dayofweek.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/factorial-tail.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/factorial.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/mult-returns.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/multasgn.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/print-loop.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/reverse.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/rounding.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/safedivide.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mk/debian/docs: -------------------------------------------------------------------------------- 1 | README 2 | -------------------------------------------------------------------------------- /test2/ppc/cut.1: -------------------------------------------------------------------------------- 1 | cut=99 2 | -------------------------------------------------------------------------------- /test2/ppc/emptyifbody.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/emptyifbody.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/eqasolve-000.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/eqasolve-000.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/eqasolve-000.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/non-local-cut.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/non-local-cut.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail_from_c.s1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/ppc/tail_from_c.s2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /interp/test/factorial-tail.cmm.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test2/output/cut.1: -------------------------------------------------------------------------------- 1 | cut=99 2 | -------------------------------------------------------------------------------- /test2/output/sparcerr.1: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /test2/output/zerou.1: -------------------------------------------------------------------------------- 1 | 0U == 0 2 | -------------------------------------------------------------------------------- /test2/ppc/add.1: -------------------------------------------------------------------------------- 1 | hello, world! 2 | -------------------------------------------------------------------------------- /test2/ppc/bits-bug.1: -------------------------------------------------------------------------------- 1 | success 2 | -------------------------------------------------------------------------------- /test2/x86/const.s: -------------------------------------------------------------------------------- 1 | .globl main 2 | -------------------------------------------------------------------------------- /config/aux/.gitignore: -------------------------------------------------------------------------------- 1 | /tst 2 | 3 | -------------------------------------------------------------------------------- /gen/sparc.discards: -------------------------------------------------------------------------------- 1 | discard MULScc 2 | -------------------------------------------------------------------------------- /interp/test/factorial-args.script.2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mk/.gitignore: -------------------------------------------------------------------------------- 1 | /mk 2 | *.tar.gz 3 | -------------------------------------------------------------------------------- /test2/output/add.1: -------------------------------------------------------------------------------- 1 | hello, world! 2 | -------------------------------------------------------------------------------- /test2/output/bits-bug.1: -------------------------------------------------------------------------------- 1 | success 2 | -------------------------------------------------------------------------------- /test2/output/exp-001.1: -------------------------------------------------------------------------------- 1 | total is 6 2 | -------------------------------------------------------------------------------- /test2/output/failedcase.1: -------------------------------------------------------------------------------- 1 | int: 0 2 | -------------------------------------------------------------------------------- /test2/output/hello.1: -------------------------------------------------------------------------------- 1 | hello, world! 2 | -------------------------------------------------------------------------------- /test2/output/tailbug.1: -------------------------------------------------------------------------------- 1 | test done 2 | -------------------------------------------------------------------------------- /test2/output/x86-000.1: -------------------------------------------------------------------------------- 1 | total is 7 2 | -------------------------------------------------------------------------------- /test2/ppc/hello.1: -------------------------------------------------------------------------------- 1 | hello, world! 2 | -------------------------------------------------------------------------------- /test2/x86/err-002.s: -------------------------------------------------------------------------------- 1 | .globl main 2 | -------------------------------------------------------------------------------- /test2/output/ralloc-000.1: -------------------------------------------------------------------------------- 1 | total is 10 2 | -------------------------------------------------------------------------------- /test2/ppc/const.1: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 2 | -------------------------------------------------------------------------------- /test2/ppc/float-003.1: -------------------------------------------------------------------------------- 1 | f == nan; x == 1 2 | -------------------------------------------------------------------------------- /test2/x86/non-local-cut.s: -------------------------------------------------------------------------------- 1 | .globl main 2 | -------------------------------------------------------------------------------- /config/.gitignore: -------------------------------------------------------------------------------- 1 | /config.mk 2 | /auxdir/tst 3 | -------------------------------------------------------------------------------- /interp/libinclude/.gitignore: -------------------------------------------------------------------------------- 1 | *.[h] 2 | P=* 3 | -------------------------------------------------------------------------------- /interp/test/dayofweek.cmm.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 2 2 | -------------------------------------------------------------------------------- /interp/test/factorial.cmm.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 5040 2 | -------------------------------------------------------------------------------- /mk/debian/patches/00list: -------------------------------------------------------------------------------- 1 | 01-debian.dpatch 2 | -------------------------------------------------------------------------------- /test2/output/const.1: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 10 2 | -------------------------------------------------------------------------------- /test2/output/float-003.1: -------------------------------------------------------------------------------- 1 | f == nan; x == 1 2 | -------------------------------------------------------------------------------- /test2/output/ratail.1: -------------------------------------------------------------------------------- 1 | sixty should be 60 2 | -------------------------------------------------------------------------------- /test2/output/round2.1: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 2 4 | 1 5 | -------------------------------------------------------------------------------- /test2/sparc/float-003.1: -------------------------------------------------------------------------------- 1 | f == NaN; x == 1 2 | -------------------------------------------------------------------------------- /test2/tiger/merge.0: -------------------------------------------------------------------------------- 1 | 1 2 3 4 p 2 | 3 4 6 7 g 3 | -------------------------------------------------------------------------------- /test2/tiger/output/hello.1: -------------------------------------------------------------------------------- 1 | Hello, world. 2 | -------------------------------------------------------------------------------- /test2/tiger/output/merge.1: -------------------------------------------------------------------------------- 1 | 1 2 3 3 4 4 6 7 2 | -------------------------------------------------------------------------------- /interp/test/factorial-tail.cmm.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 5040 2 | -------------------------------------------------------------------------------- /interp/test/rounding.cmm.1: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 2 4 | 1 5 | -------------------------------------------------------------------------------- /test2/output/unwind.1: -------------------------------------------------------------------------------- 1 | unwound to 77 as expected 2 | -------------------------------------------------------------------------------- /test2/ppc/fadd.1: -------------------------------------------------------------------------------- 1 | 3.000000 + 0.141590 = 3.141590 2 | -------------------------------------------------------------------------------- /test2/quest/globals.c: -------------------------------------------------------------------------------- 1 | int globals_placeholder; 2 | -------------------------------------------------------------------------------- /debian/files: -------------------------------------------------------------------------------- 1 | qcmm_20040513_i386.deb devel optional 2 | -------------------------------------------------------------------------------- /interp/test/data.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 405634 2 | [CMMPRINT] 7 3 | -------------------------------------------------------------------------------- /test2/output/fadd.1: -------------------------------------------------------------------------------- 1 | 3.000000 + 0.141590 = 3.141590 2 | -------------------------------------------------------------------------------- /test2/output/nest.1: -------------------------------------------------------------------------------- 1 | closest enclosing span is inner 2 | -------------------------------------------------------------------------------- /test2/output/spdemo.1: -------------------------------------------------------------------------------- 1 | sum up to 4 is 10; product is 24 2 | -------------------------------------------------------------------------------- /test2/ppc/conj.1: -------------------------------------------------------------------------------- 1 | foo(0) = 0; foo(1) = 0; foo(2) = 999 2 | -------------------------------------------------------------------------------- /test2/ppc/f2.1: -------------------------------------------------------------------------------- 1 | Disjunction is 1 and conversion is -4 2 | -------------------------------------------------------------------------------- /test2/ppc/spdemo.1: -------------------------------------------------------------------------------- 1 | sum up to 4 is 10; product is 24 2 | -------------------------------------------------------------------------------- /test2/src/altret2.0: -------------------------------------------------------------------------------- 1 | I have at least 10 bytes of text. 2 | -------------------------------------------------------------------------------- /interp/test/factorial.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 7 2 | [CMMPRINT] 5040 3 | -------------------------------------------------------------------------------- /interp/test/mult-returns.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 5 2 | [CMMPRINT] 5 3 | -------------------------------------------------------------------------------- /interp/test/multasgn.cmm.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 2 2 | [CMMPRINT] 1 3 | -------------------------------------------------------------------------------- /test2/output/conj.1: -------------------------------------------------------------------------------- 1 | foo(0) = 0; foo(1) = 0; foo(2) = 999 2 | -------------------------------------------------------------------------------- /test2/output/deadcontvar.1: -------------------------------------------------------------------------------- 1 | SUCCESS: continuation reached 2 | -------------------------------------------------------------------------------- /test2/output/f2.1: -------------------------------------------------------------------------------- 1 | Disjunction is 1 and conversion is -4 2 | -------------------------------------------------------------------------------- /test2/output/fork.1: -------------------------------------------------------------------------------- 1 | fib(10) = 55 2 | run_thread returns 55 3 | -------------------------------------------------------------------------------- /test2/output/test-050.1: -------------------------------------------------------------------------------- 1 | argc = 1 2 | argc = 1 3 | argc = 1 4 | -------------------------------------------------------------------------------- /test2/ppc/bool.1: -------------------------------------------------------------------------------- 1 | 3 low bit is nonzero 2 | 4 low bit is zero 3 | -------------------------------------------------------------------------------- /test2/ppc/float-000.1: -------------------------------------------------------------------------------- 1 | pi with 2 ulps is 3.1415 2 | -------------------------------------------------------------------------------- /test2/ppc/rnd2.1: -------------------------------------------------------------------------------- 1 | Integer 3 converts to floating-point 3.00 2 | -------------------------------------------------------------------------------- /test2/ppc/test-050.1: -------------------------------------------------------------------------------- 1 | argc = 1 2 | argc = 1 3 | argc = 1 4 | -------------------------------------------------------------------------------- /test2/tiger/output/forloop.1: -------------------------------------------------------------------------------- 1 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 2 | -------------------------------------------------------------------------------- /test2/tiger/output/funcall.1: -------------------------------------------------------------------------------- 1 | str1 str2 str2 str2 str2 2 | -------------------------------------------------------------------------------- /aug99/.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.aux 3 | *.dvi 4 | *.log 5 | *.blg 6 | -------------------------------------------------------------------------------- /interp/test/factorial-tail.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 7 2 | [CMMPRINT] 5040 3 | -------------------------------------------------------------------------------- /mk/mk.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/mk/mk.pdf -------------------------------------------------------------------------------- /test2/output/bool.1: -------------------------------------------------------------------------------- 1 | 3 low bit is nonzero 2 | 4 low bit is zero 3 | -------------------------------------------------------------------------------- /test2/output/float-000.1: -------------------------------------------------------------------------------- 1 | pi with 2 ulps is 3.1415 2 | -------------------------------------------------------------------------------- /test2/output/float-001.1: -------------------------------------------------------------------------------- 1 | a hand-written literal pi is 3.14159 2 | -------------------------------------------------------------------------------- /test2/output/jtab.1: -------------------------------------------------------------------------------- 1 | Counting 1 2 | Counting 2 3 | Counting 3 4 | -------------------------------------------------------------------------------- /test2/output/rnd2.1: -------------------------------------------------------------------------------- 1 | Integer 3 converts to floating-point 3.00 2 | -------------------------------------------------------------------------------- /test2/output/tf.1: -------------------------------------------------------------------------------- 1 | %true gives truth and %false gives falsehood 2 | -------------------------------------------------------------------------------- /test2/tiger/rbshort.0: -------------------------------------------------------------------------------- 1 | now is the time because the time is now 2 | -------------------------------------------------------------------------------- /test2/x86/carry.5: -------------------------------------------------------------------------------- 1 | c04364cb6b524d107d4439dd3376fa42 src/ctest.c 2 | -------------------------------------------------------------------------------- /test2/x86/ladd.5: -------------------------------------------------------------------------------- 1 | ded1fabff67f94c4312c27ae25482ec2 src/ops64.c 2 | -------------------------------------------------------------------------------- /test2/x86/r64.5: -------------------------------------------------------------------------------- 1 | de66be303faab2cfa277e49cc7b0e36a src/r64main.c 2 | -------------------------------------------------------------------------------- /config/nocond: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | sed "/^@defn/s/ *(($*))//" 3 | 4 | 5 | -------------------------------------------------------------------------------- /mk/debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | usr/share/doc/mk 4 | -------------------------------------------------------------------------------- /mk/mk-a4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/mk/mk-a4.pdf -------------------------------------------------------------------------------- /mk/mk-usl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/mk/mk-usl.pdf -------------------------------------------------------------------------------- /test2/output/altread.2: -------------------------------------------------------------------------------- 1 | /does-not-exist: No such file or directory 2 | -------------------------------------------------------------------------------- /test2/output/float-001-coward.1: -------------------------------------------------------------------------------- 1 | a hand-written literal pi is 3.14159 2 | -------------------------------------------------------------------------------- /test2/output/float-001-hero.1: -------------------------------------------------------------------------------- 1 | a hand-written literal pi is 3.14159 2 | -------------------------------------------------------------------------------- /test2/output/not.1: -------------------------------------------------------------------------------- 1 | 987 >= 33 == 1; 33 >= 987 == 0; 987 >= 987 == 1 2 | -------------------------------------------------------------------------------- /test2/output/r64.1: -------------------------------------------------------------------------------- 1 | C-- can return a long long like 0xfeedfacedeadbeef 2 | -------------------------------------------------------------------------------- /test2/output/wtizzy.1: -------------------------------------------------------------------------------- 1 | called c_fun(0x0098374817263847, 32.000000) 2 | -------------------------------------------------------------------------------- /test2/ppc/exp-000.1: -------------------------------------------------------------------------------- 1 | lookup returns 0xdeadbeef (should be 0xdeadbeef) 2 | -------------------------------------------------------------------------------- /test2/ppc/not.1: -------------------------------------------------------------------------------- 1 | 987 >= 33 == 1; 33 >= 987 == 0; 987 >= 987 == 1 2 | -------------------------------------------------------------------------------- /test2/ppc/r64.1: -------------------------------------------------------------------------------- 1 | C-- can return a long long like 0xfeedfacedeadbeef 2 | -------------------------------------------------------------------------------- /test2/x86/fargres.5: -------------------------------------------------------------------------------- 1 | 174fcd83e47c55a60b4e7cdf01fd948e src/double.c 2 | -------------------------------------------------------------------------------- /test2/x86/lit8.5: -------------------------------------------------------------------------------- 1 | 1aff23b3ad4217351dda8c83872a99eb src/lit8main.c 2 | -------------------------------------------------------------------------------- /doc/release.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/doc/release.pdf -------------------------------------------------------------------------------- /lua/test/09.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/lua/test/09.lua -------------------------------------------------------------------------------- /lua/test/12.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/lua/test/12.lua -------------------------------------------------------------------------------- /lua/test/16.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/lua/test/16.lua -------------------------------------------------------------------------------- /lua/test/18.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/lua/test/18.lua -------------------------------------------------------------------------------- /lua/test/19.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/lua/test/19.lua -------------------------------------------------------------------------------- /tdpe/.gitignore: -------------------------------------------------------------------------------- 1 | /callcc.c 2 | /main 3 | /newer 4 | /spec 5 | /uint64p.c 6 | -------------------------------------------------------------------------------- /tdpe/one01RtlMk.mli: -------------------------------------------------------------------------------- 1 | module M : One01Constructors.S with type t = Rtl.rtl 2 | -------------------------------------------------------------------------------- /tdpe/one02RtlMk.mli: -------------------------------------------------------------------------------- 1 | module M : One02Constructors.S with type t = Rtl.rtl 2 | -------------------------------------------------------------------------------- /tdpe/sparcRtlMk.mli: -------------------------------------------------------------------------------- 1 | module M : SparcConstructors.S with type t = Rtl.rtl 2 | -------------------------------------------------------------------------------- /test2/output/altret2.1: -------------------------------------------------------------------------------- 1 | read() read 10 bytes 2 | Error: read() returned -1 3 | -------------------------------------------------------------------------------- /test2/output/emptyifbody.1: -------------------------------------------------------------------------------- 1 | Disjunction, conversion, empty if-body: works. 2 | -------------------------------------------------------------------------------- /test2/output/exp-000.1: -------------------------------------------------------------------------------- 1 | lookup returns 0xdeadbeef (should be 0xdeadbeef) 2 | -------------------------------------------------------------------------------- /test2/ppc/altret2.1: -------------------------------------------------------------------------------- 1 | read() read 10 bytes 2 | Error: read() returned -1 3 | -------------------------------------------------------------------------------- /test2/ppc/emptyifbody.1: -------------------------------------------------------------------------------- 1 | Disjunction, conversion, empty if-body: works. 2 | -------------------------------------------------------------------------------- /test2/ppc/sub.1: -------------------------------------------------------------------------------- 1 | dual-result call to f returns 33, -99 (expected 33, -99) 2 | -------------------------------------------------------------------------------- /asdl/.gitignore: -------------------------------------------------------------------------------- 1 | *.cm[xioa] 2 | *.ml[ly] 3 | *.ml 4 | *.o 5 | DEPEND* 6 | P=* 7 | -------------------------------------------------------------------------------- /interp/test/safedivide.cmm.1: -------------------------------------------------------------------------------- 1 | -- caught and handled exception : Division by zero 2 | -------------------------------------------------------------------------------- /test2/output/sub.1: -------------------------------------------------------------------------------- 1 | dual-result call to f returns 33, -99 (expected 33, -99) 2 | -------------------------------------------------------------------------------- /test2/output/tail.1: -------------------------------------------------------------------------------- 1 | calling down 100 levels is 0 bytes deeper than 10 levels 2 | -------------------------------------------------------------------------------- /test2/ppc/hex.1: -------------------------------------------------------------------------------- 1 | length is 1 (wants 1) and first character is the final newline. 2 | -------------------------------------------------------------------------------- /test2/src/errno.c: -------------------------------------------------------------------------------- 1 | #include 2 | int geterrno(void) { return errno; } 3 | -------------------------------------------------------------------------------- /test2/tiger/output/arrays.1: -------------------------------------------------------------------------------- 1 | printing array of size: 10 2 | P G P G P G P G P G 3 | -------------------------------------------------------------------------------- /test2/tiger/output/rbshort.1: -------------------------------------------------------------------------------- 1 | 1 because 2 | 2 is 3 | 2 now 4 | 2 the 5 | 2 time 6 | -------------------------------------------------------------------------------- /test2/tiger/rc4.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/test2/tiger/rc4.0 -------------------------------------------------------------------------------- /ccl-suite/iconx.m68k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/ccl-suite/iconx.m68k -------------------------------------------------------------------------------- /ccl-suite/iconx.mips: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/ccl-suite/iconx.mips -------------------------------------------------------------------------------- /ccl-suite/tgen.m68k: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/ccl-suite/tgen.m68k -------------------------------------------------------------------------------- /ccl-suite/tgen.mips: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/ccl-suite/tgen.mips -------------------------------------------------------------------------------- /ccl-suite/tgen.sparc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/ccl-suite/tgen.sparc -------------------------------------------------------------------------------- /interp/samples/mkfile: -------------------------------------------------------------------------------- 1 | callcc.qs: callcc.c-- 2 | qc-- -interp -S -globals callcc.c-- 3 | -------------------------------------------------------------------------------- /mk/lib/9/newprint.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/mk/lib/9/newprint.c -------------------------------------------------------------------------------- /src/peephole.lua: -------------------------------------------------------------------------------- 1 | local b = backend or Backend.x86 2 | b.improve=Optimize.improve 3 | -------------------------------------------------------------------------------- /test2/output/hex.1: -------------------------------------------------------------------------------- 1 | length is 1 (wants 1) and first character is the final newline. 2 | -------------------------------------------------------------------------------- /test2/ppc/altret3.2: -------------------------------------------------------------------------------- 1 | altread: No such file or directory 2 | altread: Is a directory 3 | -------------------------------------------------------------------------------- /ccl-suite/iconx.sparc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/ccl-suite/iconx.sparc -------------------------------------------------------------------------------- /lua-bench/.gitignore: -------------------------------------------------------------------------------- 1 | *.lua.out* 2 | gmon.out* 3 | *.lua.err* 4 | *.lua.stats* 5 | *.j 6 | -------------------------------------------------------------------------------- /tdpe/one01TreesBuild.mli: -------------------------------------------------------------------------------- 1 | module Build : One01Constructors.S with type t = One01Trees.M.t 2 | -------------------------------------------------------------------------------- /tdpe/one02TreesBuild.mli: -------------------------------------------------------------------------------- 1 | module Build : One02Constructors.S with type t = One02Trees.M.t 2 | -------------------------------------------------------------------------------- /tdpe/sparcTreesBuild.mli: -------------------------------------------------------------------------------- 1 | module Build : SparcConstructors.S with type t = SparcTrees.M.t 2 | -------------------------------------------------------------------------------- /test2/output/altret3.2: -------------------------------------------------------------------------------- 1 | altread: No such file or directory 2 | altread: Is a directory 3 | -------------------------------------------------------------------------------- /test2/output/tail2.1: -------------------------------------------------------------------------------- 1 | tail-calling indirect down 10 levels uses same space as 100 levels 2 | -------------------------------------------------------------------------------- /test2/output/tailnot.1: -------------------------------------------------------------------------------- 1 | calling down 10 and 100 levels predicts 47 levels with size >= 3 2 | -------------------------------------------------------------------------------- /test2/output/x86-001.1: -------------------------------------------------------------------------------- 1 | some weird instructions ran, after which we returned a literal 99 2 | -------------------------------------------------------------------------------- /test2/ppc/tadd22.1: -------------------------------------------------------------------------------- 1 | 2 tagged is 5 and 2 tagged is 5 2 | sum tagged is 9 and untagged is 4 3 | -------------------------------------------------------------------------------- /test2/src/ops64.c: -------------------------------------------------------------------------------- 1 | long long ladd(long long x, long long y) { 2 | return x + y; 3 | } 4 | -------------------------------------------------------------------------------- /interp/clients/.gitignore: -------------------------------------------------------------------------------- 1 | *.[chim] 2 | gc.tex 3 | gc_client 4 | exn.tex 5 | exn_client 6 | P=* 7 | -------------------------------------------------------------------------------- /interp/test/.gitignore: -------------------------------------------------------------------------------- 1 | test.tex 2 | *.dvi 3 | regr 4 | qrun 5 | qrun-gc 6 | qrun-exn 7 | P=* 8 | -------------------------------------------------------------------------------- /lua/old/.gitignore: -------------------------------------------------------------------------------- 1 | *.ml 2 | *.mli 3 | *.mly 4 | *.cmi 5 | *.cmo 6 | *.cmx 7 | *.cma 8 | *.mll 9 | -------------------------------------------------------------------------------- /test2/output/tadd22.1: -------------------------------------------------------------------------------- 1 | 2 tagged is 5 and 2 tagged is 5 2 | sum tagged is 9 and untagged is 4 3 | -------------------------------------------------------------------------------- /test2/ppc/tadd.1: -------------------------------------------------------------------------------- 1 | 10 tagged is 21 and 11 tagged is 23 2 | sum tagged is 43 and untagged is 21 3 | -------------------------------------------------------------------------------- /test2/ppc/tadd.11: -------------------------------------------------------------------------------- 1 | -1 tagged is -1 and -1 tagged is -1 2 | sum tagged is -3 and untagged is -2 3 | -------------------------------------------------------------------------------- /test2/ppc/tadd11.1: -------------------------------------------------------------------------------- 1 | -1 tagged is -1 and -1 tagged is -1 2 | sum tagged is -3 and untagged is -2 3 | -------------------------------------------------------------------------------- /test2/tiger/stdlib-x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nrnrnr/qc--/HEAD/test2/tiger/stdlib-x86.a -------------------------------------------------------------------------------- /test2/x86/exp-002.s: -------------------------------------------------------------------------------- 1 | .globl _MD5Init_perl 2 | .globl _MD5Update_perl 3 | .globl _MD5Final_perl 4 | -------------------------------------------------------------------------------- /cllib/.gitignore: -------------------------------------------------------------------------------- 1 | *.cm[xioa] 2 | *.ml[ly] 3 | *.ml 4 | *.o 5 | DEPEND* 6 | P=* 7 | /rc_parse.output 8 | -------------------------------------------------------------------------------- /test2/here.lua: -------------------------------------------------------------------------------- 1 | Ld.rtend = "../lib/libqc--.a ../lib/pcmap.ld" 2 | Ld.options = "-I../include -g" 3 | -------------------------------------------------------------------------------- /test2/output/divmod.1: -------------------------------------------------------------------------------- 1 | 987 div 33 == 29 (wants 29); 987 mod 33 == 30 (wants 30); d * q + r == 987 2 | -------------------------------------------------------------------------------- /test2/output/ladd.1: -------------------------------------------------------------------------------- 1 | sum of 0000000080000000 2 | and 0000000080000000 3 | is 0000000100000000 4 | -------------------------------------------------------------------------------- /test2/output/tadd.1: -------------------------------------------------------------------------------- 1 | 10 tagged is 21 and 11 tagged is 23 2 | sum tagged is 43 and untagged is 21 3 | -------------------------------------------------------------------------------- /test2/output/tadd.11: -------------------------------------------------------------------------------- 1 | -1 tagged is -1 and -1 tagged is -1 2 | sum tagged is -3 and untagged is -2 3 | -------------------------------------------------------------------------------- /test2/output/tadd11.1: -------------------------------------------------------------------------------- 1 | -1 tagged is -1 and -1 tagged is -1 2 | sum tagged is -3 and untagged is -2 3 | -------------------------------------------------------------------------------- /test2/ppc/divmod.1: -------------------------------------------------------------------------------- 1 | 987 div 33 == 29 (wants 29); 987 mod 33 == 30 (wants 30); d * q + r == 987 2 | -------------------------------------------------------------------------------- /test2/ppc/ladd.1: -------------------------------------------------------------------------------- 1 | sum of 0000000080000000 2 | and 0000000080000000 3 | is 0000000100000000 4 | -------------------------------------------------------------------------------- /test2/ppc/tadd.100-: -------------------------------------------------------------------------------- 1 | 100 tagged is 201 and -1 tagged is -1 2 | sum tagged is 199 and untagged is 99 3 | -------------------------------------------------------------------------------- /test2/ppc/tadd100-.1: -------------------------------------------------------------------------------- 1 | 100 tagged is 201 and -1 tagged is -1 2 | sum tagged is 199 and untagged is 99 3 | -------------------------------------------------------------------------------- /lua-bench/hello.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | write("hello world\n") 5 | -------------------------------------------------------------------------------- /test2/output/tadd.100-: -------------------------------------------------------------------------------- 1 | 100 tagged is 201 and -1 tagged is -1 2 | sum tagged is 199 and untagged is 99 3 | -------------------------------------------------------------------------------- /test2/output/tadd100-.1: -------------------------------------------------------------------------------- 1 | 100 tagged is 201 and -1 tagged is -1 2 | sum tagged is 199 and untagged is 99 3 | -------------------------------------------------------------------------------- /test2/ppc/fargres.1: -------------------------------------------------------------------------------- 1 | value passed in was 5.000000 2 | The value returned was 10.000000 (should be 10.0) 3 | -------------------------------------------------------------------------------- /test2/src/sub.pp: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | export f; 4 | 5 | f(bits32 i) { return (~i, ~99); } 6 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | usr/include/qc-- 4 | usr/lib/qc-- 5 | usr/share/doc/qcmm 6 | 7 | -------------------------------------------------------------------------------- /test2/output/fargres.1: -------------------------------------------------------------------------------- 1 | value passed in was 5.000000 2 | The value returned was 10.000000 (should be 10.0) 3 | -------------------------------------------------------------------------------- /test2/ppc/global.1: -------------------------------------------------------------------------------- 1 | global variable n == 99 2 | calling external function incn... 3 | global variable n == 100 4 | -------------------------------------------------------------------------------- /test2/ppc/taddov.1: -------------------------------------------------------------------------------- 1 | 536870912 tagged is 1073741825 and 536870912 tagged is 1073741825 2 | addition overflows 3 | -------------------------------------------------------------------------------- /test2/tiger/output/exceptions.1: -------------------------------------------------------------------------------- 1 | hello 2 | bye 3 | out of ex block 1 4 | exception 1 5 | out of ex block 2 6 | -------------------------------------------------------------------------------- /figures/README: -------------------------------------------------------------------------------- 1 | 2 | The figures in this directory are made with Tgif, a free vector 3 | drawing program. 4 | 5 | 6 | -------------------------------------------------------------------------------- /gen/.gitignore: -------------------------------------------------------------------------------- 1 | *.sled 2 | *.rtl 3 | *.cmo 4 | *.cmi 5 | *.cmx 6 | *.cma 7 | *.cmxa 8 | DEPEND* 9 | P=* 10 | -------------------------------------------------------------------------------- /lua/std/.gitignore: -------------------------------------------------------------------------------- 1 | *.ml 2 | *.mli 3 | *.mly 4 | *.cmi 5 | *.cmo 6 | *.cmx 7 | *.cma 8 | *.mll 9 | P=* 10 | -------------------------------------------------------------------------------- /test2/output/global.1: -------------------------------------------------------------------------------- 1 | global variable n == 99 2 | calling external function incn... 3 | global variable n == 100 4 | -------------------------------------------------------------------------------- /test2/output/taddov.1: -------------------------------------------------------------------------------- 1 | 536870912 tagged is 1073741825 and 536870912 tagged is 1073741825 2 | addition overflows 3 | -------------------------------------------------------------------------------- /test2/lcc/output/fields.1: -------------------------------------------------------------------------------- 1 | x = 1 2 3 4 -3 6 2 | y = 3 8 9 3 | x = 1 2 3 0 0 6 4 | y = 2 8 16 5 | p->a = 0x3, p->b = 0xf 6 | -------------------------------------------------------------------------------- /config/man.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Rules for manual pages 3 | # 4 | 5 | %.man:D: %.1 6 | nroff -man -Tascii $prereq > $target 7 | -------------------------------------------------------------------------------- /test2/src/incn.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | bits32 n; 4 | 5 | export incn; 6 | 7 | incn() { n = n + 1; return; } 8 | -------------------------------------------------------------------------------- /interp/test/factorial-args.script.1: -------------------------------------------------------------------------------- 1 | Quick C-- Interpreter 2 | 'help' prints available commands. 3 | 4 | > > > [CMMPRINT] 120 5 | > -------------------------------------------------------------------------------- /test2/ppc/blockcpy.1: -------------------------------------------------------------------------------- 1 | 0 0 0 0 2 | 5 6 7 8 3 | 0 0 0 0 0 0 0 0 4 | 1 2 3 4 5 6 7 8 5 | 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 6 | -------------------------------------------------------------------------------- /lua/camlboxval: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if false && [ -x $BIN/camlboxval ]; then 4 | exec $BIN/camlboxval 5 | else 6 | exec cat 7 | fi 8 | -------------------------------------------------------------------------------- /test2/output/blockcpy.1: -------------------------------------------------------------------------------- 1 | 0 0 0 0 2 | 5 6 7 8 3 | 0 0 0 0 0 0 0 0 4 | 1 2 3 4 5 6 7 8 5 | 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 6 | -------------------------------------------------------------------------------- /tdpe/one01RtlRec.mli: -------------------------------------------------------------------------------- 1 | module M(I : One01Constructors.S): 2 | sig 3 | val defaultOfInstruction : Rtl.Private.rtl -> I.t 4 | end 5 | -------------------------------------------------------------------------------- /tdpe/one02RtlRec.mli: -------------------------------------------------------------------------------- 1 | module M(I : One02Constructors.S): 2 | sig 3 | val defaultOfInstruction : Rtl.Private.rtl -> I.t 4 | end 5 | -------------------------------------------------------------------------------- /tdpe/sparcRtlRec.mli: -------------------------------------------------------------------------------- 1 | module M(I : SparcConstructors.S): 2 | sig 3 | val defaultOfInstruction : Rtl.Private.rtl -> I.t 4 | end 5 | -------------------------------------------------------------------------------- /gen/sparcmkasm.mli: -------------------------------------------------------------------------------- 1 | module M (R : Sledlib.RELOC_PRINT) : Sparc.S 2 | with type t = Sledlib.String.t and module Reloc = R 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gen/x86imkasm.mli: -------------------------------------------------------------------------------- 1 | module M (R : Sledlib.RELOC_PRINT) : X86i.S 2 | with type t = Sledlib.String.t and module Reloc = R 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test2/src/double.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | float doubleme(float a) { 4 | printf("value passed in was %f\n", a); 5 | return a*2.0; 6 | } 7 | -------------------------------------------------------------------------------- /interp/assert.c: -------------------------------------------------------------------------------- 1 | #include 2 | const Except_T Assert_Failed = { "Assertion failed" }; 3 | void (assert)(int e) { 4 | assert(e); 5 | } 6 | -------------------------------------------------------------------------------- /test2/src/live_rtd.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | import exit; 3 | export main; 4 | 5 | main() { 6 | foreign "C" exit(0) never returns; 7 | } 8 | -------------------------------------------------------------------------------- /asdl/share.nw: -------------------------------------------------------------------------------- 1 | <>= 2 | type 'a share = DEFv of string * 'a | USEv of string 3 | <>= 4 | type 'a share = | DEFv of string * 'a | USEv of string 5 | -------------------------------------------------------------------------------- /test2/src/test-051.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | export f; 3 | 4 | f () { 5 | bits32 n; 6 | if (%bool(1::bits1)) { return (1); } else { return (0); } 7 | } 8 | -------------------------------------------------------------------------------- /doc/lcc: -------------------------------------------------------------------------------- 1 | How to use the lcc front end 2 | 3 | From the CVS repository, check out frontends/lcc. 4 | 5 | Follow the directions in the README file. 6 | -------------------------------------------------------------------------------- /test2/output/switch.1: -------------------------------------------------------------------------------- 1 | first branch: n = 1 2 | second branch: n = 2 3 | second branch: n = 3 4 | third branch: n = 4 5 | default branch: n = 99 6 | default branch: n = -3 7 | -------------------------------------------------------------------------------- /test2/output/test-042.s2: -------------------------------------------------------------------------------- 1 | This can't happen: unknown hardware register "register7" 2 | Caml exception: Impossible.Impossible("unknown hardware register \"register7\"") 3 | -------------------------------------------------------------------------------- /test2/ppc/switch.1: -------------------------------------------------------------------------------- 1 | first branch: n = 1 2 | second branch: n = 2 3 | second branch: n = 3 4 | third branch: n = 4 5 | default branch: n = 99 6 | default branch: n = -3 7 | -------------------------------------------------------------------------------- /test2/src/test-043.c--: -------------------------------------------------------------------------------- 1 | /* this is a C-- comment ******/ 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | -------------------------------------------------------------------------------- /test2/src/call3.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | export call3; 4 | 5 | call3(bits32 f, bits32 arg0, bits32 arg1, bits32 arg2) { 6 | jump f(arg0, arg1, arg2); 7 | } 8 | -------------------------------------------------------------------------------- /test2/output/err-000.s2: -------------------------------------------------------------------------------- 1 | File "src/err-000.c--", line 12, characters 5-26 Error: overflow computing size 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/src/test-036.c--: -------------------------------------------------------------------------------- 1 | export bits32 z; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | const z = 3; 9 | -------------------------------------------------------------------------------- /test2/output/test-013.s2: -------------------------------------------------------------------------------- 1 | File "src/test-013.c--", line 12, characters 5-33 Error: too many initial values 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/ppc/exp-002.s2: -------------------------------------------------------------------------------- 1 | source code specifies byteorder big, but target x86 specifies byteorder little 2 | Caml exception: Error.ErrorExn("metrics of source code don't match the target") 3 | -------------------------------------------------------------------------------- /test2/ppc/float-001.s2: -------------------------------------------------------------------------------- 1 | File "src/float-001.c--", line 12, characters 5-26 Error: overflow computing size 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/dummy/non-local-cut.s2: -------------------------------------------------------------------------------- 1 | File "src/non-local-cut.c--", line 25, characters 10-14 Error: unknown value: cont 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/exp-002.s2: -------------------------------------------------------------------------------- 1 | source code specifies byteorder big, but target x86 specifies byteorder little 2 | Caml exception: Error.ErrorExn("metrics of source code don't match the target") 3 | -------------------------------------------------------------------------------- /test2/output/non-local-cut.s2: -------------------------------------------------------------------------------- 1 | File "src/non-local-cut.c--", line 25, characters 10-14 Error: unknown value: cont 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-036.s2: -------------------------------------------------------------------------------- 1 | File "src/test-036.c--", line 1, characters 1-17 Error: constant 'z' can't be exported 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/ppc/non-local-cut.s2: -------------------------------------------------------------------------------- 1 | File "src/non-local-cut.c--", line 25, characters 10-14 Error: unknown value: cont 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Idioms we generate low-quality code for 2 | 3 | if (x `xor` y) `lt` 0 ... 4 | 5 | 6 | 7 | Missed opportunities for peephole optimization? 8 | 9 | x86 cltd instruction 10 | -------------------------------------------------------------------------------- /test2/dummy/exp-002.s2: -------------------------------------------------------------------------------- 1 | source code specifies byteorder big, but target dummy32l specifies byteorder little 2 | Caml exception: Error.ErrorExn("metrics of source code don't match the target") 3 | -------------------------------------------------------------------------------- /test2/output/test-014.s2: -------------------------------------------------------------------------------- 1 | File "src/test-014.c--", line 16, characters 13-32 Error: alignment 5 is not a power of 2 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-019.s2: -------------------------------------------------------------------------------- 1 | File "src/test-019.c--", line 17, characters 17-36 Error: alignment 3 is not a power of 2 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /runtime/overflow/clientbuildsclosure/mkfile: -------------------------------------------------------------------------------- 1 | overflow: overflow.c-- overflow-client.c-- overflow-global.c-- 2 | qc-- -o overflow -globals overflow.c-- overflow-client.c-- overflow-global.c-- 3 | -------------------------------------------------------------------------------- /test2/lcc/output/struct.1: -------------------------------------------------------------------------------- 1 | (-1,-1) is not within [10,10; 310,310] 2 | (1,1) is not within [10,10; 310,310] 3 | (20,300) is within [10,10; 310,310] 4 | (500,400) is not within [10,10; 310,310] 5 | ab 6 | -------------------------------------------------------------------------------- /test2/output/test-024.s2: -------------------------------------------------------------------------------- 1 | File "src/test-024.c--", line 1, characters 18-24 Error: constant expression may not be a Boolean 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /interp/test/print-loop.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 0 2 | [CMMPRINT] 1 3 | [CMMPRINT] 2 4 | [CMMPRINT] 3 5 | [CMMPRINT] 4 6 | [CMMPRINT] 5 7 | [CMMPRINT] 6 8 | [CMMPRINT] 7 9 | [CMMPRINT] 8 10 | [CMMPRINT] 9 11 | -------------------------------------------------------------------------------- /test2/dummy/fadd.s2: -------------------------------------------------------------------------------- 1 | The current calling convention could not support a 64-bit value 2 | For a longer explanation run 3 | qc-- -e 'Unsupported.explain(4, 64)' 4 | Caml exception: Unsupported.Unsupported 5 | -------------------------------------------------------------------------------- /test2/dummy/rnd2.s2: -------------------------------------------------------------------------------- 1 | The current calling convention could not support a 64-bit value 2 | For a longer explanation run 3 | qc-- -e 'Unsupported.explain(4, 64)' 4 | Caml exception: Unsupported.Unsupported 5 | -------------------------------------------------------------------------------- /test2/output/test-012.s2: -------------------------------------------------------------------------------- 1 | File "src/test-012.c--", line 12, characters 20-21 Error: initialized string must specify type bits8 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/ppc/tail2.1: -------------------------------------------------------------------------------- 1 | calling indirect down 10 levels uses 40 bytes of stack 2 | calling indirect down 100 levels uses 40 bytes of stack 3 | calling indirect down 100 levels is 0 bytes deeper than 10 levels 4 | -------------------------------------------------------------------------------- /test2/src/test-005.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | const x = foo; 8 | 9 | foo (bits32 x) {} 10 | 11 | -------------------------------------------------------------------------------- /test2/src/test-027.c--: -------------------------------------------------------------------------------- 1 | bits1 one; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | foo() { 9 | jump one (); 10 | } 11 | -------------------------------------------------------------------------------- /test2/src/test-031.c--: -------------------------------------------------------------------------------- 1 | bits1 one; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | 6 | foo() { 7 | return <3 / 0>; 8 | 9 | target byteorder little; 10 | } 11 | -------------------------------------------------------------------------------- /interp/test/factorial-args.script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ## 3 | ### ./regr "./$SELF" $REGRFLAGS -out $BASE.script.1 -err $BASE.script.2 4 | 5 | echo \ 6 | "load factorial-args.lua ; 7 | run main 5" | ../../bin/qc--interp -------------------------------------------------------------------------------- /test2/dummy/float-000.s2: -------------------------------------------------------------------------------- 1 | The current calling convention could not support a 64-bit value 2 | For a longer explanation run 3 | qc-- -e 'Unsupported.explain(4, 64)' 4 | Caml exception: Unsupported.Unsupported 5 | -------------------------------------------------------------------------------- /test2/dummy/float-001.s2: -------------------------------------------------------------------------------- 1 | The current calling convention could not support a 64-bit value 2 | For a longer explanation run 3 | qc-- -e 'Unsupported.explain(4, 64)' 4 | Caml exception: Unsupported.Unsupported 5 | -------------------------------------------------------------------------------- /test2/output/err-001.s2: -------------------------------------------------------------------------------- 1 | This can't happen: Continuation escapes but is not annotated with also cuts to 2 | Caml exception: Impossible.Impossible("Continuation escapes but is not annotated with also cuts to") 3 | -------------------------------------------------------------------------------- /test2/output/test-018.s2: -------------------------------------------------------------------------------- 1 | File "src/test-018.c--", line 17, characters 17-26 Error: address's type is not the machine's pointer size 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/quest/.gitignore: -------------------------------------------------------------------------------- 1 | /test-*-cmm-cmm 2 | /test-*-cmm-lcc 3 | /test-*-cmm-gcc 4 | /test-*-lcc-cmm 5 | /test-*-lcc-lcc 6 | /test-*-lcc-gcc 7 | /test-*-gcc-cmm 8 | /test-*-gcc-lcc 9 | /test-*-gcc-gcc 10 | -------------------------------------------------------------------------------- /test2/src/test-026.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits1 one; 8 | 9 | foo() { 10 | cut to one (); 11 | } 12 | -------------------------------------------------------------------------------- /test2/src/test-028.c--: -------------------------------------------------------------------------------- 1 | bits1 one; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | foo() { 9 | continuation c (one): 10 | } 11 | -------------------------------------------------------------------------------- /test2/src/test-030.c--: -------------------------------------------------------------------------------- 1 | bits1 one; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | 6 | foo() { 7 | return <1 / one>; 8 | 9 | target byteorder little; 10 | } 11 | -------------------------------------------------------------------------------- /testcc/.gitignore: -------------------------------------------------------------------------------- 1 | /alpha 2 | /mips 3 | /x86 4 | /ia64 5 | /alpha.sh 6 | /mips.sh 7 | /x86.sh 8 | /ia64.sh 9 | /*-test.tar.gz 10 | /*-call.sigs 11 | /*.c 12 | /*.c-- 13 | /*.s 14 | /a.out 15 | /P=* 16 | -------------------------------------------------------------------------------- /test2/output/test-022.s2: -------------------------------------------------------------------------------- 1 | File "src/test-022.c--", line 10, character 5 - line 12, character 6 Error: condition in `if' is not a Boolean 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/ppc/tailnot.1: -------------------------------------------------------------------------------- 1 | calling indirect down 10 levels uses 472 bytes of stack 2 | calling indirect down 100 levels uses 4792 bytes of stack 3 | calling indirect down 100 levels is 4320 bytes deeper than 10 levels 4 | -------------------------------------------------------------------------------- /test2/src/test-000.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits32 x; 8 | bits32 x; 9 | 10 | foo () 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test2/src/test-029.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | bits1 one; 6 | 7 | foo() { 8 | return ; 9 | 10 | target byteorder little; 11 | } 12 | -------------------------------------------------------------------------------- /interp/mkfile.user: -------------------------------------------------------------------------------- 1 | # users can't run the Toolkit 2 | 3 | encode.c encode.h: bytecode.sled 4 | sh ./toolkit-usage $MODE $target 5 | 6 | %-dec.c:D: %.m bytecode.sled decode.fetch 7 | sh ./toolkit-usage $MODE $target 8 | -------------------------------------------------------------------------------- /interp/test/cut-bad.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 0 2 | [CMMPRINT] 1 3 | [CMMPRINT] 2 4 | [CMMPRINT] 3 5 | [CMMPRINT] 4 6 | [CMMPRINT] 5 7 | [CMMPRINT] 6 8 | [CMMPRINT] 7 9 | [CMMPRINT] 8 10 | [CMMPRINT] 9 11 | [CMMPRINT] 10 12 | -------------------------------------------------------------------------------- /lua/test/21.lua: -------------------------------------------------------------------------------- 1 | 2 | t = newtag(); a = {}; settag(a, t) 3 | 4 | function f (a) 5 | %write(_STDERR, '.') 6 | %settag({}, %tag(a)) 7 | end 8 | 9 | settagmethod(t, 'gc', f) 10 | t = nil; a = nil; f = nil 11 | -------------------------------------------------------------------------------- /runtime/overflow/runtimebuildsclosure/mkfile: -------------------------------------------------------------------------------- 1 | overflow: overflow.c-- overflow-client.c-- overflow-global.c-- getspan.c 2 | qc-- -o overflow -globals overflow.c-- overflow-client.c-- overflow-global.c-- getspan.c 3 | -------------------------------------------------------------------------------- /test2/output/test-029.s2: -------------------------------------------------------------------------------- 1 | File "src/test-029.c--", line 8, characters 5-22 Error: a constant expression may not refer to register variable 'one' 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-030.s2: -------------------------------------------------------------------------------- 1 | File "src/test-030.c--", line 7, characters 5-22 Error: a constant expression may not refer to register variable 'one' 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-037.s2: -------------------------------------------------------------------------------- 1 | File "src/test-037.c--", line 13, characters 13-24 Error: target list omitted and target is not a local code label 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-017.s2: -------------------------------------------------------------------------------- 1 | File "src/test-017.c--", line 17, characters 9-24 Error: target of 'cut to' must be a bit vector of the native pointer type 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-026.s2: -------------------------------------------------------------------------------- 1 | File "src/test-026.c--", line 10, characters 5-19 Error: target of 'cut to' must be a bit vector of the native pointer type 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-027.s2: -------------------------------------------------------------------------------- 1 | File "src/test-027.c--", line 9, characters 5-17 Error: procedure value must be a bit vector of the native pointer type 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/output/test-031.s2: -------------------------------------------------------------------------------- 1 | File "src/test-031.c--", line 7, characters 5-20 Error: in return , i must be at most n but you have i = 3 and n = 0 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/src/test-004.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | const x = 1 + y; 8 | const y = z; 9 | const z = x + 1; 10 | 11 | -------------------------------------------------------------------------------- /camlburg/run_twelf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | 3 | spawn /usr/share/twelf/bin/twelf-server 4 | expect "OK" 5 | send "loadFile $argv\n" 6 | expect { 7 | "ABORT" {send "\004"} 8 | "OK" {send "\004"} 9 | } 10 | exit 11 | -------------------------------------------------------------------------------- /test2/src/r64main.c: -------------------------------------------------------------------------------- 1 | extern int printf(const char *fmt, ...); 2 | extern unsigned long long f(void); 3 | 4 | main(int argc, char **argv) { 5 | printf("C-- can return a long long like 0x%16llx\n", f()); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /interp/test/cut.1: -------------------------------------------------------------------------------- 1 | [CMMPRINT] 0 2 | [CMMPRINT] 1 3 | [CMMPRINT] 2 4 | [CMMPRINT] 3 5 | [CMMPRINT] 4 6 | [CMMPRINT] 5 7 | [CMMPRINT] 6 8 | [CMMPRINT] 7 9 | [CMMPRINT] 8 10 | [CMMPRINT] 9 11 | [CMMPRINT] 10 12 | [CMMPRINT] 0 13 | -------------------------------------------------------------------------------- /lua-bench/sumcol.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | local sum = 0 5 | local line = read() 6 | while line ~= nil do 7 | sum = sum + line 8 | line = read() 9 | end 10 | write(sum, "\n") 11 | -------------------------------------------------------------------------------- /mk/debian/README.Debian: -------------------------------------------------------------------------------- 1 | mk for Debian 2 | ------------- 3 | 4 | This is just mk from http://www.cs.tufts.edu/~nr/c--/ re-packaged for Debian. 5 | 6 | -- Christian Lindig , Fri, 5 Mar 2004 05:03:22 -0500 7 | -------------------------------------------------------------------------------- /test2/lcc/output/array.1: -------------------------------------------------------------------------------- 1 | 0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003 2 | 0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003 3 | 0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003 4 | 0 1 2 3 1000 1001 1002 1003 2000 2001 2002 2003 5 | -------------------------------------------------------------------------------- /test2/lcc/output/init.1: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | 5 6 3 | 7 4 | if 5 | for 6 | else 7 | while 8 | 1 2 3 if 9 | 4 5 0 for 10 | 6 7 8 else 11 | 9 10 11 while 12 | 1 2 3 if 13 | 4 5 0 for 14 | 6 7 8 else 15 | 9 10 11 while 16 | 0 0 0 17 | -------------------------------------------------------------------------------- /test2/output/test-016.s2: -------------------------------------------------------------------------------- 1 | File "src/test-016.c--", line 17, characters 9-26 Error: target c is a register variable (must be a procedure or imported pointer) 2 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 3 | -------------------------------------------------------------------------------- /test2/src/test-001.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | const x = 1; 8 | const y = z; 9 | 10 | foo () 11 | { 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /test2/src/test-025.c--: -------------------------------------------------------------------------------- 1 | const true = 1 == 1; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | foo() { 9 | bits1 x; 10 | 11 | goto x; 12 | } 13 | -------------------------------------------------------------------------------- /test2/src/test-033.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | foo() { 8 | bits32 x, y; 9 | bits16 a ,b; 10 | 11 | x, y = a(b); 12 | } 13 | -------------------------------------------------------------------------------- /doc/restrictions.tex: -------------------------------------------------------------------------------- 1 | Restrictions on source code: 2 | \begin{itemize} 3 | \item 4 | The \texttt{bit} and \texttt{bool} operators are not supported. 5 | \item 6 | A nontrivial guard may appear only on a branch instruction. 7 | \end{itemize} 8 | -------------------------------------------------------------------------------- /src/loadfiles: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # can't use modern awk gsub because it is not available on 4 | # Solaris and not every platform has nawk 5 | 6 | cat $* | 7 | tr '{}\\' ' ' | 8 | awk '/^.loadfile/ { 9 | print $2 10 | }' 11 | -------------------------------------------------------------------------------- /test2/src/if-false.c--: -------------------------------------------------------------------------------- 1 | target wordsize 32 pointersize 32 byteorder little; 2 | 3 | export main; 4 | 5 | foreign "C" main (bits32 argc, bits32 argv) 6 | { 7 | if (%conjoin(1 == 0, 1 == 1)) { return(1); } else { return(0); } 8 | } 9 | -------------------------------------------------------------------------------- /test2/src/test-009.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[0]; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test2/output/tail_from_c.1: -------------------------------------------------------------------------------- 1 | stackdata difference: 0 2 | stackdata difference: 0 3 | stackdata difference: 0 4 | stackdata difference: 0 5 | stackdata difference: 0 6 | stackdata difference: 0 7 | sum: 28 8 | product: 5040 9 | Total: 21 10 | -------------------------------------------------------------------------------- /test2/ppc/tail_from_c.1: -------------------------------------------------------------------------------- 1 | stackdata: bfffef64 2 | stackdata: bfffef64 3 | stackdata: bfffef64 4 | stackdata: bfffef64 5 | stackdata: bfffef64 6 | stackdata: bfffef64 7 | stackdata: bfffef64 8 | sum: 28 9 | product: 5040 10 | Total: 21 11 | -------------------------------------------------------------------------------- /test2/src/test-012.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4] "abcd"; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /test2/src/test-034.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | foo() { 8 | bits32 x, y; 9 | bits16 a ,b; 10 | 11 | y = %%add (a,x); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | qcmm (20040505) unstable; urgency=low 2 | 3 | * Initial Release. 4 | 5 | -- Christian Lindig Thu, 6 May 2004 16:26:33 +0200 6 | 7 | Local variables: 8 | mode: debian-changelog 9 | End: 10 | -------------------------------------------------------------------------------- /tdpe/one02Nbe.mli: -------------------------------------------------------------------------------- 1 | 2 | 3 | val reify_amode : One02Trees.M.amode -> Tdpe.dynamic 4 | val reflect_amode : Tdpe.dynamic -> One02Trees.M.amode 5 | val reify_t : One02Trees.M.t -> Tdpe.dynamic 6 | val reflect_t : Tdpe.dynamic -> 7 | One02Trees.M.t 8 | 9 | -------------------------------------------------------------------------------- /test2/output/test-039.1: -------------------------------------------------------------------------------- 1 | sp1(1) == (1, 1) 2 | sp2(1) == (1, 1) 3 | sp3(1) == (1, 1) 4 | sp1(4) == (10, 24) 5 | sp2(4) == (10, 24) 6 | sp3(4) == (10, 24) 7 | sp1(10) == (55, 3628800) 8 | sp2(10) == (55, 3628800) 9 | sp3(10) == (55, 3628800) 10 | -------------------------------------------------------------------------------- /interp/include/cii/assert.h: -------------------------------------------------------------------------------- 1 | /* $Id$ */ 2 | #undef assert 3 | #ifdef NDEBUG 4 | #define assert(e) ((void)0) 5 | #else 6 | #include "except.h" 7 | extern void assert(int e); 8 | #define assert(e) ((void)((e)||(RAISE(Assert_Failed),0))) 9 | #endif 10 | -------------------------------------------------------------------------------- /test2/src/err-000.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[3.14::bits64]; 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test2/src/test-032.c--: -------------------------------------------------------------------------------- 1 | bits1 one; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | foo() { 9 | bits32 x, y; 10 | bits16 a ,b; 11 | 12 | x, y = a, b; 13 | } 14 | -------------------------------------------------------------------------------- /tools/.gitignore: -------------------------------------------------------------------------------- 1 | *.cm[xioa] 2 | *.tex 3 | *.o 4 | *.sig 5 | DEPEND 6 | *.1 7 | *.pod 8 | *.tar* 9 | *.mll 10 | *.ml 11 | *.html 12 | /pod2htm* 13 | /ocamlerror 14 | /ocamlerror.opt 15 | /nofake 16 | /grades 17 | /newer 18 | /newer.c 19 | P=* 20 | -------------------------------------------------------------------------------- /interp/test/simple.2: -------------------------------------------------------------------------------- 1 | error: fell off end of a C-- section 2 | error: unrecoverable runtime error at PC 0x808f01c 3 | | Stack trace: 4 | | 0: main() 5 | | End of Stack Trace (oldest activation was #0) 6 | Try disassembling 'main' to find relevant instructions 7 | -------------------------------------------------------------------------------- /test2/output/exp-003.s2: -------------------------------------------------------------------------------- 1 | This can't happen: Asked for temporary in space `general-purpose temporaries' with unsupported width 80 2 | Caml exception: Impossible.Impossible("Asked for temporary in space `general-purpose temporaries' with unsupported width 80") 3 | -------------------------------------------------------------------------------- /test2/src/test-013.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4] { 1, 2, 3, 4, 5 }; 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test2/src/test-035.c--: -------------------------------------------------------------------------------- 1 | export bits1 foo; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | foo() { 9 | bits32 x, y; 10 | bits16 a ,b; 11 | 12 | ; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /lua-bench/fibo.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | function fib(n) 5 | if (n < 2) then return(1) end 6 | return( fib(n-2) + fib(n-1) ) 7 | end 8 | 9 | N = tonumber((arg and arg[1])) or 1 10 | write(fib(N), "\n") 11 | -------------------------------------------------------------------------------- /mk/lib/9/dirstat-Inferno.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | -------------------------------------------------------------------------------- /mk/lib/9/getuser-Inferno.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | -------------------------------------------------------------------------------- /test2/output/test-051.s2: -------------------------------------------------------------------------------- 1 | File "src/test-051.c--", line 6, characters 13-21 Error: literal 1 does not fit in 1 signed bits, but it will 2 | fit in 1 unsigned bits---perhaps you want '1U'? 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/test-022.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | foo() { 8 | bits32 x; 9 | 10 | if (x) { 11 | ; 12 | } 13 | 14 | return; 15 | } 16 | -------------------------------------------------------------------------------- /test2/tiger/README: -------------------------------------------------------------------------------- 1 | When Tiger runtime changes, rebuild stdlib.a in tigerland 2 | and make it stdlib-x86.a. Also rebuild runtime.o in tigerland and 3 | make it tigermain-x86.o. Or if feeling brave, do 'mk nrinstall' 4 | from tigerland and 'mk refresh' here. 5 | 6 | -------------------------------------------------------------------------------- /figures/mkfile: -------------------------------------------------------------------------------- 1 | 2 | OBJ = `find . -name '*.obj' -print` 3 | EPS = `echo $OBJ | sed 's/.obj/.eps/g'` 4 | 5 | TGIF = tgif 6 | 7 | all:V: $EPS 8 | 9 | %.eps: %.obj 10 | $TGIF -print -eps $prereq 11 | -------------------------------------------------------------------------------- /mkdirs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # build directories in order 4 | 5 | set -x 6 | 7 | TGT=update 8 | 9 | case $1 in 10 | -opt) TGT=update.opt ; shift ;; 11 | esac 12 | 13 | for i do 14 | (cd $i && mk $MKFLAGS depend && mk $MKFLAGS $TGT) || exit 1 15 | done 16 | -------------------------------------------------------------------------------- /test2/src/infloop.c--: -------------------------------------------------------------------------------- 1 | f3 () { 2 | stackdata { 3 | bar: bits8[64]; 4 | } 5 | 6 | f3_label: 7 | bits64[bar] = 18::bits64; 8 | bits64[bar+4*8] = bits64[bar]; 9 | goto f3_label; 10 | } 11 | 12 | target byteorder little; 13 | export f3; 14 | -------------------------------------------------------------------------------- /test2/output/test-005.s2: -------------------------------------------------------------------------------- 1 | File "src/test-005.c--", line 7, characters 15-18 Error: unknown value: foo 2 | File "src/test-005.c--", line 9, characters 1-18 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/test-011.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[foo]; 13 | 14 | } 15 | 16 | foo (bits32 x) { } 17 | 18 | -------------------------------------------------------------------------------- /testcc/gensigs.lua: -------------------------------------------------------------------------------- 1 | $debug 1 2 | CMD.dashe = 1 3 | Debug.paths_proc(tgt, "C", 4 | { { type = "int" , widths = iwidths } 5 | , { type = "float", widths = fwidths } 6 | }) 7 | Debug.path_2_in_overflow(tgt, "C") 8 | -------------------------------------------------------------------------------- /camlburg/TODO: -------------------------------------------------------------------------------- 1 | vim: set ts=8 et sw=4: 2 | 3 | $Id$ 4 | 5 | o semantic error: constructor `Store' is used inconsistently 6 | Please give the 2 inconsistent uses... -- NR 7 | o Make code more imperative; replace { foo with x = ..} 8 | with (foo.x <- ..; foo ) 9 | -------------------------------------------------------------------------------- /interp/mkfile.developer: -------------------------------------------------------------------------------- 1 | TOOLS = tools 2 | 3 | encode.c encode.h:D: bytecode.sled 4 | $TOOLS -lc-cons-names -encoder encode $prereq 5 | 6 | %-dec.c:D: %.m bytecode.sled decode.fetch 7 | $TOOLS -lc-cons-names -decoder $target -matcher $stem.m \ 8 | bytecode.sled decode.fetch 9 | -------------------------------------------------------------------------------- /test2/output/test-002.s2: -------------------------------------------------------------------------------- 1 | File "src/test-002.c--", line 8, characters 15-29 Error: a constant expression may not refer to memory 2 | File "src/test-002.c--", line 9, characters 27-28 Error: unknown value: a 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/output/test-001.s2: -------------------------------------------------------------------------------- 1 | File "src/test-001.c--", line 8, characters 15-16 Error: unknown value: z 2 | File "src/test-001.c--", line 10, character 1 - line 13, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/ppc/tail.1: -------------------------------------------------------------------------------- 1 | calling down 10 levels uses 44 bytes of stack 2 | calling down 100 levels uses 44 bytes of stack 3 | value returned after 10 levels is 44 bytes of stack 4 | value returned after 100 levels is 44 bytes of stack 5 | calling down 100 levels is 0 bytes deeper than 10 levels 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.asdl 3 | *.cm[xioa] 4 | *.ml[ly] 5 | *.mli 6 | *.o 7 | /bin 8 | /lib 9 | /man 10 | /include 11 | /DEPEND 12 | /DEPEND.evaluating 13 | .nfs* 14 | .*swp 15 | /graph.dot 16 | /graph.ps 17 | *tar.gz 18 | /bin 19 | /man 20 | /bin/* 21 | /man/man1/* 22 | /configure.log 23 | -------------------------------------------------------------------------------- /camlburg/.gitignore: -------------------------------------------------------------------------------- 1 | *.mlb 2 | *.mly 3 | *.mli 4 | *.ml 5 | *.cmi 6 | *.cmo 7 | *.cmx 8 | *.mll 9 | *.tex 10 | *.1 11 | DEPEND* 12 | /mlburg 13 | /mlburg.opt 14 | /nofake* 15 | /pp* 16 | /srcmap* 17 | /ocamlburg 18 | /ocamlburg.opt 19 | P=* 20 | /ocamlburg.tar.gz 21 | /parse.output 22 | -------------------------------------------------------------------------------- /interp/test/encoding.script.2: -------------------------------------------------------------------------------- 1 | error: cannot open file [somefilethatdoesntexist] 2 | error: unrecoverable error; cannot finish loading file [somefilethatdoesntexist] 3 | error: cannot find specified exported C-- label: notalabel 4 | error: cannot find specified exported C-- label: notalabel 5 | -------------------------------------------------------------------------------- /test2/lcc/output/sort.1: -------------------------------------------------------------------------------- 1 | exchange(1,9) 2 | exchange(3,7) 3 | exchange(5,6) 4 | exchange(0,5) 5 | exchange(0,3) 6 | exchange(0,0) 7 | exchange(1,2) 8 | exchange(6,6) 9 | exchange(8,9) 10 | exchange(7,8) 11 | -51 12 | -1 13 | 0 14 | 1 15 | 3 16 | 10 17 | 18 18 | 32 19 | 567 20 | 789 21 | -------------------------------------------------------------------------------- /test2/src/deadcut.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | export main; 4 | 5 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 6 | bits32 dead; 7 | 8 | cut to k("signed" 97) also cuts to k; 9 | 10 | continuation k(dead): 11 | foreign "C" return(0); 12 | } 13 | -------------------------------------------------------------------------------- /test2/src/test-037.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | section "foo" { 8 | 9 | label: 10 | bits32[2]; 11 | 12 | foo () { 13 | goto label; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test2/src/test-045.c--: -------------------------------------------------------------------------------- 1 | // execute the commands below to use this file as a test case 2 | // 3 | 4 | target byteorder little; 5 | 6 | section "data" { 7 | str: bits8; 8 | } 9 | 10 | f () 11 | { 12 | stackdata { 13 | str: bits8[64]; 14 | } 15 | return; 16 | } 17 | -------------------------------------------------------------------------------- /mk/debian/mk.doc-base: -------------------------------------------------------------------------------- 1 | Document: mk 2 | Title: Debian mk Manual 3 | Author: Andrew G. Hume, Bob Flandrena 4 | Abstract: Maintaining Files on Plan 9 with Mk. A tutorial for using Mk that 5 | complements the manual page, 6 | 7 | Format: PDF 8 | Files: /usr/share/doc/mk/mk.pdf.gz 9 | 10 | -------------------------------------------------------------------------------- /test2/output/test-011.s2: -------------------------------------------------------------------------------- 1 | File "src/test-011.c--", line 12, characters 12-15 Error: constant foo not resolvable until link time 2 | File "src/test-011.c--", line 16, characters 1-19 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/test-002.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | const y = 2 + bits32 [0]; 9 | const x = 2 + bits32 [a]; 10 | 11 | section "data" 12 | { 13 | a: 14 | bits32[5]; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /config/install.mk: -------------------------------------------------------------------------------- 1 | $install_bin: 2 | mkdir -p $target 3 | 4 | $install_lib: 5 | mkdir -p $target 6 | 7 | $install_lua: 8 | mkdir -p $target 9 | 10 | $install_inc: 11 | mkdir -p $target 12 | 13 | $install_doc: 14 | mkdir -p $target 15 | 16 | $install_man1: 17 | mkdir -p $target 18 | 19 | -------------------------------------------------------------------------------- /test2/output/test-006.s2: -------------------------------------------------------------------------------- 1 | File "src/test-006.c--", line 16, characters 9-29 Error: alignment 3 is not a power of 2 2 | File "src/test-006.c--", line 14, character 1 - line 17, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/output/test-020.s2: -------------------------------------------------------------------------------- 1 | File "src/test-020.c--", line 16, characters 5-6 Error: may not assign to data label x 2 | File "src/test-020.c--", line 15, character 1 - line 17, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/test-006.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | section "data" 8 | { 9 | x: 10 | bits32; 11 | 12 | } 13 | 14 | foo (bits32 y) { 15 | 16 | y = bits32 [x aligned 3]; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /test2/src/test-014.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | return (bits32[x aligned 5]); 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /interp/include/cii/atom.h: -------------------------------------------------------------------------------- 1 | /* $Id$ */ 2 | #ifndef ATOM_INCLUDED 3 | #define ATOM_INCLUDED 4 | extern int Atom_length(const char *str); 5 | extern const char *Atom_new (const char *str, int len); 6 | extern const char *Atom_string(const char *str); 7 | extern const char *Atom_int (long n); 8 | #endif 9 | -------------------------------------------------------------------------------- /test2/output/test-021.s2: -------------------------------------------------------------------------------- 1 | File "src/test-021.c--", line 17, characters 5-15 Error: only a name may appear to left of a call 2 | File "src/test-021.c--", line 15, character 1 - line 18, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/output/test-023.s2: -------------------------------------------------------------------------------- 1 | File "src/test-023.c--", line 6, characters 18-24 Error: constant expression may not be a Boolean 2 | File "src/test-023.c--", line 13, character 9 - line 15, character 10 Error: condition in `if' is not a Boolean 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/ppc/arglist.1: -------------------------------------------------------------------------------- 1 | ok (expected 1, received 1) 2 | ok (expected 2, received 2) 3 | ok (expected 3, received 3) 4 | ok (expected 4, received 4) 5 | ok (expected 5, received 5) 6 | ok (expected 6, received 6) 7 | ok (expected 6, received 6) 8 | ok (expected 5, received 5) 9 | ok (expected 4, received 4) 10 | -------------------------------------------------------------------------------- /test2/output/arglist.1: -------------------------------------------------------------------------------- 1 | ok (expected 1, received 1) 2 | ok (expected 2, received 2) 3 | ok (expected 3, received 3) 4 | ok (expected 4, received 4) 5 | ok (expected 5, received 5) 6 | ok (expected 6, received 6) 7 | ok (expected 6, received 6) 8 | ok (expected 5, received 5) 9 | ok (expected 4, received 4) 10 | -------------------------------------------------------------------------------- /test2/output/test-015.s2: -------------------------------------------------------------------------------- 1 | File "src/test-015.c--", line 18, characters 9-27 Error: initialization not permitted for stackdata 2 | File "src/test-015.c--", line 15, character 1 - line 21, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/output/test-035.s2: -------------------------------------------------------------------------------- 1 | File "src/test-035.c--", line 1, characters 1-18 Error: exported value must have native pointer type 2 | File "src/test-035.c--", line 8, character 1 - line 13, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/inf.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | // loops forever and should be killed 4 | export main; 5 | 6 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 7 | bits32 iptr; 8 | L: 9 | if (iargc > 0) { 10 | goto L; 11 | } else { 12 | return (0); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test2/src/test-007.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32; 13 | 14 | } 15 | 16 | foo (bits32 y) { 17 | 18 | y = bits32 [c]; 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test2/src/test-048.c--: -------------------------------------------------------------------------------- 1 | // execute the commands below to use this file as a test case 2 | // 3 | 4 | target byteorder little; 5 | 6 | g () 7 | { 8 | lg: 9 | } 10 | 11 | f (bits32 i) 12 | { 13 | lf: 14 | goto i; 15 | goto lf; 16 | goto i targets lg; 17 | goto i targets lf; 18 | } 19 | -------------------------------------------------------------------------------- /test2/output/test-007.s2: -------------------------------------------------------------------------------- 1 | File "src/test-007.c--", line 18, characters 9-19 Error: address's type is not the machine's pointer size 2 | File "src/test-007.c--", line 16, character 1 - line 19, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/output/test-025.s2: -------------------------------------------------------------------------------- 1 | File "src/test-025.c--", line 1, characters 18-24 Error: constant expression may not be a Boolean 2 | File "src/test-025.c--", line 11, characters 5-12 Error: target of goto must be a bit vector of the native pointer type 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/test-016.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | 17 | jump 1 targets c; 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test2/src/test-020.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | x = foo(); 17 | } 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test2/src/availexprs.c--: -------------------------------------------------------------------------------- 1 | target 2 | memsize 8 3 | byteorder little 4 | pointersize 32 5 | wordsize 32; 6 | bits2 System.rounding_mode = "IEEE 754 rounding mode"; 7 | 8 | export f; 9 | f() { 10 | bits32 x; 11 | bits32 z; 12 | 13 | x = (0x0 :: bits32); 14 | z = %zx32(%bit(%lt(x, x))); 15 | return (z); 16 | } 17 | -------------------------------------------------------------------------------- /test2/src/test-008.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits16; 13 | 14 | } 15 | 16 | foo (bits32 y) { 17 | 18 | y = c + bits32[x]; 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test2/src/test-017.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | 17 | cut to c (1,2); 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /lua-bench/strcat2.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | -- this version uses the native string concatenation operator 5 | 6 | local n = tonumber((arg and arg[1]) or 1) 7 | local str = "" 8 | local i=1; while i <= n do i = i + 1 9 | str = str.."hello\n" 10 | end 11 | write(strlen(str), "\n") 12 | -------------------------------------------------------------------------------- /test2/.gitignore: -------------------------------------------------------------------------------- 1 | /testqc 2 | /testdrv.lua 3 | /testdrv.tex 4 | /testqc.tex 5 | P=* 6 | /opgen.lua 7 | /copgen.lua 8 | *.c 9 | *.o 10 | *.s 11 | /cmmopgen-*.c-- 12 | /optest-*-* 13 | *.dvi 14 | *.inc 15 | *.tex 16 | *.toc 17 | *.aux 18 | /a.out 19 | *.count 20 | /cmmfloat.h 21 | /interp.h 22 | /limited 23 | /sign-runtime 24 | -------------------------------------------------------------------------------- /test2/src/test-018.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | 17 | return (bits32[c]); 18 | } 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test2/src/test-024.c--: -------------------------------------------------------------------------------- 1 | const true = 1 == 1; 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | foo() { 9 | bits1 x; 10 | 11 | span 1 true { 12 | if (true) { 13 | ; 14 | } 15 | } 16 | 17 | return; 18 | } 19 | -------------------------------------------------------------------------------- /testcc/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains tools to test calling conventions. The idea is 3 | to generate calls that pass parameters whose value are checked by the 4 | callee. Calls are generated from a list of "interesting" signatures 5 | which in turn are derived from an automaton that implements a calling 6 | convention. 7 | 8 | -------------------------------------------------------------------------------- /test2/output/err-002.s2: -------------------------------------------------------------------------------- 1 | File "src/err-002.c--", line 24, characters 16-19 Error: unknown value: exn 2 | File "src/err-002.c--", line 24, characters 16-19 Error: unknown value: exn 3 | File "src/err-002.c--", line 25, characters 32-35 Error: unknown value: exn 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 5 | -------------------------------------------------------------------------------- /test2/output/test-033.s2: -------------------------------------------------------------------------------- 1 | File "src/test-033.c--", line 11, characters 5-17 Error: procedure value must be a bit vector of the native pointer type 2 | File "src/test-033.c--", line 7, character 1 - line 12, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /runtime/.gitignore: -------------------------------------------------------------------------------- 1 | DEPEND 2 | lib*.a 3 | *.aux 4 | *.dvi 5 | *.log 6 | *.ps 7 | *.toc 8 | P=* 9 | *.s 10 | *.o 11 | *.inc 12 | *.exe 13 | /runtime.c 14 | /pcmap.c 15 | /gcc-linux.c 16 | /qc--runtime.h 17 | /pcmap.h 18 | /pcmap.ld 19 | /cut.c-- 20 | /thread.c-- 21 | /yield.c-- 22 | /gcc-linux.tex 23 | /pcmap.tex 24 | /runtime.tex 25 | -------------------------------------------------------------------------------- /test2/all.x86.tst: -------------------------------------------------------------------------------- 1 | backend = Backend.x86 2 | backend.ralloc = backend.ralloc or Ralloc.color 3 | 4 | -- compare results with files in x86 5 | Test.asmdir = Test.asmdir or "x86" 6 | 7 | Ld.rtend = "" --- don't need the run-time system 8 | -- source files live in src directory 9 | Test.source = "src" 10 | dofile('l32files.lua') 11 | -------------------------------------------------------------------------------- /aug99/util.nw: -------------------------------------------------------------------------------- 1 | % -*- mode: Noweb; noweb-code-mode: sml-mode -*- 2 | 3 | \section{Utility modules} 4 | 5 | \subsection{\texttt{Option}} 6 | <>= 7 | val get : 'a option -> 'a -> 'a 8 | <>= 9 | let get opt default = match opt with None -> default | Some x -> x 10 | @ 11 | <>= 12 | <>= 13 | 14 | -------------------------------------------------------------------------------- /test2/src/hello.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | import bits32 printf; 4 | export main, my_data; 5 | 6 | section "data" { 7 | my_data: bits8 [] "hello, world!\n\0"; 8 | } 9 | 10 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 11 | foreign "C" printf("address" my_data); 12 | foreign "C" return(0); 13 | } 14 | -------------------------------------------------------------------------------- /test2/src/test-021.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | ; 17 | bits32 [x] = foo(); 18 | } 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test2/tiger/output/qsort.1: -------------------------------------------------------------------------------- 1 | sorted by name : 2 | 18 David 3 | -1 Joao 4 | -51 Kathleeen 5 | 567 Kevin 6 | 3 Kim 7 | 49 Mike 8 | 789 Norman 9 | 1 Omri 10 | 10 Paul 11 | 32 Stuart 12 | sorted by num : 13 | -51 Kathleeen 14 | -1 Joao 15 | 1 Omri 16 | 3 Kim 17 | 10 Paul 18 | 18 David 19 | 32 Stuart 20 | 49 Mike 21 | 567 Kevin 22 | 789 Norman 23 | -------------------------------------------------------------------------------- /test2/tiger/output/rc4.1: -------------------------------------------------------------------------------- 1 | sorted by name : 2 | 18 David 3 | -1 Joao 4 | -51 Kathleeen 5 | 567 Kevin 6 | 3 Kim 7 | 49 Mike 8 | 789 Norman 9 | 1 Omri 10 | 10 Paul 11 | 32 Stuart 12 | sorted by num : 13 | -51 Kathleeen 14 | -1 Joao 15 | 1 Omri 16 | 3 Kim 17 | 10 Paul 18 | 18 David 19 | 32 Stuart 20 | 49 Mike 21 | 567 Kevin 22 | 789 Norman 23 | -------------------------------------------------------------------------------- /test2/src/test-019.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | 17 | return (bits32[4 aligned 3]); 18 | } 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tdpe/one01Nbe.mli: -------------------------------------------------------------------------------- 1 | 2 | open One01Trees 3 | val amode : M.amode Tdpe.rr 4 | val t : M.t Tdpe.rr 5 | val amode_None : M.amode Tdpe.rr 6 | val t_None : M.t Tdpe.rr 7 | 8 | val reify_amode : M.amode -> Tdpe.dynamic 9 | val reflect_amode : Tdpe.dynamic -> M.amode 10 | 11 | val reflect_t : Tdpe.dynamic -> M.t 12 | val reify_t : M.t -> Tdpe.dynamic 13 | -------------------------------------------------------------------------------- /test2/output/test-008.s2: -------------------------------------------------------------------------------- 1 | File "src/test-008.c--", line 18, characters 10-23 Error: operator %add expected argument of type bits8, got bits32 (in unspecified position) 2 | File "src/test-008.c--", line 16, character 1 - line 19, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/output/test-034.s2: -------------------------------------------------------------------------------- 1 | File "src/test-034.c--", line 11, characters 5-21 Error: operator %add expected argument of type bits16, got bits32 (in unspecified position) 2 | File "src/test-034.c--", line 7, character 1 - line 12, character 2 Error: control falls off end of procedure 3 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 4 | -------------------------------------------------------------------------------- /test2/src/test-015.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: 12 | bits32[4]; 13 | } 14 | 15 | foo () { 16 | stackdata { 17 | y: 18 | bits32[4] { 1, 2}; 19 | } 20 | 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /test2/src/test-023.c--: -------------------------------------------------------------------------------- 1 | // execute the commands below to use this file as a test case 2 | // 3 | 4 | target byteorder little; 5 | 6 | const true = 1 == 1; 7 | const one = 1; 8 | 9 | foo() { 10 | bits1 x; 11 | 12 | span one 1 { 13 | if (one) { 14 | ; 15 | } 16 | } 17 | 18 | return; 19 | } 20 | -------------------------------------------------------------------------------- /test2/src/zerou.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | import bits32 printf; 4 | export main; 5 | 6 | section "data" { 7 | f: bits8[] "0U == %u\n\0"; 8 | } 9 | 10 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 11 | bits32 n; 12 | n = 0U; 13 | foreign "C" printf("address" f, n); 14 | foreign "C" return(n); 15 | } 16 | -------------------------------------------------------------------------------- /src/cfgx.nw: -------------------------------------------------------------------------------- 1 | % -*- mode: Noweb; noweb-code-mode: caml-mode -*- 2 | <>= 3 | module X : Cfg.X 4 | module M : Cfg.S with module X = X 5 | @ 6 | <>= 7 | module X = struct 8 | type jx = unit 9 | type fx = unit 10 | type nx = unit 11 | let jx () = () 12 | let fx () = () 13 | let nx () = () 14 | end 15 | module M = Cfg.Make(X) 16 | -------------------------------------------------------------------------------- /test2/output/const.s2: -------------------------------------------------------------------------------- 1 | File "src/const.c--", line 11, characters 33-53 Error: not a compile-time operator: / 2 | File "src/const.c--", line 9, characters 33-48 Error: not a compile-time operator: / 3 | File "src/const.c--", line 7, characters 34-43 Error: not a compile-time operator: >> 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors.") 5 | -------------------------------------------------------------------------------- /test2/ppc/const.s2: -------------------------------------------------------------------------------- 1 | File "src/const.c--", line 11, characters 33-53 Error: not a compile-time operator: / 2 | File "src/const.c--", line 9, characters 33-48 Error: not a compile-time operator: / 3 | File "src/const.c--", line 7, characters 34-43 Error: not a compile-time operator: >> 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors.") 5 | -------------------------------------------------------------------------------- /test2/all.ppc.tst: -------------------------------------------------------------------------------- 1 | backend = Backend.ppc 2 | backend.ralloc = backend.ralloc or Ralloc.color 3 | 4 | Options.swap = 1 5 | 6 | -- compare results with files in ppc 7 | Test.asmdir = Test.asmdir or "ppc" 8 | 9 | Ld.rtend = "" --- don't need the run-time system 10 | -- source files live in src directory 11 | Test.source = "src" 12 | dofile('l32files.lua') 13 | -------------------------------------------------------------------------------- /test2/quest/globals.c--: -------------------------------------------------------------------------------- 1 | target 2 | byteorder little 3 | memsize 8 4 | wordsize 32 5 | pointersize 32 6 | float "ieee754"; 7 | 8 | bits2 System.rounding_mode = "IEEE 754 rounding mode"; 9 | section "data" { 10 | } 11 | section "bss" { 12 | export i@globals_placeholder as "globals_placeholder"; 13 | align 4; 14 | i@globals_placeholder: 15 | bits8[4]; 16 | } 17 | -------------------------------------------------------------------------------- /test2/src/r64.c--: -------------------------------------------------------------------------------- 1 | target 2 | byteorder little 3 | memsize 8 4 | wordsize 32 5 | pointersize 32 6 | float "ieee754"; 7 | 8 | bits2 System.rounding_mode = "IEEE 754 rounding mode"; 9 | 10 | 11 | export f; 12 | foreign "C" f() { 13 | bits64 r1; 14 | 15 | r1 = 0xfeedfacedeadbeef::bits64; 16 | 17 | foreign "C" return(r1); 18 | } 19 | -------------------------------------------------------------------------------- /test2/x86/err-001.s: -------------------------------------------------------------------------------- 1 | .globl main 2 | .globl Cmm.global_area 3 | .globl Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY 4 | .section .data 5 | /* memory for global registers */ 6 | Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY: 7 | Cmm.global_area: 8 | .globl Cmm_stack_growth 9 | .section .data 10 | .align 4 11 | Cmm_stack_growth: 12 | .long 0xffffffff 13 | .section .text 14 | -------------------------------------------------------------------------------- /lua-bench/reversefile.lua: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/lua 2 | -- $Id$ 3 | -- http://www.bagley.org/~doug/shootout/ 4 | 5 | local lines = {} 6 | local w = write 7 | local r = read 8 | nl = 0 9 | local l 10 | repeat 11 | l = read() 12 | lines[nl] = l 13 | nl = nl + 1 14 | until not l 15 | 16 | local i = nl - 1; while i > 0 do i = i - 1 17 | w(lines[i], '\n') 18 | end 19 | -------------------------------------------------------------------------------- /mk/lib/9/errstr-Inferno.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | void 9 | oserrstr(char *buf) 10 | { 11 | *buf = 0; 12 | errstr(buf); 13 | } 14 | -------------------------------------------------------------------------------- /lua-bench/mkjgraph: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # usage: mkjgraph interp foo.lua sizes 4 | 5 | case $# in 6 | 0|1|2) echo "Usage: $0 interp bench.lua " 1>&2; exit 1 ;; 7 | esac 8 | 9 | interp=$1 10 | bench=$2 11 | echo newgraph newcurve linetype solid pts 12 | shift; shift 13 | for x 14 | do 15 | (/usr/bin/time -f "$x %e " $interp $bench $x > /dev/null) 2>&1 16 | done 17 | -------------------------------------------------------------------------------- /test2/output/test-000.s2: -------------------------------------------------------------------------------- 1 | File "src/test-000.c--", line 8, characters 1-10 Error: re-declaration of value x 2 | File "src/test-000.c--", line 7, characters 1-10 Error: previously declared here 3 | File "src/test-000.c--", line 10, character 1 - line 13, character 2 Error: control falls off end of procedure 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 5 | -------------------------------------------------------------------------------- /mk/lib/bio/bfildes.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | #include 8 | 9 | int 10 | Bfildes(Biobuf *bp) 11 | { 12 | 13 | return bp->fid; 14 | } 15 | -------------------------------------------------------------------------------- /test2/tiger/mkfile: -------------------------------------------------------------------------------- 1 | INSTALL=/usr/local/lib/tiger 2 | 3 | refresh:VQ: stdlib-x86.a tigermain-x86.o 4 | [ -r $INSTALL/runtime.o -a -r $INSTALL/stdlib.a ] || 5 | { echo "Bad news! No installed tiger from which to update!"; exit 2; } 6 | 7 | stdlib-x86.a: $INSTALL/stdlib.a 8 | cp $prereq $target 9 | 10 | tigermain-x86.o: $INSTALL/runtime.o 11 | cp $prereq $target 12 | 13 | -------------------------------------------------------------------------------- /config/c.mk: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------ 2 | # $Id$ 3 | # 4 | # rules and tools to compile C source code 5 | # ------------------------------------------------------------------ 6 | 7 | CC = $config_cc 8 | CFLAGS = -Wall 9 | 10 | %.o: %.c 11 | $CC $CFLAGS -c $stem.c -o $stem.o 12 | 13 | %.a: 14 | ar cr $target $prereq 15 | -------------------------------------------------------------------------------- /runtime/overflow/directreturn/getspan.c: -------------------------------------------------------------------------------- 1 | #include "qc--runtime.h" 2 | 3 | Cmm_Dataptr getspan(Cmm_Cont* k, Cmm_Word token) { 4 | Cmm_Activation a = Cmm_YoungestActivation(k); 5 | return Cmm_GetDescriptor(&a, token); 6 | } 7 | 8 | Cmm_Dataptr getlocal(Cmm_Cont* k, unsigned n) { 9 | Cmm_Activation a = Cmm_YoungestActivation(k); 10 | return Cmm_FindLocalVar(&a, n); 11 | } 12 | -------------------------------------------------------------------------------- /lua/texboxval: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | awk ' 4 | /^@text / && ($2 == "(*unboxval*)" || $2 == "(*inboxval*)") { 5 | print "@literal \\eatline"; next 6 | } 7 | /^@text / && $2 == "(*boxval" { 8 | line=$0 9 | sub(/^@text ..boxval */, "", line) 10 | sub(/[*][)]$/, "", line) 11 | printf "@literal \\hfill\\fbox{%s}\\hskip\\nwdefspace\n", line 12 | next 13 | } 14 | { print }' $* 15 | -------------------------------------------------------------------------------- /runtime/overflow/runtimebuildsclosure/getspan.c: -------------------------------------------------------------------------------- 1 | #include "qc--runtime.h" 2 | 3 | Cmm_Dataptr getspan(Cmm_Cont* k, Cmm_Word token) { 4 | Cmm_Activation a = Cmm_YoungestActivation(k); 5 | return Cmm_GetDescriptor(&a, token); 6 | } 7 | 8 | Cmm_Dataptr getlocal(Cmm_Cont* k, unsigned n) { 9 | Cmm_Activation a = Cmm_YoungestActivation(k); 10 | return Cmm_FindLocalVar(&a, n); 11 | } 12 | -------------------------------------------------------------------------------- /tdpe/one01Syntax.mli: -------------------------------------------------------------------------------- 1 | type exp = (allTypes) Syntax.bExp 2 | and amode_S = 3 | Short 4 | | Hword 5 | | Word 6 | | Dword 7 | and instruction_S = 8 | Add of exp * exp * exp 9 | | Ld of exp * exp 10 | | St of exp * exp 11 | | Nop 12 | and allTypes = 13 | T__amode of amode_S 14 | | T__instruction of instruction_S 15 | 16 | 17 | val pprint : exp -> 18 | unit 19 | 20 | -------------------------------------------------------------------------------- /lua/.gitignore: -------------------------------------------------------------------------------- 1 | DEPEND.* 2 | *.ml 3 | *.mli 4 | *.mly 5 | *.cmi 6 | *.cmo 7 | a.out 8 | *.tex 9 | *.dvi 10 | *.ps 11 | *.log 12 | *.aux 13 | *.cmx 14 | *.cma 15 | *.mll 16 | /oclua-* 17 | /oclua-*.opt 18 | /oclbench-* 19 | /tspecl 20 | /lspecl 21 | /tspecl.icn 22 | /lspecl.icn 23 | .nfs* 24 | /luaclient 25 | *.htoc 26 | *.haux 27 | /lua-ml.tar 28 | /lua-ml.tar.gz 29 | P=* 30 | /luaparsex.output 31 | -------------------------------------------------------------------------------- /mk/lib/9/getuser-Nt.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | char* 9 | getuser(void) 10 | { 11 | static char *user = 0; 12 | user = "unknown"; 13 | return user; 14 | } 15 | -------------------------------------------------------------------------------- /test2/output/round.1: -------------------------------------------------------------------------------- 1 | 1.500000 rounded down is 1 2 | 1.500000 rounded up is 2 3 | 1.500000 rounded nearest is 2 4 | 1.500000 rounded zero is 1 5 | 1.333333 rounded down is 1 6 | 1.333333 rounded up is 2 7 | 1.333333 rounded nearest is 1 8 | 1.333333 rounded zero is 1 9 | -2.333333 rounded down is -3 10 | -2.333333 rounded up is -2 11 | -2.333333 rounded nearest is -2 12 | -2.333333 rounded zero is -2 13 | -------------------------------------------------------------------------------- /asdl/stdPrims.nw: -------------------------------------------------------------------------------- 1 | <>= 2 | type std_int = int 3 | type std_string = string 4 | 5 | (* TODO properly support these operations *) 6 | type identifier = std_string 7 | type big_int = std_int 8 | 9 | 10 | 11 | <>= 12 | type std_int = int 13 | type std_string = string 14 | type identifier = std_string 15 | type big_int = std_int 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mk/lib/9/runestrlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | 9 | int 10 | runestrlen(Rune *s) 11 | { 12 | int i; 13 | 14 | i = 0; 15 | while(*s++) 16 | i++; 17 | return i; 18 | } 19 | -------------------------------------------------------------------------------- /test2/output/altread.1: -------------------------------------------------------------------------------- 1 | "You know, it's at times like this when I'm trapped in a Vogon 2 | airlock with a man from Betelgeuse and about to die of asphyxiation in 3 | deep space that I really wish I'd listened to what my mother told me 4 | when I was young!" 5 | "Why, what did she tell you?" 6 | "I don't know, I didn't listen!" 7 | -- Douglas Adams, "Hitchhiker's Guide to the Galaxy" 8 | -------------------------------------------------------------------------------- /test2/ppc/altret.1: -------------------------------------------------------------------------------- 1 | notail calling conv... 2 | returning... 3 | Alt return 1:000 4 | notail calling conv... 5 | returning... 6 | Alt return 2:123456 7 | notail calling conv... 8 | returning... 9 | Normal return:222 10 | Cmm calling conv... 11 | returning... 12 | Alt return 1:000 13 | Cmm calling conv... 14 | returning... 15 | Alt return 2:123456 16 | Cmm calling conv... 17 | returning... 18 | Normal return:222 19 | -------------------------------------------------------------------------------- /lua-bench/ackermann.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | function Ack(M, N) 5 | if (M == 0) then 6 | return( N + 1 ) 7 | end 8 | if (N == 0) then 9 | return( Ack(M - 1, 1) ) 10 | end 11 | return( Ack(M - 1, Ack(M, (N - 1))) ) 12 | end 13 | 14 | NUM = tonumber((arg and arg[1])) or 1 15 | if NUM > 7 then NUM=7 end 16 | write("Ack(3,", NUM ,"): ", Ack(3,NUM), "\n") 17 | -------------------------------------------------------------------------------- /test2/output/altret.1: -------------------------------------------------------------------------------- 1 | notail calling conv... 2 | returning... 3 | Alt return 1:000 4 | notail calling conv... 5 | returning... 6 | Alt return 2:123456 7 | notail calling conv... 8 | returning... 9 | Normal return:222 10 | Cmm calling conv... 11 | returning... 12 | Alt return 1:000 13 | Cmm calling conv... 14 | returning... 15 | Alt return 2:123456 16 | Cmm calling conv... 17 | returning... 18 | Normal return:222 19 | -------------------------------------------------------------------------------- /lua-bench/hash.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | -- Author: Roberto Ierusalimschy 4 | 5 | local n = tonumber((arg and arg[1]) or 1) 6 | 7 | local X={} 8 | local i = 1 9 | while i <= n do 10 | X[format("%x", i)] = i 11 | i = i + 1 12 | end 13 | 14 | local c = 0 15 | 16 | local i = n 17 | while i >= 1 do 18 | if X[i..''] then c = c+1 end 19 | i = i - 1 20 | end 21 | 22 | print(c) 23 | -------------------------------------------------------------------------------- /mk/lib/9/setbinmode-Nt.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | void 9 | setbinmode(void) 10 | { 11 | _setmode(0, _O_BINARY); 12 | _setmode(1, _O_BINARY); 13 | _setmode(2, _O_BINARY); 14 | } 15 | -------------------------------------------------------------------------------- /test2/output/test-048.s2: -------------------------------------------------------------------------------- 1 | File "src/test-048.c--", line 6, character 1 - line 9, character 2 Error: control falls off end of procedure 2 | File "src/test-048.c--", line 14, characters 5-12 Error: target list omitted and target is not a local code label 3 | File "src/test-048.c--", line 16, characters 5-23 Error: may not goto lg (label in another procedure) 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 5 | -------------------------------------------------------------------------------- /mk/lib/9/seek.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | #include 8 | #include 9 | 10 | long 11 | seek(int fd, long where, int from) 12 | { 13 | return lseek(fd, where, from); 14 | } 15 | -------------------------------------------------------------------------------- /test2/lcc/juliet.txt: -------------------------------------------------------------------------------- 1 | What's here? a cup, closed in my true love's hand? 2 | Poison, I see, hath been his timeless end: 3 | O churl! drunk all, and left no friendly drop 4 | To help me after? I will kiss thy lips; 5 | Haply some poison yet doth hang on them, 6 | To make die with a restorative. 7 | Thy lips are warm. 8 | Yea, noise? then I'll be brief. O happy dagger! 9 | This is thy sheath; 10 | there rust, and let me die. 11 | -------------------------------------------------------------------------------- /test2/src/nestmain.c: -------------------------------------------------------------------------------- 1 | #include "qc--runtime.h" 2 | #include 3 | #include 4 | #include 5 | 6 | extern int nest(void); 7 | 8 | int main(int argc, char *argv[]) { 9 | return nest(); 10 | } 11 | 12 | void trace(Cmm_Cont *k) { 13 | Cmm_Activation a = Cmm_YoungestActivation(k); 14 | char *s = Cmm_GetDescriptor(&a, 1); 15 | printf("closest enclosing span is %s\n", s); 16 | exit(0); 17 | } 18 | -------------------------------------------------------------------------------- /test2/src/test-046.c--: -------------------------------------------------------------------------------- 1 | // execute the commands below to use this file as a test case 2 | // 3 | 4 | /* this test shows some white space sensitivity of c-- */ 5 | 6 | target byteorder little; 7 | 8 | f (bits32 i) 9 | { 10 | switch [1 .. 3] i { 11 | case 1: { return (i); } 12 | case 2 .. 3: { return (i); } 13 | /* must be 2 .. 3, not 2..3 */ 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test2/src/test-049.c--: -------------------------------------------------------------------------------- 1 | // execute the commands below to use this file as a test case 2 | // 3 | 4 | target byteorder little; 5 | 6 | g () 7 | { 8 | import bits32 f; 9 | 10 | bits32 x,y,z; 11 | bits16 a,b,c; 12 | bits1 n; 13 | 14 | bits1[a] = n; 15 | bits1[x] = n; 16 | bits32[a] = x; 17 | "foo" x = f () targets f; 18 | "foo" x = f (); 19 | "bar" x = %eq(x,y); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /test2/output/test-004.s2: -------------------------------------------------------------------------------- 1 | File "src/test-004.c--", line 7, characters 1-21 Error: constant definition for x is cyclic 2 | File "src/test-004.c--", line 7, characters 19-20 Error: unknown value: y 3 | File "src/test-004.c--", line 7, characters 1-21 Error: re-declaration of value x 4 | File "src/test-004.c--", line 7, characters 1-21 Error: previously declared here 5 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 6 | -------------------------------------------------------------------------------- /test2/output/test-032.s2: -------------------------------------------------------------------------------- 1 | File "src/test-032.c--", line 12, characters 5-6 Error: location of type bits32 cannot hold value of type bits16 2 | File "src/test-032.c--", line 12, characters 8-9 Error: location of type bits32 cannot hold value of type bits16 3 | File "src/test-032.c--", line 8, character 1 - line 13, character 2 Error: control falls off end of procedure 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 5 | -------------------------------------------------------------------------------- /interp/test/cut2.c--: -------------------------------------------------------------------------------- 1 | // cut2.c-- 2 | // 3 | 4 | target 5 | byteorder little 6 | memsize 8 7 | wordsize 32 8 | pointersize 32 9 | ; 10 | 11 | export main; 12 | 13 | section "text" { 14 | main() { 15 | subroutine(cont) also cuts to cont; 16 | return; 17 | 18 | continuation cont(): 19 | return; 20 | } 21 | 22 | subroutine(bits32 kc) { 23 | cut to kc(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tdpe/one02Syntax.mli: -------------------------------------------------------------------------------- 1 | 2 | type exp = (allTypes) Syntax.bExp 3 | and allTypes = T__amode of t__amode 4 | | T__t of t__t 5 | 6 | and t__amode = 7 | Short of unit 8 | | Hword of unit 9 | | Word of unit 10 | | Dword of unit 11 | 12 | and t__t = 13 | Add of (exp * exp * exp) 14 | | Ld of (exp * exp) 15 | | St of (exp * exp) 16 | | Nop of unit 17 | 18 | 19 | 20 | val pprint : exp -> 21 | unit 22 | 23 | -------------------------------------------------------------------------------- /test2/output/multasgn.1: -------------------------------------------------------------------------------- 1 | (hp, 0) (x, 21) (bits32[locals], 0) (bits32[locals+4], 1) (bits32[locals+8], 2) (bits32[locals+12], 3) 2 | (hp, 0) (x, 21) (bits32[locals], 0) (bits32[locals+4], 1) (bits32[locals+8], 2) (bits32[locals+12], 3) 3 | (hp, 8) (x, 0) (bits32[locals], 77) (bits32[locals+4], 99) (bits32[locals+8], 2) (bits32[locals+12], 3) 4 | (hp, 8) (x, 0) (bits32[locals], 77) (bits32[locals+4], 99) (bits32[locals+8], 2) (bits32[locals+12], 3) 5 | -------------------------------------------------------------------------------- /test2/src/if-false2.c--: -------------------------------------------------------------------------------- 1 | target 2 | byteorder little 3 | memsize 8 4 | wordsize 32 5 | pointersize 32 6 | float "ieee754"; 7 | 8 | bits2 System.rounding_mode = "IEEE 754 rounding mode"; 9 | 10 | export main; 11 | 12 | foreign "C" main(bits32 argc, bits32 argv) { 13 | bits32 x; 14 | 15 | if(%eq(0::bits32, 1::bits32)) { x = 0::bits32; } 16 | 17 | foreign "C" return(0); 18 | } 19 | -------------------------------------------------------------------------------- /tdpe/one01Trees.mli: -------------------------------------------------------------------------------- 1 | 2 | module type S = 3 | sig 4 | type exp = Tdpe.dynamic 5 | type amode = 6 | Short 7 | | Hword 8 | | Word 9 | | Dword 10 | type t = 11 | Add of exp * exp * exp 12 | | Ld of exp * exp 13 | | St of exp * exp 14 | | Nop 15 | end 16 | 17 | module M : S 18 | module Rec(I : One01Constructors.S) : 19 | sig 20 | val rec_t : M.t -> I.t 21 | end 22 | -------------------------------------------------------------------------------- /test2/lcc/output/limits.1: -------------------------------------------------------------------------------- 1 | UCHAR_MAX: 000000ff=255 2 | USHRT_MAX: 0000ffff=65535 3 | UINT_MAX: ffffffff=-1 4 | ULONG_MAX: ffffffff=-1 5 | CHAR_MAX: 0000007f=127 6 | SCHAR_MAX: 0000007f=127 7 | SHRT_MAX: 00007fff=32767 8 | INT_MAX: 7fffffff=2147483647 9 | LONG_MAX: 7fffffff=2147483647 10 | CHAR_MIN: ffffff80=-128 11 | SCHAR_MIN: ffffff80=-128 12 | SHRT_MIN: ffff8000=-32768 13 | INT_MIN: 80000000=-2147483648 14 | LONG_MIN: 80000000=-2147483648 15 | -------------------------------------------------------------------------------- /test2/src/deadcontvar-unwind.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../runtime/qc--runtime.h" 4 | 5 | void do_unwind(Cmm_Cont *k) { 6 | Cmm_Activation a; 7 | Cmm_Cont *k2; 8 | 9 | a = Cmm_YoungestActivation(k); 10 | if(!Cmm_ChangeActivation(&a)) { 11 | fprintf(stderr, "Failed: couldn't change activation\n"); 12 | exit(1); 13 | } 14 | k2 = Cmm_MakeUnwindCont(&a, 0, 97); 15 | Cmm_CutTo(k2); 16 | } 17 | -------------------------------------------------------------------------------- /test2/src/test-050.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | import printf; 4 | export main; 5 | 6 | foreign "C" main(bits32 argc, "address" bits32 argv) { 7 | foreign "C" printf(fmt, argc) reads mem writes; 8 | foreign "C" printf(fmt, argc) reads code, data writes; 9 | foreign "C" printf(fmt, argc) reads code, data writes mem; 10 | foreign "C" return(0); 11 | } 12 | 13 | section "data" { 14 | fmt : bits8[] "argc = %d\n\0"; 15 | } 16 | -------------------------------------------------------------------------------- /lua-bench/spellcheck.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | -- based on code from Roberto Ierusalimschy 4 | 5 | assert(readfrom("Usr.Dict.Words")) 6 | local dict = {} 7 | local line = read() 8 | while line do 9 | dict[line] = 1 10 | line = read() 11 | end 12 | readfrom() -- closes dictionary 13 | 14 | local word = read() 15 | while word do 16 | if not dict[word] then print(word) end 17 | word = read() 18 | end 19 | -------------------------------------------------------------------------------- /lua/test/README: -------------------------------------------------------------------------------- 1 | > I am writing to ask if you have any sort of test suite that I could 2 | > use to test my implementation. 3 | 4 | We do have an extensive test suite for Lua, but (blame me!) we did not keep 5 | them in RCS at the time of 2.5 release. The first versions of tests that I 6 | have are for some pre-release of Lua 3.2. I am sending them to you, 7 | although I am not sure whether they will help... 8 | 9 | -- Roberto 10 | 11 | 12 | -------------------------------------------------------------------------------- /test2/lcc/output/cf.1: -------------------------------------------------------------------------------- 1 | char freq 2 | 012 2.7 3 | 040 17.1 4 | ! 0.5 5 | ' 0.8 6 | , 1.9 7 | . 1.1 8 | : 0.3 9 | ; 0.5 10 | ? 1.1 11 | H 0.3 12 | I 0.8 13 | O 0.5 14 | P 0.3 15 | T 1.1 16 | W 0.3 17 | Y 0.3 18 | a 5.2 19 | b 0.8 20 | c 0.8 21 | d 3.3 22 | e 10.1 23 | f 1.1 24 | g 0.8 25 | h 5.7 26 | i 4.9 27 | k 0.8 28 | l 4.6 29 | m 2.2 30 | n 4.1 31 | o 4.1 32 | p 2.4 33 | r 4.1 34 | s 5.4 35 | t 5.2 36 | u 1.4 37 | v 0.5 38 | w 0.8 39 | y 2.2 40 | -------------------------------------------------------------------------------- /lua-bench/mkfile: -------------------------------------------------------------------------------- 1 | # V2_5 is a list of benchmarks that can reasonably be expected to work using lua 2.5 2 | 3 | V2_5=ackermann ary ary2 ary3 fibo hash hash2 heapsort list matrix moments nestedloop random 4 | 5 | # need input: moments 6 | 7 | INTERP=std 8 | PROFILE=-p 9 | 10 | bin:VQ: 11 | (cd ../lua && mk clean && mk INTERP=$INTERP PROFILE=$PROFILE update.opt) 12 | ### (cd ../lua-uniq && mk all.opt && copy -v oclbench.opt /usr/local/bin/oclbenchu) 13 | -------------------------------------------------------------------------------- /test2/output/test-041.s2: -------------------------------------------------------------------------------- 1 | File "src/test-041.c--", line 19, characters 36-48 Error: unknown value: closure_slot 2 | File "src/test-041.c--", line 23, characters 26-37 Error: unknown value: answer_slot 3 | File "src/test-041.c--", line 24, characters 9-14 Error: unknown value: yield 4 | File "src/test-041.c--", line 14, character 5 - line 26, character 6 Error: control falls off end of procedure 5 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 6 | -------------------------------------------------------------------------------- /test2/src/sub.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | export f, main; 4 | import printf; 5 | 6 | f (bits32 i) { 7 | return (-i, -99); 8 | } 9 | 10 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 11 | bits32 x, y; 12 | 13 | x, y = f(-33); 14 | 15 | foreign "C" printf ("address" fmt, x, y); 16 | foreign "C" return(0); 17 | } 18 | 19 | section "data" { 20 | fmt: bits8[] "dual-result call to f returns %d, %d (expected 33, -99)\n\0"; 21 | } 22 | -------------------------------------------------------------------------------- /test2/output/test-047.s2: -------------------------------------------------------------------------------- 1 | File "src/test-047.c--", line 9, character 9 - line 12, character 10 Error: case arm uses range of type bits8 but scrutinee has type bits32 2 | File "src/test-047.c--", line 14, character 9 - line 17, character 10 Error: ranges in case arm have different types bits32 and bits8 3 | File "src/test-047.c--", line 19, character 9 - line 22, character 10 Error: case arm has an empty range list 4 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 5 | -------------------------------------------------------------------------------- /config/lrtl.mk: -------------------------------------------------------------------------------- 1 | # 2 | # imports LRTLHEAP and MACHINEREGEX 3 | # 4 | 5 | LRTL=lrtl 6 | 7 | ^($MACHINEREGEX).ml'$' ($MACHINEREGEX).mli'$':R: '\1'.sled '\1'.rtl 8 | $LRTL -inst $stem1 9 | 10 | ^($MACHINEREGEX)rec.ml'$':R: '\1'.sled '\1'.rtl 11 | $LRTL -recog4 $stem1 12 | 13 | ^($MACHINEREGEX)rtl.ml'$':R: '\1'.sled '\1'.rtl 14 | $LRTL -lower -qc--rtl $stem1 15 | 16 | ^($MACHINEREGEX)mkasm.ml'$' ($MACHINEREGEX)mkasm.mli'$':R: '\1'.sled 17 | $LRTL -lower -emitasm $stem1 18 | 19 | -------------------------------------------------------------------------------- /mk/lib/9/dirwstat.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | #include 8 | #include 9 | 10 | int 11 | dirfwstat(int fd, Dir *d) 12 | { 13 | return -1; 14 | } 15 | 16 | int 17 | dirwstat(char *name, Dir *d) 18 | { 19 | return -1; 20 | } 21 | -------------------------------------------------------------------------------- /test2/all.sparc.tst: -------------------------------------------------------------------------------- 1 | backend = Backend.sparc 2 | 3 | Test.asmdir = Test.asmdir or "sparc" 4 | 5 | Ld.rtend = "" --- don't need the run-time system 6 | -- source files live in src directory 7 | Test.source = "src" 8 | Options.swap = 1 9 | 10 | dofile('l32files.lua') 11 | 12 | local i = 1 13 | while Test.files[i] do 14 | if type(Test.files[i]) == 'table' and Test.files[i].source == 'float-003.c--' then 15 | Test.files[i].outdir = 'sparc' 16 | end 17 | i = i + 1 18 | end 19 | -------------------------------------------------------------------------------- /lua-bench/ary3.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | local n = tonumber((arg and arg[1]) or 1) 5 | 6 | local x, y = {}, {} 7 | local last = n - 1 8 | 9 | local i = 0 10 | while i <= last do 11 | x[i] = i + 1 12 | y[i] = 0 13 | i = i + 1 14 | end 15 | local k = 1 16 | while k <= 1000 do 17 | local j = last 18 | while j >= 0 do 19 | y[j] = y[j] + x[j] 20 | j = j - 1 21 | end 22 | k = k + 1 23 | end 24 | 25 | write(y[0], " ", y[last], "\n") 26 | -------------------------------------------------------------------------------- /test2/src/err-001.c--: -------------------------------------------------------------------------------- 1 | // cut.c-- 2 | // 3 | // fails an assertion in the "linorder" method of "label" (cfg4.nw) 4 | 5 | target 6 | byteorder little; 7 | 8 | export main; 9 | import printf; 10 | 11 | foreign "C" main(bits32 argc, "address" bits32 argv) { 12 | bits32 rc; 13 | rc = foreign "C" printf("address" fmt, k); 14 | return; 15 | 16 | continuation k(): 17 | return; 18 | } 19 | 20 | section "data" { 21 | fmt: bits8[] "address of continuiation is %08lx\n\0"; 22 | } 23 | -------------------------------------------------------------------------------- /mk/lib/9/exits.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | void 9 | exits(const char *s) 10 | { 11 | if(s == 0 || *s == 0) 12 | exit(0); 13 | exit(1); 14 | } 15 | 16 | void 17 | _exits(const char *s) 18 | { 19 | if(s == 0 || *s == 0) 20 | _exit(0); 21 | _exit(1); 22 | } 23 | -------------------------------------------------------------------------------- /tdpe/todo: -------------------------------------------------------------------------------- 1 | 2 | 3 | Make a proper implementation of the bits/bitops code. 4 | 5 | Integrate the SML code with the toolikit. A better use of file names 6 | 7 | Change the syntactic representation of machine instructions. 8 | 9 | Find a way to deal with relocatable addresses 10 | 11 | Benchmarking? Generating instruction streams? 12 | 13 | Residualizing instance: pprining to file, streams, etc. 14 | 15 | Straighten out the RTL-substitution code. 16 | 17 | ---------------------------------------- 18 | -------------------------------------------------------------------------------- /interp/test/cut-bad.2: -------------------------------------------------------------------------------- 1 | error: illegal continuation passed to interpreter! 2 | error: unrecoverable runtime error at PC 0x808e756 3 | | Stack trace: 4 | | 0: subroutine() 5 | | 1: subroutine() 6 | | 2: subroutine() 7 | | 3: subroutine() 8 | | 4: subroutine() 9 | | 5: subroutine() 10 | | 6: subroutine() 11 | | 7: subroutine() 12 | | 8: subroutine() 13 | | 9: subroutine() 14 | | 10: subroutine() 15 | | End of Stack Trace (oldest activation was #10) 16 | Try disassembling 'subroutine' to find relevant instructions 17 | -------------------------------------------------------------------------------- /mk/lib/9/log-Nt.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | int 9 | logopen(char *logname) 10 | { 11 | USED(logname); 12 | return 0; 13 | } 14 | 15 | void 16 | logmsg(int fd, char *s) 17 | { 18 | (void) write(fd, s, strlen(s)); 19 | } 20 | 21 | void 22 | logclose(void) 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /src/strip.lua: -------------------------------------------------------------------------------- 1 | backend = backend or Backend.dummy 2 | 3 | backend.intwiden = nil 4 | backend.placevars = Placevar.context(Placevar.x86, "x86") 5 | backend.floatwiden = nil 6 | backend.expand = nil 7 | backend.liveness = Liveness.liveness 8 | backend.ralloc =nil 9 | backend.freeze =nil 10 | backend.rmvfp = nil 11 | backend.asm= Asm.cmm 12 | backend.emit_data =nil 13 | 14 | backend.preopt = Optimize.remove_nops 15 | 16 | --backend.placevars = nil 17 | backend.liveness =nil 18 | 19 | Options.validate = nil 20 | -------------------------------------------------------------------------------- /tdpe/sparcNbe.mli: -------------------------------------------------------------------------------- 1 | 2 | val reify_reg_or_imm : SparcTrees.M.reg_or_imm -> Tdpe.dynamic 3 | val reflect_reg_or_imm : Tdpe.dynamic -> SparcTrees.M.reg_or_imm 4 | val reify_address : SparcTrees.M.address -> Tdpe.dynamic 5 | val reflect_address : Tdpe.dynamic -> SparcTrees.M.address 6 | val reify_regaddr : SparcTrees.M.regaddr -> Tdpe.dynamic 7 | val reflect_regaddr : Tdpe.dynamic -> SparcTrees.M.regaddr 8 | val reify_t : SparcTrees.M.t -> Tdpe.dynamic 9 | val reflect_t : Tdpe.dynamic -> 10 | SparcTrees.M.t 11 | 12 | -------------------------------------------------------------------------------- /test2/src/bool.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | import printf; 4 | export main; 5 | 6 | foreign "C" main(bits32 argc, "address" bits32 argv) { 7 | tryout(3); tryout(4); 8 | foreign "C" return(0); 9 | } 10 | 11 | tryout(bits32 n) { 12 | bits32 fmt; 13 | if %bool(%lobits1(n)) { fmt = nz; } else { fmt = z; } 14 | foreign "C" printf(fmt, n); 15 | return; 16 | } 17 | 18 | section "data" { 19 | nz : bits8[] "%d low bit is nonzero\n\0"; 20 | z : bits8[] "%d low bit is zero\n\0"; 21 | } 22 | -------------------------------------------------------------------------------- /camlburg/parseerror.nw: -------------------------------------------------------------------------------- 1 | 2 | % ------------------------------------------------------------------ 3 | \section{Parse Error} 4 | % ------------------------------------------------------------------ 5 | 6 | We cannot declare our own error exception in the generated parser 7 | because it would not be declared in the generated interface. So we 8 | create an extra module here. 9 | 10 | <>= 11 | exception Error of string 12 | @ 13 | 14 | <>= 15 | exception Error of string 16 | @ 17 | 18 | -------------------------------------------------------------------------------- /test2/src/exp-000.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | q (bits32 x) { 4 | return (bits32[x+x]); 5 | } 6 | 7 | import printf; export main; 8 | 9 | foreign "C" main(bits32 argc, "address" bits32 argv) { 10 | stackdata { align 4; p: bits32; } 11 | bits32[p] = 0xdeadbeef; 12 | bits32 n; 13 | n = q(p `divu` 2); 14 | foreign "C" printf("address" fmt, n); 15 | foreign "C" return(0); 16 | } 17 | 18 | section "data" { 19 | fmt: bits8[] "lookup returns 0x%x (should be 0xdeadbeef)\n\0"; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /mk/lib/regexp/regerror.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include 7 | #include "regexp.h" 8 | 9 | void 10 | regerror(char *s) 11 | { 12 | char buf[132]; 13 | 14 | strcpy(buf, "regerror: "); 15 | strcat(buf, s); 16 | strcat(buf, "\n"); 17 | write(2, buf, strlen(buf)); 18 | exits("regerr"); 19 | } 20 | -------------------------------------------------------------------------------- /test2/src/nest.c--: -------------------------------------------------------------------------------- 1 | target byteorder little wordsize 32 ; 2 | 3 | export nest; 4 | 5 | section "text" { 6 | span 1 outer { 7 | foreign "C" nest() { 8 | span 1 inner { 9 | import trace; 10 | foreign "C" trace(k) also cuts to k also aborts; 11 | foreign "C" return (0); 12 | 13 | continuation k(): 14 | foreign "C" return(1); 15 | } 16 | } 17 | } 18 | } 19 | 20 | section "data" { 21 | outer: bits8[] "outer\0"; 22 | inner: bits8[] "inner\0"; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /runtime/doc.tex: -------------------------------------------------------------------------------- 1 | \documentclass[twoside]{article} 2 | \input{../config/macros.tex} 3 | \usepackage{noweb} 4 | \pagestyle{noweb} 5 | \usepackage[hypertex]{hyperref} 6 | \noweboptions{shift} 7 | %\noweboptions{breakcode} 8 | 9 | \title{Quick C-- Runtime System} 10 | \begin{document} 11 | 12 | \maketitle 13 | 14 | \ifhtml\else\tableofcontents\fi 15 | 16 | \let\osection=\section 17 | \def\section{\clearpage\osection} 18 | 19 | \input{pcmap.inc} 20 | \input{runtime.inc} 21 | \input{gcc-linux.inc} 22 | 23 | \end{document} 24 | -------------------------------------------------------------------------------- /test2/sparc/incn.s: -------------------------------------------------------------------------------- 1 | .global incn 2 | .section ".data" 3 | Cmm.ref_to_global_area: 4 | ! reference to global-register signature 5 | .word Cmm.globalsig.VKSBdZcIGPIUdLCTLDKJKdWRec 6 | .section ".text" 7 | incn: 8 | save %sp, -96, %sp 9 | Linitialize_continuations_l5: 10 | Lproc_body_start_l4: 11 | set Cmm.global_area, %l7 12 | ld [%l7], %l7 13 | set 1, %l6 14 | add %l7, %l6, %l7 15 | set Cmm.global_area, %l6 16 | st %l7, [%l6] 17 | ! Evil recognizer deleted add %sp, 96, %sp 18 | ret 19 | restore 20 | .section ".text" 21 | -------------------------------------------------------------------------------- /interp/test/multasgn.c--: -------------------------------------------------------------------------------- 1 | // multasgn.c-- 2 | // 3 | /// ./regr "./qrun $SELF" $REGRFLAGS -out $BASE.cmm.1 -err $BASE.cmm.2 4 | 5 | target byteorder little; 6 | 7 | import bits32 cmmprint32; 8 | export main; 9 | 10 | section "text" { 11 | 12 | 13 | main() { 14 | bits32 i; 15 | bits32 j; 16 | 17 | i = 1; 18 | j = 2; 19 | 20 | i, j = j, i; 21 | i, j = j, j+1; 22 | i, j = i+1, i; 23 | 24 | foreign "C" cmmprint32(i); 25 | foreign "C" cmmprint32(j); 26 | 27 | return; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lua-bench/nestedloop.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | 4 | local n = tonumber((arg and arg[1]) or 1) 5 | local x = 0 6 | local a = 1; while a <= n do a = a + 1 7 | local b = 1; while b <= n do b = b + 1 8 | local c = 1; while c <= n do c = c + 1 9 | local d = 1; while d <= n do d = d + 1 10 | local e = 1; while e <= n do e = e + 1 11 | local f = 1; while f <= n do f = f + 1 12 | x = x + 1 13 | end 14 | end 15 | end 16 | end 17 | end 18 | end 19 | write(x,"\n") 20 | -------------------------------------------------------------------------------- /test2/src/fork.c--: -------------------------------------------------------------------------------- 1 | target byteorder little wordsize 32 ; 2 | 3 | export cmm_threadfun, run_thread; 4 | import fib; 5 | 6 | section "data" { 7 | align 4; 8 | comeback: bits32; 9 | } 10 | 11 | foreign "C" run_thread(bits32 k) { 12 | bits32[comeback] = cutback; 13 | cut to k() also cuts to cutback; 14 | continuation cutback(n): 15 | bits32 n; 16 | foreign "C" return (n); 17 | } 18 | 19 | cmm_threadfun(bits32 x) { 20 | bits32 n; 21 | n = foreign "C" fib("address" x, 10); 22 | cut to bits32[comeback](n); 23 | } 24 | -------------------------------------------------------------------------------- /test2/src/hex.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | export main; import printf; 3 | section "data" { 4 | notzero: bits8[] "\x0a\0"; 5 | } 6 | 7 | foreign "C" main(bits32 argc, "address" bits32 argv) { 8 | bits32 n; 9 | import strlen; 10 | n = foreign "C" strlen("address" notzero); 11 | 12 | foreign "C" printf("address" answer, n, %zx32(bits8[notzero])); 13 | foreign "C" return(0); 14 | } 15 | 16 | section "data" { 17 | answer: bits8[] 18 | "length is %d (wants 1) and first character is the final newline.%c\0"; 19 | } 20 | -------------------------------------------------------------------------------- /doc/PORTABILITY: -------------------------------------------------------------------------------- 1 | Things that are not portable: 2 | 3 | * Code to set, query, and use floating-point rounding mode 4 | 5 | * The 'install' command. Instead, 6 | - Depend on the appropriate $install_ variable(s) 7 | - Include config/install.mk (which you might want to understand) 8 | - Use cp 9 | 10 | * The [ ... ] builtin shell command when using -n or -nt options 11 | - Use $config_test instead; we haven't been bitten yet 12 | 13 | * pod2html 14 | - Use nroff with -man macros instead (man 7 man) 15 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | /index.tex 2 | /cfg.tex 3 | /refactor.tex 4 | /stack.tex 5 | /release.tex 6 | *.aux 7 | *.dvi 8 | *.log 9 | *.toc 10 | *.1 11 | *.man 12 | *.inc 13 | /cfg.ps 14 | /better.ps 15 | /working.ps 16 | /newtarget.ps 17 | /modules.ps 18 | /backend.ps 19 | /refactor.ps 20 | /qc--.ps 21 | /qc--internals.ps 22 | /qc--interp.ps 23 | /index.ps 24 | /cfg.pdf 25 | /better.pdf 26 | /working.pdf 27 | /newtarget.pdf 28 | /modules.pdf 29 | /backend.pdf 30 | /refactor.pdf 31 | /qc--.pdf 32 | /qc--internals.pdf 33 | /qc--interp.pdf 34 | /index.pdf 35 | -------------------------------------------------------------------------------- /interp/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.log 3 | *.dvi 4 | *.ps 5 | *.blg 6 | *.toc 7 | /design.tex 8 | /state.tex 9 | *.inc 10 | /decode.fetch 11 | /bytecode.sled 12 | /qc--interp 13 | /opgen.icn 14 | /opgen.tex 15 | /opgen 16 | /interp.tex 17 | /runtime.tex 18 | /client.tex 19 | /intervals.tex 20 | /manual.tex 21 | *.[chim] 22 | *.trace 23 | *.atac 24 | *.prof 25 | .nfs* 26 | /doc.tex 27 | /bytecode.tex 28 | /inspect.lua 29 | /inspect.clua 30 | P=* 31 | /doc.bbl 32 | *.cmm.c-- 33 | *.cmm.qs 34 | /booted-interp 35 | /booted-interp.opt 36 | DEPEND.raw 37 | -------------------------------------------------------------------------------- /mk/debian/control: -------------------------------------------------------------------------------- 1 | Source: mk 2 | Section: devel 3 | Priority: optional 4 | Maintainer: Norman Ramsey 5 | Build-Depends: debhelper (>= 4.0.0), dpatch 6 | Standards-Version: 3.7.2 7 | 8 | Package: mk 9 | Architecture: any 10 | Depends: ${shlibs:Depends} 11 | Description: a Make replacement from Plan-9, small and elegant 12 | Mk controls a compilation process for a set of source files based on 13 | rules in a mkfile which is similar to a Makefile. Compared to Make, Mk 14 | is simpler and integrates better with the shell. 15 | -------------------------------------------------------------------------------- /tdpe/tools.nw: -------------------------------------------------------------------------------- 1 | % -*- mode: Noweb; noweb-code-mode: caml-mode -*- 2 | 3 | \section{Tools for TDPE} 4 | 5 | Basically, a simple gensym function. 6 | 7 | <>= 8 | val gensym : string -> string 9 | val resetGen : unit -> unit 10 | 11 | val fst : ('a * 'b) -> 'a 12 | 13 | @ \section{Implementation} 14 | 15 | <>= 16 | let idcount = Cell.newCell() 17 | 18 | let gensym stub = 19 | Cell.inc(idcount); 20 | stub ^ (string_of_int (!idcount)) 21 | 22 | let resetGen () = Cell.reset idcount 23 | 24 | let fst (x,y) = x 25 | @ 26 | -------------------------------------------------------------------------------- /test2/ppc/if-false.s: -------------------------------------------------------------------------------- 1 | .globl _main 2 | .globl _Cmm.global_area 3 | .globl _Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY 4 | .section __DATA,data 5 | ; memory for global registers 6 | _Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY: 7 | _Cmm.global_area: 8 | .text 9 | _main: 10 | addi r1,r1,-64 11 | mflr r12 12 | _Linitialize_continuations_l4: 13 | _Lproc_body_start_l3: 14 | bl _Lpic_fun_l13 15 | _Lpic_l12: 16 | _Lpic_fun_l13: 17 | mflr r11 18 | _Lpic_end_l14: 19 | _Ljoin_l8: 20 | addi r3,0,0 21 | mtlr r12 22 | addi r1,r1,64 23 | blr 24 | .text 25 | -------------------------------------------------------------------------------- /test2/ppc/if-false2.s: -------------------------------------------------------------------------------- 1 | .globl _main 2 | .globl _Cmm.global_area 3 | .globl _Cmm.globalsig.LPcHEVFbOZHbAHHMQTLHQeIQVI 4 | .section __DATA,data 5 | ; memory for global registers 6 | _Cmm.globalsig.LPcHEVFbOZHbAHHMQTLHQeIQVI: 7 | _Cmm.global_area: 8 | .text 9 | _main: 10 | addi r1,r1,-64 11 | mflr r12 12 | _Linitialize_continuations_l4: 13 | _Lproc_body_start_l3: 14 | bl _Lpic_fun_l12 15 | _Lpic_l11: 16 | _Lpic_fun_l12: 17 | mflr r11 18 | _Lpic_end_l13: 19 | _Ljoin_l7: 20 | addi r3,0,0 21 | mtlr r12 22 | addi r1,r1,64 23 | blr 24 | .text 25 | -------------------------------------------------------------------------------- /test2/src/float-000.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | 8 | const x = 2::bits64 + 3.1415::bits64; 9 | 10 | section "data" 11 | { 12 | a: 13 | bits32[5]; 14 | b: bits64[] { x }; 15 | fmt: bits8[] "pi with 2 ulps is %18g\n\0"; 16 | } 17 | 18 | import printf; export main; 19 | 20 | foreign "C" main(bits32 argc, "address" bits32 argv) { 21 | foreign "C" printf("address" fmt, "float" bits64[b]); 22 | foreign "C" return(0); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test2/src/sparcerr.c--: -------------------------------------------------------------------------------- 1 | // this program is in the test suite because it once triggered a compiler bug 2 | target byteorder little; 3 | 4 | import bits32 printf; 5 | export main, my_data; 6 | 7 | section "data" { 8 | my_data: bits8 [] "hello\x0a\x00"; 9 | } 10 | 11 | foreign "C" foo("address" bits32 f) { 12 | foreign "C" f(my_data); 13 | foreign "C" return(f); 14 | } 15 | 16 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 17 | bits32 q; 18 | q = foreign "C" foo(printf); 19 | foreign "C" return(0); 20 | } 21 | -------------------------------------------------------------------------------- /test2/src/badlit8.c--: -------------------------------------------------------------------------------- 1 | // literals that should *not* fit in 8 bits 2 | 3 | target byteorder little; 4 | export lits; 5 | section "data" { 6 | lits: 7 | bits8[] { 255::bits8, 256::bits8, -129::bits8, }; 8 | align 8; bits64[] { 18446744073709551616U::bits64, 18446744073709551617U::bits64, 9 | 9223372036854775808::bits64, -9223372036854775809::bits64, 10 | 0xeFFFFFFFFFFFFFFFF::bits64, 46116860184273879040U::bits64, 11 | 11529215046068469760::bits64, 23058430092136939520U::bits64, 12 | 13 | }; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /test2/src/non-local-cut.c--: -------------------------------------------------------------------------------- 1 | // cut.c-- 2 | // 3 | // fails an assertion in the "linorder" method of "label" (cfg4.nw) 4 | 5 | target 6 | byteorder little 7 | memsize 8 8 | wordsize 32 9 | pointersize 32 10 | ; 11 | 12 | export main; 13 | import bits32 cmmprint; 14 | 15 | section "text" { 16 | main() { 17 | subroutine(0) also cuts to cont; 18 | return; 19 | 20 | continuation cont(): 21 | return; 22 | } 23 | 24 | subroutine(bits8 x) { 25 | cut to cont(); 26 | return; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test2/src/tf.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | section "data" { 4 | truth : bits8[] "truth\0"; 5 | falsehood : bits8[] "falsehood\0"; 6 | fmt: bits8[] "%%true gives %s and %%false gives %s\n\0"; 7 | } 8 | 9 | foreign "C" main(bits32 argc, "address" bits32 argv) { 10 | bits32 t, f; 11 | if (%true) { t = truth; } else { t = falsehood; } 12 | if (%false) { f = truth; } else { f = falsehood; } 13 | foreign "C" printf("address" fmt, "address" t, "address" f); 14 | foreign "C" return(0); 15 | } 16 | 17 | import printf; export main; 18 | -------------------------------------------------------------------------------- /mk/lib/9/strdup.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | /* 9 | renamed from strdup() to avoid conflict with strdup in libc on some 10 | systems CL 11 | */ 12 | char* 13 | strdup9(const char *s) 14 | { 15 | char *os; 16 | 17 | os = malloc(strlen(s) + 1); 18 | if(os == 0) 19 | return 0; 20 | return strcpy(os, s); 21 | } 22 | -------------------------------------------------------------------------------- /test2/lcc/output/cvt.1: -------------------------------------------------------------------------------- 1 | 1 1 1 1 1 1 1 1 1.000000 1.000000 1.000000 2 | 2 2 2 2 2 2 2 2 2.000000 2.000000 2.000000 3 | 3 3 3 3 3 3 3 3 3.000000 3.000000 3.000000 4 | 4 4 4 4 4 4 4 4 4.000000 4.000000 4.000000 5 | 5 5 5 5 5 5 5 5 5.000000 5.000000 5.000000 6 | 6 6 6 6 6 6 6 6 6.000000 6.000000 6.000000 7 | 7 7 7 7 7 7 7 7 7.000000 7.000000 7.000000 8 | 8 8 8 8 8 8 8 8 8.000000 8.000000 8.000000 9 | 9 9 9 9 9 9 9 9 9.000000 9.000000 9.000000 10 | 10 10 10 10 10 10 10 10 10.000000 10.000000 10.000000 11 | 11 11 11 11 11 11 11 11 11.000000 11.000000 11.000000 12 | -------------------------------------------------------------------------------- /test2/output/test-028.s2: -------------------------------------------------------------------------------- 1 | File "src/test-028.c--", line 9, characters 5-26 Error: continuation parameter 'one' may not be a global variable 2 | File "src/test-028.c--", line 8, character 1 - line 10, character 2 Error: continuation parameter 'one' may not be a global variable 3 | File "src/test-028.c--", line 9, characters 5-26 Error: control can fall through to continuation 4 | File "src/test-028.c--", line 8, character 1 - line 10, character 2 Error: control falls off end of procedure 5 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 6 | -------------------------------------------------------------------------------- /test2/src/float-001.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: bits64[] { 3.1415926535::bits64 }; 12 | } 13 | 14 | export main; import printf; 15 | foreign "C" main (bits32 argc, "address" bits32 argv) { 16 | bits64 y; 17 | y = bits64[x]; 18 | foreign "C" printf("address" fmt, y); 19 | foreign "C" return (0); 20 | } 21 | 22 | section "data" { 23 | fmt: bits8[] "a hand-written literal pi is %lg\n\0"; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test2/src/ratail.c--: -------------------------------------------------------------------------------- 1 | foreign "C" 2 | g(bits32 a, bits32 b) { 3 | jump gt(a, b, b+10); 4 | } 5 | 6 | gt(bits32 a, bits32 b, bits32 c) { 7 | foreign "C" return (a + b + c); 8 | } 9 | 10 | foreign "C" main (bits32 argc, "address" bits32 argv) { 11 | bits32 n; 12 | n = foreign "C" g(10, 20); 13 | n = foreign "C" printf("address" fmt, n); import printf; 14 | foreign "C" return (0); 15 | } 16 | 17 | section "data" { 18 | fmt: bits8 [] "sixty should be %d\n\0"; 19 | } 20 | 21 | export main; 22 | 23 | 24 | target byteorder little; 25 | 26 | -------------------------------------------------------------------------------- /test2/src/rnd2.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | bits2 rm = "IEEE 754 rounding mode"; 4 | 5 | section "text" { 6 | p() { 7 | return ("float" %i2f32(3, rm)); 8 | } 9 | } 10 | 11 | foreign "C" main(bits32 argc, "address" bits32 argv) { 12 | bits32 x; 13 | "float" x = p(); 14 | 15 | foreign "C" printf("address" answer, "float" %f2f64(x, rm)); 16 | foreign "C" return(0); 17 | } 18 | 19 | section "data" { 20 | answer: bits8[] 21 | "Integer 3 converts to floating-point %4.2lf\n\0"; 22 | } 23 | 24 | import printf; export main; 25 | -------------------------------------------------------------------------------- /test2/src/global.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | bits32 n; 4 | 5 | import printf; 6 | export main; 7 | 8 | foreign "C" main(bits32 argc, "address" bits32 argv) { 9 | n = 99; 10 | foreign "C" printf("address" nvalue, n); 11 | foreign "C" printf("address" callincn); 12 | incn(); 13 | foreign "C" printf("address" nvalue, n); 14 | foreign "C" return(0); 15 | } 16 | 17 | import incn; 18 | 19 | section "data" { 20 | nvalue : bits8[] "global variable n == %d\n\0"; 21 | callincn : bits8[] "calling external function incn...\n\0"; 22 | } 23 | -------------------------------------------------------------------------------- /mk/include/ar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #define ARMAG "!\n" 7 | #define SARMAG 8 8 | 9 | #define ARFMAG "`\n" 10 | #define SARNAME 16 11 | 12 | struct ar_hdr 13 | { 14 | char name[SARNAME]; 15 | char date[12]; 16 | char uid[6]; 17 | char gid[6]; 18 | char mode[8]; 19 | char size[10]; 20 | char fmag[2]; 21 | }; 22 | #define SAR_HDR 60 23 | -------------------------------------------------------------------------------- /tdpe/one02Constructors.mli: -------------------------------------------------------------------------------- 1 | module type S = sig 2 | type nativeint = Base.std_nativeint 3 | type amode 4 | type t 5 | 6 | val short : unit -> amode 7 | val hword : unit -> amode 8 | val word : unit -> amode 9 | val dword : unit -> amode 10 | val add : 11 | addr:nativeint (*[0..67108863]*) -> rop:nativeint (*[0..3]*) -> 12 | amode:amode -> t 13 | val ld : rop:nativeint (*[0..3]*) -> addr:nativeint (*[0..67108863]*) -> t 14 | val st : addr:nativeint (*[0..67108863]*) -> rop:nativeint (*[0..3]*) -> t 15 | val nop : unit -> t 16 | end 17 | -------------------------------------------------------------------------------- /test2/src/unwind.c--: -------------------------------------------------------------------------------- 1 | // does not do anything, but should not cause assertion failure 2 | 3 | target byteorder little wordsize 32 ; 4 | 5 | export unwind_test; 6 | 7 | foreign "C" unwind_test() { 8 | g() also unwinds to k1 also aborts; 9 | foreign "C" return (0); 10 | 11 | continuation k1(n): 12 | bits32 n; 13 | foreign "C" return (n); 14 | } 15 | 16 | g() { 17 | foreign "C" do_unwind(k) never returns also aborts also cuts to k; 18 | import do_unwind; 19 | 20 | continuation k(): return (1); 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /lua-bench/ary.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | -- Author: Roberto Ierusalimschy 4 | 5 | local n = tonumber((arg and arg[1]) or 1) 6 | 7 | local x, y = {}, {} 8 | local i = 1 9 | while i <= n do 10 | x[i] = i 11 | i = i + 1 12 | end 13 | 14 | local j = n 15 | while j >= 1 do 16 | y[j] = x[j] 17 | j = j - 1 18 | end 19 | 20 | write(y[n-1], "\n") 21 | 22 | -- old oclbench timings 23 | -- 70 0.02 700 0.25 1000 0.43 1500 0.96 2000 1.75 2500 2.96 3000 4.87 3500 6.67 4000 9.37 24 | 25 | -- now hitting nonlinearity between 20000 and 40000 -------------------------------------------------------------------------------- /tdpe/one02Constructors.ml: -------------------------------------------------------------------------------- 1 | module type S = sig 2 | type nativeint = Base.std_nativeint 3 | type amode 4 | type t 5 | 6 | val short : unit -> amode 7 | val hword : unit -> amode 8 | val word : unit -> amode 9 | val dword : unit -> amode 10 | val add : 11 | addr:nativeint (*[0..67108863]*) -> rop:nativeint (*[0..3]*) -> 12 | amode:amode -> t 13 | val ld : rop:nativeint (*[0..3]*) -> addr:nativeint (*[0..67108863]*) -> t 14 | val st : addr:nativeint (*[0..67108863]*) -> rop:nativeint (*[0..3]*) -> t 15 | val nop : unit -> t 16 | end 17 | 18 | -------------------------------------------------------------------------------- /test2/src/float-001-hero.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | x: bits64[] { 3.1415926535::bits64 }; 12 | } 13 | 14 | export main; import printf; 15 | foreign "C" main (bits32 argc, "address" bits32 argv) { 16 | bits64 y; 17 | y = bits64[x aligned 1]; 18 | foreign "C" printf("address" fmt, y); 19 | foreign "C" return (0); 20 | } 21 | 22 | section "data" { 23 | fmt: bits8[] "a hand-written literal pi is %lg\n\0"; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test2/x86/incn.s: -------------------------------------------------------------------------------- 1 | .globl incn 2 | .section .data 3 | Cmm.ref_to_global_area: 4 | /* reference to global-register signature */ 5 | .long Cmm.globalsig.VKSBdZcIGPIUdLCTLDKJKdWRec 6 | .section .text 7 | incn: 8 | movl %esp,%eax 9 | movl (%eax),%eax 10 | .Linitialize_continuations_l3: 11 | .Lproc_body_start_l2: 12 | leal Cmm.global_area,%ecx 13 | movl (%ecx),%ecx 14 | movl $1,%edx 15 | addl %edx,%ecx 16 | leal Cmm.global_area,%edx 17 | movl %ecx,(%edx) 18 | movl %esp,%ecx 19 | movl $0,%edx 20 | addl %edx,%ecx 21 | movl %eax,(%ecx) 22 | ret 23 | .section .text 24 | -------------------------------------------------------------------------------- /interp/include/cii/arena.h: -------------------------------------------------------------------------------- 1 | /* $Id$ */ 2 | #ifndef ARENA_INCLUDED 3 | #define ARENA_INCLUDED 4 | #include "except.h" 5 | #define T Arena_T 6 | typedef struct T *T; 7 | extern const Except_T Arena_NewFailed; 8 | extern const Except_T Arena_Failed; 9 | extern T Arena_new (void); 10 | extern void Arena_dispose(T *ap); 11 | extern void *Arena_alloc (T arena, long nbytes, 12 | const char *file, int line); 13 | extern void *Arena_calloc(T arena, long count, 14 | long nbytes, const char *file, int line); 15 | extern void Arena_free (T arena); 16 | #undef T 17 | #endif 18 | -------------------------------------------------------------------------------- /test2/x86/fact.5: -------------------------------------------------------------------------------- 1 | ab7a3bddf10c8b5c1fea1fbe231f0337 ../lib/libqc--.a(runtime.o) 2 | 139001386fad752b5a028317821661d0 ../lib/libqc--.a(pcmap.o) 3 | 43118c4b03883b9d40bb09242cdb0c21 ../lib/libqc--.a(gcc-linux.o) 4 | 8d8488e6c3d25c870ddaa1e0cd2fdaf4 ../lib/libqc--.a(cut.o) 5 | 37c3083f86f52e8f455d9ed1b6c6e755 ../lib/libqc--.a(thread.o) 6 | c2a31099f5857f74450fa7e558329349 ../lib/libqc--.a(yield.o) 7 | 176558e006753a555e64833e96ffad0d ../lib/libqc--.a(x86-linux.o) 8 | 489ef885152858eaac5a875949e822ba ../lib/pcmap.ld 9 | e5d4f0f87aa9c4e73f299c32acae324e src/factmain.c 10 | -------------------------------------------------------------------------------- /test2/x86/fork.5: -------------------------------------------------------------------------------- 1 | ab7a3bddf10c8b5c1fea1fbe231f0337 ../lib/libqc--.a(runtime.o) 2 | 139001386fad752b5a028317821661d0 ../lib/libqc--.a(pcmap.o) 3 | 43118c4b03883b9d40bb09242cdb0c21 ../lib/libqc--.a(gcc-linux.o) 4 | 8d8488e6c3d25c870ddaa1e0cd2fdaf4 ../lib/libqc--.a(cut.o) 5 | 37c3083f86f52e8f455d9ed1b6c6e755 ../lib/libqc--.a(thread.o) 6 | c2a31099f5857f74450fa7e558329349 ../lib/libqc--.a(yield.o) 7 | 176558e006753a555e64833e96ffad0d ../lib/libqc--.a(x86-linux.o) 8 | 489ef885152858eaac5a875949e822ba ../lib/pcmap.ld 9 | d54ff169dbb4a476d72185e03709b16c src/forkmain.c 10 | -------------------------------------------------------------------------------- /test2/x86/incn-color.s: -------------------------------------------------------------------------------- 1 | .globl incn 2 | .section .data 3 | Cmm.ref_to_global_area: 4 | /* reference to global-register signature */ 5 | .long Cmm.globalsig.VKSBdZcIGPIUdLCTLDKJKdWRec 6 | .section .text 7 | incn: 8 | movl %esp,%eax 9 | movl (%eax),%eax 10 | .Linitialize_continuations_l3: 11 | .Lproc_body_start_l2: 12 | leal Cmm.global_area,%ecx 13 | movl (%ecx),%edx 14 | movl $1,%ecx 15 | addl %ecx,%edx 16 | leal Cmm.global_area,%ecx 17 | movl %edx,(%ecx) 18 | movl %esp,%edx 19 | movl $0,%ecx 20 | addl %ecx,%edx 21 | movl %eax,(%edx) 22 | ret 23 | .section .text 24 | -------------------------------------------------------------------------------- /test2/x86/nest.5: -------------------------------------------------------------------------------- 1 | ab7a3bddf10c8b5c1fea1fbe231f0337 ../lib/libqc--.a(runtime.o) 2 | 139001386fad752b5a028317821661d0 ../lib/libqc--.a(pcmap.o) 3 | 43118c4b03883b9d40bb09242cdb0c21 ../lib/libqc--.a(gcc-linux.o) 4 | 8d8488e6c3d25c870ddaa1e0cd2fdaf4 ../lib/libqc--.a(cut.o) 5 | 37c3083f86f52e8f455d9ed1b6c6e755 ../lib/libqc--.a(thread.o) 6 | c2a31099f5857f74450fa7e558329349 ../lib/libqc--.a(yield.o) 7 | 176558e006753a555e64833e96ffad0d ../lib/libqc--.a(x86-linux.o) 8 | 489ef885152858eaac5a875949e822ba ../lib/pcmap.ld 9 | 1d0674ea7978e29a55043c2339625492 src/nestmain.c 10 | -------------------------------------------------------------------------------- /test2/x86/trace.5: -------------------------------------------------------------------------------- 1 | ab7a3bddf10c8b5c1fea1fbe231f0337 ../lib/libqc--.a(runtime.o) 2 | 139001386fad752b5a028317821661d0 ../lib/libqc--.a(pcmap.o) 3 | 43118c4b03883b9d40bb09242cdb0c21 ../lib/libqc--.a(gcc-linux.o) 4 | 8d8488e6c3d25c870ddaa1e0cd2fdaf4 ../lib/libqc--.a(cut.o) 5 | 37c3083f86f52e8f455d9ed1b6c6e755 ../lib/libqc--.a(thread.o) 6 | c2a31099f5857f74450fa7e558329349 ../lib/libqc--.a(yield.o) 7 | 176558e006753a555e64833e96ffad0d ../lib/libqc--.a(x86-linux.o) 8 | 489ef885152858eaac5a875949e822ba ../lib/pcmap.ld 9 | c830e23e3c9a46693251adf8bb5fc1ed src/tracemain.c 10 | -------------------------------------------------------------------------------- /test2/x86/unwind.5: -------------------------------------------------------------------------------- 1 | ab7a3bddf10c8b5c1fea1fbe231f0337 ../lib/libqc--.a(runtime.o) 2 | 139001386fad752b5a028317821661d0 ../lib/libqc--.a(pcmap.o) 3 | 43118c4b03883b9d40bb09242cdb0c21 ../lib/libqc--.a(gcc-linux.o) 4 | 8d8488e6c3d25c870ddaa1e0cd2fdaf4 ../lib/libqc--.a(cut.o) 5 | 37c3083f86f52e8f455d9ed1b6c6e755 ../lib/libqc--.a(thread.o) 6 | c2a31099f5857f74450fa7e558329349 ../lib/libqc--.a(yield.o) 7 | 176558e006753a555e64833e96ffad0d ../lib/libqc--.a(x86-linux.o) 8 | 489ef885152858eaac5a875949e822ba ../lib/pcmap.ld 9 | ad89bd091891d5edbd9c17356e23a743 src/unwindt.c 10 | -------------------------------------------------------------------------------- /lua-bench/wc.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | -- from Roberto Ierusalimschy 4 | 5 | BUFSIZE = 2^12 6 | 7 | local cc,lc,wc = 0,0,0 8 | local lines, rest = read(BUFSIZE, "*l") 9 | while lines do 10 | if rest then lines = lines..rest..'\n' end 11 | cc = cc+strlen(lines) 12 | local _,t = gsub(lines, "%S+", "") -- count words in the line 13 | wc = wc+t 14 | _,t = gsub(lines, "\n", "\n") -- count newlines in the line 15 | lc = lc+t 16 | lines, rest = read(BUFSIZE, "*l") 17 | end 18 | 19 | write(lc, " ", wc, " ", cc, "\n") 20 | -------------------------------------------------------------------------------- /mk/lib/regexp/Makefile: -------------------------------------------------------------------------------- 1 | AR=ar crvs 2 | RANLIB=ranlib 3 | 4 | ORIGINALS=regaux.o regcomp.o regerror.o regexec.o regsub.o rregexec.o rregsub.o 5 | 6 | UNNEEDED=regerror.o rregexec.o rregsub.o 7 | 8 | OFILES=regaux.o regcomp.o regexec.o regsub.o 9 | 10 | TARG=../libregexp.a 11 | CFLAGS=-g -I../../include 12 | 13 | all: $(TARG) 14 | 15 | $(TARG): $(OFILES) 16 | $(AR) $(TARG) $(OFILES) 17 | $(RANLIB) $(TARG) 18 | 19 | $(OFILES): ../../include/regexp.h ../../include/lib9.h regcomp.h 20 | 21 | clean: 22 | rm -f *~ 23 | rm -f *.o 24 | 25 | nuke: clean 26 | rm -f $(TARG) 27 | -------------------------------------------------------------------------------- /test2/src/float-001-coward.c--: -------------------------------------------------------------------------------- 1 | 2 | // execute the commands below to use this file as a test case 3 | // 4 | 5 | target byteorder little; 6 | 7 | bits8 c; 8 | 9 | section "data" 10 | { 11 | align 8; 12 | x: bits64[] { 3.1415926535::bits64 }; 13 | } 14 | 15 | export main; import printf; 16 | foreign "C" main (bits32 argc, "address" bits32 argv) { 17 | bits64 y; 18 | y = bits64[x]; 19 | foreign "C" printf("address" fmt, y); 20 | foreign "C" return (0); 21 | } 22 | 23 | section "data" { 24 | fmt: bits8[] "a hand-written literal pi is %lg\n\0"; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /mk/lib/9/utflen.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | 8 | long 9 | utflen(char *s) 10 | { 11 | int c; 12 | long n; 13 | Rune rune; 14 | 15 | n = 0; 16 | for(;;) { 17 | c = *(uchar*)s; 18 | if(c < Runeself) { 19 | if(c == 0) 20 | return n; 21 | s++; 22 | } else 23 | s += chartorune(&rune, s); 24 | n++; 25 | } 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /test2/src/exp-001.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | section "text" { 4 | p () { 5 | bits32 x, y, z, total; 6 | x = 1; 7 | y = 2; 8 | z = 3; 9 | 10 | total = x + y + z; 11 | return (total); 12 | } 13 | } 14 | 15 | export main; import printf; 16 | foreign "C" main (bits32 argc, "address" bits32 argv) { 17 | bits32 n; 18 | n = p(); 19 | foreign "C" printf("address" fmt, n); 20 | foreign "C" return (0); 21 | } 22 | 23 | section "data" { 24 | fmt: bits8[] "total is %d\n\0"; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /gen/mkfile.normal: -------------------------------------------------------------------------------- 1 | # in normal mode, the prerequisites for specifications and the rules for 2 | # the \-RTL translator are invisible. 3 | # 4 | 5 | # No real action here 6 | 7 | ast.asdl: ast.nw 8 | touch $target 9 | 10 | rtlasdl.asdl: rtlasdl.nw 11 | touch $target 12 | 13 | astUtil.mli \ 14 | astUtil.ml \ 15 | ast.mli \ 16 | ast.ml: ast.asdl 17 | touch $target 18 | 19 | rtlasdl.ml \ 20 | rtlasdl.mli \ 21 | rtlasdlUtil.ml \ 22 | rtlasdlUtil.mli: rtlasdl.asdl 23 | touch $target 24 | -------------------------------------------------------------------------------- /src/ep.nw: -------------------------------------------------------------------------------- 1 | % -*- mode: Noweb; noweb-code-mode: caml-mode -*- 2 | % -*- mode: Noweb; noweb-code-mode: caml-mode -*- 3 | 4 | \section{Embedding-projection pairs} 5 | 6 | This code is in a separate module to make it easier to avoid circular dependencies. 7 | <>= 8 | type ('em, 'pr) pre_map = 9 | { embed : 'em 10 | ; project : 'pr 11 | } 12 | type ('lo, 'hi) map = ('lo -> 'hi, 'hi -> 'lo) pre_map 13 | <>= 14 | type ('em, 'pr) pre_map = 15 | { embed : 'em 16 | ; project : 'pr 17 | } 18 | type ('lo, 'hi) map = ('lo -> 'hi, 'hi -> 'lo) pre_map 19 | @ 20 | -------------------------------------------------------------------------------- /test2/x86/deadcontvar.5: -------------------------------------------------------------------------------- 1 | ab7a3bddf10c8b5c1fea1fbe231f0337 ../lib/libqc--.a(runtime.o) 2 | 139001386fad752b5a028317821661d0 ../lib/libqc--.a(pcmap.o) 3 | 43118c4b03883b9d40bb09242cdb0c21 ../lib/libqc--.a(gcc-linux.o) 4 | 8d8488e6c3d25c870ddaa1e0cd2fdaf4 ../lib/libqc--.a(cut.o) 5 | 37c3083f86f52e8f455d9ed1b6c6e755 ../lib/libqc--.a(thread.o) 6 | c2a31099f5857f74450fa7e558329349 ../lib/libqc--.a(yield.o) 7 | 176558e006753a555e64833e96ffad0d ../lib/libqc--.a(x86-linux.o) 8 | 489ef885152858eaac5a875949e822ba ../lib/pcmap.ld 9 | c2be2fe05c2e53cb1dec7e7cd4cdebf2 src/deadcontvar-unwind.c 10 | -------------------------------------------------------------------------------- /test2/src/not.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | ge(bits32 i, bits32 j) { 4 | if (%not(%lt(i, j))) { 5 | return (1); 6 | } else { 7 | return (0); 8 | } 9 | } 10 | 11 | 12 | foreign "C" main(bits32 argc, "address" bits32 argv) { 13 | bits32 a, b, c; 14 | a = ge(987, 33); 15 | b = ge(33, 987); 16 | c = ge(987, 987); 17 | 18 | foreign "C" printf("address" answer, a, b, c); 19 | foreign "C" return(0); 20 | } 21 | 22 | section "data" { 23 | answer: bits8[] 24 | "987 >= 33 == %d; 33 >= 987 == %d; 987 >= 987 == %d\n\0"; 25 | } 26 | 27 | import printf; export main; 28 | -------------------------------------------------------------------------------- /debian/qcmm.doc-base.EX: -------------------------------------------------------------------------------- 1 | Document: qcmm 2 | Title: Debian qcmm Manual 3 | Author: 4 | Abstract: This manual describes what qcmm is 5 | and how it can be used to 6 | manage online manuals on Debian systems. 7 | Section: unknown 8 | 9 | Format: debiandoc-sgml 10 | Files: /usr/share/doc/qcmm/qcmm.sgml.gz 11 | 12 | Format: postscript 13 | Files: /usr/share/doc/qcmm/qcmm.ps.gz 14 | 15 | Format: text 16 | Files: /usr/share/doc/qcmm/qcmm.text.gz 17 | 18 | Format: HTML 19 | Index: /usr/share/doc/qcmm/html/index.html 20 | Files: /usr/share/doc/qcmm/html/*.html 21 | 22 | 23 | -------------------------------------------------------------------------------- /test2/src/conj.c--: -------------------------------------------------------------------------------- 1 | target wordsize 32 pointersize 32 byteorder little; 2 | 3 | foo (bits32 i) 4 | { 5 | bits32 x; 6 | if ((i != 1) `conjoin` (i != 0)) {x=999;} 7 | else {x=0;} 8 | return(x); 9 | } 10 | 11 | export main; import printf; 12 | 13 | foreign "C" main("unsigned" bits32 iargc, "address" bits32 iargv) { 14 | bits32 a, b, c; 15 | a = foo(0); 16 | b = foo(1); 17 | c = foo(2); 18 | 19 | foreign "C" printf("address" fmt, a, b, c); 20 | foreign "C" return(0); 21 | } 22 | 23 | section "data" { 24 | fmt: bits8[] "foo(0) = %d; foo(1) = %d; foo(2) = %d\n\0"; 25 | } 26 | -------------------------------------------------------------------------------- /lua-bench/random.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | -- implemented by: Roberto Ierusalimschy 4 | 5 | local IM = 139968 6 | local IA = 3877 7 | local IC = 29573 8 | 9 | LAST = 42 10 | function gen_random(max) 11 | -- LAST = mod((LAST * %IA + %IC ), %IM ) 12 | LAST = mod((LAST * 3877 + 29573), 139968) 13 | -- return( (max * LAST) / %IM ) 14 | return( (max * LAST) / 139968 ) 15 | end 16 | 17 | local N = tonumber((arg and arg[1])) or 1 18 | local i = N; while i > 2 do i = i - 1 19 | gen_random(100) 20 | end 21 | write(format("%.9f\n", gen_random(100))) 22 | -------------------------------------------------------------------------------- /tdpe/one02Trees.mli: -------------------------------------------------------------------------------- 1 | 2 | module type S = 3 | sig 4 | type nativeint = Tdpe.dynamic 5 | type amode 6 | = Short of unit 7 | | Hword of unit 8 | | Word of unit 9 | | Dword of unit 10 | 11 | type t 12 | = Add of nativeint (*[0..67108863]*) * nativeint (*[0..3]*) * amode 13 | | Ld of nativeint (*[0..3]*) * nativeint (*[0..67108863]*) 14 | | St of nativeint (*[0..67108863]*) * nativeint (*[0..3]*) 15 | | Nop of unit 16 | end 17 | 18 | module M : S 19 | module Rec(I : One02Constructors.S) : 20 | sig 21 | val rec_t : M.t -> I.t 22 | end 23 | -------------------------------------------------------------------------------- /lua-bench/hash2.lua: -------------------------------------------------------------------------------- 1 | -- $Id$ 2 | -- http://www.bagley.org/~doug/shootout/ 3 | -- with help from Roberto Ierusalimschy 4 | 5 | local n = tonumber((arg and arg[1]) or 1) 6 | 7 | local hash1={} 8 | local i = 0 9 | while i <= 10000 do 10 | hash1["foo_"..i] = i 11 | i = i + 1 12 | end 13 | local hash2={} 14 | local i = 1 15 | while i < n do 16 | local k, v = next(hash1, nil) 17 | while k do 18 | hash2[k] = v + (hash2[k] or 0) 19 | k, v = next(hash1, k) 20 | end 21 | i = i + 1 22 | end 23 | 24 | write(format("%d %d %d %d\n", hash1["foo_1"], hash1["foo_9999"], 25 | hash2["foo_1"], hash2["foo_9999"])) 26 | -------------------------------------------------------------------------------- /mk/lib/bio/bbuffered.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | #include 8 | 9 | int 10 | Bbuffered(Biobuf *bp) 11 | { 12 | switch(bp->state) { 13 | case Bracteof: 14 | case Bractive: 15 | return -bp->icount; 16 | 17 | case Bwactive: 18 | return bp->bsize + bp->ocount; 19 | 20 | case Binactive: 21 | return 0; 22 | } 23 | fprint(2, "Bbuffered: unknown state %d\n", bp->state); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /test2/output/test-049.s2: -------------------------------------------------------------------------------- 1 | File "src/test-049.c--", line 14, characters 5-13 Error: address's type is not the machine's pointer size 2 | File "src/test-049.c--", line 15, characters 5-13 Error: reference's type is not a multiple of target memsize 3 | File "src/test-049.c--", line 16, characters 5-14 Error: address's type is not the machine's pointer size 4 | File "src/test-049.c--", line 19, characters 9-12 Error: kind permissible only on parameter or result 5 | File "src/test-049.c--", line 6, character 1 - line 20, character 2 Error: control falls off end of procedure 6 | Caml exception: Error.ErrorExn("compilation aborted because of errors") 7 | -------------------------------------------------------------------------------- /test2/src/divmod.c--: -------------------------------------------------------------------------------- 1 | divmod(bits32 n, bits32 m) { 2 | bits32 x, y; 3 | 4 | x = n `divu` m; 5 | y = n `modu` m; 6 | return (x, y); 7 | } 8 | 9 | 10 | target byteorder little; 11 | 12 | foreign "C" main(bits32 argc, "address" bits32 argv) { 13 | bits32 x, y; 14 | bits32 n, m; 15 | n, m = 987, 33; 16 | x, y = divmod(n, m); 17 | 18 | foreign "C" printf("address" answer, n, m, x, n, m, y, x * m + y); 19 | foreign "C" return(0); 20 | } 21 | 22 | section "data" { 23 | answer: bits8[] 24 | "%d div %d == %d (wants 29); %d mod %d == %d (wants 30); d * q + r == %d\n\0"; 25 | } 26 | 27 | import printf; export main; 28 | -------------------------------------------------------------------------------- /test2/src/fadd.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | bits2 rm = "IEEE 754 rounding mode"; 3 | import bits32 printf; 4 | export main; 5 | 6 | section "data" { 7 | align 4; 8 | x: bits32 {0x40400000}; // 3.0 9 | y: bits32 {0x3e10fcf8}; // 0.14159 10 | z: bits32; 11 | fmt: bits8[] "%f + %f = %f\n\0"; 12 | } 13 | 14 | 15 | foreign "C" main () { 16 | bits32[z] = %fadd(bits32[x], bits32[y], rm); 17 | foreign "C" printf("address" fmt, 18 | "float" %f2f64(bits32[x], rm), 19 | "float" %f2f64(bits32[y], rm), 20 | "float" %f2f64(bits32[z], rm)); 21 | return (0); 22 | } 23 | -------------------------------------------------------------------------------- /test2/src/unwindt.c: -------------------------------------------------------------------------------- 1 | #include "qc--runtime.h" 2 | #include 3 | #include 4 | 5 | extern int unwind_test(void); 6 | 7 | int main(int argc, char *argv[]) { 8 | int n; 9 | n = unwind_test(); 10 | if (n == 77) 11 | printf("unwound to %d as expected\n", n); 12 | else 13 | printf("returned %d?! must be an error...\n", n); 14 | return 0; 15 | } 16 | 17 | void do_unwind(Cmm_Cont *k) { 18 | Cmm_Activation a = Cmm_YoungestActivation(k); 19 | int n = Cmm_ChangeActivation(&a); 20 | Cmm_Cont *u; 21 | assert(n); 22 | u = Cmm_MakeUnwindCont(&a, 0, 77); 23 | Cmm_CutTo(u); 24 | assert(0); 25 | } 26 | -------------------------------------------------------------------------------- /mk/lib/bio/bputrune.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright © 1998, 1999 Lucent Technologies Inc. All rights reserved. 3 | Revisions Copyright © 1999, 2000 Vita Nuova Limited. All rights reserved. 4 | Revisions Copyright © 2001 Norman Ramsey. All rights reserved. 5 | */ 6 | #include "lib9.h" 7 | #include 8 | 9 | int 10 | Bputrune(Biobuf *bp, long c) 11 | { 12 | Rune rune; 13 | char str[4]; 14 | int n; 15 | 16 | rune = c; 17 | if(rune < Runeself) { 18 | Bputc(bp, rune); 19 | return 1; 20 | } 21 | n = runetochar(str, &rune); 22 | if(n == 0) 23 | return Bbad; 24 | if(Bwrite(bp, str, n) != n) 25 | return Beof; 26 | return n; 27 | } 28 | -------------------------------------------------------------------------------- /test2/src/ladd.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | import ladd, printf; 4 | export main; 5 | 6 | foreign "C" main(bits32 argc, "address" bits32 argv) { 7 | bits64 n, m; 8 | n = 0x80000000::bits64; 9 | m = 0x80000000::bits64; 10 | bits64 sum; 11 | sum = foreign "C" ladd(n, m); 12 | foreign "C" printf(format, n, m, sum); 13 | foreign "C" return(0); 14 | } 15 | 16 | section "data" { 17 | format: bits8[] "sum of %016llx\nand %016llx\nis %016llx\n\0"; 18 | } 19 | 20 | /* N.B. ladd is a C function defined as follows: 21 | 22 | long long ladd(long long x, long long y) { 23 | return x + y; 24 | } 25 | 26 | */ 27 | -------------------------------------------------------------------------------- /test2/src/test-047.c--: -------------------------------------------------------------------------------- 1 | // execute the commands below to use this file as a test case 2 | // 3 | 4 | target byteorder little; 5 | 6 | 7 | f (bits32 i) 8 | { 9 | switch [1 .. 3] i { 10 | case 1::bits8: { return (i); } 11 | case 2.. 3: { return (i); } 12 | } 13 | 14 | switch [1 .. 3] i { 15 | case 0,1::bits8: { return (i); } 16 | case 2 .. 3: { return (i); } 17 | } 18 | 19 | switch [1 .. 3] i { 20 | case : { return (i); } 21 | case 2 .. 3: { return (i); } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test2/sparc/if-false.s: -------------------------------------------------------------------------------- 1 | .global main 2 | .global Cmm.global_area 3 | .global Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY 4 | .section ".data" 5 | ! memory for global registers 6 | Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY: 7 | Cmm.global_area: 8 | .global Cmm_stack_growth 9 | .section ".data" 10 | .align 4 11 | Cmm_stack_growth: 12 | .word 0xffffffff 13 | .section ".text" 14 | main: 15 | save %sp, -96, %sp 16 | mov %i0, %l7 17 | mov %i1, %l7 18 | Linitialize_continuations_l5: 19 | Lproc_body_start_l4: 20 | Ljoin_l9: 21 | set 0, %l7 22 | mov %l7, %i0 23 | ! Evil recognizer deleted add %sp, 96, %sp 24 | ret 25 | restore 26 | .section ".text" 27 | -------------------------------------------------------------------------------- /test2/sparc/if-false2.s: -------------------------------------------------------------------------------- 1 | .global main 2 | .global Cmm.global_area 3 | .global Cmm.globalsig.LPcHEVFbOZHbAHHMQTLHQeIQVI 4 | .section ".data" 5 | ! memory for global registers 6 | Cmm.globalsig.LPcHEVFbOZHbAHHMQTLHQeIQVI: 7 | Cmm.global_area: 8 | .global Cmm_stack_growth 9 | .section ".data" 10 | .align 4 11 | Cmm_stack_growth: 12 | .word 0xffffffff 13 | .section ".text" 14 | main: 15 | save %sp, -96, %sp 16 | mov %i0, %l7 17 | mov %i1, %l7 18 | Linitialize_continuations_l5: 19 | Lproc_body_start_l4: 20 | Ljoin_l8: 21 | set 0, %l7 22 | mov %l7, %i0 23 | ! Evil recognizer deleted add %sp, 96, %sp 24 | ret 25 | restore 26 | .section ".text" 27 | -------------------------------------------------------------------------------- /test2/src/const.c--: -------------------------------------------------------------------------------- 1 | target byteorder little; 2 | 3 | const c1 = 1; 4 | const c2 = c3 - c1; 5 | const c3 = c1+c1+c1; 6 | const c4 = c2*c2; 7 | const xc5 = c2 + c3; const c5 = c10 >> c1; 8 | const c6 = c3 << c1; 9 | const xc7 = c4 + c3; const c7 = (c10 + c4) / c2; 10 | const c8 = c1 << c3; 11 | const xc9 = c3 * c3; const c9 = (c10 * c8 - c1) / c8; 12 | const c10 = c6 + c4; 13 | 14 | section "data" { 15 | fmt: bits8[] "%d %d %d %d %d %d %d %d %d %d\n"; 16 | } 17 | 18 | import printf; 19 | export main; 20 | foreign "C" main() { 21 | foreign "C" printf("address" fmt, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10); 22 | foreign "C" return; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test2/src/lit8main.c: -------------------------------------------------------------------------------- 1 | extern signed char lits8[], lits8lim[]; 2 | extern signed long long lits64[], lits64lim[]; 3 | extern int printf(const char *fmt, ...); 4 | 5 | main(int argc, char *argv) { 6 | signed char *p; 7 | signed long long *l; 8 | 9 | for (p = lits8; p < lits8lim; p++) 10 | printf("lits8[%d] = %d (%u) [0x%02x]\n", p - lits8, *p, *(unsigned char *)p, 11 | *(unsigned char *)p); 12 | 13 | for (l = lits64; l < lits64lim; l++) 14 | printf("lits64[%d] = %lld (%llu) [0x%016llx]\n", l - lits64, *l, 15 | *(unsigned long long *)l, *(unsigned long long *)l); 16 | 17 | return 0; 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lua/test/07.lua: -------------------------------------------------------------------------------- 1 | print("testando erros") 2 | 3 | 4 | function doit (s) 5 | local m = {msg = nil} 6 | m.msg = '' --call(dostring, {s}, '', function (s) %m.msg = s end) 7 | return m.msg; 8 | end 9 | 10 | i = 0 11 | function y () i=i+1; y() end 12 | 13 | --assert(doit('y()')=="stack size overflow") 14 | --assert(doit('y()')=="stack size overflow") 15 | print('+') 16 | --assert(strfind(doit("syntax error"), "syntax error")) 17 | 18 | --doit('i = dostring("a=9+"); a=3') 19 | --assert(a==3 and i == nil) 20 | print('+') 21 | 22 | i = 0 23 | -- while (i=i+1)<10000 do 24 | -- doit('a = ') 25 | -- doit('a = 4+nil') 26 | -- end 27 | 28 | print('OK') 29 | -------------------------------------------------------------------------------- /interp/test/stackd.c--: -------------------------------------------------------------------------------- 1 | // stackd.c-- 2 | 3 | target byteorder little; 4 | 5 | export main; 6 | import bits32 printf; 7 | 8 | section "data" { 9 | print: bits8[] {'%'::bits8, 'd'::bits8, 10::bits8, 0::bits8}; 10 | } 11 | 12 | section "text" { 13 | main() { 14 | bits8 x; 15 | bits32 addr; 16 | 17 | stackdata { 18 | slabel: bits8; 19 | slabel2: bits8; 20 | bits16[2]; 21 | slabel3: bits32; 22 | } 23 | 24 | addr = slabel; 25 | addr = slabel2; 26 | addr = slabel3; 27 | 28 | bits8[slabel2] = 4::bits8; 29 | 30 | foreign "C" printf(print, bits8[slabel2]); 31 | 32 | return; 33 | } 34 | } -------------------------------------------------------------------------------- /lua/log.nw: -------------------------------------------------------------------------------- 1 | % -*- mode: Noweb; noweb-code-mode: caml-mode -*- 2 | % Grades ::= "%%Grades:" Quality Importance Urgency 3 | % Quality ::= A|B|C|D|E 4 | % Importance ::= Central|Subsystem|Peripheral 5 | % Urgency ::= Immediate|Soon|Later 6 | % 7 | % Example (at beginning of line): %%Grades: B Central Soon 8 | 9 | <>= 10 | val bucket_length : int -> unit 11 | val avg_length : unit -> float 12 | <>= 13 | let sum = ref 0 14 | let n = ref 0 15 | 16 | let bucket_length k = 17 | n := !n + 1; 18 | sum := !sum + k 19 | 20 | let avg_length () = 21 | if !sum = 0 then 0.0 22 | else float_of_int (!sum) /. float_of_int (!n) 23 | --------------------------------------------------------------------------------