diff mbox

[hsa,merge,09/10] Majority of the HSA back-end

Message ID 20160115234912.GA30403@virgil.suse.cz
State New
Headers show

Commit Message

Martin Jambor Jan. 15, 2016, 11:49 p.m. UTC
Hi,

bootstrapping on i686-linux revealed the need for the following simple
patch.  I've run into two types of compilation errors on
powerpc-ibm-aix (no htolenn functions and ASM_GENERATE_INTERNAL_LABEL
somehow expanding to undeclared rs6000_xcoff_strip_dollar).  I plan to
workaround them quickly by making most of the contents of hsa-*.c
files compiled only conditionally (and leave potential hsa support on
non-linux platforms for later), but I will not have time to do the
change and test it properly until Monday.

But that will hopefully really be it,

Martin


2016-01-16  Martin Jambor  <mjambor@suse.cz>

	* hsa-dump.c (dump_hsa_symbol): Add missing argumet cast.

Comments

Jakub Jelinek Jan. 16, 2016, 8:58 a.m. UTC | #1
On Sat, Jan 16, 2016 at 12:49:12AM +0100, Martin Jambor wrote:
> bootstrapping on i686-linux revealed the need for the following simple
> patch.  I've run into two types of compilation errors on
> powerpc-ibm-aix (no htolenn functions and ASM_GENERATE_INTERNAL_LABEL
> somehow expanding to undeclared rs6000_xcoff_strip_dollar).  I plan to
> workaround them quickly by making most of the contents of hsa-*.c
> files compiled only conditionally (and leave potential hsa support on
> non-linux platforms for later), but I will not have time to do the
> change and test it properly until Monday.
> 
> But that will hopefully really be it,

IMHO you'd be best to write your own helpers for conversion to little
endian (and back).
gcc configure already has AC_C_BIGENDIAN (dunno how it handles pdp endian
host though, so not sure if it is safe to rely on that), for recent GCC
you can use __BYTE_ORDER__ macro to check endianity and __builtin_bswap*.
So perhaps just
#if GCC_VERSION >= 4006
// use __BYTE_ORDER__ and __builtin_bswap or nothing
#else
// provide a safe slower default, with shifts and masking
#endif

As for rs6000_xcoff_strip_dollar, look at other sources that use it what
headers they do include, bet you want to #include "tm_p.h" to make it work.

	Jakub
Jakub Jelinek Jan. 16, 2016, 9:22 a.m. UTC | #2
On Sat, Jan 16, 2016 at 09:58:51AM +0100, Jakub Jelinek wrote:
> IMHO you'd be best to write your own helpers for conversion to little
> endian (and back).
> gcc configure already has AC_C_BIGENDIAN (dunno how it handles pdp endian
> host though, so not sure if it is safe to rely on that), for recent GCC
> you can use __BYTE_ORDER__ macro to check endianity and __builtin_bswap*.
> So perhaps just
> #if GCC_VERSION >= 4006
> // use __BYTE_ORDER__ and __builtin_bswap or nothing
> #else
> // provide a safe slower default, with shifts and masking
> #endif

Note e.g. libiberty/simple-object* uses the slow version with shifts and
masking all the time, so just optimizing the case of recent GCC host (and
therefore also bootstrapped compilers) might be enough.

	Jakub
diff mbox

Patch

diff --git a/gcc/hsa-dump.c b/gcc/hsa-dump.c
index af79bcb..c5f1f69 100644
--- a/gcc/hsa-dump.c
+++ b/gcc/hsa-dump.c
@@ -720,7 +720,7 @@  dump_hsa_symbol (FILE *f, hsa_symbol *symbol)
 	   hsa_type_name (symbol->m_type & ~BRIG_TYPE_ARRAY_MASK), name);
 
   if (symbol->m_type & BRIG_TYPE_ARRAY_MASK)
-    fprintf (f, "[%lu]", symbol->m_dim);
+    fprintf (f, "[%lu]", (unsigned long) symbol->m_dim);
 }
 
 /* Dump textual representation of HSA IL operand OP to file F.  */