]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
tests: cris: force inlining
authorRabin Vincent <rabinv@axis.com>
Tue, 23 Aug 2016 14:34:59 +0000 (16:34 +0200)
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Wed, 28 Sep 2016 08:45:44 +0000 (10:45 +0200)
The CRIS tests expect that functions marked inline are always inline.
With newer versions of GCC, building them results warnings like the
following and spurious failures when they are run.

In file included from tests/tcg/cris/check_moveq.c:5:0:
tests/tcg/cris/crisutils.h:66:20: warning: inlining failed in call to
'cris_tst_cc.constprop.0': call is unlikely and code size would grow [-Winline]
tests/tcg/cris/check_moveq.c:28:13: warning: called from here [-Winline]

Use the always_inline attribute when building them to fix this.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Rabin Vincent <rabinv@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
tests/tcg/cris/check_abs.c
tests/tcg/cris/check_addc.c
tests/tcg/cris/check_addcm.c
tests/tcg/cris/check_bound.c
tests/tcg/cris/check_ftag.c
tests/tcg/cris/check_int64.c
tests/tcg/cris/check_lz.c
tests/tcg/cris/check_swap.c
tests/tcg/cris/crisutils.h
tests/tcg/cris/sys.h

index 9770a8d9ef40e027eda201cf8d62b7ad1e7d3947..08b67b6ef0ce3811a246381ac752a08214a121be 100644 (file)
@@ -4,14 +4,14 @@
 #include "sys.h"
 #include "crisutils.h"
 
-static inline int cris_abs(int n)
+static always_inline int cris_abs(int n)
 {
        int r;
        asm ("abs\t%1, %0\n" : "=r" (r) : "r" (n));
        return r;
 }
 
