xref: /openbmc/qemu/include/tcg/tcg-ldst.h (revision ed75658a)
1 /*
2  * Memory helpers that will be used by TCG generated code.
3  *
4  * Copyright (c) 2008 Fabrice Bellard
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TCG_LDST_H
26 #define TCG_LDST_H
27 
28 /* Value zero-extended to tcg register size.  */
29 tcg_target_ulong helper_ldub_mmu(CPUArchState *env, uint64_t addr,
30                                  MemOpIdx oi, uintptr_t retaddr);
31 tcg_target_ulong helper_lduw_mmu(CPUArchState *env, uint64_t addr,
32                                  MemOpIdx oi, uintptr_t retaddr);
33 tcg_target_ulong helper_ldul_mmu(CPUArchState *env, uint64_t addr,
34                                  MemOpIdx oi, uintptr_t retaddr);
35 uint64_t helper_ldq_mmu(CPUArchState *env, uint64_t addr,
36                         MemOpIdx oi, uintptr_t retaddr);
37 Int128 helper_ld16_mmu(CPUArchState *env, uint64_t addr,
38                        MemOpIdx oi, uintptr_t retaddr);
39 
40 /* Value sign-extended to tcg register size.  */
41 tcg_target_ulong helper_ldsb_mmu(CPUArchState *env, uint64_t addr,
42                                  MemOpIdx oi, uintptr_t retaddr);
43 tcg_target_ulong helper_ldsw_mmu(CPUArchState *env, uint64_t addr,
44                                  MemOpIdx oi, uintptr_t retaddr);
45 tcg_target_ulong helper_ldsl_mmu(CPUArchState *env, uint64_t addr,
46                                  MemOpIdx oi, uintptr_t retaddr);
47 
48 /*
49  * Value extended to at least uint32_t, so that some ABIs do not require
50  * zero-extension from uint8_t or uint16_t.
51  */
52 void helper_stb_mmu(CPUArchState *env, uint64_t addr, uint32_t val,
53                     MemOpIdx oi, uintptr_t retaddr);
54 void helper_stw_mmu(CPUArchState *env, uint64_t addr, uint32_t val,
55                     MemOpIdx oi, uintptr_t retaddr);
56 void helper_stl_mmu(CPUArchState *env, uint64_t addr, uint32_t val,
57                     MemOpIdx oi, uintptr_t retaddr);
58 void helper_stq_mmu(CPUArchState *env, uint64_t addr, uint64_t val,
59                     MemOpIdx oi, uintptr_t retaddr);
60 void helper_st16_mmu(CPUArchState *env, uint64_t addr, Int128 val,
61                      MemOpIdx oi, uintptr_t retaddr);
62 
63 #endif /* TCG_LDST_H */
64