source: rtems/c/src/lib/libcpu/sparc/access/access.S @ 1549beb

5
Last change on this file since 1549beb was 8639685, checked in by Jacob Hansen <jacob.hansen@…>, on 10/28/16 at 14:05:56

sparc: Adjust assembly to improve compability with LLVM

  • All references of %0 changed to %g0
  • 'call label,0' changed to 'call label'. According to the sparc specification call does not take any registers
  • '.seg "text"' changed to '.section ".text"'
  • the synonym stub is replaced with stb
  • the synonym stuh is replaced with sth
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Optimized access routines for SPARC.
3 *
4 *  Note the difference between byteorder.h (inlined functions) and access.S
5 *  where the functions will be declared in the library archive librtemscpu.a.
6 *  Function names starting with _ are in library and can be referenced by
7 *  function pointers.
8 *
9 *  _ldN, _stN          standard machine endianess access (SPARC: big-endian)
10 *  _ld_beN, _st_beN    forced big-endian
11 *  _ld_leN, _st_leN    forced little-endian (defined in access_le.C)
12 *
13 *  This file is written in assembly because the big-endian functions maps to
14 *  machine dependant access methods, i.e. same function has two names.
15 *
16 *  COPYRIGHT (c) 2011
17 *  Aeroflex Gaisler.
18 *
19 *  The license and distribution terms for this file may be
20 *  found in the file LICENSE in this distribution or at
21 *  http://www.rtems.org/license/LICENSE.
22 */
23
24#include <rtems/asm.h>
25
26        .align 4
27        .section ".text"
28        PUBLIC(_ld8)
29        PUBLIC(_ld16)
30        PUBLIC(_ld32)
31        PUBLIC(_ld64)
32        PUBLIC(_st8)
33        PUBLIC(_st16)
34        PUBLIC(_st32)
35        PUBLIC(_st64)
36        PUBLIC(_ld_be16)
37        PUBLIC(_ld_be32)
38        PUBLIC(_ld_be64)
39        PUBLIC(_st_be16)
40        PUBLIC(_st_be32)
41        PUBLIC(_st_be64)
42
43SYM(_ld8):
44        retl
45         ldub [%o0], %o0
46
47SYM(_ld_be16):
48SYM(_ld16):
49        retl
50         lduh [%o0], %o0
51
52SYM(_ld_be32):
53SYM(_ld32):
54        retl
55         ld [%o0], %o0
56
57SYM(_ld_be64):
58SYM(_ld64):
59        retl
60         ldd [%o0], %o0
61
62SYM(_st8):
63        retl
64         stb %o1, [%o0]
65
66SYM(_st_be16):
67SYM(_st16):
68        retl
69         sth %o1, [%o0]
70
71SYM(_st_be32):
72SYM(_st32):
73        retl
74         st %o1, [%o0]
75
76SYM(_st_be64):
77SYM(_st64):
78        mov %o2, %o3
79        mov %o1, %o2
80        retl
81         std %o2, [%o0]
Note: See TracBrowser for help on using the repository browser.