[PATCH] D52874: [mips] Set pointer size to 4 bytes for N32 ABI

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 04:32:03 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL344039: [mips] Set pointer size to 4 bytes for N32 ABI (authored by atanasyan, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52874?vs=168258&id=168777#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52874

Files:
  llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
  llvm/trunk/test/MC/Mips/ptr-size.s


Index: llvm/trunk/test/MC/Mips/ptr-size.s
===================================================================
--- llvm/trunk/test/MC/Mips/ptr-size.s
+++ llvm/trunk/test/MC/Mips/ptr-size.s
@@ -0,0 +1,13 @@
+# RUN: llvm-mc -filetype=obj -triple mips--gnu -g %s \
+# RUN:   | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=O32 %s
+# RUN: llvm-mc -filetype=obj -triple mips64--gnuabin32 -g %s \
+# RUN:   | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=N32 %s
+# RUN: llvm-mc -filetype=obj -triple mips64--gnuabi64 -g %s \
+# RUN:   | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=N64 %s
+
+# O32: addr_size = 0x04
+# N32: addr_size = 0x04
+# N64: addr_size = 0x08
+
+foo:
+  nop
Index: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
@@ -21,9 +21,8 @@
 MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
   IsLittleEndian = TheTriple.isLittleEndian();
 
-  if (TheTriple.isMIPS64()) {
+  if (TheTriple.isMIPS64() && TheTriple.getEnvironment() != Triple::GNUABIN32)
     CodePointerSize = CalleeSaveStackSlotSize = 8;
-  }
 
   // FIXME: This condition isn't quite right but it's the best we can do until
   //        this object can identify the ABI. It will misbehave when using O32


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52874.168777.patch
Type: text/x-patch
Size: 1417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181009/6d82e050/attachment.bin>


More information about the llvm-commits mailing list