Skip to content

Commit

Permalink
Darwin, Arm64 : Account for stack addresses less aligned than DI.
Browse files Browse the repository at this point in the history
darwinpcs, packs some stack items, which means that one cannot
guarantee that they are aligned to DI.  Check for these cases and
reject PRFM instructions then.

Note, that this generally results in use of an extra temporary reg.

clang uses 'PRFUM' instructions in those cases, so we have a missed
optimisation opportunity (low priority).

fixes issue #16.
  • Loading branch information
iains committed Oct 25, 2020
1 parent 0577b32 commit d7b8bcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gcc/config/aarch64/aarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -9531,6 +9531,10 @@ aarch64_address_valid_for_prefetch_p (rtx x, bool strict_p)
if (!res)
return false;

/* Darwinpcs allows addresses on the stack that are not DImode aligned. */
if (TARGET_MACHO && addr.offset && (INTVAL (addr.offset) & 0x07))
return false;

/* ... except writeback forms. */
return addr.type != ADDRESS_REG_WB;
}
Expand Down

0 comments on commit d7b8bcf

Please sign in to comment.