On Thu, Sep 24, 2009 at 9:59 AM, W-Mark Kubacki
<wmark.google@hurrikane.de> wrote:
>
> On 24 Sep., 10:02, dreamcat four <dreamc...@gmail.com> wrote:
>> Mark,
>> I'm sorry but we cannot remove the following line:
>> #error unsupported processor. please write a patch and send it to me
>>
>> Also, why did you only define the uints and not the ints?
>> Doesn't arm have an int type?
>>
>> For a new additional architecture, why not:
>>
>> #elif ( __myarch__ || __myarch )
>>
>> As per the existing two architectures ?
>
> You're right. I could add another #elif, but I feel the code will be
> much more portable if the #if (__myarch__) sections got deleted in
> favour of __sync_bool_compare_and_swap - which works on x86 and amd64
> as well. (Which might be a coincidence, though.)
> Then, the only left #if/else/endif section would be for checking
> whether the compiler is GCC at all.
Yeah, we just don't want to run any risks on the stable branch as so
many people rely upon it. (and currently there's no unstable branch.
So in short we would prefer just to add what's needed on a
case-by-case basis, with a view to re-factoring the code later (in an
unstable development branch).
> I've not seen the ints being used, therefore I've skipped them for
> brevity as Marcin Ochab did in his Sparc patch. Of course ARM has that
It seems we don't have Marcin's Sparc 64 patch yet either.
This one? http://forum.nginx.org/read.php?3,3533
>> Then can nest the #if arch64 inside that if necessary
>> [...]
>
> If we used the portable code, we should use the pre-defined data types
> - and there will be no longer an #if arch64 switch. It has already
> been done in libc (or whatever library you feel suits best).
We'd be happy to look at more patches here if you feel your original
patch using the arch64 declaration wouldn't work right. Do you which
is know the correct __arch__ declaration for your architecture?
Its unnecessary to remove / take out the existing i386/amd64 ASM. We
aren't sure if is better / worse than the gcc equivalent. Again,
because we only have a stable / production branch at this time. Of
course, we'd prefer to have less code and use the GCC function, if
possible. Except this thread says:
http://groups.google.com/group/cocotron-dev/browse_thread/thread/d51d2941e3aafd5d
that compare_swap doesn't universally work. Depending on which version
of GCC you have (>4.2) + and/or the cflags. Therefore you might see no
problem compiling on your machine, but others would experience
compilation errors and /or crashes. So this looks to be a common
practise for projects to re-write it.
Requires more expertise / knowledge. It's an open question whether we
would only need to enforce a check for the GCC version >= 4.2, so that
we can support ARM. Or would we need a cflags check also? This isn't
yet included in your patch. It's also worth pointing out that Marcin
didn't use the gcc function, but re-wrote it in SPARC 64 assembler. If
we had a similar one for ARM, we wouldn't require such configuration
checks.
So if anyone can help us solve these remaining issues, we would be
very grateful to include and support the ARM platform.
Best regards,
dreamcat4
dreamcat4@gmail.com