
Hello, I am trying to understand the inline assembly function out_be32
extern inline void out_be32(volatile unsigned __iomem *addr, int val) { __asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); }
I am not familiar with the syntax here, especially for the %U0%X0 part, can someone help me to translate this into assemble code?
Thanks Qingyu

Dear Qingyu Song,
In message 352fc0270904171713s58d231f4u8445292dddbf21ff@mail.gmail.com you wrote:
extern inline void out_be32(volatile unsigned __iomem *addr, int val) { __asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); }
I am not familiar with the syntax here, especially for the %U0%X0 part, can someone help me to translate this into assemble code?
Ask gcc. He is really great in translating C code into assembly code. Try "gcc -S ... "
Best regards,
Wolfgang Denk

On Fri, Apr 17, 2009 at 05:13:06PM -0700, Qingyu Song wrote:
Hello, I am trying to understand the inline assembly function out_be32
extern inline void out_be32(volatile unsigned __iomem *addr, int val) { __asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); }
I am not familiar with the syntax here, especially for the %U0%X0 part, can someone help me to translate this into assemble code?
%U0%X0 tells GCC to add the "u" or "x" suffixes to the instruction as needed by operand 0.
-Scott
participants (3)
-
Qingyu Song
-
Scott Wood
-
Wolfgang Denk