ARM: More intrinsics part 1/2

Andrew Haley aph at redhat.com
Fri Mar 16 05:35:04 PDT 2012


On 03/16/2012 12:16 PM, Xerxes Rånby wrote:

>>> +    .type arm_val_compare_and_swap_long, %function
>>> +arm_val_compare_and_swap_long:
>>> +    stmfd    sp!, {r4, r5, r6, r7}
>>> +    ldrd    r4, [sp, #16]
>>> +    dmb    sy
>>> +0:    ldrexd    r6, [r0]
>>> +    cmp    r6, r2
>>> +    it    eq
>>> +    cmpeq    r7, r3
>>> +    bne    1f
>>> +    strexd    r1, r4, [r0]
>>> +    cmp    r1, #0
>>> +    bne    0b
>>> +    dmb    sy
>>> +1:    mov    r0, r6
>>> +    mov    r1, r7
>>> +    ldmfd    sp!, {r4, r5, r6, r7}
>>> +    bx    lr
>>> +    .popsection
>>> +#endif // __ARM_ARCH_7A__
> 
> OK I think, i have no good way to verify its functionality except running the Volatile tests from: http://www.cs.umd.edu/~pugh/java/memoryModel/ *a-lot*.
> Testcase: cd into icedtea build dir and execute
> wget http://www.cs.umd.edu/~pugh/java/memoryModel/Volatiles.tar
> tar xvf Volatiles.tar
> ./openjdk.build/j2sdk-image/bin/javac volatile/AtomicLong.java
> ./openjdk.build/j2sdk-image/bin/javac volatile/CoherenceVolatile.java
> ./openjdk.build/j2sdk-image/bin/javac volatile/ReadAfterWrite.java
> ./openjdk.build/j2sdk-image/bin/java -cp volatile AtomicLong
> ./openjdk.build/j2sdk-image/bin/java -cp volatile CoherenceVolatile
> ./openjdk.build/j2sdk-image/bin/java -cp volatile ReadAfterWrite

It's pretty much impossible to test volatile.
volatile/AtomicLong.java passed *before* I did the atomic logic!

> Ok nice to see this work gets supported on softfp armv7 as well as
> hard armv7 builds.

>>> @@ -7857,7 +7954,7 @@
>>>
>>>   #define DEBUG_REGSET ((1<<ARM_R0)|(1<<ARM_R1)|(1<<ARM_R2)|(1<<ARM_R3)|(1<<ARM_IP))
>>>
>>> -// DEBUG_METHODENTRY
>>> +// DEBUG_METHDENTRY
>>>     handlers[H_DEBUG_METHODENTRY] = out_pos(&codebuf);
>>>     stm(&codebuf, DEBUG_REGSET | (1<<ARM_LR), ARM_SP, PUSH_FD, 1);
>>>     mov_reg(&codebuf, ARM_R2, ARM_R0);
> 
> Please skip merging this comment typo.

Err, OK.  :-)

Thanks a lot,
Andrew.



More information about the distro-pkg-dev mailing list