[llvm] r212932 - [mips] Correct the AFL_FLAGS1_ODDSPREG flag in .MIPS.abiflags when no '.module oddspreg' is used
Daniel Sanders
daniel.sanders at imgtec.com
Mon Jul 14 03:26:17 PDT 2014
Author: dsanders
Date: Mon Jul 14 05:26:15 2014
New Revision: 212932
URL: http://llvm.org/viewvc/llvm-project?rev=212932&view=rev
Log:
[mips] Correct the AFL_FLAGS1_ODDSPREG flag in .MIPS.abiflags when no '.module oddspreg' is used
Differential Revision: http://reviews.llvm.org/D4486
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
llvm/trunk/test/MC/Mips/mips32/abiflags.s
llvm/trunk/test/MC/Mips/mips32r2/abiflags.s
llvm/trunk/test/MC/Mips/mips64/abiflags.s
llvm/trunk/test/MC/Mips/mips64r2/abiflags.s
llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s
llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s
llvm/trunk/test/MC/Mips/msa/abiflags.s
llvm/trunk/test/MC/Mips/oddspreg.s
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Mon Jul 14 05:26:15 2014
@@ -237,7 +237,7 @@ public:
((STI.getFeatureBits() & Mips::FeatureN32) != 0) +
((STI.getFeatureBits() & Mips::FeatureN64) != 0)) == 1);
- if (!isABI_O32() && !allowOddSPReg() != 0)
+ if (!isABI_O32() && !useOddSPReg() != 0)
report_fatal_error("-mno-odd-spreg requires the O32 ABI");
}
@@ -254,7 +254,7 @@ public:
bool isABI_O32() const { return STI.getFeatureBits() & Mips::FeatureO32; }
bool isABI_FPXX() const { return false; } // TODO: add check for FeatureXX
- bool allowOddSPReg() const {
+ bool useOddSPReg() const {
return !(STI.getFeatureBits() & Mips::FeatureNoOddSPReg);
}
@@ -572,7 +572,7 @@ public:
assert(N == 1 && "Invalid number of operands!");
Inst.addOperand(MCOperand::CreateReg(getFGR32Reg()));
// FIXME: We ought to do this for -integrated-as without -via-file-asm too.
- if (!AsmParser.allowOddSPReg() && RegIdx.Index & 1)
+ if (!AsmParser.useOddSPReg() && RegIdx.Index & 1)
AsmParser.Error(StartLoc, "-mno-odd-spreg prohibits the use of odd FPU "
"registers");
}
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h Mon Jul 14 05:26:15 2014
@@ -228,6 +228,7 @@ public:
setCPR1SizeFromPredicates(P);
setASESetFromPredicates(P);
setFpAbiFromPredicates(P);
+ OddSPReg = P.useOddSPReg();
}
};
Modified: llvm/trunk/test/MC/Mips/mips32/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32/abiflags.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips32/abiflags.s Mon Jul 14 05:26:15 2014
@@ -26,7 +26,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00002001 01010001 00000000 00000000 |.. .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/mips32r2/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips32r2/abiflags.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips32r2/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips32r2/abiflags.s Mon Jul 14 05:26:15 2014
@@ -27,7 +27,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00002002 01010001 00000000 00000000 |.. .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/mips64/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64/abiflags.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips64/abiflags.s Mon Jul 14 05:26:15 2014
@@ -26,7 +26,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00004001 02020001 00000000 00000000 |.. at .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/mips64r2/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips64r2/abiflags.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips64r2/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/mips64r2/abiflags.s Mon Jul 14 05:26:15 2014
@@ -26,7 +26,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00004002 02020001 00000000 00000000 |.. at .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s (original)
+++ llvm/trunk/test/MC/Mips/mips_abi_flags_xx.s Mon Jul 14 05:26:15 2014
@@ -26,7 +26,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00002001 01010005 00000000 00000000 |.. .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s (original)
+++ llvm/trunk/test/MC/Mips/mips_abi_flags_xx_set.s Mon Jul 14 05:26:15 2014
@@ -27,7 +27,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00002001 01010005 00000000 00000000 |.. .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/msa/abiflags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/msa/abiflags.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/msa/abiflags.s (original)
+++ llvm/trunk/test/MC/Mips/msa/abiflags.s Mon Jul 14 05:26:15 2014
@@ -27,7 +27,7 @@
# CHECK-OBJ: ]
# CHECK-OBJ: SectionData (
# CHECK-OBJ: 0000: 00002002 01030001 00000000 00000200 |.. .............|
-# CHECK-OBJ: 0010: 00000000 00000000 |........|
+# CHECK-OBJ: 0010: 00000001 00000000 |........|
# CHECK-OBJ: )
# CHECK-OBJ: }
Modified: llvm/trunk/test/MC/Mips/oddspreg.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/oddspreg.s?rev=212932&r1=212931&r2=212932&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/oddspreg.s (original)
+++ llvm/trunk/test/MC/Mips/oddspreg.s Mon Jul 14 05:26:15 2014
@@ -15,7 +15,21 @@
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 | \
# RUN: FileCheck %s -check-prefix=CHECK-ASM
#
-# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -filetype=obj -o - | \
+# Repeat the -filetype=obj tests but this time use an empty assembly file. The
+# output should be unchanged.
+# RUN: llvm-mc /dev/null -arch=mips64 -mcpu=mips64 -filetype=obj -o - | \
+# RUN: llvm-readobj -sections -section-data -section-relocations - | \
+# RUN: FileCheck %s -check-prefix=CHECK-OBJ-ALL -check-prefix=CHECK-OBJ-N64
+
+# RUN: llvm-mc /dev/null -arch=mips -mcpu=mips32 -mattr=+fp64 -filetype=obj -o - | \
+# RUN: llvm-readobj -sections -section-data -section-relocations - | \
+# RUN: FileCheck %s -check-prefix=CHECK-OBJ-ALL -check-prefix=CHECK-OBJ-O32
+#
+# RUN: llvm-mc /dev/null -arch=mips64 -mcpu=mips64 -mattr=-n64,+n32 -filetype=obj -o - | \
+# RUN: llvm-readobj -sections -section-data -section-relocations - | \
+# RUN: FileCheck %s -check-prefix=CHECK-OBJ-ALL -check-prefix=CHECK-OBJ-N32
+
+# RUN: llvm-mc /dev/null -arch=mips64 -mcpu=mips64 -filetype=obj -o - | \
# RUN: llvm-readobj -sections -section-data -section-relocations - | \
# RUN: FileCheck %s -check-prefix=CHECK-OBJ-ALL -check-prefix=CHECK-OBJ-N64
More information about the llvm-commits
mailing list