-static inline void
+static always_inline void
 verify_abs(int val, int res,
           const int n, const int z, const int v, const int c)
 {
index facd1bea2dc30a32541935381c5c6ff2136a5dd2..fc3fb1faa80a8cad84c49c410cf3bfd79c432a50 100644 (file)
@@ -4,7 +4,7 @@
 #include "sys.h"
 #include "crisutils.h"
 
-static inline int cris_addc(int a, const int b)
+static always_inline int cris_addc(int a, const int b)
 {
        asm ("addc\t%1, %0\n" : "+r" (a) : "r" (b));
        return a;
index 7928bc9999b598c22c3ae86c0b135544c77d4825..b355ba164fbd6fc152649c5d77248bd9b8456586 100644 (file)
@@ -5,14 +5,14 @@
 #include "crisutils.h"
 
 /* need to avoid acr as source here.  */
-static inline int cris_addc_m(int a, const int *b)
+static always_inline int cris_addc_m(int a, const int *b)
 {
        asm volatile ("addc [%1], %0\n" : "+r" (a) : "r" (b));
        return a;
 }
 
 /* 'b' is a crisv32 constrain to avoid postinc with $acr.  */
-static inline int cris_addc_pi_m(int a, int **b)
+static always_inline int cris_addc_pi_m(int a, int **b)
 {
        asm volatile ("addc [%1+], %0\n" : "+r" (a), "+b" (*b));
        return a;
index e8831754ecebb466e07826dad03bec9c8771bfcf..d956ab9adec3c3ab44a8d941683d988618172bdc 100644 (file)
@@ -4,21 +4,21 @@
 #include "sys.h"
 #include "crisutils.h"
 
-static inline int cris_bound_b(int v, int b)
+static always_inline int cris_bound_b(int v, int b)
 {
        int r = v;
        asm ("bound.b\t%1, %0\n" : "+r" (r) : "ri" (b));
        return r;
 }
 
-static inline int cris_bound_w(int v, int b)
+static always_inline int cris_bound_w(int v, int b)
 {
        int r = v;
        asm ("bound.w\t%1, %0\n" : "+r" (r) : "ri" (b));
        return r;
 }
 
-static inline int cris_bound_d(int v, int b)
+static always_inline int cris_bound_d(int v, int b)
 {
        int r = v;
        asm ("bound.d\t%1, %0\n" : "+r" (r) : "ri" (b));
index 908773a38a8349c4d1cdfe615b9ff4c36256265a..aaa5c9711592fae1b3664457d9d9a04e4ca08c47 100644 (file)
@@ -4,22 +4,22 @@
 #include "sys.h"
 #include "crisutils.h"
 
-static inline void cris_ftag_i(unsigned int x)
+static always_inline void cris_ftag_i(unsigned int x)
 {
        register unsigned int v asm("$r10") = x;
        asm ("ftagi\t[%0]\n" : : "r" (v) );
 }
-static inline void cris_ftag_d(unsigned int x)
+static always_inline void cris_ftag_d(unsigned int x)
 {
        register unsigned int v asm("$r10") = x;
        asm ("ftagd\t[%0]\n" : : "r" (v) );
 }
-static inline void cris_fidx_i(unsigned int x)
+static always_inline void cris_fidx_i(unsigned int x)
 {
        register unsigned int v asm("$r10") = x;
        asm ("fidxi\t[%0]\n" : : "r" (v) );
 }
-static inline void cris_fidx_d(unsigned int x)
+static always_inline void cris_fidx_d(unsigned int x)
 {
        register unsigned int v asm("$r10") = x;
        asm ("fidxd\t[%0]\n" : : "r" (v) );
index fc600176e2329711988e056dd6af39e57aff40e3..69caec1bb24de64673584d8edd85ee8a302b41c0 100644 (file)
@@ -5,12 +5,12 @@
 #include "crisutils.h"
 
 
-static inline int64_t add64(const int64_t a, const int64_t b)
+static always_inline int64_t add64(const int64_t a, const int64_t b)
 {
        return a + b;
 }
 
-static inline int64_t sub64(const int64_t a, const int64_t b)
+static always_inline int64_t sub64(const int64_t a, const int64_t b)
 {
        return a - b;
 }
index 69c2e6d4ecacc06d909f3d91f6c508bce86cb613..bf051a6b550e41c61c971ee95de1e436d5327d19 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdint.h>
 #include "sys.h"
 
-static inline int cris_lz(int x)
+static always_inline int cris_lz(int x)
 {
        int r;
        asm ("lz\t%1, %0\n" : "=r" (r) : "r" (x));
index f851cbcef1f3e1218ac71d1ec18502cdad568507..9a68c1e5d7658622426d1e9e25d9e88ed43817f7 100644 (file)
@@ -9,7 +9,7 @@
 #define B 2
 #define R 1
 
-static inline int cris_swap(const int mode, int x)
+static always_inline int cris_swap(const int mode, int x)
 {
        switch (mode)
        {
index 3456b9d50dad8d345d5c4bb31c194a4dab42f805..bbbe6c55405dc98f66ac4ea16ce9cf569ace3721 100644 (file)
@@ -13,57 +13,57 @@ void _err(void) {
        _fail(tst_cc_loc);
 }
 
-static inline void cris_tst_cc_n1(void)
+static always_inline void cris_tst_cc_n1(void)
 {
        asm volatile ("bpl _err\n"
                      "nop\n");
 }
-static inline void cris_tst_cc_n0(void)
+static always_inline void cris_tst_cc_n0(void)
 {
        asm volatile ("bmi _err\n"
                      "nop\n");
 }
 
-static inline void cris_tst_cc_z1(void)
+static always_inline void cris_tst_cc_z1(void)
 {
        asm volatile ("bne _err\n"
                      "nop\n");
 }
-static inline void cris_tst_cc_z0(void)
+static always_inline void cris_tst_cc_z0(void)
 {
        asm volatile ("beq _err\n"
                      "nop\n");
 }
-static inline void cris_tst_cc_v1(void)
+static always_inline void cris_tst_cc_v1(void)
 {
        asm volatile ("bvc _err\n"
                      "nop\n");
 }
-static inline void cris_tst_cc_v0(void)
+static always_inline void cris_tst_cc_v0(void)
 {
        asm volatile ("bvs _err\n"
                      "nop\n");
 }
 
-static inline void cris_tst_cc_c1(void)
+static always_inline void cris_tst_cc_c1(void)
 {
        asm volatile ("bcc _err\n"
                      "nop\n");
 }
-static inline void cris_tst_cc_c0(void)
+static always_inline void cris_tst_cc_c0(void)
 {
        asm volatile ("bcs _err\n"
                      "nop\n");
 }
 
-static inline void cris_tst_mov_cc(int n, int z)
+static always_inline void cris_tst_mov_cc(int n, int z)
 {
        if (n) cris_tst_cc_n1(); else cris_tst_cc_n0();
        if (z) cris_tst_cc_z1(); else cris_tst_cc_z0();
        asm volatile ("" : : "g" (_err));
 }
 
-static inline void cris_tst_cc(const int n, const int z,
+static always_inline void cris_tst_cc(const int n, const int z,
                               const int v, const int c)
 {
        if (n) cris_tst_cc_n1(); else cris_tst_cc_n0();
index c5f88e1a2946f1ed8bae75a8e1bd186a07eea4d2..3dd47bb673068a62dfcb1f42eec5cf98db5b172b 100644 (file)
@@ -3,6 +3,8 @@
 #define STRINGIFY(x) #x
 #define TOSTRING(x) STRINGIFY(x)
 
+#define always_inline inline __attribute__((always_inline))
+
 #define CURRENT_LOCATION __FILE__ ":" TOSTRING(__LINE__)
 
 #define err()                         \