Commit 21ce148c authored by Rabin Vincent's avatar Rabin Vincent Committed by Edgar E. Iglesias
Browse files

tests: cris: force inlining



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: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: default avatarRabin Vincent <rabinv@axis.com>
Signed-off-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
parent 25930ed6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)
{
+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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));
+4 −4
Original line number Diff line number Diff line
@@ -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) );
Loading