s390x-codegen.h - Define s390_SP and s390_BP
[mono.git] / mono / arch / s390x / s390x-codegen.h
index 9ef7475467a880c69943e59e66f060cf4b75ccdb..d3292bffb907295510f3f20f3602fc1955d63153 100644 (file)
@@ -146,6 +146,8 @@ typedef enum {
 #define s390_is_uimm12(val)            ((glong)val >= 0 && (glong)val <= 4095)
 
 #define STK_BASE                       s390_r15
+#define S390_SP                                s390_r15
+#define S390_FP                                s390_r11
 #define S390_MINIMAL_STACK_SIZE                160
 #define S390_REG_SAVE_OFFSET           48
 #define S390_PARM_SAVE_OFFSET          16
@@ -272,7 +274,7 @@ typedef struct {
        char    b2 : 4;
        int     d2 : 20;
        char    op2;
-} RXY_Format __attribute__ ((packed));
+} __attribute__ ((packed)) RXY_Format;
 
 typedef struct {
        char    op;
@@ -305,7 +307,7 @@ typedef struct {
        char    b2 : 4;
        int     d2 : 20;
        char    op2;
-} RSY_Format_1 __attribute__ ((packed));
+} __attribute__ ((packed)) RSY_Format_1;
 
 typedef struct {
        char    op1;
@@ -314,7 +316,7 @@ typedef struct {
        char    b2 : 4;
        int     d2 : 20;
        char    op2;
-} RSY_Format_2 __attribute__ ((packed));
+} __attribute__ ((packed)) RSY_Format_2;
 
 typedef struct {
        char    op1;
@@ -335,7 +337,7 @@ typedef struct {
 
 typedef struct {
        char    op1;
-       char    r1 : 4;
+       char    m1 : 4;
        char    op2 : 4;
        short   i2;
 } RI_Format;
@@ -354,14 +356,14 @@ typedef struct {
        char    r1 : 4;
        char    op2 : 4;
        int     i2;
-} RIL_Format_1 __attribute__ ((packed));
+} __attribute__ ((packed)) RIL_Format_1;
 
 typedef struct {
        char    op1;
        char    m1 : 4;
        char    op2 : 4;
        int     i2;
-} RIL_Format_2 __attribute__ ((packed));
+} __attribute__ ((packed)) RIL_Format_2;
 
 typedef struct {
        char    op;
@@ -376,7 +378,7 @@ typedef struct {
        char    b1 : 4;
        int     d1 : 20;
        char    op2;
-} SIY_Format __attribute__ ((packed));
+} __attribute__ ((packed)) SIY_Format;
 
 typedef struct {
        short   op;
@@ -429,17 +431,17 @@ typedef struct {
        short   d1 : 12;
        char    b2 : 4;
        short   d2 : 12;
-} SSE_Format __attribute__ ((packed));
+} __attribute__ ((packed)) SSE_Format;
 
 #define s390_emit16(c, x) do                   \
 {                                              \
-       *((guint16 *) c) = x;                   \
+       *((guint16 *) c) = (guint16) x;         \
        c += sizeof(guint16);                   \
 } while(0)
 
 #define s390_emit32(c, x) do                   \
 {                                              \
-       *((guint32 *) c) = x;                   \
+       *((guint32 *) c) = (guint32) x;         \
        c += sizeof(guint32);                   \
 } while(0)
 
