Segher Boessenkool <seg...@kernel.crashing.org> wrote: > Okay for trunk. For backports maybe wait a bit longer than usual? So ask > again in two weeks, maybe? I know it's important for the darwin port, but > the generic part is a little scary.
No problem (I would like to get this in to the final issue of 7, if possible). FWIW, this implementation is completely guarded on TARGET_MACHO. I made some comments about “maybe the generic code would care about similar things” because when debugging and tracking through stuff, as you note below, it wasn’t obvious. > On Sat, Oct 12, 2019 at 10:13:16PM +0100, Iain Sandoe wrote: >> 2) To resolve this we need to extend the handling of the mem_operand_gpr to >> allow looking through Mach-O PIC UNSPECs in the lo_sum cases. >> >> - note, that rs6000_offsettable_memref_p () will not handle these so that >> would return early, producing the issue with unsatisfiable constraints. >> >> - I do wonder if that's also the case for some non-Darwin lo_sum cases. >> >> (some things might be hard to detect, since the code will generally fall >> back to doing " la Rx xxx@l ; ld Ry 0(Rx)" so it won't fail - just be >> less efficient than it could be). > > I'm putting this on the Big List of things I may some day have time to > look at ;-) > >> * config/rs6000/darwin.md (movdi_low, movsi_low_st): Delete > > Full stop. > >> + /* We only care if the access(es) would cause a change to the high part. >> */ >> + offset = ((offset & 0xffff) ^ 0x8000) - 0x8000; >> + return SIGNED_16BIT_OFFSET_EXTRA_P (offset, extra); > > So this works because the "extra" part only is relevant for positive > offsets. Okay. Tricky. > >> --- a/gcc/config/rs6000/rs6000.md >> +++ b/gcc/config/rs6000/rs6000.md >> @@ -6894,13 +6894,6 @@ >> ;; do the load 16-bits at a time. We could do this by loading from memory, >> ;; and this is even supposed to be faster, but it is simpler not to get >> ;; integers in the TOC. >> -(define_insn "movsi_low" > > Should the preceding comment be moved elsewhere / changed / deleted? It seemed to be a comment about the following code - or something that should have been deleted long ago - it mentions the TOC, which Darwin does not use so not a Darwin-related thing. Happy to do a separate patch to delete it that’s desired. cheers Iain