On 30.07.2013 19:57, Chuck Zhao wrote:
> So, what was the root cause that POCL didn't support long/double on ARM?

I *think* the root cause was a confusion in clang and/or pocl on 
platforms where (in C) sizeof(long)==4. C specifies 'long' to be no 
shorter than 'int'. Opencl specifies 'long' as 8-bytes. Pocl assumes 
somewhere that sizeof(long)==8.

This, and the fact that all platforms with sizeof(long)==4 not being the 
main focus of anybody's work :)


Actually, a quick test (below) shows this is a clang bug: on x86 and 
PPC32, the value returned below is 4, on x86_64 (and PPC64) it is 8. I 
don't have my ARM board to test with right now, but I bet it would 
return 4, too. This is with LLVM 3.3.

$ cat test.cl
int foo()
{
        return sizeof(long);
}       

$ clang -x cl test.cl -S -emit-llvm -o -
; ModuleID = 'test.cl'
target datalayout = 
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
target triple = "i386-pc-linux-gnu"

define i32 @foo() nounwind readnone {
entry:
   ret i32 4
}


kalle

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to