1ad3d0e4dSRichard Henderson /* SPDX-License-Identifier: MIT */ 2ad3d0e4dSRichard Henderson /* 3ad3d0e4dSRichard Henderson * Target independent opcode generation functions. 4ad3d0e4dSRichard Henderson * 5ad3d0e4dSRichard Henderson * Copyright (c) 2008 Fabrice Bellard 6ad3d0e4dSRichard Henderson */ 7ad3d0e4dSRichard Henderson 8ad3d0e4dSRichard Henderson #ifndef TCG_TCG_OP_COMMON_H 9ad3d0e4dSRichard Henderson #define TCG_TCG_OP_COMMON_H 10ad3d0e4dSRichard Henderson 11ad3d0e4dSRichard Henderson #include "tcg/tcg.h" 12c213ee2dSRichard Henderson #include "exec/helper-proto-common.h" 13e4eff8e4SRichard Henderson #include "exec/helper-gen-common.h" 14ad3d0e4dSRichard Henderson 15ad3d0e4dSRichard Henderson /* Basic output routines. Not for general consumption. */ 16ad3d0e4dSRichard Henderson 17ad3d0e4dSRichard Henderson void tcg_gen_op1(TCGOpcode, TCGArg); 18ad3d0e4dSRichard Henderson void tcg_gen_op2(TCGOpcode, TCGArg, TCGArg); 19ad3d0e4dSRichard Henderson void tcg_gen_op3(TCGOpcode, TCGArg, TCGArg, TCGArg); 20ad3d0e4dSRichard Henderson void tcg_gen_op4(TCGOpcode, TCGArg, TCGArg, TCGArg, TCGArg); 21ad3d0e4dSRichard Henderson void tcg_gen_op5(TCGOpcode, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg); 22ad3d0e4dSRichard Henderson void tcg_gen_op6(TCGOpcode, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg, TCGArg); 23ad3d0e4dSRichard Henderson 24ad3d0e4dSRichard Henderson void vec_gen_2(TCGOpcode, TCGType, unsigned, TCGArg, TCGArg); 25ad3d0e4dSRichard Henderson void vec_gen_3(TCGOpcode, TCGType, unsigned, TCGArg, TCGArg, TCGArg); 26ad3d0e4dSRichard Henderson void vec_gen_4(TCGOpcode, TCGType, unsigned, TCGArg, TCGArg, TCGArg, TCGArg); 27ad3d0e4dSRichard Henderson 28ad3d0e4dSRichard Henderson static inline void tcg_gen_op1_i32(TCGOpcode opc, TCGv_i32 a1) 29ad3d0e4dSRichard Henderson { 30ad3d0e4dSRichard Henderson tcg_gen_op1(opc, tcgv_i32_arg(a1)); 31ad3d0e4dSRichard Henderson } 32ad3d0e4dSRichard Henderson 33ad3d0e4dSRichard Henderson static inline void tcg_gen_op1_i64(TCGOpcode opc, TCGv_i64 a1) 34ad3d0e4dSRichard Henderson { 35ad3d0e4dSRichard Henderson tcg_gen_op1(opc, tcgv_i64_arg(a1)); 36ad3d0e4dSRichard Henderson } 37ad3d0e4dSRichard Henderson 38ad3d0e4dSRichard Henderson static inline void tcg_gen_op1i(TCGOpcode opc, TCGArg a1) 39ad3d0e4dSRichard Henderson { 40ad3d0e4dSRichard Henderson tcg_gen_op1(opc, a1); 41ad3d0e4dSRichard Henderson } 42ad3d0e4dSRichard Henderson 43ad3d0e4dSRichard Henderson static inline void tcg_gen_op2_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2) 44ad3d0e4dSRichard Henderson { 45ad3d0e4dSRichard Henderson tcg_gen_op2(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2)); 46ad3d0e4dSRichard Henderson } 47ad3d0e4dSRichard Henderson 48ad3d0e4dSRichard Henderson static inline void tcg_gen_op2_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2) 49ad3d0e4dSRichard Henderson { 50ad3d0e4dSRichard Henderson tcg_gen_op2(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2)); 51ad3d0e4dSRichard Henderson } 52ad3d0e4dSRichard Henderson 53ad3d0e4dSRichard Henderson static inline void tcg_gen_op2i_i32(TCGOpcode opc, TCGv_i32 a1, TCGArg a2) 54ad3d0e4dSRichard Henderson { 55ad3d0e4dSRichard Henderson tcg_gen_op2(opc, tcgv_i32_arg(a1), a2); 56ad3d0e4dSRichard Henderson } 57ad3d0e4dSRichard Henderson 58ad3d0e4dSRichard Henderson static inline void tcg_gen_op2i_i64(TCGOpcode opc, TCGv_i64 a1, TCGArg a2) 59ad3d0e4dSRichard Henderson { 60ad3d0e4dSRichard Henderson tcg_gen_op2(opc, tcgv_i64_arg(a1), a2); 61ad3d0e4dSRichard Henderson } 62ad3d0e4dSRichard Henderson 63ad3d0e4dSRichard Henderson static inline void tcg_gen_op2ii(TCGOpcode opc, TCGArg a1, TCGArg a2) 64ad3d0e4dSRichard Henderson { 65ad3d0e4dSRichard Henderson tcg_gen_op2(opc, a1, a2); 66ad3d0e4dSRichard Henderson } 67ad3d0e4dSRichard Henderson 68ad3d0e4dSRichard Henderson static inline void tcg_gen_op3_i32(TCGOpcode opc, TCGv_i32 a1, 69ad3d0e4dSRichard Henderson TCGv_i32 a2, TCGv_i32 a3) 70ad3d0e4dSRichard Henderson { 71ad3d0e4dSRichard Henderson tcg_gen_op3(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), tcgv_i32_arg(a3)); 72ad3d0e4dSRichard Henderson } 73ad3d0e4dSRichard Henderson 74ad3d0e4dSRichard Henderson static inline void tcg_gen_op3_i64(TCGOpcode opc, TCGv_i64 a1, 75ad3d0e4dSRichard Henderson TCGv_i64 a2, TCGv_i64 a3) 76ad3d0e4dSRichard Henderson { 77ad3d0e4dSRichard Henderson tcg_gen_op3(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), tcgv_i64_arg(a3)); 78ad3d0e4dSRichard Henderson } 79ad3d0e4dSRichard Henderson 80ad3d0e4dSRichard Henderson static inline void tcg_gen_op3i_i32(TCGOpcode opc, TCGv_i32 a1, 81ad3d0e4dSRichard Henderson TCGv_i32 a2, TCGArg a3) 82ad3d0e4dSRichard Henderson { 83ad3d0e4dSRichard Henderson tcg_gen_op3(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), a3); 84ad3d0e4dSRichard Henderson } 85ad3d0e4dSRichard Henderson 86ad3d0e4dSRichard Henderson static inline void tcg_gen_op3i_i64(TCGOpcode opc, TCGv_i64 a1, 87ad3d0e4dSRichard Henderson TCGv_i64 a2, TCGArg a3) 88ad3d0e4dSRichard Henderson { 89ad3d0e4dSRichard Henderson tcg_gen_op3(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), a3); 90ad3d0e4dSRichard Henderson } 91ad3d0e4dSRichard Henderson 92ad3d0e4dSRichard Henderson static inline void tcg_gen_ldst_op_i32(TCGOpcode opc, TCGv_i32 val, 93ad3d0e4dSRichard Henderson TCGv_ptr base, TCGArg offset) 94ad3d0e4dSRichard Henderson { 95ad3d0e4dSRichard Henderson tcg_gen_op3(opc, tcgv_i32_arg(val), tcgv_ptr_arg(base), offset); 96ad3d0e4dSRichard Henderson } 97ad3d0e4dSRichard Henderson 98ad3d0e4dSRichard Henderson static inline void tcg_gen_ldst_op_i64(TCGOpcode opc, TCGv_i64 val, 99ad3d0e4dSRichard Henderson TCGv_ptr base, TCGArg offset) 100ad3d0e4dSRichard Henderson { 101ad3d0e4dSRichard Henderson tcg_gen_op3(opc, tcgv_i64_arg(val), tcgv_ptr_arg(base), offset); 102ad3d0e4dSRichard Henderson } 103ad3d0e4dSRichard Henderson 104ad3d0e4dSRichard Henderson static inline void tcg_gen_op4_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 105ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGv_i32 a4) 106ad3d0e4dSRichard Henderson { 107ad3d0e4dSRichard Henderson tcg_gen_op4(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 108ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), tcgv_i32_arg(a4)); 109ad3d0e4dSRichard Henderson } 110ad3d0e4dSRichard Henderson 111ad3d0e4dSRichard Henderson static inline void tcg_gen_op4_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 112ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGv_i64 a4) 113ad3d0e4dSRichard Henderson { 114ad3d0e4dSRichard Henderson tcg_gen_op4(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 115ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), tcgv_i64_arg(a4)); 116ad3d0e4dSRichard Henderson } 117ad3d0e4dSRichard Henderson 118ad3d0e4dSRichard Henderson static inline void tcg_gen_op4i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 119ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGArg a4) 120ad3d0e4dSRichard Henderson { 121ad3d0e4dSRichard Henderson tcg_gen_op4(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 122ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), a4); 123ad3d0e4dSRichard Henderson } 124ad3d0e4dSRichard Henderson 125ad3d0e4dSRichard Henderson static inline void tcg_gen_op4i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 126ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGArg a4) 127ad3d0e4dSRichard Henderson { 128ad3d0e4dSRichard Henderson tcg_gen_op4(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 129ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), a4); 130ad3d0e4dSRichard Henderson } 131ad3d0e4dSRichard Henderson 132ad3d0e4dSRichard Henderson static inline void tcg_gen_op4ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 133ad3d0e4dSRichard Henderson TCGArg a3, TCGArg a4) 134ad3d0e4dSRichard Henderson { 135ad3d0e4dSRichard Henderson tcg_gen_op4(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), a3, a4); 136ad3d0e4dSRichard Henderson } 137ad3d0e4dSRichard Henderson 138ad3d0e4dSRichard Henderson static inline void tcg_gen_op4ii_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 139ad3d0e4dSRichard Henderson TCGArg a3, TCGArg a4) 140ad3d0e4dSRichard Henderson { 141ad3d0e4dSRichard Henderson tcg_gen_op4(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), a3, a4); 142ad3d0e4dSRichard Henderson } 143ad3d0e4dSRichard Henderson 144ad3d0e4dSRichard Henderson static inline void tcg_gen_op5_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 145ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGv_i32 a4, TCGv_i32 a5) 146ad3d0e4dSRichard Henderson { 147ad3d0e4dSRichard Henderson tcg_gen_op5(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 148ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5)); 149ad3d0e4dSRichard Henderson } 150ad3d0e4dSRichard Henderson 151ad3d0e4dSRichard Henderson static inline void tcg_gen_op5_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 152ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGv_i64 a4, TCGv_i64 a5) 153ad3d0e4dSRichard Henderson { 154ad3d0e4dSRichard Henderson tcg_gen_op5(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 155ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5)); 156ad3d0e4dSRichard Henderson } 157ad3d0e4dSRichard Henderson 158ad3d0e4dSRichard Henderson static inline void tcg_gen_op5i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 159ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGv_i32 a4, TCGArg a5) 160ad3d0e4dSRichard Henderson { 161ad3d0e4dSRichard Henderson tcg_gen_op5(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 162ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), tcgv_i32_arg(a4), a5); 163ad3d0e4dSRichard Henderson } 164ad3d0e4dSRichard Henderson 165ad3d0e4dSRichard Henderson static inline void tcg_gen_op5i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 166ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGv_i64 a4, TCGArg a5) 167ad3d0e4dSRichard Henderson { 168ad3d0e4dSRichard Henderson tcg_gen_op5(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 169ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), tcgv_i64_arg(a4), a5); 170ad3d0e4dSRichard Henderson } 171ad3d0e4dSRichard Henderson 172ad3d0e4dSRichard Henderson static inline void tcg_gen_op5ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 173ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGArg a4, TCGArg a5) 174ad3d0e4dSRichard Henderson { 175ad3d0e4dSRichard Henderson tcg_gen_op5(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 176ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), a4, a5); 177ad3d0e4dSRichard Henderson } 178ad3d0e4dSRichard Henderson 179ad3d0e4dSRichard Henderson static inline void tcg_gen_op5ii_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 180ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGArg a4, TCGArg a5) 181ad3d0e4dSRichard Henderson { 182ad3d0e4dSRichard Henderson tcg_gen_op5(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 183ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), a4, a5); 184ad3d0e4dSRichard Henderson } 185ad3d0e4dSRichard Henderson 186ad3d0e4dSRichard Henderson static inline void tcg_gen_op6_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 187ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGv_i32 a4, 188ad3d0e4dSRichard Henderson TCGv_i32 a5, TCGv_i32 a6) 189ad3d0e4dSRichard Henderson { 190ad3d0e4dSRichard Henderson tcg_gen_op6(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 191ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5), 192ad3d0e4dSRichard Henderson tcgv_i32_arg(a6)); 193ad3d0e4dSRichard Henderson } 194ad3d0e4dSRichard Henderson 195ad3d0e4dSRichard Henderson static inline void tcg_gen_op6_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 196ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGv_i64 a4, 197ad3d0e4dSRichard Henderson TCGv_i64 a5, TCGv_i64 a6) 198ad3d0e4dSRichard Henderson { 199ad3d0e4dSRichard Henderson tcg_gen_op6(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 200ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5), 201ad3d0e4dSRichard Henderson tcgv_i64_arg(a6)); 202ad3d0e4dSRichard Henderson } 203ad3d0e4dSRichard Henderson 204ad3d0e4dSRichard Henderson static inline void tcg_gen_op6i_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 205ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGv_i32 a4, 206ad3d0e4dSRichard Henderson TCGv_i32 a5, TCGArg a6) 207ad3d0e4dSRichard Henderson { 208ad3d0e4dSRichard Henderson tcg_gen_op6(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 209ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), tcgv_i32_arg(a4), tcgv_i32_arg(a5), a6); 210ad3d0e4dSRichard Henderson } 211ad3d0e4dSRichard Henderson 212ad3d0e4dSRichard Henderson static inline void tcg_gen_op6i_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 213ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGv_i64 a4, 214ad3d0e4dSRichard Henderson TCGv_i64 a5, TCGArg a6) 215ad3d0e4dSRichard Henderson { 216ad3d0e4dSRichard Henderson tcg_gen_op6(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 217ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), tcgv_i64_arg(a4), tcgv_i64_arg(a5), a6); 218ad3d0e4dSRichard Henderson } 219ad3d0e4dSRichard Henderson 220ad3d0e4dSRichard Henderson static inline void tcg_gen_op6ii_i32(TCGOpcode opc, TCGv_i32 a1, TCGv_i32 a2, 221ad3d0e4dSRichard Henderson TCGv_i32 a3, TCGv_i32 a4, 222ad3d0e4dSRichard Henderson TCGArg a5, TCGArg a6) 223ad3d0e4dSRichard Henderson { 224ad3d0e4dSRichard Henderson tcg_gen_op6(opc, tcgv_i32_arg(a1), tcgv_i32_arg(a2), 225ad3d0e4dSRichard Henderson tcgv_i32_arg(a3), tcgv_i32_arg(a4), a5, a6); 226ad3d0e4dSRichard Henderson } 227ad3d0e4dSRichard Henderson 228ad3d0e4dSRichard Henderson static inline void tcg_gen_op6ii_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, 229ad3d0e4dSRichard Henderson TCGv_i64 a3, TCGv_i64 a4, 230ad3d0e4dSRichard Henderson TCGArg a5, TCGArg a6) 231ad3d0e4dSRichard Henderson { 232ad3d0e4dSRichard Henderson tcg_gen_op6(opc, tcgv_i64_arg(a1), tcgv_i64_arg(a2), 233ad3d0e4dSRichard Henderson tcgv_i64_arg(a3), tcgv_i64_arg(a4), a5, a6); 234ad3d0e4dSRichard Henderson } 235ad3d0e4dSRichard Henderson 236ad3d0e4dSRichard Henderson 237ad3d0e4dSRichard Henderson /* Generic ops. */ 238ad3d0e4dSRichard Henderson 239ad3d0e4dSRichard Henderson static inline void gen_set_label(TCGLabel *l) 240ad3d0e4dSRichard Henderson { 241ad3d0e4dSRichard Henderson l->present = 1; 242ad3d0e4dSRichard Henderson tcg_gen_op1(INDEX_op_set_label, label_arg(l)); 243ad3d0e4dSRichard Henderson } 244ad3d0e4dSRichard Henderson 245ad3d0e4dSRichard Henderson void tcg_gen_br(TCGLabel *l); 246ad3d0e4dSRichard Henderson void tcg_gen_mb(TCGBar); 247ad3d0e4dSRichard Henderson 248ad3d0e4dSRichard Henderson /** 249ad3d0e4dSRichard Henderson * tcg_gen_exit_tb() - output exit_tb TCG operation 250ad3d0e4dSRichard Henderson * @tb: The TranslationBlock from which we are exiting 251ad3d0e4dSRichard Henderson * @idx: Direct jump slot index, or exit request 252ad3d0e4dSRichard Henderson * 253ad3d0e4dSRichard Henderson * See tcg/README for more info about this TCG operation. 254ad3d0e4dSRichard Henderson * See also tcg.h and the block comment above TB_EXIT_MASK. 255ad3d0e4dSRichard Henderson * 256ad3d0e4dSRichard Henderson * For a normal exit from the TB, back to the main loop, @tb should 257ad3d0e4dSRichard Henderson * be NULL and @idx should be 0. Otherwise, @tb should be valid and 258ad3d0e4dSRichard Henderson * @idx should be one of the TB_EXIT_ values. 259ad3d0e4dSRichard Henderson */ 260ad3d0e4dSRichard Henderson void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx); 261ad3d0e4dSRichard Henderson 262ad3d0e4dSRichard Henderson /** 263ad3d0e4dSRichard Henderson * tcg_gen_goto_tb() - output goto_tb TCG operation 264ad3d0e4dSRichard Henderson * @idx: Direct jump slot index (0 or 1) 265ad3d0e4dSRichard Henderson * 266ad3d0e4dSRichard Henderson * See tcg/README for more info about this TCG operation. 267ad3d0e4dSRichard Henderson * 268ad3d0e4dSRichard Henderson * NOTE: In softmmu emulation, direct jumps with goto_tb are only safe within 269ad3d0e4dSRichard Henderson * the pages this TB resides in because we don't take care of direct jumps when 270ad3d0e4dSRichard Henderson * address mapping changes, e.g. in tlb_flush(). In user mode, there's only a 271ad3d0e4dSRichard Henderson * static address translation, so the destination address is always valid, TBs 272ad3d0e4dSRichard Henderson * are always invalidated properly, and direct jumps are reset when mapping 273ad3d0e4dSRichard Henderson * changes. 274ad3d0e4dSRichard Henderson */ 275ad3d0e4dSRichard Henderson void tcg_gen_goto_tb(unsigned idx); 276ad3d0e4dSRichard Henderson 277ad3d0e4dSRichard Henderson /** 278ad3d0e4dSRichard Henderson * tcg_gen_lookup_and_goto_ptr() - look up the current TB, jump to it if valid 279ad3d0e4dSRichard Henderson * @addr: Guest address of the target TB 280ad3d0e4dSRichard Henderson * 281ad3d0e4dSRichard Henderson * If the TB is not valid, jump to the epilogue. 282ad3d0e4dSRichard Henderson * 283ad3d0e4dSRichard Henderson * This operation is optional. If the TCG backend does not implement goto_ptr, 284ad3d0e4dSRichard Henderson * this op is equivalent to calling tcg_gen_exit_tb() with 0 as the argument. 285ad3d0e4dSRichard Henderson */ 286ad3d0e4dSRichard Henderson void tcg_gen_lookup_and_goto_ptr(void); 287ad3d0e4dSRichard Henderson 288ad3d0e4dSRichard Henderson static inline void tcg_gen_plugin_cb_start(unsigned from, unsigned type, 289ad3d0e4dSRichard Henderson unsigned wr) 290ad3d0e4dSRichard Henderson { 291ad3d0e4dSRichard Henderson tcg_gen_op3(INDEX_op_plugin_cb_start, from, type, wr); 292ad3d0e4dSRichard Henderson } 293ad3d0e4dSRichard Henderson 294ad3d0e4dSRichard Henderson static inline void tcg_gen_plugin_cb_end(void) 295ad3d0e4dSRichard Henderson { 296ad3d0e4dSRichard Henderson tcg_emit_op(INDEX_op_plugin_cb_end, 0); 297ad3d0e4dSRichard Henderson } 298ad3d0e4dSRichard Henderson 299ad3d0e4dSRichard Henderson /* 32 bit ops */ 300ad3d0e4dSRichard Henderson 301ad3d0e4dSRichard Henderson void tcg_gen_movi_i32(TCGv_i32 ret, int32_t arg); 302ad3d0e4dSRichard Henderson void tcg_gen_addi_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 303ad3d0e4dSRichard Henderson void tcg_gen_subfi_i32(TCGv_i32 ret, int32_t arg1, TCGv_i32 arg2); 304ad3d0e4dSRichard Henderson void tcg_gen_subi_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 305ad3d0e4dSRichard Henderson void tcg_gen_andi_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 306ad3d0e4dSRichard Henderson void tcg_gen_ori_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 307ad3d0e4dSRichard Henderson void tcg_gen_xori_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 308ad3d0e4dSRichard Henderson void tcg_gen_shli_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 309ad3d0e4dSRichard Henderson void tcg_gen_shri_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 310ad3d0e4dSRichard Henderson void tcg_gen_sari_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 311ad3d0e4dSRichard Henderson void tcg_gen_muli_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 312ad3d0e4dSRichard Henderson void tcg_gen_div_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 313ad3d0e4dSRichard Henderson void tcg_gen_rem_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 314ad3d0e4dSRichard Henderson void tcg_gen_divu_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 315ad3d0e4dSRichard Henderson void tcg_gen_remu_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 316ad3d0e4dSRichard Henderson void tcg_gen_andc_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 317ad3d0e4dSRichard Henderson void tcg_gen_eqv_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 318ad3d0e4dSRichard Henderson void tcg_gen_nand_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 319ad3d0e4dSRichard Henderson void tcg_gen_nor_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 320ad3d0e4dSRichard Henderson void tcg_gen_orc_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 321ad3d0e4dSRichard Henderson void tcg_gen_clz_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 322ad3d0e4dSRichard Henderson void tcg_gen_ctz_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 323ad3d0e4dSRichard Henderson void tcg_gen_clzi_i32(TCGv_i32 ret, TCGv_i32 arg1, uint32_t arg2); 324ad3d0e4dSRichard Henderson void tcg_gen_ctzi_i32(TCGv_i32 ret, TCGv_i32 arg1, uint32_t arg2); 325ad3d0e4dSRichard Henderson void tcg_gen_clrsb_i32(TCGv_i32 ret, TCGv_i32 arg); 326ad3d0e4dSRichard Henderson void tcg_gen_ctpop_i32(TCGv_i32 a1, TCGv_i32 a2); 327ad3d0e4dSRichard Henderson void tcg_gen_rotl_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 328ad3d0e4dSRichard Henderson void tcg_gen_rotli_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 329ad3d0e4dSRichard Henderson void tcg_gen_rotr_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); 330ad3d0e4dSRichard Henderson void tcg_gen_rotri_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); 331ad3d0e4dSRichard Henderson void tcg_gen_deposit_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2, 332ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 333ad3d0e4dSRichard Henderson void tcg_gen_deposit_z_i32(TCGv_i32 ret, TCGv_i32 arg, 334ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 335ad3d0e4dSRichard Henderson void tcg_gen_extract_i32(TCGv_i32 ret, TCGv_i32 arg, 336ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 337ad3d0e4dSRichard Henderson void tcg_gen_sextract_i32(TCGv_i32 ret, TCGv_i32 arg, 338ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 339ad3d0e4dSRichard Henderson void tcg_gen_extract2_i32(TCGv_i32 ret, TCGv_i32 al, TCGv_i32 ah, 340ad3d0e4dSRichard Henderson unsigned int ofs); 341ad3d0e4dSRichard Henderson void tcg_gen_brcond_i32(TCGCond cond, TCGv_i32 arg1, TCGv_i32 arg2, TCGLabel *); 342ad3d0e4dSRichard Henderson void tcg_gen_brcondi_i32(TCGCond cond, TCGv_i32 arg1, int32_t arg2, TCGLabel *); 343ad3d0e4dSRichard Henderson void tcg_gen_setcond_i32(TCGCond cond, TCGv_i32 ret, 344ad3d0e4dSRichard Henderson TCGv_i32 arg1, TCGv_i32 arg2); 345ad3d0e4dSRichard Henderson void tcg_gen_setcondi_i32(TCGCond cond, TCGv_i32 ret, 346ad3d0e4dSRichard Henderson TCGv_i32 arg1, int32_t arg2); 347*3635502dSRichard Henderson void tcg_gen_negsetcond_i32(TCGCond cond, TCGv_i32 ret, 348*3635502dSRichard Henderson TCGv_i32 arg1, TCGv_i32 arg2); 349ad3d0e4dSRichard Henderson void tcg_gen_movcond_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 c1, 350ad3d0e4dSRichard Henderson TCGv_i32 c2, TCGv_i32 v1, TCGv_i32 v2); 351ad3d0e4dSRichard Henderson void tcg_gen_add2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al, 352ad3d0e4dSRichard Henderson TCGv_i32 ah, TCGv_i32 bl, TCGv_i32 bh); 353ad3d0e4dSRichard Henderson void tcg_gen_sub2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al, 354ad3d0e4dSRichard Henderson TCGv_i32 ah, TCGv_i32 bl, TCGv_i32 bh); 355ad3d0e4dSRichard Henderson void tcg_gen_mulu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2); 356ad3d0e4dSRichard Henderson void tcg_gen_muls2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2); 357ad3d0e4dSRichard Henderson void tcg_gen_mulsu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2); 358ad3d0e4dSRichard Henderson void tcg_gen_ext8s_i32(TCGv_i32 ret, TCGv_i32 arg); 359ad3d0e4dSRichard Henderson void tcg_gen_ext16s_i32(TCGv_i32 ret, TCGv_i32 arg); 360ad3d0e4dSRichard Henderson void tcg_gen_ext8u_i32(TCGv_i32 ret, TCGv_i32 arg); 361ad3d0e4dSRichard Henderson void tcg_gen_ext16u_i32(TCGv_i32 ret, TCGv_i32 arg); 362ad3d0e4dSRichard Henderson void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags); 363ad3d0e4dSRichard Henderson void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg); 364ad3d0e4dSRichard Henderson void tcg_gen_hswap_i32(TCGv_i32 ret, TCGv_i32 arg); 365ad3d0e4dSRichard Henderson void tcg_gen_smin_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2); 366ad3d0e4dSRichard Henderson void tcg_gen_smax_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2); 367ad3d0e4dSRichard Henderson void tcg_gen_umin_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2); 368ad3d0e4dSRichard Henderson void tcg_gen_umax_i32(TCGv_i32, TCGv_i32 arg1, TCGv_i32 arg2); 369ad3d0e4dSRichard Henderson void tcg_gen_abs_i32(TCGv_i32, TCGv_i32); 370ad3d0e4dSRichard Henderson 371ad3d0e4dSRichard Henderson /* Replicate a value of size @vece from @in to all the lanes in @out */ 372ad3d0e4dSRichard Henderson void tcg_gen_dup_i32(unsigned vece, TCGv_i32 out, TCGv_i32 in); 373ad3d0e4dSRichard Henderson 374ad3d0e4dSRichard Henderson static inline void tcg_gen_discard_i32(TCGv_i32 arg) 375ad3d0e4dSRichard Henderson { 376ad3d0e4dSRichard Henderson tcg_gen_op1_i32(INDEX_op_discard, arg); 377ad3d0e4dSRichard Henderson } 378ad3d0e4dSRichard Henderson 379ad3d0e4dSRichard Henderson static inline void tcg_gen_mov_i32(TCGv_i32 ret, TCGv_i32 arg) 380ad3d0e4dSRichard Henderson { 381ad3d0e4dSRichard Henderson if (ret != arg) { 382ad3d0e4dSRichard Henderson tcg_gen_op2_i32(INDEX_op_mov_i32, ret, arg); 383ad3d0e4dSRichard Henderson } 384ad3d0e4dSRichard Henderson } 385ad3d0e4dSRichard Henderson 386ad3d0e4dSRichard Henderson static inline void tcg_gen_ld8u_i32(TCGv_i32 ret, TCGv_ptr arg2, 387ad3d0e4dSRichard Henderson tcg_target_long offset) 388ad3d0e4dSRichard Henderson { 389ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_ld8u_i32, ret, arg2, offset); 390ad3d0e4dSRichard Henderson } 391ad3d0e4dSRichard Henderson 392ad3d0e4dSRichard Henderson static inline void tcg_gen_ld8s_i32(TCGv_i32 ret, TCGv_ptr arg2, 393ad3d0e4dSRichard Henderson tcg_target_long offset) 394ad3d0e4dSRichard Henderson { 395ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_ld8s_i32, ret, arg2, offset); 396ad3d0e4dSRichard Henderson } 397ad3d0e4dSRichard Henderson 398ad3d0e4dSRichard Henderson static inline void tcg_gen_ld16u_i32(TCGv_i32 ret, TCGv_ptr arg2, 399ad3d0e4dSRichard Henderson tcg_target_long offset) 400ad3d0e4dSRichard Henderson { 401ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_ld16u_i32, ret, arg2, offset); 402ad3d0e4dSRichard Henderson } 403ad3d0e4dSRichard Henderson 404ad3d0e4dSRichard Henderson static inline void tcg_gen_ld16s_i32(TCGv_i32 ret, TCGv_ptr arg2, 405ad3d0e4dSRichard Henderson tcg_target_long offset) 406ad3d0e4dSRichard Henderson { 407ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_ld16s_i32, ret, arg2, offset); 408ad3d0e4dSRichard Henderson } 409ad3d0e4dSRichard Henderson 410ad3d0e4dSRichard Henderson static inline void tcg_gen_ld_i32(TCGv_i32 ret, TCGv_ptr arg2, 411ad3d0e4dSRichard Henderson tcg_target_long offset) 412ad3d0e4dSRichard Henderson { 413ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_ld_i32, ret, arg2, offset); 414ad3d0e4dSRichard Henderson } 415ad3d0e4dSRichard Henderson 416ad3d0e4dSRichard Henderson static inline void tcg_gen_st8_i32(TCGv_i32 arg1, TCGv_ptr arg2, 417ad3d0e4dSRichard Henderson tcg_target_long offset) 418ad3d0e4dSRichard Henderson { 419ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_st8_i32, arg1, arg2, offset); 420ad3d0e4dSRichard Henderson } 421ad3d0e4dSRichard Henderson 422ad3d0e4dSRichard Henderson static inline void tcg_gen_st16_i32(TCGv_i32 arg1, TCGv_ptr arg2, 423ad3d0e4dSRichard Henderson tcg_target_long offset) 424ad3d0e4dSRichard Henderson { 425ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_st16_i32, arg1, arg2, offset); 426ad3d0e4dSRichard Henderson } 427ad3d0e4dSRichard Henderson 428ad3d0e4dSRichard Henderson static inline void tcg_gen_st_i32(TCGv_i32 arg1, TCGv_ptr arg2, 429ad3d0e4dSRichard Henderson tcg_target_long offset) 430ad3d0e4dSRichard Henderson { 431ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i32(INDEX_op_st_i32, arg1, arg2, offset); 432ad3d0e4dSRichard Henderson } 433ad3d0e4dSRichard Henderson 434ad3d0e4dSRichard Henderson static inline void tcg_gen_add_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 435ad3d0e4dSRichard Henderson { 436ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_add_i32, ret, arg1, arg2); 437ad3d0e4dSRichard Henderson } 438ad3d0e4dSRichard Henderson 439ad3d0e4dSRichard Henderson static inline void tcg_gen_sub_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 440ad3d0e4dSRichard Henderson { 441ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_sub_i32, ret, arg1, arg2); 442ad3d0e4dSRichard Henderson } 443ad3d0e4dSRichard Henderson 444ad3d0e4dSRichard Henderson static inline void tcg_gen_and_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 445ad3d0e4dSRichard Henderson { 446ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_and_i32, ret, arg1, arg2); 447ad3d0e4dSRichard Henderson } 448ad3d0e4dSRichard Henderson 449ad3d0e4dSRichard Henderson static inline void tcg_gen_or_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 450ad3d0e4dSRichard Henderson { 451ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2); 452ad3d0e4dSRichard Henderson } 453ad3d0e4dSRichard Henderson 454ad3d0e4dSRichard Henderson static inline void tcg_gen_xor_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 455ad3d0e4dSRichard Henderson { 456ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_xor_i32, ret, arg1, arg2); 457ad3d0e4dSRichard Henderson } 458ad3d0e4dSRichard Henderson 459ad3d0e4dSRichard Henderson static inline void tcg_gen_shl_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 460ad3d0e4dSRichard Henderson { 461ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_shl_i32, ret, arg1, arg2); 462ad3d0e4dSRichard Henderson } 463ad3d0e4dSRichard Henderson 464ad3d0e4dSRichard Henderson static inline void tcg_gen_shr_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 465ad3d0e4dSRichard Henderson { 466ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_shr_i32, ret, arg1, arg2); 467ad3d0e4dSRichard Henderson } 468ad3d0e4dSRichard Henderson 469ad3d0e4dSRichard Henderson static inline void tcg_gen_sar_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 470ad3d0e4dSRichard Henderson { 471ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_sar_i32, ret, arg1, arg2); 472ad3d0e4dSRichard Henderson } 473ad3d0e4dSRichard Henderson 474ad3d0e4dSRichard Henderson static inline void tcg_gen_mul_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) 475ad3d0e4dSRichard Henderson { 476ad3d0e4dSRichard Henderson tcg_gen_op3_i32(INDEX_op_mul_i32, ret, arg1, arg2); 477ad3d0e4dSRichard Henderson } 478ad3d0e4dSRichard Henderson 479ad3d0e4dSRichard Henderson static inline void tcg_gen_neg_i32(TCGv_i32 ret, TCGv_i32 arg) 480ad3d0e4dSRichard Henderson { 481ad3d0e4dSRichard Henderson if (TCG_TARGET_HAS_neg_i32) { 482ad3d0e4dSRichard Henderson tcg_gen_op2_i32(INDEX_op_neg_i32, ret, arg); 483ad3d0e4dSRichard Henderson } else { 484ad3d0e4dSRichard Henderson tcg_gen_subfi_i32(ret, 0, arg); 485ad3d0e4dSRichard Henderson } 486ad3d0e4dSRichard Henderson } 487ad3d0e4dSRichard Henderson 488ad3d0e4dSRichard Henderson static inline void tcg_gen_not_i32(TCGv_i32 ret, TCGv_i32 arg) 489ad3d0e4dSRichard Henderson { 490ad3d0e4dSRichard Henderson if (TCG_TARGET_HAS_not_i32) { 491ad3d0e4dSRichard Henderson tcg_gen_op2_i32(INDEX_op_not_i32, ret, arg); 492ad3d0e4dSRichard Henderson } else { 493ad3d0e4dSRichard Henderson tcg_gen_xori_i32(ret, arg, -1); 494ad3d0e4dSRichard Henderson } 495ad3d0e4dSRichard Henderson } 496ad3d0e4dSRichard Henderson 497ad3d0e4dSRichard Henderson /* 64 bit ops */ 498ad3d0e4dSRichard Henderson 499ad3d0e4dSRichard Henderson void tcg_gen_movi_i64(TCGv_i64 ret, int64_t arg); 500ad3d0e4dSRichard Henderson void tcg_gen_addi_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 501ad3d0e4dSRichard Henderson void tcg_gen_subfi_i64(TCGv_i64 ret, int64_t arg1, TCGv_i64 arg2); 502ad3d0e4dSRichard Henderson void tcg_gen_subi_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 503ad3d0e4dSRichard Henderson void tcg_gen_andi_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 504ad3d0e4dSRichard Henderson void tcg_gen_ori_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 505ad3d0e4dSRichard Henderson void tcg_gen_xori_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 506ad3d0e4dSRichard Henderson void tcg_gen_shli_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 507ad3d0e4dSRichard Henderson void tcg_gen_shri_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 508ad3d0e4dSRichard Henderson void tcg_gen_sari_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 509ad3d0e4dSRichard Henderson void tcg_gen_muli_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 510ad3d0e4dSRichard Henderson void tcg_gen_div_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 511ad3d0e4dSRichard Henderson void tcg_gen_rem_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 512ad3d0e4dSRichard Henderson void tcg_gen_divu_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 513ad3d0e4dSRichard Henderson void tcg_gen_remu_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 514ad3d0e4dSRichard Henderson void tcg_gen_andc_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 515ad3d0e4dSRichard Henderson void tcg_gen_eqv_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 516ad3d0e4dSRichard Henderson void tcg_gen_nand_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 517ad3d0e4dSRichard Henderson void tcg_gen_nor_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 518ad3d0e4dSRichard Henderson void tcg_gen_orc_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 519ad3d0e4dSRichard Henderson void tcg_gen_clz_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 520ad3d0e4dSRichard Henderson void tcg_gen_ctz_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 521ad3d0e4dSRichard Henderson void tcg_gen_clzi_i64(TCGv_i64 ret, TCGv_i64 arg1, uint64_t arg2); 522ad3d0e4dSRichard Henderson void tcg_gen_ctzi_i64(TCGv_i64 ret, TCGv_i64 arg1, uint64_t arg2); 523ad3d0e4dSRichard Henderson void tcg_gen_clrsb_i64(TCGv_i64 ret, TCGv_i64 arg); 524ad3d0e4dSRichard Henderson void tcg_gen_ctpop_i64(TCGv_i64 a1, TCGv_i64 a2); 525ad3d0e4dSRichard Henderson void tcg_gen_rotl_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 526ad3d0e4dSRichard Henderson void tcg_gen_rotli_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 527ad3d0e4dSRichard Henderson void tcg_gen_rotr_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 528ad3d0e4dSRichard Henderson void tcg_gen_rotri_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); 529ad3d0e4dSRichard Henderson void tcg_gen_deposit_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2, 530ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 531ad3d0e4dSRichard Henderson void tcg_gen_deposit_z_i64(TCGv_i64 ret, TCGv_i64 arg, 532ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 533ad3d0e4dSRichard Henderson void tcg_gen_extract_i64(TCGv_i64 ret, TCGv_i64 arg, 534ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 535ad3d0e4dSRichard Henderson void tcg_gen_sextract_i64(TCGv_i64 ret, TCGv_i64 arg, 536ad3d0e4dSRichard Henderson unsigned int ofs, unsigned int len); 537ad3d0e4dSRichard Henderson void tcg_gen_extract2_i64(TCGv_i64 ret, TCGv_i64 al, TCGv_i64 ah, 538ad3d0e4dSRichard Henderson unsigned int ofs); 539ad3d0e4dSRichard Henderson void tcg_gen_brcond_i64(TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2, TCGLabel *); 540ad3d0e4dSRichard Henderson void tcg_gen_brcondi_i64(TCGCond cond, TCGv_i64 arg1, int64_t arg2, TCGLabel *); 541ad3d0e4dSRichard Henderson void tcg_gen_setcond_i64(TCGCond cond, TCGv_i64 ret, 542ad3d0e4dSRichard Henderson TCGv_i64 arg1, TCGv_i64 arg2); 543ad3d0e4dSRichard Henderson void tcg_gen_setcondi_i64(TCGCond cond, TCGv_i64 ret, 544ad3d0e4dSRichard Henderson TCGv_i64 arg1, int64_t arg2); 545*3635502dSRichard Henderson void tcg_gen_negsetcond_i64(TCGCond cond, TCGv_i64 ret, 546*3635502dSRichard Henderson TCGv_i64 arg1, TCGv_i64 arg2); 547ad3d0e4dSRichard Henderson void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 c1, 548ad3d0e4dSRichard Henderson TCGv_i64 c2, TCGv_i64 v1, TCGv_i64 v2); 549ad3d0e4dSRichard Henderson void tcg_gen_add2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al, 550ad3d0e4dSRichard Henderson TCGv_i64 ah, TCGv_i64 bl, TCGv_i64 bh); 551ad3d0e4dSRichard Henderson void tcg_gen_sub2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al, 552ad3d0e4dSRichard Henderson TCGv_i64 ah, TCGv_i64 bl, TCGv_i64 bh); 553ad3d0e4dSRichard Henderson void tcg_gen_mulu2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2); 554ad3d0e4dSRichard Henderson void tcg_gen_muls2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2); 555ad3d0e4dSRichard Henderson void tcg_gen_mulsu2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2); 556ad3d0e4dSRichard Henderson void tcg_gen_not_i64(TCGv_i64 ret, TCGv_i64 arg); 557ad3d0e4dSRichard Henderson void tcg_gen_ext8s_i64(TCGv_i64 ret, TCGv_i64 arg); 558ad3d0e4dSRichard Henderson void tcg_gen_ext16s_i64(TCGv_i64 ret, TCGv_i64 arg); 559ad3d0e4dSRichard Henderson void tcg_gen_ext32s_i64(TCGv_i64 ret, TCGv_i64 arg); 560ad3d0e4dSRichard Henderson void tcg_gen_ext8u_i64(TCGv_i64 ret, TCGv_i64 arg); 561ad3d0e4dSRichard Henderson void tcg_gen_ext16u_i64(TCGv_i64 ret, TCGv_i64 arg); 562ad3d0e4dSRichard Henderson void tcg_gen_ext32u_i64(TCGv_i64 ret, TCGv_i64 arg); 563ad3d0e4dSRichard Henderson void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags); 564ad3d0e4dSRichard Henderson void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags); 565ad3d0e4dSRichard Henderson void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg); 566ad3d0e4dSRichard Henderson void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg); 567ad3d0e4dSRichard Henderson void tcg_gen_wswap_i64(TCGv_i64 ret, TCGv_i64 arg); 568ad3d0e4dSRichard Henderson void tcg_gen_smin_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2); 569ad3d0e4dSRichard Henderson void tcg_gen_smax_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2); 570ad3d0e4dSRichard Henderson void tcg_gen_umin_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2); 571ad3d0e4dSRichard Henderson void tcg_gen_umax_i64(TCGv_i64, TCGv_i64 arg1, TCGv_i64 arg2); 572ad3d0e4dSRichard Henderson void tcg_gen_abs_i64(TCGv_i64, TCGv_i64); 573ad3d0e4dSRichard Henderson 574ad3d0e4dSRichard Henderson /* Replicate a value of size @vece from @in to all the lanes in @out */ 575ad3d0e4dSRichard Henderson void tcg_gen_dup_i64(unsigned vece, TCGv_i64 out, TCGv_i64 in); 576ad3d0e4dSRichard Henderson 577ad3d0e4dSRichard Henderson #if TCG_TARGET_REG_BITS == 64 578ad3d0e4dSRichard Henderson static inline void tcg_gen_discard_i64(TCGv_i64 arg) 579ad3d0e4dSRichard Henderson { 580ad3d0e4dSRichard Henderson tcg_gen_op1_i64(INDEX_op_discard, arg); 581ad3d0e4dSRichard Henderson } 582ad3d0e4dSRichard Henderson 583ad3d0e4dSRichard Henderson static inline void tcg_gen_mov_i64(TCGv_i64 ret, TCGv_i64 arg) 584ad3d0e4dSRichard Henderson { 585ad3d0e4dSRichard Henderson if (ret != arg) { 586ad3d0e4dSRichard Henderson tcg_gen_op2_i64(INDEX_op_mov_i64, ret, arg); 587ad3d0e4dSRichard Henderson } 588ad3d0e4dSRichard Henderson } 589ad3d0e4dSRichard Henderson 590ad3d0e4dSRichard Henderson static inline void tcg_gen_ld8u_i64(TCGv_i64 ret, TCGv_ptr arg2, 591ad3d0e4dSRichard Henderson tcg_target_long offset) 592ad3d0e4dSRichard Henderson { 593ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld8u_i64, ret, arg2, offset); 594ad3d0e4dSRichard Henderson } 595ad3d0e4dSRichard Henderson 596ad3d0e4dSRichard Henderson static inline void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, 597ad3d0e4dSRichard Henderson tcg_target_long offset) 598ad3d0e4dSRichard Henderson { 599ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld8s_i64, ret, arg2, offset); 600ad3d0e4dSRichard Henderson } 601ad3d0e4dSRichard Henderson 602ad3d0e4dSRichard Henderson static inline void tcg_gen_ld16u_i64(TCGv_i64 ret, TCGv_ptr arg2, 603ad3d0e4dSRichard Henderson tcg_target_long offset) 604ad3d0e4dSRichard Henderson { 605ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld16u_i64, ret, arg2, offset); 606ad3d0e4dSRichard Henderson } 607ad3d0e4dSRichard Henderson 608ad3d0e4dSRichard Henderson static inline void tcg_gen_ld16s_i64(TCGv_i64 ret, TCGv_ptr arg2, 609ad3d0e4dSRichard Henderson tcg_target_long offset) 610ad3d0e4dSRichard Henderson { 611ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld16s_i64, ret, arg2, offset); 612ad3d0e4dSRichard Henderson } 613ad3d0e4dSRichard Henderson 614ad3d0e4dSRichard Henderson static inline void tcg_gen_ld32u_i64(TCGv_i64 ret, TCGv_ptr arg2, 615ad3d0e4dSRichard Henderson tcg_target_long offset) 616ad3d0e4dSRichard Henderson { 617ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld32u_i64, ret, arg2, offset); 618ad3d0e4dSRichard Henderson } 619ad3d0e4dSRichard Henderson 620ad3d0e4dSRichard Henderson static inline void tcg_gen_ld32s_i64(TCGv_i64 ret, TCGv_ptr arg2, 621ad3d0e4dSRichard Henderson tcg_target_long offset) 622ad3d0e4dSRichard Henderson { 623ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld32s_i64, ret, arg2, offset); 624ad3d0e4dSRichard Henderson } 625ad3d0e4dSRichard Henderson 626ad3d0e4dSRichard Henderson static inline void tcg_gen_ld_i64(TCGv_i64 ret, TCGv_ptr arg2, 627ad3d0e4dSRichard Henderson tcg_target_long offset) 628ad3d0e4dSRichard Henderson { 629ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_ld_i64, ret, arg2, offset); 630ad3d0e4dSRichard Henderson } 631ad3d0e4dSRichard Henderson 632ad3d0e4dSRichard Henderson static inline void tcg_gen_st8_i64(TCGv_i64 arg1, TCGv_ptr arg2, 633ad3d0e4dSRichard Henderson tcg_target_long offset) 634ad3d0e4dSRichard Henderson { 635ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_st8_i64, arg1, arg2, offset); 636ad3d0e4dSRichard Henderson } 637ad3d0e4dSRichard Henderson 638ad3d0e4dSRichard Henderson static inline void tcg_gen_st16_i64(TCGv_i64 arg1, TCGv_ptr arg2, 639ad3d0e4dSRichard Henderson tcg_target_long offset) 640ad3d0e4dSRichard Henderson { 641ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_st16_i64, arg1, arg2, offset); 642ad3d0e4dSRichard Henderson } 643ad3d0e4dSRichard Henderson 644ad3d0e4dSRichard Henderson static inline void tcg_gen_st32_i64(TCGv_i64 arg1, TCGv_ptr arg2, 645ad3d0e4dSRichard Henderson tcg_target_long offset) 646ad3d0e4dSRichard Henderson { 647ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_st32_i64, arg1, arg2, offset); 648ad3d0e4dSRichard Henderson } 649ad3d0e4dSRichard Henderson 650ad3d0e4dSRichard Henderson static inline void tcg_gen_st_i64(TCGv_i64 arg1, TCGv_ptr arg2, 651ad3d0e4dSRichard Henderson tcg_target_long offset) 652ad3d0e4dSRichard Henderson { 653ad3d0e4dSRichard Henderson tcg_gen_ldst_op_i64(INDEX_op_st_i64, arg1, arg2, offset); 654ad3d0e4dSRichard Henderson } 655ad3d0e4dSRichard Henderson 656ad3d0e4dSRichard Henderson static inline void tcg_gen_add_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 657ad3d0e4dSRichard Henderson { 658ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_add_i64, ret, arg1, arg2); 659ad3d0e4dSRichard Henderson } 660ad3d0e4dSRichard Henderson 661ad3d0e4dSRichard Henderson static inline void tcg_gen_sub_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 662ad3d0e4dSRichard Henderson { 663ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_sub_i64, ret, arg1, arg2); 664ad3d0e4dSRichard Henderson } 665ad3d0e4dSRichard Henderson 666ad3d0e4dSRichard Henderson static inline void tcg_gen_and_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 667ad3d0e4dSRichard Henderson { 668ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_and_i64, ret, arg1, arg2); 669ad3d0e4dSRichard Henderson } 670ad3d0e4dSRichard Henderson 671ad3d0e4dSRichard Henderson static inline void tcg_gen_or_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 672ad3d0e4dSRichard Henderson { 673ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_or_i64, ret, arg1, arg2); 674ad3d0e4dSRichard Henderson } 675ad3d0e4dSRichard Henderson 676ad3d0e4dSRichard Henderson static inline void tcg_gen_xor_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 677ad3d0e4dSRichard Henderson { 678ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_xor_i64, ret, arg1, arg2); 679ad3d0e4dSRichard Henderson } 680ad3d0e4dSRichard Henderson 681ad3d0e4dSRichard Henderson static inline void tcg_gen_shl_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 682ad3d0e4dSRichard Henderson { 683ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_shl_i64, ret, arg1, arg2); 684ad3d0e4dSRichard Henderson } 685ad3d0e4dSRichard Henderson 686ad3d0e4dSRichard Henderson static inline void tcg_gen_shr_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 687ad3d0e4dSRichard Henderson { 688ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_shr_i64, ret, arg1, arg2); 689ad3d0e4dSRichard Henderson } 690ad3d0e4dSRichard Henderson 691ad3d0e4dSRichard Henderson static inline void tcg_gen_sar_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 692ad3d0e4dSRichard Henderson { 693ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_sar_i64, ret, arg1, arg2); 694ad3d0e4dSRichard Henderson } 695ad3d0e4dSRichard Henderson 696ad3d0e4dSRichard Henderson static inline void tcg_gen_mul_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2) 697ad3d0e4dSRichard Henderson { 698ad3d0e4dSRichard Henderson tcg_gen_op3_i64(INDEX_op_mul_i64, ret, arg1, arg2); 699ad3d0e4dSRichard Henderson } 700ad3d0e4dSRichard Henderson #else /* TCG_TARGET_REG_BITS == 32 */ 701ad3d0e4dSRichard Henderson void tcg_gen_st8_i64(TCGv_i64 arg1, TCGv_ptr arg2, tcg_target_long offset); 702ad3d0e4dSRichard Henderson void tcg_gen_st16_i64(TCGv_i64 arg1, TCGv_ptr arg2, tcg_target_long offset); 703ad3d0e4dSRichard Henderson void tcg_gen_st32_i64(TCGv_i64 arg1, TCGv_ptr arg2, tcg_target_long offset); 704ad3d0e4dSRichard Henderson 705ad3d0e4dSRichard Henderson void tcg_gen_add_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 706ad3d0e4dSRichard Henderson void tcg_gen_sub_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 707ad3d0e4dSRichard Henderson 708ad3d0e4dSRichard Henderson void tcg_gen_discard_i64(TCGv_i64 arg); 709ad3d0e4dSRichard Henderson void tcg_gen_mov_i64(TCGv_i64 ret, TCGv_i64 arg); 710ad3d0e4dSRichard Henderson void tcg_gen_ld8u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 711ad3d0e4dSRichard Henderson void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 712ad3d0e4dSRichard Henderson void tcg_gen_ld16u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 713ad3d0e4dSRichard Henderson void tcg_gen_ld16s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 714ad3d0e4dSRichard Henderson void tcg_gen_ld32u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 715ad3d0e4dSRichard Henderson void tcg_gen_ld32s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 716ad3d0e4dSRichard Henderson void tcg_gen_ld_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset); 717ad3d0e4dSRichard Henderson void tcg_gen_st_i64(TCGv_i64 arg1, TCGv_ptr arg2, tcg_target_long offset); 718ad3d0e4dSRichard Henderson void tcg_gen_and_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 719ad3d0e4dSRichard Henderson void tcg_gen_or_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 720ad3d0e4dSRichard Henderson void tcg_gen_xor_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 721ad3d0e4dSRichard Henderson void tcg_gen_shl_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 722ad3d0e4dSRichard Henderson void tcg_gen_shr_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 723ad3d0e4dSRichard Henderson void tcg_gen_sar_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 724ad3d0e4dSRichard Henderson void tcg_gen_mul_i64(TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); 725ad3d0e4dSRichard Henderson #endif /* TCG_TARGET_REG_BITS */ 726ad3d0e4dSRichard Henderson 727ad3d0e4dSRichard Henderson static inline void tcg_gen_neg_i64(TCGv_i64 ret, TCGv_i64 arg) 728ad3d0e4dSRichard Henderson { 729ad3d0e4dSRichard Henderson if (TCG_TARGET_HAS_neg_i64) { 730ad3d0e4dSRichard Henderson tcg_gen_op2_i64(INDEX_op_neg_i64, ret, arg); 731ad3d0e4dSRichard Henderson } else { 732ad3d0e4dSRichard Henderson tcg_gen_subfi_i64(ret, 0, arg); 733ad3d0e4dSRichard Henderson } 734ad3d0e4dSRichard Henderson } 735ad3d0e4dSRichard Henderson 736ad3d0e4dSRichard Henderson /* Size changing operations. */ 737ad3d0e4dSRichard Henderson 738ad3d0e4dSRichard Henderson void tcg_gen_extu_i32_i64(TCGv_i64 ret, TCGv_i32 arg); 739ad3d0e4dSRichard Henderson void tcg_gen_ext_i32_i64(TCGv_i64 ret, TCGv_i32 arg); 740ad3d0e4dSRichard Henderson void tcg_gen_concat_i32_i64(TCGv_i64 dest, TCGv_i32 low, TCGv_i32 high); 741ad3d0e4dSRichard Henderson void tcg_gen_extrl_i64_i32(TCGv_i32 ret, TCGv_i64 arg); 742ad3d0e4dSRichard Henderson void tcg_gen_extrh_i64_i32(TCGv_i32 ret, TCGv_i64 arg); 743ad3d0e4dSRichard Henderson void tcg_gen_extr_i64_i32(TCGv_i32 lo, TCGv_i32 hi, TCGv_i64 arg); 744ad3d0e4dSRichard Henderson void tcg_gen_extr32_i64(TCGv_i64 lo, TCGv_i64 hi, TCGv_i64 arg); 745ad3d0e4dSRichard Henderson 746ad3d0e4dSRichard Henderson void tcg_gen_mov_i128(TCGv_i128 dst, TCGv_i128 src); 747ad3d0e4dSRichard Henderson void tcg_gen_extr_i128_i64(TCGv_i64 lo, TCGv_i64 hi, TCGv_i128 arg); 748ad3d0e4dSRichard Henderson void tcg_gen_concat_i64_i128(TCGv_i128 ret, TCGv_i64 lo, TCGv_i64 hi); 749ad3d0e4dSRichard Henderson 750ad3d0e4dSRichard Henderson static inline void tcg_gen_concat32_i64(TCGv_i64 ret, TCGv_i64 lo, TCGv_i64 hi) 751ad3d0e4dSRichard Henderson { 752ad3d0e4dSRichard Henderson tcg_gen_deposit_i64(ret, lo, hi, 32, 32); 753ad3d0e4dSRichard Henderson } 754ad3d0e4dSRichard Henderson 755ad3d0e4dSRichard Henderson /* Local load/store bit ops */ 756ad3d0e4dSRichard Henderson 757ad3d0e4dSRichard Henderson void tcg_gen_qemu_ld_i32_chk(TCGv_i32, TCGTemp *, TCGArg, MemOp, TCGType); 758ad3d0e4dSRichard Henderson void tcg_gen_qemu_st_i32_chk(TCGv_i32, TCGTemp *, TCGArg, MemOp, TCGType); 759ad3d0e4dSRichard Henderson void tcg_gen_qemu_ld_i64_chk(TCGv_i64, TCGTemp *, TCGArg, MemOp, TCGType); 760ad3d0e4dSRichard Henderson void tcg_gen_qemu_st_i64_chk(TCGv_i64, TCGTemp *, TCGArg, MemOp, TCGType); 761ad3d0e4dSRichard Henderson void tcg_gen_qemu_ld_i128_chk(TCGv_i128, TCGTemp *, TCGArg, MemOp, TCGType); 762ad3d0e4dSRichard Henderson void tcg_gen_qemu_st_i128_chk(TCGv_i128, TCGTemp *, TCGArg, MemOp, TCGType); 763ad3d0e4dSRichard Henderson 764ad3d0e4dSRichard Henderson /* Atomic ops */ 765ad3d0e4dSRichard Henderson 766ad3d0e4dSRichard Henderson void tcg_gen_atomic_cmpxchg_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, TCGv_i32, 767ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 768ad3d0e4dSRichard Henderson void tcg_gen_atomic_cmpxchg_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, TCGv_i64, 769ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 770ad3d0e4dSRichard Henderson void tcg_gen_atomic_cmpxchg_i128_chk(TCGv_i128, TCGTemp *, TCGv_i128, 771ad3d0e4dSRichard Henderson TCGv_i128, TCGArg, MemOp, TCGType); 772ad3d0e4dSRichard Henderson 773ad3d0e4dSRichard Henderson void tcg_gen_nonatomic_cmpxchg_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, TCGv_i32, 774ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 775ad3d0e4dSRichard Henderson void tcg_gen_nonatomic_cmpxchg_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, TCGv_i64, 776ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 777ad3d0e4dSRichard Henderson void tcg_gen_nonatomic_cmpxchg_i128_chk(TCGv_i128, TCGTemp *, TCGv_i128, 778ad3d0e4dSRichard Henderson TCGv_i128, TCGArg, MemOp, TCGType); 779ad3d0e4dSRichard Henderson 780ad3d0e4dSRichard Henderson void tcg_gen_atomic_xchg_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 781ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 782ad3d0e4dSRichard Henderson void tcg_gen_atomic_xchg_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 783ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 784ad3d0e4dSRichard Henderson 785ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_add_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 786ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 787ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_add_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 788ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 789ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_and_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 790ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 791ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_and_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 792ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 793ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_or_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 794ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 795ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_or_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 796ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 797ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_xor_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 798ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 799ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_xor_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 800ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 801ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_smin_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 802ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 803ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_smin_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 804ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 805ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_umin_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 806ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 807ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_umin_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 808ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 809ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_smax_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 810ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 811ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_smax_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 812ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 813ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_umax_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 814ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 815ad3d0e4dSRichard Henderson void tcg_gen_atomic_fetch_umax_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 816ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 817ad3d0e4dSRichard Henderson 818ad3d0e4dSRichard Henderson void tcg_gen_atomic_add_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 819ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 820ad3d0e4dSRichard Henderson void tcg_gen_atomic_add_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 821ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 822ad3d0e4dSRichard Henderson void tcg_gen_atomic_and_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 823ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 824ad3d0e4dSRichard Henderson void tcg_gen_atomic_and_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 825ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 826ad3d0e4dSRichard Henderson void tcg_gen_atomic_or_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 827ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 828ad3d0e4dSRichard Henderson void tcg_gen_atomic_or_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 829ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 830ad3d0e4dSRichard Henderson void tcg_gen_atomic_xor_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 831ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 832ad3d0e4dSRichard Henderson void tcg_gen_atomic_xor_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 833ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 834ad3d0e4dSRichard Henderson void tcg_gen_atomic_smin_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 835ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 836ad3d0e4dSRichard Henderson void tcg_gen_atomic_smin_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 837ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 838ad3d0e4dSRichard Henderson void tcg_gen_atomic_umin_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 839ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 840ad3d0e4dSRichard Henderson void tcg_gen_atomic_umin_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 841ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 842ad3d0e4dSRichard Henderson void tcg_gen_atomic_smax_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 843ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 844ad3d0e4dSRichard Henderson void tcg_gen_atomic_smax_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 845ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 846ad3d0e4dSRichard Henderson void tcg_gen_atomic_umax_fetch_i32_chk(TCGv_i32, TCGTemp *, TCGv_i32, 847ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 848ad3d0e4dSRichard Henderson void tcg_gen_atomic_umax_fetch_i64_chk(TCGv_i64, TCGTemp *, TCGv_i64, 849ad3d0e4dSRichard Henderson TCGArg, MemOp, TCGType); 850ad3d0e4dSRichard Henderson 851ad3d0e4dSRichard Henderson /* Vector ops */ 852ad3d0e4dSRichard Henderson 853ad3d0e4dSRichard Henderson void tcg_gen_mov_vec(TCGv_vec, TCGv_vec); 854ad3d0e4dSRichard Henderson void tcg_gen_dup_i32_vec(unsigned vece, TCGv_vec, TCGv_i32); 855ad3d0e4dSRichard Henderson void tcg_gen_dup_i64_vec(unsigned vece, TCGv_vec, TCGv_i64); 856ad3d0e4dSRichard Henderson void tcg_gen_dup_mem_vec(unsigned vece, TCGv_vec, TCGv_ptr, tcg_target_long); 857ad3d0e4dSRichard Henderson void tcg_gen_dupi_vec(unsigned vece, TCGv_vec, uint64_t); 858ad3d0e4dSRichard Henderson void tcg_gen_add_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 859ad3d0e4dSRichard Henderson void tcg_gen_sub_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 860ad3d0e4dSRichard Henderson void tcg_gen_mul_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 861ad3d0e4dSRichard Henderson void tcg_gen_and_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 862ad3d0e4dSRichard Henderson void tcg_gen_or_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 863ad3d0e4dSRichard Henderson void tcg_gen_xor_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 864ad3d0e4dSRichard Henderson void tcg_gen_andc_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 865ad3d0e4dSRichard Henderson void tcg_gen_orc_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 866ad3d0e4dSRichard Henderson void tcg_gen_nand_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 867ad3d0e4dSRichard Henderson void tcg_gen_nor_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 868ad3d0e4dSRichard Henderson void tcg_gen_eqv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 869ad3d0e4dSRichard Henderson void tcg_gen_not_vec(unsigned vece, TCGv_vec r, TCGv_vec a); 870ad3d0e4dSRichard Henderson void tcg_gen_neg_vec(unsigned vece, TCGv_vec r, TCGv_vec a); 871ad3d0e4dSRichard Henderson void tcg_gen_abs_vec(unsigned vece, TCGv_vec r, TCGv_vec a); 872ad3d0e4dSRichard Henderson void tcg_gen_ssadd_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 873ad3d0e4dSRichard Henderson void tcg_gen_usadd_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 874ad3d0e4dSRichard Henderson void tcg_gen_sssub_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 875ad3d0e4dSRichard Henderson void tcg_gen_ussub_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 876ad3d0e4dSRichard Henderson void tcg_gen_smin_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 877ad3d0e4dSRichard Henderson void tcg_gen_umin_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 878ad3d0e4dSRichard Henderson void tcg_gen_smax_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 879ad3d0e4dSRichard Henderson void tcg_gen_umax_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b); 880ad3d0e4dSRichard Henderson 881ad3d0e4dSRichard Henderson void tcg_gen_shli_vec(unsigned vece, TCGv_vec r, TCGv_vec a, int64_t i); 882ad3d0e4dSRichard Henderson void tcg_gen_shri_vec(unsigned vece, TCGv_vec r, TCGv_vec a, int64_t i); 883ad3d0e4dSRichard Henderson void tcg_gen_sari_vec(unsigned vece, TCGv_vec r, TCGv_vec a, int64_t i); 884ad3d0e4dSRichard Henderson void tcg_gen_rotli_vec(unsigned vece, TCGv_vec r, TCGv_vec a, int64_t i); 885ad3d0e4dSRichard Henderson void tcg_gen_rotri_vec(unsigned vece, TCGv_vec r, TCGv_vec a, int64_t i); 886ad3d0e4dSRichard Henderson 887ad3d0e4dSRichard Henderson void tcg_gen_shls_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_i32 s); 888ad3d0e4dSRichard Henderson void tcg_gen_shrs_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_i32 s); 889ad3d0e4dSRichard Henderson void tcg_gen_sars_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_i32 s); 890ad3d0e4dSRichard Henderson void tcg_gen_rotls_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_i32 s); 891ad3d0e4dSRichard Henderson 892ad3d0e4dSRichard Henderson void tcg_gen_shlv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec s); 893ad3d0e4dSRichard Henderson void tcg_gen_shrv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec s); 894ad3d0e4dSRichard Henderson void tcg_gen_sarv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec s); 895ad3d0e4dSRichard Henderson void tcg_gen_rotlv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec s); 896ad3d0e4dSRichard Henderson void tcg_gen_rotrv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec s); 897ad3d0e4dSRichard Henderson 898ad3d0e4dSRichard Henderson void tcg_gen_cmp_vec(TCGCond cond, unsigned vece, TCGv_vec r, 899ad3d0e4dSRichard Henderson TCGv_vec a, TCGv_vec b); 900ad3d0e4dSRichard Henderson 901ad3d0e4dSRichard Henderson void tcg_gen_bitsel_vec(unsigned vece, TCGv_vec r, TCGv_vec a, 902ad3d0e4dSRichard Henderson TCGv_vec b, TCGv_vec c); 903ad3d0e4dSRichard Henderson void tcg_gen_cmpsel_vec(TCGCond cond, unsigned vece, TCGv_vec r, 904ad3d0e4dSRichard Henderson TCGv_vec a, TCGv_vec b, TCGv_vec c, TCGv_vec d); 905ad3d0e4dSRichard Henderson 906ad3d0e4dSRichard Henderson void tcg_gen_ld_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset); 907ad3d0e4dSRichard Henderson void tcg_gen_st_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset); 908ad3d0e4dSRichard Henderson void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset, TCGType t); 909ad3d0e4dSRichard Henderson 910ad3d0e4dSRichard Henderson /* Host pointer ops */ 911ad3d0e4dSRichard Henderson 912ad3d0e4dSRichard Henderson #if UINTPTR_MAX == UINT32_MAX 913ad3d0e4dSRichard Henderson # define PTR i32 914ad3d0e4dSRichard Henderson # define NAT TCGv_i32 915ad3d0e4dSRichard Henderson #else 916ad3d0e4dSRichard Henderson # define PTR i64 917ad3d0e4dSRichard Henderson # define NAT TCGv_i64 918ad3d0e4dSRichard Henderson #endif 919ad3d0e4dSRichard Henderson 920ad3d0e4dSRichard Henderson static inline void tcg_gen_ld_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o) 921ad3d0e4dSRichard Henderson { 922ad3d0e4dSRichard Henderson glue(tcg_gen_ld_,PTR)((NAT)r, a, o); 923ad3d0e4dSRichard Henderson } 924ad3d0e4dSRichard Henderson 925ad3d0e4dSRichard Henderson static inline void tcg_gen_st_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o) 926ad3d0e4dSRichard Henderson { 927ad3d0e4dSRichard Henderson glue(tcg_gen_st_, PTR)((NAT)r, a, o); 928ad3d0e4dSRichard Henderson } 929ad3d0e4dSRichard Henderson 930ad3d0e4dSRichard Henderson static inline void tcg_gen_discard_ptr(TCGv_ptr a) 931ad3d0e4dSRichard Henderson { 932ad3d0e4dSRichard Henderson glue(tcg_gen_discard_,PTR)((NAT)a); 933ad3d0e4dSRichard Henderson } 934ad3d0e4dSRichard Henderson 935ad3d0e4dSRichard Henderson static inline void tcg_gen_add_ptr(TCGv_ptr r, TCGv_ptr a, TCGv_ptr b) 936ad3d0e4dSRichard Henderson { 937ad3d0e4dSRichard Henderson glue(tcg_gen_add_,PTR)((NAT)r, (NAT)a, (NAT)b); 938ad3d0e4dSRichard Henderson } 939ad3d0e4dSRichard Henderson 940ad3d0e4dSRichard Henderson static inline void tcg_gen_addi_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t b) 941ad3d0e4dSRichard Henderson { 942ad3d0e4dSRichard Henderson glue(tcg_gen_addi_,PTR)((NAT)r, (NAT)a, b); 943ad3d0e4dSRichard Henderson } 944ad3d0e4dSRichard Henderson 945ad3d0e4dSRichard Henderson static inline void tcg_gen_mov_ptr(TCGv_ptr d, TCGv_ptr s) 946ad3d0e4dSRichard Henderson { 947ad3d0e4dSRichard Henderson glue(tcg_gen_mov_,PTR)((NAT)d, (NAT)s); 948ad3d0e4dSRichard Henderson } 949ad3d0e4dSRichard Henderson 950ad3d0e4dSRichard Henderson static inline void tcg_gen_movi_ptr(TCGv_ptr d, intptr_t s) 951ad3d0e4dSRichard Henderson { 952ad3d0e4dSRichard Henderson glue(tcg_gen_movi_,PTR)((NAT)d, s); 953ad3d0e4dSRichard Henderson } 954ad3d0e4dSRichard Henderson 955ad3d0e4dSRichard Henderson static inline void tcg_gen_brcondi_ptr(TCGCond cond, TCGv_ptr a, 956ad3d0e4dSRichard Henderson intptr_t b, TCGLabel *label) 957ad3d0e4dSRichard Henderson { 958ad3d0e4dSRichard Henderson glue(tcg_gen_brcondi_,PTR)(cond, (NAT)a, b, label); 959ad3d0e4dSRichard Henderson } 960ad3d0e4dSRichard Henderson 961ad3d0e4dSRichard Henderson static inline void tcg_gen_ext_i32_ptr(TCGv_ptr r, TCGv_i32 a) 962ad3d0e4dSRichard Henderson { 963ad3d0e4dSRichard Henderson #if UINTPTR_MAX == UINT32_MAX 964ad3d0e4dSRichard Henderson tcg_gen_mov_i32((NAT)r, a); 965ad3d0e4dSRichard Henderson #else 966ad3d0e4dSRichard Henderson tcg_gen_ext_i32_i64((NAT)r, a); 967ad3d0e4dSRichard Henderson #endif 968ad3d0e4dSRichard Henderson } 969ad3d0e4dSRichard Henderson 970ad3d0e4dSRichard Henderson static inline void tcg_gen_trunc_i64_ptr(TCGv_ptr r, TCGv_i64 a) 971ad3d0e4dSRichard Henderson { 972ad3d0e4dSRichard Henderson #if UINTPTR_MAX == UINT32_MAX 973ad3d0e4dSRichard Henderson tcg_gen_extrl_i64_i32((NAT)r, a); 974ad3d0e4dSRichard Henderson #else 975ad3d0e4dSRichard Henderson tcg_gen_mov_i64((NAT)r, a); 976ad3d0e4dSRichard Henderson #endif 977ad3d0e4dSRichard Henderson } 978ad3d0e4dSRichard Henderson 979ad3d0e4dSRichard Henderson static inline void tcg_gen_extu_ptr_i64(TCGv_i64 r, TCGv_ptr a) 980ad3d0e4dSRichard Henderson { 981ad3d0e4dSRichard Henderson #if UINTPTR_MAX == UINT32_MAX 982ad3d0e4dSRichard Henderson tcg_gen_extu_i32_i64(r, (NAT)a); 983ad3d0e4dSRichard Henderson #else 984ad3d0e4dSRichard Henderson tcg_gen_mov_i64(r, (NAT)a); 985ad3d0e4dSRichard Henderson #endif 986ad3d0e4dSRichard Henderson } 987ad3d0e4dSRichard Henderson 988ad3d0e4dSRichard Henderson static inline void tcg_gen_trunc_ptr_i32(TCGv_i32 r, TCGv_ptr a) 989ad3d0e4dSRichard Henderson { 990ad3d0e4dSRichard Henderson #if UINTPTR_MAX == UINT32_MAX 991ad3d0e4dSRichard Henderson tcg_gen_mov_i32(r, (NAT)a); 992ad3d0e4dSRichard Henderson #else 993ad3d0e4dSRichard Henderson tcg_gen_extrl_i64_i32(r, (NAT)a); 994ad3d0e4dSRichard Henderson #endif 995ad3d0e4dSRichard Henderson } 996ad3d0e4dSRichard Henderson 997ad3d0e4dSRichard Henderson #undef PTR 998ad3d0e4dSRichard Henderson #undef NAT 999ad3d0e4dSRichard Henderson 1000ad3d0e4dSRichard Henderson #endif /* TCG_TCG_OP_COMMON_H */ 1001