remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / unmaintained / arm / 4 / 4.factor
blob0d317fd5530c807f4f3e1941f30fb1acdf6dab05
1 ! Copyright (C) 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien arrays cpu.architecture cpu.arm.assembler
4 cpu.arm.architecture cpu.arm5.assembler kernel kernel.private
5 math math.private namespaces sequences words quotations
6 byte-arrays hashtables.private hashtables generator
7 generator.registers generator.fixup sequences.private
8 strings.private ;
9 IN: cpu.arm4
11 : (%char-slot)
12     "out" operand string-offset MOV
13     "out" operand dup "n" operand 2 <LSR> ADD ;
15 \ char-slot [
16     (%char-slot)
17     "out" operand "obj" operand "out" operand <+> LDRH
18     "out" operand dup %tag-fixnum
19 ] H{
20     { +input+ { { f "n" } { f "obj" } } }
21     { +scratch+ { { f "out" } } }
22     { +output+ { "out" } }
23 } define-intrinsic
25 \ set-char-slot [
26     "val" operand dup %untag-fixnum
27     (%char-slot)
28     "val" operand "obj" operand "out" operand <+> STRH
29 ] H{
30     { +input+ { { f "val" } { f "n" } { f "obj" } } }
31     { +scratch+ { { f "out" } } }
32     { +clobber+ { "val" } }
33 } define-intrinsic
35 \ alien-signed-1 [ LDRSB ]
36 \ set-alien-signed-1 [ STRB ]
37 define-alien-integer-intrinsics
39 \ alien-unsigned-2 [ LDRH ]
40 \ set-alien-unsigned-2 [ STRH ]
41 define-alien-integer-intrinsics
43 \ alien-signed-2 [ LDRSH ]
44 \ set-alien-signed-2 [ STRH ]
45 define-alien-integer-intrinsics