174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/*
274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * Tiny Code Generator for QEMU
374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt *
474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * Copyright (c) 2008 Fabrice Bellard
574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt *
674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * Permission is hereby granted, free of charge, to any person obtaining a copy
774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * of this software and associated documentation files (the "Software"), to deal
874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * in the Software without restriction, including without limitation the rights
974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * copies of the Software, and to permit persons to whom the Software is
1174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * furnished to do so, subject to the following conditions:
1274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt *
1374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * The above copyright notice and this permission notice shall be included in
1474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * all copies or substantial portions of the Software.
1574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt *
1674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt * THE SOFTWARE.
2374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt */
2474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_PPC64 1
2574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
2674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_REG_BITS 64
2774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_WORDS_BIGENDIAN
2874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_NB_REGS 32
2974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
3074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedtenum {
3174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R0 = 0,
3274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R1,
3374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R2,
3474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R3,
3574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R4,
3674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R5,
3774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R6,
3874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R7,
3974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R8,
4074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R9,
4174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R10,
4274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R11,
4374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R12,
4474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R13,
4574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R14,
4674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R15,
4774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R16,
4874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R17,
4974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R18,
5074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R19,
5174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R20,
5274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R21,
5374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R22,
5474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R23,
5574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R24,
5674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R25,
5774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R26,
5874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R27,
5974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R28,
6074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R29,
6174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R30,
6274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt    TCG_REG_R31
6374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt};
6474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
6574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* used for function call generation */
6674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_REG_CALL_STACK TCG_REG_R1
6774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_STACK_ALIGN 16
6874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_CALL_STACK_OFFSET 48
6974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
7074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* optional instructions */
7174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_div_i32
7274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_rot_i32 */
7374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_ext8s_i32
7474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_ext16s_i32
7574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_ext8u_i32 */
7674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_ext16u_i32 */
7774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_bswap16_i32 */
7874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_bswap32_i32 */
7974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_not_i32 */
8074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_neg_i32
8174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_andc_i32 */
8274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_orc_i32 */
83f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner/* #define TCG_TARGET_HAS_eqv_i32 */
84f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner/* #define TCG_TARGET_HAS_nand_i32 */
85f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner/* #define TCG_TARGET_HAS_nor_i32 */
8674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
8774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_div_i64
8874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_rot_i64 */
8974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_ext8s_i64
9074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_ext16s_i64
9174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_ext32s_i64
9274bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_ext8u_i64 */
9374bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_ext16u_i64 */
9474bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_ext32u_i64 */
9574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_bswap16_i64 */
9674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_bswap32_i64 */
9774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_bswap64_i64 */
9874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_not_i64 */
9974bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_neg_i64
10074bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_andc_i64 */
10174bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt/* #define TCG_TARGET_HAS_orc_i64 */
102f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner/* #define TCG_TARGET_HAS_eqv_i64 */
103f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner/* #define TCG_TARGET_HAS_nand_i64 */
104f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner/* #define TCG_TARGET_HAS_nor_i64 */
10574bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
10674bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_AREG0 TCG_REG_R27
10774bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt
10874bdaadb718584b216e29c13b9e1226c9f77205eMarcus Comstedt#define TCG_TARGET_HAS_GUEST_BASE
109f1d9bf153726533acf659efd796aa484dfd0b412David 'Digit' Turner#define TCG_TARGET_EXTEND_ARGS 1
110