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 Mar 26, 2022
1 parent dcd4b62 commit 0d58fd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gcc/config/aarch64/aarch64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11066,6 +11066,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 0d58fd7

Please sign in to comment.