[llvm-commits] [dragonegg] r149786 - /dragonegg/trunk/include/x86/dragonegg/Target.h

Duncan Sands baldrick at free.fr
Sat Feb 4 09:46:13 PST 2012


Author: baldrick
Date: Sat Feb  4 11:46:13 2012
New Revision: 149786

URL: http://llvm.org/viewvc/llvm-project?rev=149786&view=rev
Log:
Handle an interesting asm feature supported by recent versions of GCC:
an asm string beginning with %v like '%vpcmpestri' means to use the
'vpcmpestri' instruction if targeting a processor supporting AVX, and
'pcmpestri' otherwise.

Modified:
    dragonegg/trunk/include/x86/dragonegg/Target.h

Modified: dragonegg/trunk/include/x86/dragonegg/Target.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/x86/dragonegg/Target.h?rev=149786&r1=149785&r2=149786&view=diff
==============================================================================
--- dragonegg/trunk/include/x86/dragonegg/Target.h (original)
+++ dragonegg/trunk/include/x86/dragonegg/Target.h Sat Feb  4 11:46:13 2012
@@ -368,6 +368,13 @@
 #define LLVM_OVERRIDE_TARGET_ARCH() \
   (TARGET_64BIT ? "x86_64" : "i386")
 
+#define LLVM_ASM_EXTENSIONS(ESCAPED_CHAR, ASM, RESULT)			\
+  else if ((ESCAPED_CHAR) == 'v') {					\
+    /* %v means to use the AVX prefix 'v' if TARGET_AVX is true. */	\
+    if (TARGET_AVX)							\
+      Result += 'v';							\
+  }
+
 /* LLVM_TARGET_INTRINSIC_LOWER - To handle builtins, we want to expand the
  * invocation into normal LLVM code.  If the target can handle the builtin, this
  * macro should call the target TreeToLLVM::TargetIntrinsicLower method and





More information about the llvm-commits mailing list