[Bug target/52941] SH Target: Add support for movco.l / movli.l atomics on SH4A

olegendo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 17 00:03:00 GMT 2012


--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-04-17 00:03:19 UTC ---
Created attachment 27173
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27173
Proposed patch

(In reply to comment #6)
> The patch looks just fine.  I don't mind whether those atomics are
> fully optimized or not ATM.  Programs having atomics in the minor
> loop are pathological in the first place, I think.

I was also concerned about the code size in sync.md...
Anyway, how about the attached patch instead?  It now should do all atomics for
I've scrapped the LUT and whatnot and the code size (both generated and in the
compiler) now looks more reasonable.  Only one thing ... is it safe to do the
"@-r15", "@+r15" stuff in the atomic sequence?  I remember there were some
border cases where things would blow up, but can't recall.  I've also briefly
checked with atomic vars being on the stack and it looks OK.

More information about the Gcc-bugs mailing list