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