[llvm] r215846 - ARM: correct toggling behaviour
Saleem Abdulrasool
compnerd at compnerd.org
Sun Aug 17 12:20:38 PDT 2014
Author: compnerd
Date: Sun Aug 17 14:20:38 2014
New Revision: 215846
URL: http://llvm.org/viewvc/llvm-project?rev=215846&view=rev
Log:
ARM: correct toggling behaviour
This was a thinko. The intent was to flip the explicit bits that need toggling
rather than all bits. This would result in incorrect behaviour (which now is
tested).
Thanks to Nico Weber for pointing this out!
Added:
llvm/trunk/test/MC/ARM/directive-arch_extension-toggle.s
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=215846&r1=215845&r2=215846&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Sun Aug 17 14:20:38 2014
@@ -9580,14 +9580,12 @@ bool ARMAsmParser::parseDirectiveArchExt
return false;
}
- bool ToggleFeatures = EnableFeature
- ? (~STI.getFeatureBits() & Extension.Features)
- : ( STI.getFeatureBits() & Extension.Features);
- if (ToggleFeatures) {
- unsigned Features =
- ComputeAvailableFeatures(STI.ToggleFeature(Extension.Features));
- setAvailableFeatures(Features);
- }
+ unsigned ToggleFeatures = EnableFeature
+ ? (~STI.getFeatureBits() & Extension.Features)
+ : ( STI.getFeatureBits() & Extension.Features);
+ unsigned Features =
+ ComputeAvailableFeatures(STI.ToggleFeature(ToggleFeatures));
+ setAvailableFeatures(Features);
return false;
}
Added: llvm/trunk/test/MC/ARM/directive-arch_extension-toggle.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/directive-arch_extension-toggle.s?rev=215846&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/directive-arch_extension-toggle.s (added)
+++ llvm/trunk/test/MC/ARM/directive-arch_extension-toggle.s Sun Aug 17 14:20:38 2014
@@ -0,0 +1,8 @@
+@ RUN: llvm-mc -triple armv7-eabi -mattr hwdiv -filetype asm -o /dev/null %s
+
+ .syntax unified
+ .thumb
+
+ udiv r0, r1, r2
+ .arch_extension idiv
+ udiv r0, r1, r2
More information about the llvm-commits
mailing list