diff options
Diffstat (limited to 'testasmcomp')
| -rw-r--r-- | testasmcomp/alpha.asm | 55 | ||||
| -rw-r--r-- | testasmcomp/fib.cmm | 5 | ||||
| -rw-r--r-- | testasmcomp/i386.asm | 31 | ||||
| -rw-r--r-- | testasmcomp/integr.cmm | 16 | ||||
| -rw-r--r-- | testasmcomp/quicksort.cmm | 21 | ||||
| -rw-r--r-- | testasmcomp/quicksort2.cmm | 27 | ||||
| -rw-r--r-- | testasmcomp/soli.cmm | 93 | ||||
| -rw-r--r-- | testasmcomp/sparc.asm | 19 | ||||
| -rw-r--r-- | testasmcomp/tak.cmm | 9 |
9 files changed, 0 insertions, 276 deletions
diff --git a/testasmcomp/alpha.asm b/testasmcomp/alpha.asm deleted file mode 100644 index a445718b6b..0000000000 --- a/testasmcomp/alpha.asm +++ /dev/null @@ -1,55 +0,0 @@ - .globl call_gen_code - .ent call_gen_code - -/**** - C Caml Light - - Args: $16 $17 $18 $19 $9 $10 $11 $12 - $f16 $f17 $f18 $f19 $f2 $f3 $f4 $f5 - - Results: $0 $f0 - $0 $f0 -****/ - -call_gen_code: - lda $sp, -80($sp) - stq $26, 0($sp) - stq $9, 8($sp) - stq $10, 16($sp) - stq $11, 24($sp) - stq $12, 32($sp) - stt $f2, 40($sp) - stt $f3, 48($sp) - stt $f4, 56($sp) - stt $f5, 64($sp) - mov $17, $9 - mov $18, $10 - mov $19, $11 - mov $20, $12 - fmov $f16, $f2 - fmov $f17, $f3 - fmov $f18, $f4 - fmov $f19, $f5 - mov $16, $27 - jsr ($16) - ldq $26, 0($sp) - ldq $9, 8($sp) - ldq $10, 16($sp) - ldq $11, 24($sp) - ldq $12, 32($sp) - ldt $f2, 40($sp) - ldt $f3, 48($sp) - ldt $f4, 56($sp) - ldt $f5, 64($sp) - lda $sp, 80($sp) - ret ($26) - - .end call_gen_code - - .globl caml_c_call - .ent caml_c_call -caml_c_call: - mov $25, $27 - jmp ($25) - - .end caml_c_call diff --git a/testasmcomp/fib.cmm b/testasmcomp/fib.cmm deleted file mode 100644 index 1db71535e5..0000000000 --- a/testasmcomp/fib.cmm +++ /dev/null @@ -1,5 +0,0 @@ -(function "fib" (n: int) - (if (< n 2) - 1 - (+ (app "fib" (- n 1) int) - (app "fib" (- n 2) int)))) diff --git a/testasmcomp/i386.asm b/testasmcomp/i386.asm deleted file mode 100644 index c1ce85c537..0000000000 --- a/testasmcomp/i386.asm +++ /dev/null @@ -1,31 +0,0 @@ - .globl _call_gen_code - .align 4 -_call_gen_code: - pushl %ebp - movl %esp,%ebp - pushl %ebx - pushl %esi - pushl %edi - movl 12(%ebp),%eax - movl 16(%ebp),%ebx - movl 20(%ebp),%ecx - movl 24(%ebp),%edx - fldz - fldz - fldz - fldz - call *8(%ebp) - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - - .globl _caml_c_call - .align 4 -_caml_c_call: - jmp *%eax - - .comm _caml_exception_pointer, 4 - .comm _young_ptr, 4 - .comm _young_start, 4 diff --git a/testasmcomp/integr.cmm b/testasmcomp/integr.cmm deleted file mode 100644 index 6334b35079..0000000000 --- a/testasmcomp/integr.cmm +++ /dev/null @@ -1,16 +0,0 @@ -(function "square" (x: float) - ( *f x x)) - -(function "integr" (f: addr low: float high: float n: int) - (let (h (/f (-f high low) (floatofint n)) - x low - s 0.0 - i n) - (while (> i 0) - (assign s (+f s (app f x float))) - (assign x (+f x h)) - (assign i (- i 1))) - ( *f s h))) - -(function "test" (n: int) - (app "integr" ["square" 0.0 1.0 n] float)) diff --git a/testasmcomp/quicksort.cmm b/testasmcomp/quicksort.cmm deleted file mode 100644 index bee443a746..0000000000 --- a/testasmcomp/quicksort.cmm +++ /dev/null @@ -1,21 +0,0 @@ -(function "quicksort" (lo: int hi: int a: addr) - (if (< lo hi) - (let (i lo - j hi - pivot (addraref a hi)) - (while (< i j) - (while (if (< i hi) (<= (addraref a i) pivot) 0) - (assign i (+ i 1))) - (while (if (> j lo) (>= (addraref a j) pivot) 0) - (assign j (- j 1))) - (if (< i j) - (let temp (addraref a i) - (addraset a i (addraref a j)) - (addraset a j temp)) - [])) - (let temp (addraref a i) - (addraset a i (addraref a hi)) - (addraset a hi temp)) - (app "quicksort" [lo (- i 1) a] unit) - (app "quicksort" [(+ i 1) hi a] unit)) - [])) diff --git a/testasmcomp/quicksort2.cmm b/testasmcomp/quicksort2.cmm deleted file mode 100644 index 187460faa0..0000000000 --- a/testasmcomp/quicksort2.cmm +++ /dev/null @@ -1,27 +0,0 @@ -(function "cmp" (i: int j: int) - (- i j)) - -(function "quick" (lo: int hi: int a: addr cmp: addr) - (if (< lo hi) - (let (i lo - j hi - pivot (addraref a hi)) - (while (< i j) - (while (if (< i hi) (<= (app cmp [(addraref a i) pivot] int) 0) 0) - (assign i (+ i 1))) - (while (if (> j lo) (>= (app cmp [(addraref a j) pivot] int) 0) 0) - (assign j (- j 1))) - (if (< i j) - (let temp (addraref a i) - (addraset a i (addraref a j)) - (addraset a j temp)) - [])) - (let temp (addraref a i) - (addraset a i (addraref a hi)) - (addraset a hi temp)) - (app "quick" [lo (- i 1) a cmp] unit) - (app "quick" [(+ i 1) hi a cmp] unit)) - [])) - -(function "quicksort" (lo: int hi: int a: addr) - (app "quick" [lo hi a "cmp"] unit)) diff --git a/testasmcomp/soli.cmm b/testasmcomp/soli.cmm deleted file mode 100644 index 20313d3afd..0000000000 --- a/testasmcomp/soli.cmm +++ /dev/null @@ -1,93 +0,0 @@ -("d1": int 0 int 1 - "d2": int 1 int 0 - "d3": int 0 int -1 - "d4": int -1 int 0 - "dir": addr "d1" addr "d2" addr "d3" addr "d4") - -("counter": int 0) - -(* Out = 0 Empty = 1 Peg = 2 *) - -("line0": int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0 - "line1": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0 - "line2": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0 - "line3": int 0 int 2 int 2 int 2 int 2 int 2 int 2 int 2 int 0 - "line4": int 0 int 2 int 2 int 2 int 1 int 2 int 2 int 2 int 0 - "line5": int 0 int 2 int 2 int 2 int 2 int 2 int 2 int 2 int 0 - "line6": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0 - "line7": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0 - "line8": int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0 - "board": addr "line0" addr "line1" addr "line2" addr "line3" - addr "line4" addr "line5" addr "line6" addr "line7" addr "line8") - -("format": string "%d\n\000") - -(function "solve" (m: int) - (store "counter" (+ (load "counter" int) 1)) - (if (== m 31) - (== (intaref (addraref "board" 4) 4) 2) - (try - (if (== (mod (load "counter" int) 500) 0) - (extcall "printf" ["format" (load "counter" int)] unit) - []) - (let i 1 - (while (<= i 7) - (let j 1 - (while (<= j 7) - (if (== (intaref (addraref "board" i) j) 2) - (seq - (let k 0 - (while (<= k 3) - (let (d1 (intaref (addraref "dir" k) 0) - d2 (intaref (addraref "dir" k) 1) - i1 (+ i d1) - i2 (+ i1 d1) - j1 (+ j d2) - j2 (+ j1 d2)) - (if (== (intaref (addraref "board" i1) j1) 2) - (if (== (intaref (addraref "board" i2) j2) 1) - (seq - (intaset (addraref "board" i) j 1) - (intaset (addraref "board" i1) j1 1) - (intaset (addraref "board" i2) j2 2) - (if (app "solve" (+ m 1) int) - (raise 0a) - []) - (intaset (addraref "board" i) j 2) - (intaset (addraref "board" i1) j1 2) - (intaset (addraref "board" i2) j2 1)) - []) - [])) - (assign k (+ k 1))))) - []) - (assign j (+ j 1)))) - (assign i (+ i 1)))) - 0 - with bucket - 1))) - -("format_out": string ".\000") -("format_empty": string " \000") -("format_peg": string "$\000") -("format_newline": string "\n\000") - -(function "print_board" () - (let i 0 - (while (< i 9) - (let j 0 - (while (< j 9) - (switch 3 (intaref (addraref "board" i) j) - case 0: - (extcall "printf" "format_out" unit) - case 1: - (extcall "printf" "format_empty" unit) - case 2: - (extcall "printf" "format_peg" unit)) - (assign j (+ j 1)))) - (extcall "printf" "format_newline" unit) - (assign i (+ i 1))))) - -(function "solitaire" () - (if (app "solve" 0 int) - (app "print_board" [] unit) - [])) diff --git a/testasmcomp/sparc.asm b/testasmcomp/sparc.asm deleted file mode 100644 index 42776808c0..0000000000 --- a/testasmcomp/sparc.asm +++ /dev/null @@ -1,19 +0,0 @@ - .global _call_gen_code -_call_gen_code: - save %sp, -96, %sp - mov %i0, %l0 - mov %i1, %i0 - mov %i2, %i1 - mov %i3, %i2 - mov %i4, %i3 - mov %i5, %i4 - call %l0 - nop - mov %o0, %i0 - ret - restore - - .global _caml_c_call -_caml_c_call: - jmp %g1 - nop diff --git a/testasmcomp/tak.cmm b/testasmcomp/tak.cmm deleted file mode 100644 index 34f79ae0d0..0000000000 --- a/testasmcomp/tak.cmm +++ /dev/null @@ -1,9 +0,0 @@ -(function "tak" (x:int y:int z:int) - (if (> x y) - (app "tak" [(app "tak" [(- x 1) y z] int) - (app "tak" [(- y 1) z x] int) - (app "tak" [(- z 1) x y] int)] int) - z)) - -(function "takmain" (dummy: int) - (app "tak" [18 12 6] int)) |