@@ -659,6 +661,7 @@ typedef struct {
 #define s390_lam(c, r1, r2, b, d)      S390_RS_1(c, 0x9a, r1, r2, b, d)
 #define s390_larl(c, r, o)             S390_RIL_1(c, 0xc00, r, o)
 #define s390_lb(c, r, x, b, d)         S390_RXY(c, 0xe376, r, x, b, d)
+#define s390_lbr(c, r1, r2)            S390_RRE(c, 0xb926, r1, r2)
 #define s390_lcdbr(c, r1, r2)          S390_RRE(c, 0xb313, r1, r2)
 #define s390_lcgr(c, r1, r2)           S390_RRE(c, 0xb903, r1, r2)
 #define s390_lcr(c, r1, r2)            S390_RR(c, 0x13, r1, r2)
@@ -672,6 +675,7 @@ typedef struct {
 #define s390_ler(c, r1, r2)            S390_RR(c, 0x38, r1, r2)
 #define s390_ley(c, r, x, b, d)                S390_RXY(c, 0xed64, r, x, b, d)
 #define s390_lgb(c, r, x, b, d)                S390_RXY(c, 0xe377, r, x, b, d)
+#define s390_lgbr(c, r1, r2)           S390_RRE(c, 0xb906, r1, r2)
 #define s390_lg(c, r, x, b, d)         S390_RXY(c, 0xe304, r, x, b, d)
 #define s390_lgf(c, r, x, b, d)                S390_RXY(c, 0xe314, r, x, b, d)
 #define s390_lgfr(c, r1, r2)           S390_RRE(c, 0xb914, r1, r2)
@@ -679,13 +683,19 @@ typedef struct {
 #define s390_lghi(c, r, v)             S390_RI(c, 0xa79, r, v)
 #define s390_lgr(c, r1, r2)            S390_RRE(c, 0xb904, r1, r2)
 #define s390_lh(c, r, x, b, d)         S390_RX(c, 0x48, r, x, b, d)
+#define s390_lhr(c, r1, r2)            S390_RRE(c, 0xb927, r1, r2)
 #define s390_lhg(c, r, x, b, d)                S390_RXY(c, 0xe315, r, x, b, d)
+#define s390_lghr(c, r1, r2)           S390_RRE(c, 0xb907, r1, r2)
 #define s390_lhi(c, r, v)              S390_RI(c, 0xa78, r, v)
 #define s390_lhy(c, r, x, b, d)                S390_RXY(c, 0xe378, r, x, b, d)
+#define s390_llcr(c, r1, r2)           S390_RRE(c, 0xb994, r1, r2)
 #define s390_llgc(c, r, x, b, d)       S390_RXY(c, 0xe390, r, x, b, d)
+#define s390_llgcr(c, r1, r2)          S390_RRE(c, 0xb984, r1, r2)
 #define s390_llgf(c, r, x, b, d)       S390_RXY(c, 0xe316, r, x, b, d)
 #define s390_llgfr(c, r1, r2)          S390_RRE(c, 0xb916, r1, r2)
 #define s390_llgh(c, r, x, b, d)       S390_RXY(c, 0xe391, r, x, b, d)
+#define s390_llghr(c, r1, r2)          S390_RRE(c, 0xb985, r1, r2)
+#define s390_llhr(c, r1, r2)           S390_RRE(c, 0xb995, r1, r2)
 #define s390_lm(c, r1, r2, b, d)       S390_RS_1(c, 0x98, r1, r2, b, d)
 #define s390_lmg(c, r1, r2, b, d)      S390_RSY_1(c, 0xeb04, r1, r2, b, d)
 #define s390_lndbr(c, r1, r2)          S390_RRE(c, 0xb311, r1, r2)
@@ -718,6 +728,7 @@ typedef struct {
 #define s390_ngr(c, r1, r2)            S390_RRE(c, 0xb980, r1, r2)
 #define s390_nilh(c, r, v)             S390_RI(c, 0xa56, r, v)
 #define s390_nill(c, r, v)             S390_RI(c, 0xa57, r, v)
+#define s390_nop(c)                    S390_RR(c, 0x07, 0x0, 0)
 #define s390_nr(c, r1, r2)             S390_RR(c, 0x14, r1, r2)
 #define s390_o(c, r, x, b, d)          S390_RX(c, 0x56, r, x, b, d)
 #define s390_og(c, r, x, b, d)         S390_RXY(c, 0xe381, r, x, b, d)
@@ -765,7 +776,6 @@ typedef struct {
 #define s390_stey(c, r, x, b, d)       S390_RXY(c, 0xed66, r, x, b, d)
 #define s390_stfpc(c, b, d)            S390_S(c, 0xb29c, b, d)
 #define s390_stg(c, r, x, b, d)                S390_RXY(c, 0xe324, r, x, b, d)
-#define s390_stg(c, r, x, b, d)                S390_RXY(c, 0xe324, r, x, b, d)
 #define s390_sth(c, r, x, b, d)                S390_RX(c, 0x40, r, x, b, d)
 #define s390_sthy(c, r, x, b, d)       S390_RXY(c, 0xe370, r, x, b, d)
 #define s390_stm(c, r1, r2, b, d)      S390_RS_1(c, 0x90, r1, r2, b, d)