r271166 - Fix typo.
Author: rafael Date: Sat May 28 22:03:22 2016 New Revision: 271166 URL: http://llvm.org/viewvc/llvm-project?rev=271166&view=rev Log: Fix typo. Thanks to David Majnemer for noticing. Modified: cfe/trunk/include/clang/Driver/CC1Options.td Modified: cfe/trunk/include/clang/Driver/CC1Options.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=271166&r1=271165&r2=271166&view=diff == --- cfe/trunk/include/clang/Driver/CC1Options.td (original) +++ cfe/trunk/include/clang/Driver/CC1Options.td Sat May 28 22:03:22 2016 @@ -144,7 +144,7 @@ def mno_exec_stack : Flag<["-"], "mnoexe def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">, HelpText<"Make assembler warnings fatal">; def mrelax_relocations : Flag<["--"], "mrelax-relocations">, -HelpText<"Use relaxabel elf relocations">; +HelpText<"Use relaxable elf relocations">; def compress_debug_sections : Flag<["-"], "compress-debug-sections">, HelpText<"Compress DWARF debug sections using zlib">; def msave_temp_labels : Flag<["-"], "msave-temp-labels">, ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r271165 - [CodeGen] Use the ArrayRef form CreateShuffleVector instead of building ConstantVectors or ConstantDataVectors and calling the other form.
Author: ctopper Date: Sat May 28 21:39:30 2016 New Revision: 271165 URL: http://llvm.org/viewvc/llvm-project?rev=271165&view=rev Log: [CodeGen] Use the ArrayRef form CreateShuffleVector instead of building ConstantVectors or ConstantDataVectors and calling the other form. Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=271165&r1=271164&r2=271165&view=diff == --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original) +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sat May 28 21:39:30 2016 @@ -3268,14 +3268,13 @@ Value *CodeGenFunction::EmitCommonNeonBu case NEON::BI__builtin_neon_vext_v: case NEON::BI__builtin_neon_vextq_v: { int CV = cast(Ops[2])->getSExtValue(); -SmallVector Indices; +SmallVector Indices; for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i) - Indices.push_back(ConstantInt::get(Int32Ty, i+CV)); + Indices.push_back(i+CV); Ops[0] = Builder.CreateBitCast(Ops[0], Ty); Ops[1] = Builder.CreateBitCast(Ops[1], Ty); -Value *SV = llvm::ConstantVector::get(Indices); -return Builder.CreateShuffleVector(Ops[0], Ops[1], SV, "vext"); +return Builder.CreateShuffleVector(Ops[0], Ops[1], Indices, "vext"); } case NEON::BI__builtin_neon_vfma_v: case NEON::BI__builtin_neon_vfmaq_v: { @@ -3473,14 +3472,13 @@ Value *CodeGenFunction::EmitCommonNeonBu Value *SV = nullptr; for (unsigned vi = 0; vi != 2; ++vi) { - SmallVector Indices; + SmallVector Indices; for (unsigned i = 0, e = VTy->getNumElements(); i != e; i += 2) { -Indices.push_back(Builder.getInt32(i+vi)); -Indices.push_back(Builder.getInt32(i+e+vi)); +Indices.push_back(i+vi); +Indices.push_back(i+e+vi); } Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi); - SV = llvm::ConstantVector::get(Indices); - SV = Builder.CreateShuffleVector(Ops[1], Ops[2], SV, "vtrn"); + SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vtrn"); SV = Builder.CreateDefaultAlignedStore(SV, Addr); } return SV; @@ -3502,13 +3500,12 @@ Value *CodeGenFunction::EmitCommonNeonBu Value *SV = nullptr; for (unsigned vi = 0; vi != 2; ++vi) { - SmallVector Indices; + SmallVector Indices; for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i) -Indices.push_back(ConstantInt::get(Int32Ty, 2*i+vi)); +Indices.push_back(2*i+vi); Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi); - SV = llvm::ConstantVector::get(Indices); - SV = Builder.CreateShuffleVector(Ops[1], Ops[2], SV, "vuzp"); + SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vuzp"); SV = Builder.CreateDefaultAlignedStore(SV, Addr); } return SV; @@ -3521,14 +3518,13 @@ Value *CodeGenFunction::EmitCommonNeonBu Value *SV = nullptr; for (unsigned vi = 0; vi != 2; ++vi) { - SmallVector Indices; + SmallVector Indices; for (unsigned i = 0, e = VTy->getNumElements(); i != e; i += 2) { -Indices.push_back(ConstantInt::get(Int32Ty, (i + vi*e) >> 1)); -Indices.push_back(ConstantInt::get(Int32Ty, ((i + vi*e) >> 1)+e)); +Indices.push_back((i + vi*e) >> 1); +Indices.push_back(((i + vi*e) >> 1)+e); } Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi); - SV = llvm::ConstantVector::get(Indices); - SV = Builder.CreateShuffleVector(Ops[1], Ops[2], SV, "vzip"); + SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vzip"); SV = Builder.CreateDefaultAlignedStore(SV, Addr); } return SV; @@ -3577,18 +3573,18 @@ static Value *packTBLDVectorList(CodeGen TblOps.push_back(ExtOp); // Build a vector containing sequential number like (0, 1, 2, ..., 15) - SmallVector Indices; + SmallVector Indices; llvm::VectorType *TblTy = cast(Ops[0]->getType()); for (unsigned i = 0, e = TblTy->getNumElements(); i != e; ++i) { -Indices.push_back(ConstantInt::get(CGF.Int32Ty, 2*i)); -Indices.push_back(ConstantInt::get(CGF.Int32Ty, 2*i+1)); +Indices.push_back(2*i); +Indices.push_back(2*i+1); } - Value *SV = llvm::ConstantVector::get(Indices); int PairPos = 0, End = Ops.size() - 1; while (PairPos < End) { TblOps.push_back(CGF.Builder.CreateShuffleVector(Ops[PairPos], - Ops[PairPos+1], SV, Name)); + Ops[PairPos+1], Indices, + Name)); PairPos += 2; } @@ -3597,7 +3593,7 @@ static Value *packTBLDVectorList(CodeGen if (PairPos == End) { Value *ZeroTbl = ConstantAggregateZero::get(TblTy); TblOps.push_back(CGF.Builder.CreateShuffleVector(
r271163 - Mark test as requiring x86-registered-target.
Author: rafael Date: Sat May 28 21:36:16 2016 New Revision: 271163 URL: http://llvm.org/viewvc/llvm-project?rev=271163&view=rev Log: Mark test as requiring x86-registered-target. Modified: cfe/trunk/test/CodeGen/relax.c Modified: cfe/trunk/test/CodeGen/relax.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/relax.c?rev=271163&r1=271162&r2=271163&view=diff == --- cfe/trunk/test/CodeGen/relax.c (original) +++ cfe/trunk/test/CodeGen/relax.c Sat May 28 21:36:16 2016 @@ -1,3 +1,4 @@ +// REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations %s -mrelocation-model pic -o %t // RUN: llvm-readobj -r %t | FileCheck %s ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r271162 - Handle -Wa,--mrelax-relocations=[no|yes].
On Sat, May 28, 2016 at 7:01 PM, Rafael Espindola via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rafael > Date: Sat May 28 21:01:14 2016 > New Revision: 271162 > > URL: http://llvm.org/viewvc/llvm-project?rev=271162&view=rev > Log: > Handle -Wa,--mrelax-relocations=[no|yes]. > > Added: > cfe/trunk/test/CodeGen/relax.c > cfe/trunk/test/Driver/relax.c > cfe/trunk/test/Driver/relax.s > Modified: > cfe/trunk/include/clang/Driver/CC1Options.td > cfe/trunk/include/clang/Frontend/CodeGenOptions.def > cfe/trunk/lib/CodeGen/BackendUtil.cpp > cfe/trunk/lib/Driver/Tools.cpp > cfe/trunk/lib/Frontend/CompilerInvocation.cpp > cfe/trunk/tools/driver/cc1as_main.cpp > > Modified: cfe/trunk/include/clang/Driver/CC1Options.td > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=271162&r1=271161&r2=271162&view=diff > > == > --- cfe/trunk/include/clang/Driver/CC1Options.td (original) > +++ cfe/trunk/include/clang/Driver/CC1Options.td Sat May 28 21:01:14 2016 > @@ -143,6 +143,8 @@ def mno_exec_stack : Flag<["-"], "mnoexe >HelpText<"Mark the file as not needing an executable stack">; > def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">, >HelpText<"Make assembler warnings fatal">; > +def mrelax_relocations : Flag<["--"], "mrelax-relocations">, > +HelpText<"Use relaxabel elf relocations">; > relaxable? > def compress_debug_sections : Flag<["-"], "compress-debug-sections">, > HelpText<"Compress DWARF debug sections using zlib">; > def msave_temp_labels : Flag<["-"], "msave-temp-labels">, > > Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=271162&r1=271161&r2=271162&view=diff > > == > --- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original) > +++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Sat May 28 > 21:01:14 2016 > @@ -30,6 +30,7 @@ CODEGENOPT(Name, Bits, Default) > > CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as > CODEGENOPT(CompressDebugSections, 1, 0) ///< -Wa,-compress-debug-sections > +CODEGENOPT(RelaxELFRelocations, 1, 0) ///< -Wa,--mrelax-relocations > CODEGENOPT(AsmVerbose, 1, 0) ///< -dA, -fverbose-asm. > CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit > __attribute__((malloc)) operator new > CODEGENOPT(Autolink , 1, 1) ///< -fno-autolink > > Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=271162&r1=271161&r2=271162&view=diff > > == > --- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original) > +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sat May 28 21:01:14 2016 > @@ -593,6 +593,7 @@ TargetMachine *EmitAssemblyHelper::Creat >Options.UseInitArray = CodeGenOpts.UseInitArray; >Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS; >Options.CompressDebugSections = CodeGenOpts.CompressDebugSections; > + Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations; > >// Set EABI version. >Options.EABIVersion = > llvm::StringSwitch(TargetOpts.EABIVersion) > > Modified: cfe/trunk/lib/Driver/Tools.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=271162&r1=271161&r2=271162&view=diff > > == > --- cfe/trunk/lib/Driver/Tools.cpp (original) > +++ cfe/trunk/lib/Driver/Tools.cpp Sat May 28 21:01:14 2016 > @@ -2797,6 +2797,8 @@ static void CollectArgsForIntegratedAsse >// When using an integrated assembler, translate -Wa, and -Xassembler >// options. >bool CompressDebugSections = false; > + > + bool UseRelaxRelocations = false; >const char *MipsTargetFeature = nullptr; >for (const Arg *A : > Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { > @@ -2872,6 +2874,12 @@ static void CollectArgsForIntegratedAsse >} else if (Value == "-nocompress-debug-sections" || > Value == "--nocompress-debug-sections") { > CompressDebugSections = false; > + } else if (Value == "-mrelax-relocations=yes" || > + Value == "--mrelax-relocations=yes") { > +UseRelaxRelocations = true; > + } else if (Value == "-mrelax-relocations=no" || > + Value == "--mrelax-relocations=no") { > +UseRelaxRelocations = false; >} else if (Value.startswith("-I")) { > CmdArgs.push_back(Value.data()); > // We need to consume the next argument if the current arg is a > plain > @@ -2903,6 +2911,8 @@ static void CollectArgsForIntegratedAsse > else >D.Diag(diag::warn_
r271162 - Handle -Wa,--mrelax-relocations=[no|yes].
Author: rafael Date: Sat May 28 21:01:14 2016 New Revision: 271162 URL: http://llvm.org/viewvc/llvm-project?rev=271162&view=rev Log: Handle -Wa,--mrelax-relocations=[no|yes]. Added: cfe/trunk/test/CodeGen/relax.c cfe/trunk/test/Driver/relax.c cfe/trunk/test/Driver/relax.s Modified: cfe/trunk/include/clang/Driver/CC1Options.td cfe/trunk/include/clang/Frontend/CodeGenOptions.def cfe/trunk/lib/CodeGen/BackendUtil.cpp cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/lib/Frontend/CompilerInvocation.cpp cfe/trunk/tools/driver/cc1as_main.cpp Modified: cfe/trunk/include/clang/Driver/CC1Options.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=271162&r1=271161&r2=271162&view=diff == --- cfe/trunk/include/clang/Driver/CC1Options.td (original) +++ cfe/trunk/include/clang/Driver/CC1Options.td Sat May 28 21:01:14 2016 @@ -143,6 +143,8 @@ def mno_exec_stack : Flag<["-"], "mnoexe HelpText<"Mark the file as not needing an executable stack">; def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">, HelpText<"Make assembler warnings fatal">; +def mrelax_relocations : Flag<["--"], "mrelax-relocations">, +HelpText<"Use relaxabel elf relocations">; def compress_debug_sections : Flag<["-"], "compress-debug-sections">, HelpText<"Compress DWARF debug sections using zlib">; def msave_temp_labels : Flag<["-"], "msave-temp-labels">, Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=271162&r1=271161&r2=271162&view=diff == --- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original) +++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Sat May 28 21:01:14 2016 @@ -30,6 +30,7 @@ CODEGENOPT(Name, Bits, Default) CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as CODEGENOPT(CompressDebugSections, 1, 0) ///< -Wa,-compress-debug-sections +CODEGENOPT(RelaxELFRelocations, 1, 0) ///< -Wa,--mrelax-relocations CODEGENOPT(AsmVerbose, 1, 0) ///< -dA, -fverbose-asm. CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit __attribute__((malloc)) operator new CODEGENOPT(Autolink , 1, 1) ///< -fno-autolink Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=271162&r1=271161&r2=271162&view=diff == --- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original) +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sat May 28 21:01:14 2016 @@ -593,6 +593,7 @@ TargetMachine *EmitAssemblyHelper::Creat Options.UseInitArray = CodeGenOpts.UseInitArray; Options.DisableIntegratedAS = CodeGenOpts.DisableIntegratedAS; Options.CompressDebugSections = CodeGenOpts.CompressDebugSections; + Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations; // Set EABI version. Options.EABIVersion = llvm::StringSwitch(TargetOpts.EABIVersion) Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=271162&r1=271161&r2=271162&view=diff == --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Sat May 28 21:01:14 2016 @@ -2797,6 +2797,8 @@ static void CollectArgsForIntegratedAsse // When using an integrated assembler, translate -Wa, and -Xassembler // options. bool CompressDebugSections = false; + + bool UseRelaxRelocations = false; const char *MipsTargetFeature = nullptr; for (const Arg *A : Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) { @@ -2872,6 +2874,12 @@ static void CollectArgsForIntegratedAsse } else if (Value == "-nocompress-debug-sections" || Value == "--nocompress-debug-sections") { CompressDebugSections = false; + } else if (Value == "-mrelax-relocations=yes" || + Value == "--mrelax-relocations=yes") { +UseRelaxRelocations = true; + } else if (Value == "-mrelax-relocations=no" || + Value == "--mrelax-relocations=no") { +UseRelaxRelocations = false; } else if (Value.startswith("-I")) { CmdArgs.push_back(Value.data()); // We need to consume the next argument if the current arg is a plain @@ -2903,6 +2911,8 @@ static void CollectArgsForIntegratedAsse else D.Diag(diag::warn_debug_compression_unavailable); } + if (UseRelaxRelocations) +CmdArgs.push_back("--mrelax-relocations"); if (MipsTargetFeature != nullptr) { CmdArgs.push_back("-target-feature"); CmdArgs.push_back(MipsTargetFeature); Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp URL: http://llvm.or
Re: [PATCH] D20359: [LLVM][AVX512][Intrinsics] Convert AVX non-temporal store builtins to LLVM-native IR.
RKSimon added a subscriber: RKSimon. RKSimon added a comment. Should AVX512 store support (non-temporal or otherwise) be added to X86FastISel::X86FastEmitStore ? http://reviews.llvm.org/D20359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r271138 - CodeGen: support blocks on COFF targets in DLLs
Author: compnerd Date: Sat May 28 14:41:35 2016 New Revision: 271138 URL: http://llvm.org/viewvc/llvm-project?rev=271138&view=rev Log: CodeGen: support blocks on COFF targets in DLLs This extends the blocks support to support blocks with a dynamically linked blocks runtime. The previous code generation would work only for static builds of the blocks runtime. Mark the block "isa" pointers and functions as dllimport if no explicit declaration marked with __declspec(dllexport) is found. This additional check allows for the use of the functionality in the runtime library if desired. Added: cfe/trunk/test/CodeGen/blocks-windows.c Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=271138&r1=271137&r2=271138&view=diff == --- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original) +++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sat May 28 14:41:35 2016 @@ -2287,9 +2287,35 @@ void CodeGenFunction::enterByrefCleanup( /// Adjust the declaration of something from the blocks API. static void configureBlocksRuntimeObject(CodeGenModule &CGM, llvm::Constant *C) { - if (!CGM.getLangOpts().BlocksRuntimeOptional) return; - auto *GV = cast(C->stripPointerCasts()); + + if (CGM.getTarget().getTriple().isOSBinFormatCOFF()) { +IdentifierInfo &II = CGM.getContext().Idents.get(C->getName()); +TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl(); +DeclContext *DC = TranslationUnitDecl::castToDeclContext(TUDecl); + +assert((isa(C) || isa(C)) && + "expected Function or GlobalValue"); + +const NamedDecl *ND = nullptr; +for (const auto &Result : DC->lookup(&II)) + if ((ND = dyn_cast(Result)) || + (ND = dyn_cast(Result))) +break; + +// TODO: support static blocks runtime +if (GV->isDeclaration() && (!ND || !ND->hasAttr())) { + GV->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass); + GV->setLinkage(llvm::GlobalValue::ExternalLinkage); +} else { + GV->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass); + GV->setLinkage(llvm::GlobalValue::ExternalLinkage); +} + } + + if (!CGM.getLangOpts().BlocksRuntimeOptional) +return; + if (GV->isDeclaration() && GV->hasExternalLinkage()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); } @@ -2337,5 +2363,5 @@ llvm::Constant *CodeGenModule::getNSConc Int8PtrTy->getPointerTo(), nullptr); configureBlocksRuntimeObject(*this, NSConcreteStackBlock); - return NSConcreteStackBlock; + return NSConcreteStackBlock; } Added: cfe/trunk/test/CodeGen/blocks-windows.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks-windows.c?rev=271138&view=auto == --- cfe/trunk/test/CodeGen/blocks-windows.c (added) +++ cfe/trunk/test/CodeGen/blocks-windows.c Sat May 28 14:41:35 2016 @@ -0,0 +1,76 @@ +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLOCKS_IN_BLOCKS_DECL -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-IN-BLOCKS-DECL +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLOCKS_IN_BLOCKS_DEFN -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-IN-BLOCKS-DEFN +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLOCKS_NOT_IN_BLOCKS_EXTERN -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLCOKS_NOT_IN_BLOCKS_EXTERN_DLLIMPORT -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN-DLLIMPORT +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLCOKS_NOT_IN_BLOCKS_DLLIMPORT -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-DLLIMPORT + +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLOCKS_IN_BLOCKS_DECL -Os -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-IN-BLOCKS-DECL +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLOCKS_IN_BLOCKS_DEFN -Os -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-IN-BLOCKS-DEFN +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -Os -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS +// RUN: %clang_cc1 -triple thumbv7-windows -fblocks -fdeclspec -DBLOCKS_NOT_IN_BLOCKS_EXTERN -Os -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN +// RUN: %clang_cc1 -triple thumbv7-windows -fblock
[PATCH] D20773: [Sema] Fix incorrect enum token namespace
etienneb created this revision. etienneb added a reviewer: rsmith. etienneb added a subscriber: cfe-commits. This patch fix the scoping of enum literal. They were not resolving to the right type. It was not causing any problem as one is a copy of the other one. The literal in the switch are resolving to Sema.h:5527 ``` enum AccessResult { AR_accessible, AR_inaccessible, AR_dependent, AR_delayed }; ``` Instead of SemaAccess.cpp:27 ``` /// A copy of Sema's enum without AR_delayed. enum AccessResult { AR_accessible, AR_inaccessible, AR_dependent }; ``` This issue was found by a new clang-tidy check (still on-going). http://reviews.llvm.org/D20773 Files: lib/Sema/SemaAccess.cpp Index: lib/Sema/SemaAccess.cpp === --- lib/Sema/SemaAccess.cpp +++ lib/Sema/SemaAccess.cpp @@ -1766,9 +1766,9 @@ // while the ParsingDeclarator is active. EffectiveContext EC(CurContext); switch (CheckEffectiveAccess(*this, EC, target->getLocation(), entity)) { - case AR_accessible: return Sema::AR_accessible; - case AR_inaccessible: return Sema::AR_inaccessible; - case AR_dependent: return Sema::AR_dependent; + case ::AR_accessible: return Sema::AR_accessible; + case ::AR_inaccessible: return Sema::AR_inaccessible; + case ::AR_dependent: return Sema::AR_dependent; } llvm_unreachable("invalid access result"); } Index: lib/Sema/SemaAccess.cpp === --- lib/Sema/SemaAccess.cpp +++ lib/Sema/SemaAccess.cpp @@ -1766,9 +1766,9 @@ // while the ParsingDeclarator is active. EffectiveContext EC(CurContext); switch (CheckEffectiveAccess(*this, EC, target->getLocation(), entity)) { - case AR_accessible: return Sema::AR_accessible; - case AR_inaccessible: return Sema::AR_inaccessible; - case AR_dependent: return Sema::AR_dependent; + case ::AR_accessible: return Sema::AR_accessible; + case ::AR_inaccessible: return Sema::AR_inaccessible; + case ::AR_dependent: return Sema::AR_dependent; } llvm_unreachable("invalid access result"); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r271134 - [AVX512] Add masked v16i32 and v8i64 unaligned store tests.
Author: ctopper Date: Sat May 28 13:59:06 2016 New Revision: 271134 URL: http://llvm.org/viewvc/llvm-project?rev=271134&view=rev Log: [AVX512] Add masked v16i32 and v8i64 unaligned store tests. Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=271134&r1=271133&r2=271134&view=diff == --- cfe/trunk/test/CodeGen/avx512f-builtins.c (original) +++ cfe/trunk/test/CodeGen/avx512f-builtins.c Sat May 28 13:59:06 2016 @@ -196,6 +196,18 @@ void test_mm512_mask_store_pd(void *p, _ _mm512_mask_store_pd(p, m, a); } +void test_mm512_mask_storeu_epi32(void *__P, __mmask16 __U, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.storeu.d.512 + return _mm512_mask_storeu_epi32(__P, __U, __A); +} + +void test_mm512_mask_storeu_epi64(void *__P, __mmask8 __U, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_storeu_epi64 + // CHECK: @llvm.x86.avx512.mask.storeu.q.512 + return _mm512_mask_storeu_epi64(__P, __U, __A); +} + __m512i test_mm512_loadu_si512 (void *__P) { // CHECK-LABEL: @test_mm512_loadu_si512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D20772: Automatically detect export lists for OS X.
EricWF created this revision. EricWF added reviewers: mclow.lists, bcraig, dexonsmith. EricWF added a subscriber: cfe-commits. Libc++ reexports symbols from the system libc++abi using -reexport_symbols_list. This can cause a linker failure if the list contains symbols not defined in the system libc++abi. This patch attempts to detect the OS X version and use it to determine the correct symbol list. It's my understanding that `lib/libc++abi2.exp` should be used on 10.9 and greater. Otherwise 'lib/libc++abi.exp' should be used This fixes PR25666 (https://llvm.org/bugs/show_bug.cgi?id=25666) http://reviews.llvm.org/D20772 Files: lib/CMakeLists.txt Index: lib/CMakeLists.txt === --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -88,7 +88,21 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR LIBCXX_CXX_ABI_LIBNAME STREQUAL "none")) if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION) -set(LIBCXX_LIBCPPABI_VERSION "2") +set(LIBCXX_LIBCPPABI_VERSION "2") # Default value +execute_process( + COMMAND xcrun --show-sdk-version + OUTPUT_VARIABLE sdk_ver + RESULT_VARIABLE res + OUTPUT_STRIP_TRAILING_WHITESPACE) +if (res EQUAL 0) + message(STATUS "Found SDK version ${sdk_ver}") + string(REPLACE "10." "" sdk_ver "${sdk_ver}") + if (sdk_ver LESS 9) +set(LIBCXX_LIBCPPABI_VERSION "") + else() +set(LIBCXX_LIBCPPABI_VERSION "2") + endif() +endif() endif() if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" ) Index: lib/CMakeLists.txt === --- lib/CMakeLists.txt +++ lib/CMakeLists.txt @@ -88,7 +88,21 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR LIBCXX_CXX_ABI_LIBNAME STREQUAL "none")) if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION) -set(LIBCXX_LIBCPPABI_VERSION "2") +set(LIBCXX_LIBCPPABI_VERSION "2") # Default value +execute_process( + COMMAND xcrun --show-sdk-version + OUTPUT_VARIABLE sdk_ver + RESULT_VARIABLE res + OUTPUT_STRIP_TRAILING_WHITESPACE) +if (res EQUAL 0) + message(STATUS "Found SDK version ${sdk_ver}") + string(REPLACE "10." "" sdk_ver "${sdk_ver}") + if (sdk_ver LESS 9) +set(LIBCXX_LIBCPPABI_VERSION "") + else() +set(LIBCXX_LIBCPPABI_VERSION "2") + endif() +endif() endif() if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" ) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r271110 - [driver][mips] Fix local variable naming. NFC
Author: atanasyan Date: Sat May 28 04:44:15 2016 New Revision: 271110 URL: http://llvm.org/viewvc/llvm-project?rev=271110&view=rev Log: [driver][mips] Fix local variable naming. NFC Modified: cfe/trunk/lib/Driver/ToolChains.cpp Modified: cfe/trunk/lib/Driver/ToolChains.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=271110&r1=271109&r2=271110&view=diff == --- cfe/trunk/lib/Driver/ToolChains.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains.cpp Sat May 28 04:44:15 2016 @@ -2262,9 +2262,9 @@ static bool findMIPSMultilibs(const Driv TargetTriple.getOS() == llvm::Triple::Linux && TargetTriple.getEnvironment() == llvm::Triple::GNU) { // Select mips-mti-linux-gnu toolchain. -for (auto candidate : {&MtiMipsMultilibsV1, &MtiMipsMultilibsV2}) { - if (candidate->select(Flags, Result.SelectedMultilib)) { -Result.Multilibs = *candidate; +for (auto Candidate : {&MtiMipsMultilibsV1, &MtiMipsMultilibsV2}) { + if (Candidate->select(Flags, Result.SelectedMultilib)) { +Result.Multilibs = *Candidate; return true; } } @@ -2275,9 +2275,9 @@ static bool findMIPSMultilibs(const Driv TargetTriple.getOS() == llvm::Triple::Linux && TargetTriple.getEnvironment() == llvm::Triple::GNU) { // Select mips-img-linux-gnu toolchain. -for (auto candidate : {&ImgMultilibsV1, &ImgMultilibsV2}) { - if (candidate->select(Flags, Result.SelectedMultilib)) { -Result.Multilibs = *candidate; +for (auto Candidate : {&ImgMultilibsV1, &ImgMultilibsV2}) { + if (Candidate->select(Flags, Result.SelectedMultilib)) { +Result.Multilibs = *Candidate; return true; } } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D20684: [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (clang)
This revision was automatically updated to reflect the committed changes. Closed by commit rL271106: [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with… (authored by RKSimon). Changed prior to commit: http://reviews.llvm.org/D20684?vs=58626&id=58884#toc Repository: rL LLVM http://reviews.llvm.org/D20684 Files: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Headers/avx2intrin.h cfe/trunk/lib/Headers/smmintrin.h cfe/trunk/test/CodeGen/avx2-builtins.c cfe/trunk/test/CodeGen/builtins-x86.c cfe/trunk/test/CodeGen/sse41-builtins.c Index: cfe/trunk/include/clang/Basic/BuiltinsX86.def === --- cfe/trunk/include/clang/Basic/BuiltinsX86.def +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def @@ -382,12 +382,6 @@ TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbd128, "V4iV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbq128, "V2LLiV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbw128, "V8sV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxdq128, "V2LLiV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxwd128, "V4iV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "", "sse4.1") @@ -558,18 +552,6 @@ TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbw256, "V16sV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbd256, "V8iV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbq256, "V4LLiV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxwd256, "V8iV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxwq256, "V4LLiV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxdq256, "V4LLiV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbw256, "V16sV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbd256, "V8iV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbq256, "V4LLiV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxwd256, "V8iV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxwq256, "V4LLiV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxdq256, "V4LLiV4i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "", "avx2") Index: cfe/trunk/test/CodeGen/sse41-builtins.c === --- cfe/trunk/test/CodeGen/sse41-builtins.c +++ cfe/trunk/test/CodeGen/sse41-builtins.c @@ -119,37 +119,43 @@ __m128i test_mm_cvtepu8_epi16(__m128i a) { // CHECK-LABEL: test_mm_cvtepu8_epi16 - // CHECK: call <8 x i16> @llvm.x86.sse41.pmovzxbw(<16 x i8> {{.*}}) + // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <8 x i32> + // CHECK: zext <8 x i8> {{.*}} to <8 x i16> return _mm_cvtepu8_epi16(a); } __m128i test_mm_cvtepu8_epi32(__m128i a) { // CHECK-LABEL: test_mm_cvtepu8_epi32 - // CHECK: call <4 x i32> @llvm.x86.sse41.pmovzxbd(<16 x i8> {{.*}}) + // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <4 x i32> + // CHECK: zext <4 x i8> {{.*}} to <4 x i32> return _mm_cvtepu8_epi32(a); } __m128i test_mm_cvtepu8_epi64(__m128i a) { // CHECK-LABEL: test_mm_cvtepu8_epi64 - // CHECK: call <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8> {{.*}}) + // CHECK: shufflevector <16 x i8> {{.*}}, <16 x i8> {{.*}}, <2 x i32> + // CHECK: zext <2 x i8> {{.*}} to <2 x i64> return _mm_cvtepu8_epi64(a); } __m128i test_mm_cvtepu16_epi32(__m128i a) { // CHECK-LABEL: test_mm_cvtepu16_epi32 - // CHECK: call <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16> {{.*}}) + // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <4 x i32> + // CHECK: zext <4 x i16> {{.*}} to <4 x i32> return _mm_cvtepu16_epi32(a); } __m128i test_mm_cvtepu16_epi64(__m128i a) { // CHECK-LABEL: test_mm_cvtepu16_epi64 - // CHECK: call <2 x i64> @llvm.x86.sse41.pmovzxwq(<8 x i16> {{.*}}) + // CHECK: shufflevector <8 x i16> {{.*}}, <8 x i16> {{.*}}, <2 x i32> + // CHECK: zext <2 x i16> {{.*}} to <2 x i64> return _mm_cvtepu16_epi64(a); } __m128i test_mm_cvtepu32_epi64(__m128i a) { // CHECK-LABEL: test_mm_cvtepu32_epi64 - // CHECK: call <2 x i64> @llvm.x86.sse41.pmovzxdq(<4 x i32> {{.*}}) + // CHECK: shufflevector <4 x i32> {{.*}}, <4 x i32> {{.*}}, <2 x i32> + // CHECK: zext <2 x i32> {{.*}} to <2 x i64> re
r271106 - [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (clang)
Author: rksimon Date: Sat May 28 03:12:45 2016 New Revision: 271106 URL: http://llvm.org/viewvc/llvm-project?rev=271106&view=rev Log: [X86][SSE] Replace VPMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (clang) The VPMOVSX and (V)PMOVZX sign/zero extension intrinsics can be safely represented as generic __builtin_convertvector calls instead of x86 intrinsics. This patch removes the clang builtins and their use in the sse2/avx headers - a companion patch will remove/auto-upgrade the llvm intrinsics. Note: We already did this for SSE41 PMOVSX sometime ago. Differential Revision: http://reviews.llvm.org/D20684 Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def cfe/trunk/lib/Headers/avx2intrin.h cfe/trunk/lib/Headers/smmintrin.h cfe/trunk/test/CodeGen/avx2-builtins.c cfe/trunk/test/CodeGen/builtins-x86.c cfe/trunk/test/CodeGen/sse41-builtins.c Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=271106&r1=271105&r2=271106&view=diff == --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original) +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Sat May 28 03:12:45 2016 @@ -382,12 +382,6 @@ TARGET_BUILTIN(__builtin_ia32_pminsb128, TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbd128, "V4iV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbq128, "V2LLiV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbw128, "V8sV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxdq128, "V2LLiV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxwd128, "V4iV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "", "sse4.1") TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "", "sse4.1") @@ -558,18 +552,6 @@ TARGET_BUILTIN(__builtin_ia32_pminsb256, TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbw256, "V16sV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbd256, "V8iV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbq256, "V4LLiV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxwd256, "V8iV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxwq256, "V4LLiV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxdq256, "V4LLiV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbw256, "V16sV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbd256, "V8iV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbq256, "V4LLiV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxwd256, "V8iV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxwq256, "V4LLiV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxdq256, "V4LLiV4i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "", "avx2") TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "", "avx2") Modified: cfe/trunk/lib/Headers/avx2intrin.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx2intrin.h?rev=271106&r1=271105&r2=271106&view=diff == --- cfe/trunk/lib/Headers/avx2intrin.h (original) +++ cfe/trunk/lib/Headers/avx2intrin.h Sat May 28 03:12:45 2016 @@ -360,73 +360,85 @@ _mm256_movemask_epi8(__m256i __a) static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi8_epi16(__m128i __V) { - return (__m256i)__builtin_ia32_pmovsxbw256((__v16qi)__V); + /* This function always performs a signed extension, but __v16qi is a char + which may be signed or unsigned, so use __v16qs. */ + return (__m256i)__builtin_convertvector((__v16qs)__V, __v16hi); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi8_epi32(__m128i __V) { - return (__m256i)__builtin_ia32_pmovsxbd256((__v16qi)__V); + /* This function always performs a signed extension, but __v16qi is a char + which may be signed or unsigned, so use __v16qs. */ + return (__m256i)__builtin_convertvector(__builtin_shufflevector((__v16qs)__V, (__v16qs)__V, 0, 1, 2, 3, 4, 5, 6, 7), __v8si); } static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_cvtepi8_epi64(__m128i __V) { - return (__m256i)__builtin_ia32_pmovsxbq256((__v16qi)__V); + /* This function always performs a signed extension, but __v16qi is a char + which may be signed or unsigned, so use __v16qs. */ + return (__m256i)__builtin_convertvector(__b
Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
On 28 May 2016 12:58 a.m., "Eric Fiselier via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > > I think that would be a possibility. However IMO such a change has little value. Unlike other uses of `_LIBCPP_PREFERRED_OVERLOAD`, which fix const correctness issue, I don't think the int vs bool return type distinction as that important. Perhaps I"m just being ignorant? I don't think it's likely to be particularly important, but it seems pretty easy for us to fix with the techniques we're using elsewhere. > /Eric > > ___ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
I think that would be a possibility. However IMO such a change has little value. Unlike other uses of `_LIBCPP_PREFERRED_OVERLOAD`, which fix const correctness issue, I don't think the int vs bool return type distinction as that important. Perhaps I"m just being ignorant? /Eric ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
Could we use __LIBCPP_PREFERRED_OVERLOAD to get this working even with older glibc (and recent clang)? On 27 May 2016 3:26 p.m., "Eric Fiselier via cfe-commits" < cfe-commits@lists.llvm.org> wrote: > Author: ericwf > Date: Fri May 27 17:19:53 2016 > New Revision: 271060 > > URL: http://llvm.org/viewvc/llvm-project?rev=271060&view=rev > Log: > Tolerate incorrect return type for 'isinf' and 'isnan' in tests. > > Summary: > GLIBC recently removed the incorrect `int isinf(double)` and `int > isnan(double)` overloads in C++11 and greater. This causes previously > `XFAIL: linux` tests to start passing. > > Since there is no longer a way to 'XFAIL' the tests I choose to simply > tolerate this bug. > > See https://sourceware.org/bugzilla/show_bug.cgi?id=19439 > > > Reviewers: rsmith, mclow.lists, EricWF > > Subscribers: jroelofs, cfe-commits > > Differential Revision: http://reviews.llvm.org/D19835 > > Removed: > libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp > libcxx/trunk/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp > libcxx/trunk/test/std/numerics/c.math/cmath_isinf.pass.cpp > libcxx/trunk/test/std/numerics/c.math/cmath_isnan.pass.cpp > Modified: > libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp > libcxx/trunk/test/std/numerics/c.math/cmath.pass.cpp > > Modified: libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp > URL: > http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp?rev=271060&r1=271059&r2=271060&view=diff > > == > --- libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp (original) > +++ libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp Fri May 27 > 17:19:53 2016 > @@ -9,9 +9,6 @@ > > // > > -// NOTE: isinf and isnan are tested separately because they are expected > to fail > -// on linux. We don't want their expected failure to hide other failures > in this file. > - > #include > #include > #include > @@ -631,6 +628,29 @@ void test_isgreaterequal() > assert(isgreaterequal(-1.0, 0.F) == false); > } > > +void test_isinf() > +{ > +#ifdef isinf > +#error isinf defined > +#endif > +static_assert((std::is_same::value), > ""); > + > +typedef decltype(isinf((double)0)) DoubleRetType; > +#ifndef __linux__ > +static_assert((std::is_same::value), ""); > +#else > +// GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in > +// all C++ dialects. The test should tolerate this. > +// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 > +static_assert((std::is_same::value > +|| std::is_same::value), ""); > +#endif > + > +static_assert((std::is_same::value), ""); > +static_assert((std::is_same bool>::value), ""); > +assert(isinf(-1.0) == false); > +} > + > void test_isless() > { > #ifdef isless > @@ -688,6 +708,29 @@ void test_islessgreater() > assert(islessgreater(-1.0, 0.F) == true); > } > > +void test_isnan() > +{ > +#ifdef isnan > +#error isnan defined > +#endif > +static_assert((std::is_same::value), > ""); > + > +typedef decltype(isnan((double)0)) DoubleRetType; > +#ifndef __linux__ > +static_assert((std::is_same::value), ""); > +#else > +// GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in > +// all C++ dialects. The test should tolerate this. > +// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 > +static_assert((std::is_same::value > +|| std::is_same::value), ""); > +#endif > + > +static_assert((std::is_same::value), ""); > +static_assert((std::is_same bool>::value), ""); > +assert(isnan(-1.0) == false); > +} > + > void test_isunordered() > { > #ifdef isunordered > @@ -1443,9 +1486,11 @@ int main() > test_isnormal(); > test_isgreater(); > test_isgreaterequal(); > +test_isinf(); > test_isless(); > test_islessequal(); > test_islessgreater(); > +test_isnan(); > test_isunordered(); > test_acosh(); > test_asinh(); > > Removed: libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp > URL: > http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp?rev=271059&view=auto > > == > --- libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp > (original) > +++ libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp > (removed) > @@ -1,30 +0,0 @@ > > -//===--===// > -// > -// The LLVM Compiler Infrastructure > -// > -// This file is dual licensed under the MIT and the University of > Illinois Open > -// Source Licenses. See LICENSE.TXT for details. > -// > > -//===--===// > - > -// > - > -// isinf >