[PATCH] D108792: [M68k] Update pointer data layout
Ricky Taylor via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 26 15:16:57 PDT 2021
ricky26 created this revision.
ricky26 added reviewers: myhsu, jrtc27, nickdesaulniers, craig.topper.
Herald added a subscriber: hiraditya.
ricky26 requested review of this revision.
Herald added projects: clang, LLVM.
Fixes PR51626.
The M68k requires that all instruction, word and long word reads are
aligned to word boundaries. From the 68020 onwards, there is a
performance benefit from aligning long words to long word boundaries.
The M68k uses the same data layout for pointers and integers.
In line with this, this commit updates the pointer data layout to
match the layout already set for 32-bit integers: 32:16:32.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108792
Files:
clang/lib/Basic/Targets/M68k.cpp
llvm/lib/Target/M68k/M68kTargetMachine.cpp
Index: llvm/lib/Target/M68k/M68kTargetMachine.cpp
===================================================================
--- llvm/lib/Target/M68k/M68kTargetMachine.cpp
+++ llvm/lib/Target/M68k/M68kTargetMachine.cpp
@@ -49,10 +49,13 @@
// FIXME how to wire it with the used object format?
Ret += "-m:e";
- // M68k pointers are always 32 bit wide even for 16 bit cpus
- Ret += "-p:32:32";
+ // M68k pointers are always 32 bit wide even for 16-bit CPUs.
+ // On at least the 68020+ with a 32-bit bus, there is a performance benefit
+ // to having 32-bit alignment.
+ Ret += "-p:32:16:32";
- // M68k requires i8 to align on 2 byte boundry
+ // Bytes do not require special alignment, words are word aligned and
+ // long words are word aligned at minimum.
Ret += "-i8:8:8-i16:16:16-i32:16:32";
// FIXME no floats at the moment
Index: clang/lib/Basic/Targets/M68k.cpp
===================================================================
--- clang/lib/Basic/Targets/M68k.cpp
+++ clang/lib/Basic/Targets/M68k.cpp
@@ -37,8 +37,8 @@
// FIXME how to wire it with the used object format?
Layout += "-m:e";
- // M68k pointers are always 32 bit wide even for 16 bit cpus
- Layout += "-p:32:32";
+ // M68k pointers are always 32 bit wide even for 16-bit CPUs
+ Layout += "-p:32:16:32";
// M68k integer data types
Layout += "-i8:8:8-i16:16:16-i32:16:32";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108792.368995.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210826/bb4cf9e8/attachment.bin>
More information about the cfe-commits
mailing list