Home | History | Annotate | Download | only in compiler-flags
      1 // Copyright (c) 2014 Google Inc. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include <stdio.h>
      6 
      7 static const char* GetArchOption() {
      8 #if _M_IX86_FP == 0
      9   return "IA32";
     10 #elif _M_IX86_FP == 1
     11   return "SSE";
     12 #elif _M_IX86_FP == 2
     13 #  if defined(__AVX2__)
     14   return "AVX2";
     15 #  elif defined(__AVX__)
     16   return "AVX";
     17 #  else
     18   return "SSE2";
     19 #  endif
     20 #else
     21   return "UNSUPPORTED OPTION";
     22 #endif
     23 }
     24 
     25 int main() {
     26   printf("/arch:%s\n", GetArchOption());
     27   return 0;
     28 }
     29