Thread (6 messages) 6 messages, 3 authors, 2011-08-11

RE: [RFC] Optimize __arch_swab32 and __arch_swab16

From: David Laight <hidden>
Date: 2011-08-11 09:29:34

Possibly related (same subject, not in this thread)

=20
quoted
Which is a problem because the compiler could schedule
it be written back to real memory between the instructions.
=20
It can? There is no memory here, just registers. Even if it
is written to memory, how would that affect the register?
Although the function argument is passed in a register, the
compiler could generate a store-load sequence before and
after each __asm__() line.
Assuming you are right, would rewriting it to
  __asm__("rlwimi %0,%0,16,0x00ff0000\n\t"
	    "rlwinm %0,%0,24,0x0000ffff"
	    : "+r"(value));
help?
Except that now you've stopped the compiler scheduling
another instruction between the two - probably forcing a
execution stall.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help