From 65ea6fd48af95fb62c56fea9cb2414bd2eaaa8a0 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Wed, 13 Nov 2013 13:15:01 +0400 Subject: [PATCH] Reasoning to use sse4 bitcode file --- builtins.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/builtins.cpp b/builtins.cpp index 2c9703c6..2afd92d9 100644 --- a/builtins.cpp +++ b/builtins.cpp @@ -943,6 +943,15 @@ DefineStdlib(SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *mod switch (g->target->getVectorWidth()) { case 4: if (g->target->getDataTypeWidth() == 32) { + // Note here that for avx1-i32x4 we are using bitcode file for + // sse4-i32x4. This is intentional and good enough. + // AVX target implies appropriate target-feature attrbute, + // which forces LLVM to generate AVX code, even for SSE4 + // intrinsics. Except that the only "missing" feature in sse4 + // target is implemenation of __masked_[store|load]_[i32|i64] + // using maskmov instruction. But it's not very popular + // intrinsics, so we assume the implementation to be good + // enough at the moment. if (runtime32) { EXPORT_MODULE(builtins_bitcode_sse4_32bit); }