cogl: make cogl be able to build on ARM arch
1. Fix asm() register constraints in cogl when building for ARM. 2. Fix cogl to handle Thumb builds. (From OE-Core rev: cdfea71ff1c4f80ff3a0ade1d7514cbf3c22abde) Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
23fd4d2a09
commit
eba5d155f2
|
@ -2,6 +2,10 @@ DESCRIPTION = "a modern 3D graphics API with associated utility APIs"
|
||||||
HOMEPAGE = "http://wiki.clutter-project.org/wiki/Cogl"
|
HOMEPAGE = "http://wiki.clutter-project.org/wiki/Cogl"
|
||||||
LICENSE = "LGPLv2.1+"
|
LICENSE = "LGPLv2.1+"
|
||||||
|
|
||||||
|
SRC_URI += "file://cogl_fixed_mul-constraint.patch \
|
||||||
|
file://cogl-fixed-thumb.patch \
|
||||||
|
"
|
||||||
|
|
||||||
inherit clutter
|
inherit clutter
|
||||||
|
|
||||||
DEPENDS = "pango glib-2.0 gdk-pixbuf"
|
DEPENDS = "pango glib-2.0 gdk-pixbuf"
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
Upstream-Status: Backport
|
||||||
|
|
||||||
|
There are two asm() statements in cogl-fixed.c that can't be assembled
|
||||||
|
in Thumb mode. Add a patch to switch to the generic code in Thumb mode.
|
||||||
|
|
||||||
|
Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
|
||||||
|
---
|
||||||
|
cogl/cogl-fixed.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/cogl/cogl-fixed.c
|
||||||
|
+++ b/cogl/cogl-fixed.c
|
||||||
|
@@ -626,7 +626,7 @@ cogl_fixed_sqrt (CoglFixed x)
|
||||||
|
/*
|
||||||
|
* Find the highest bit set
|
||||||
|
*/
|
||||||
|
-#if defined (__arm__) && !defined(__ARM_ARCH_4T__)
|
||||||
|
+#if defined (__arm__) && !defined(__ARM_ARCH_4T__) && !defined(__thumb__)
|
||||||
|
/* This actually requires at least arm v5, but gcc does not seem
|
||||||
|
* to set the architecture defines correctly, and it is I think
|
||||||
|
* very unlikely that anyone will want to use clutter on anything
|
||||||
|
@@ -804,7 +804,7 @@ CoglFixed
|
||||||
|
cogl_fixed_mul (CoglFixed a,
|
||||||
|
CoglFixed b)
|
||||||
|
{
|
||||||
|
-#ifdef __arm__
|
||||||
|
+#if defined(__arm__) && !defined(__thumb__)
|
||||||
|
/* This provides about 12% speedeup on the gcc -O2 optimised
|
||||||
|
* C version
|
||||||
|
*
|
|
@ -0,0 +1,22 @@
|
||||||
|
Upstream-Status: Backport
|
||||||
|
|
||||||
|
Add register constraints to prevent asm statement complaints like:
|
||||||
|
|
||||||
|
{standard input}:382: rdhi, rdlo and rm must all be different
|
||||||
|
|
||||||
|
Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
|
||||||
|
---
|
||||||
|
cogl/cogl-fixed.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/cogl/cogl-fixed.c
|
||||||
|
+++ b/cogl/cogl-fixed.c
|
||||||
|
@@ -816,7 +816,7 @@ cogl_fixed_mul (CoglFixed a,
|
||||||
|
__asm__ ("smull %0, %1, %2, %3 \n"
|
||||||
|
"mov %0, %0, lsr %4 \n"
|
||||||
|
"add %1, %0, %1, lsl %5 \n"
|
||||||
|
- : "=r"(res_hi), "=r"(res_low) \
|
||||||
|
+ : "=&r"(res_hi), "=&r"(res_low) \
|
||||||
|
: "r"(a), "r"(b), "i"(COGL_FIXED_Q), "i"(32 - COGL_FIXED_Q));
|
||||||
|
|
||||||
|
return (CoglFixed) res_low;
|
Loading…
Reference in New Issue