[PATCH] D45616: [X86] Lower _mm[256|512]_cmp[.]_mask intrinsics to native llvm IR
    Sanjay Patel via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Jun 13 06:44:14 PDT 2018
    
    
  
spatel added inline comments.
================
Comment at: lib/CodeGen/CGBuiltin.cpp:10090-10100
+    // _CMP_TRUE_UQ, _CMP_TRUE_US produce -1,-1... vector
+    // on any input and _CMP_FALSE_OQ, _CMP_FALSE_OS produce 0, 0...
+    if (CC == 0xf || CC == 0xb || CC == 0x1b || CC == 0x1f) {
+       llvm::Type *ResultType = ConvertType(E->getType());
+
+       Value *Constant = (CC == 0xf || CC == 0x1f) ?
+              llvm::Constant::getAllOnesValue(ResultType) :
----------------
  llvm::Type *ResultType = ConvertType(E->getType());
  if (CC == 0x0f || CC == 0x1f)
    return llvm::Constant::getAllOnesValue(ResultType);
  if (CC == 0x0b || CC == 0x1b)
    return llvm::Constant::getNullValue(ResultType);
?
Also, can we use the defined predicate names instead of hex values in this code?
https://reviews.llvm.org/D45616
    
    
More information about the cfe-commits
mailing list