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
12 "out" operand string-offset MOV
13 "out" operand dup "n" operand 2 <LSR> ADD ;
17 "out" operand "obj" operand "out" operand <+> LDRH
18 "out" operand dup %tag-fixnum
20 { +input+ { { f "n" } { f "obj" } } }
21 { +scratch+ { { f "out" } } }
22 { +output+ { "out" } }
26 "val" operand dup %untag-fixnum
28 "val" operand "obj" operand "out" operand <+> STRH
30 { +input+ { { f "val" } { f "n" } { f "obj" } } }
31 { +scratch+ { { f "out" } } }
32 { +clobber+ { "val" } }
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