Betrayed by a bitfield
Posted Feb 15, 2012 17:01 UTC (Wed) by
cbf123 (guest, #74020)
In reply to:
Betrayed by a bitfield by chrisV
Parent article:
Betrayed by a bitfield
I just tested with gcc version 4.3.2 (Wind River Linux Sourcery G++ 4.3-85) for powerpc. Building the test app (the volatile version) as "gcc x.c -c -m64 -pthread" resulted in the following code, which clearly shows a 64-bit read/write cycle.
0000000000000000 <.wrong>:
0: fb e1 ff f8 std r31,-8(r1)
4: f8 21 ff c1 stdu r1,-64(r1)
8: 7c 3f 0b 78 mr r31,r1
c: f8 7f 00 70 std r3,112(r31)
10: e9 3f 00 70 ld r9,112(r31)
14: e8 09 00 08 ld r0,8(r9)
18: 39 60 00 01 li r11,1
1c: 79 60 f8 2c rldimi r0,r11,31,32
20: f8 09 00 08 std r0,8(r9)
24: e8 21 00 00 ld r1,0(r1)
28: eb e1 ff f8 ld r31,-8(r1)
2c: 4e 80 00 20 blr
(
Log in to post comments)