2 * Copyright (c) 2010 Mans Rullgard <mans@mansr.com>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVUTIL_TOMI_INTREADWRITE_H
22 #define AVUTIL_TOMI_INTREADWRITE_H
27 #define AV_RB16 AV_RB16
28 static av_always_inline uint16_t AV_RB16(const void *p)
31 __asm__ ("loadacc, (%1+) \n\t"
40 #define AV_WB16 AV_WB16
41 static av_always_inline void AV_WB16(void *p, uint16_t v)
43 __asm__ volatile ("loadacc, %1 \n\t"
45 "storeacc, (%0+) \n\t"
47 "storeacc, (%0+) \n\t"
51 #define AV_RL16 AV_RL16
52 static av_always_inline uint16_t AV_RL16(const void *p)
55 __asm__ ("loadacc, (%1+) \n\t"
64 #define AV_WL16 AV_WL16
65 static av_always_inline void AV_WL16(void *p, uint16_t v)
67 __asm__ volatile ("loadacc, %1 \n\t"
68 "storeacc, (%0+) \n\t"
70 "storeacc, (%0+) \n\t"
74 #define AV_RB32 AV_RB32
75 static av_always_inline uint32_t AV_RB32(const void *p)
78 __asm__ ("loadacc, (%1+) \n\t"
96 #define AV_WB32 AV_WB32
97 static av_always_inline void AV_WB32(void *p, uint32_t v)
99 __asm__ volatile ("loadacc, #4 \n\t"
102 "storeacc, (-%0) \n\t"
104 "storeacc, (-%0) \n\t"
106 "storeacc, (-%0) \n\t"
108 "storeacc, (-%0) \n\t"
109 : "+&a"(p) : "r"(v));
112 #define AV_RL32 AV_RL32
113 static av_always_inline uint32_t AV_RL32(const void *p)
116 __asm__ ("loadacc, (%1+) \n\t"
118 "loadacc, (%1+) \n\t"
121 "loadacc, (%1+) \n\t"
125 "loadacc, (%1+) \n\t"
134 #define AV_WL32 AV_WL32
135 static av_always_inline void AV_WL32(void *p, uint32_t v)
137 __asm__ volatile ("loadacc, %1 \n\t"
138 "storeacc, (%0+) \n\t"
140 "storeacc, (%0+) \n\t"
142 "storeacc, (%0+) \n\t"
144 "storeacc, (%0+) \n\t"
145 : "+&a"(p) : "r"(v));
148 #endif /* AVUTIL_TOMI_INTREADWRITE_H */