r190496 - Fix a bug where -msse followed by -mno-sse would leave MMX enabled.
Rafael EspĂndola
rafael.espindola at gmail.com
Mon Sep 23 13:08:31 PDT 2013
Thanks for all these fixes. How are you finding these bugs?
On 11 September 2013 02:48, Craig Topper <craig.topper at gmail.com> wrote:
> Author: ctopper
> Date: Wed Sep 11 01:48:53 2013
> New Revision: 190496
>
> URL: http://llvm.org/viewvc/llvm-project?rev=190496&view=rev
> Log:
> Fix a bug where -msse followed by -mno-sse would leave MMX enabled.
>
> Modified:
> cfe/trunk/lib/Basic/Targets.cpp
> cfe/trunk/test/Preprocessor/x86_target_features.c
>
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=190496&r1=190495&r2=190496&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Wed Sep 11 01:48:53 2013
> @@ -2143,8 +2143,6 @@ void X86TargetInfo::setSSELevel(llvm::St
> case SSE2:
> Features["sse2"] = true;
> case SSE1:
> - if (!Features.count("mmx"))
> - setMMXLevel(Features, MMX, Enabled);
> Features["sse"] = true;
> case NoSSE:
> break;
> @@ -2427,10 +2425,14 @@ bool X86TargetInfo::HandleTargetFeatures
>
> // Don't tell the backend if we're turning off mmx; it will end up disabling
> // SSE, which we don't want.
> + // Additionally, if SSE is enabled and mmx is not explicitly disabled,
> + // then enable MMX.
> std::vector<std::string>::iterator it;
> it = std::find(Features.begin(), Features.end(), "-mmx");
> if (it != Features.end())
> Features.erase(it);
> + else if (SSELevel > NoSSE)
> + MMX3DNowLevel = std::max(MMX3DNowLevel, MMX);
> return true;
> }
>
>
> Modified: cfe/trunk/test/Preprocessor/x86_target_features.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/x86_target_features.c?rev=190496&r1=190495&r2=190496&view=diff
> ==============================================================================
> --- cfe/trunk/test/Preprocessor/x86_target_features.c (original)
> +++ cfe/trunk/test/Preprocessor/x86_target_features.c Wed Sep 11 01:48:53 2013
> @@ -140,3 +140,15 @@
> // RUN: %clang -target i386-unknown-unknown -march=atom -mpopcnt -mno-sse4.2 -x c -E -dM -o - %s | FileCheck --check-prefix=NOSSE42POPCNT %s
>
> // NOSSE42POPCNT: #define __POPCNT__ 1
> +
> +// RUN: %clang -target i386-unknown-unknown -march=atom -msse -x c -E -dM -o - %s | FileCheck --check-prefix=SSEMMX %s
> +
> +// SSEMMX: #define __MMX__ 1
> +
> +// RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-sse -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOSSEMMX %s
> +
> +// SSENOSSEMMX-NOT: #define __MMX__ 1
> +
> +// RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-mmx -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOMMX %s
> +
> +// SSENOMMX-NOT: #define __MMX__ 1
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list