Skip to content

Commit

Permalink
Merge pull request #52 from pps83/master-msvc-fixes
Browse files Browse the repository at this point in the history
Port maskedvbyte/streamvbyte/varintgb to Visual Studio + msvc fixes
  • Loading branch information
lemire authored Jun 9, 2019
2 parents 19c9e6e + b6c613d commit 055d1c5
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 1,158 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.sln eol=crlf
*.vcxproj eol=crlf
*.vcxproj.filters eol=crlf
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.o
*.lo
.DS_Store
/msvc/.vs
/msvc/Debug
/msvc/Release
/msvc/x64/Debug
/msvc/x64/Release
*.suo
*.VC.db
*.VC.opendb
*.vcxproj.user
10 changes: 6 additions & 4 deletions headers/VarIntG8IU.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
* This code is released under the
* Apache License Version 2.0 http://www.apache.org/licenses/.
*/
#ifndef __SSSE3__
#if !defined(__SSSE3__) && !(defined(_MSC_VER) && defined(__AVX__))
#ifndef _MSC_VER
#pragma message \
"Disabling varintg8iu due to lack of SSSE3 support, try adding -mssse3 or the equivalent on your compiler"
#else
#pragma message("Disabling varintg8iu due to lack of SSSE3 support, try adding -mssse3 or the equivalent on your compiler")
#endif
#else
#ifndef VARINTG8IU_H__
#define VARINTG8IU_H__
#include <emmintrin.h>
Expand All @@ -31,8 +35,6 @@ namespace FastPForLib {
* This code was originally written by M. Caron and then
* optimized by D. Lemire.
*
*
*
*/
class VarIntG8IU : public IntegerCODEC {

Expand Down Expand Up @@ -210,4 +212,4 @@ class VarIntG8IU : public IntegerCODEC {
} // namespace FastPFor

#endif // VARINTG8IU_H__
#endif //__SSE3__
#endif // __SSSE3__
6 changes: 0 additions & 6 deletions headers/codecfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,9 @@ static inline CodecMap initializefactory() {
new CompositeCodec<SIMDOPTPFor<4, Simple16<false>>, VariableByte>());
map["varint"] = std::shared_ptr<IntegerCODEC>(new VariableByte());
map["vbyte"] = std::shared_ptr<IntegerCODEC>(new VByte());
#if !(defined(_MSC_VER)) // todo: port to Visual Studio
map["maskedvbyte"] = std::shared_ptr<IntegerCODEC>(new MaskedVByte());
#endif
#if !(defined(_MSC_VER)) // todo: streamvbyte needs to be ported to Visual Studio
map["streamvbyte"] = std::shared_ptr<IntegerCODEC>(new StreamVByte());
#endif
#if !defined(_MSC_VER) || (_MSC_VER != 1900)
map["varintgb"] = std::shared_ptr<IntegerCODEC>(new VarIntGB<>());
#endif
map["simple16"] = std::shared_ptr<IntegerCODEC>(new Simple16<true>());
map["simple9"] = std::shared_ptr<IntegerCODEC>(new Simple9<true>());
map["simple9_rle"] = std::shared_ptr<IntegerCODEC>(new Simple9_RLE<true>());
Expand Down
6 changes: 4 additions & 2 deletions headers/horizontalbitpacking.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
#ifndef HORIZONTALBITPACKING_H_
#define HORIZONTALBITPACKING_H_

#ifndef __SSE4_1__
#if !defined(__SSE4_1__) && !(defined(_MSC_VER) && defined(__AVX__))

#ifndef _MSC_VER
#pragma message "No SSSE4.1 support? try adding -msse4.1"
#pragma message "No SSSE4.1 support? try adding -msse4.1 or the equivalent on your compiler"
#else
#pragma message("No SSSE4.1 support? try adding -msse4.1 or the equivalent on your compiler")
#endif
#endif
#include "common.h"
Expand Down
4 changes: 0 additions & 4 deletions headers/simdvariablebyte.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#ifndef SIMDVARIABLEBYTE_H_
#define SIMDVARIABLEBYTE_H_

#if ! defined(_MSC_VER) // code relies on compound literals which Visual Studio fails to support. TODO: code a workaround


#include "common.h"
#include "codecs.h"

Expand Down Expand Up @@ -97,5 +94,4 @@ class MaskedVByte : public FastPForLib::IntegerCODEC {

std::string name() const { return "MaskedVByte"; }
};
#endif
#endif /* SIMDVARIABLEBYTE_H_ */
5 changes: 1 addition & 4 deletions headers/streamvariablebyte.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
* (c) Daniel Lemire, http://lemire.me/en/
*/



#ifndef _STREAMVARIABLEBYTE_
#define _STREAMVARIABLEBYTE_
#if !(defined(_MSC_VER)) // todo : need to be ported to Visual Studio

#include "common.h"
#include "codecs.h"

Expand Down Expand Up @@ -77,4 +75,3 @@ class StreamVByte : public IntegerCODEC {
};
}
#endif
#endif
6 changes: 0 additions & 6 deletions msvc/FastPFor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "codecs", "codecs.vcxproj",
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FastPFor", "FastPFor.vcxproj", "{42D8ABA4-FC4E-426C-A833-D64D06081F92}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "getopt.vcxproj", "{D0D480B3-816E-4A04-8AE4-75210F8701E0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inmemorybenchmark", "inmemorybenchmark.vcxproj", "{635B18E0-2AD7-45A7-914E-831A6B711F89}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit", "unit.vcxproj", "{8B2ED3AF-F2E8-480B-BE7D-7B6E44DC4BFE}"
Expand Down Expand Up @@ -37,10 +35,6 @@ Global
{42D8ABA4-FC4E-426C-A833-D64D06081F92}.Debug|x64.Build.0 = Debug|x64
{42D8ABA4-FC4E-426C-A833-D64D06081F92}.Release|x64.ActiveCfg = Release|x64
{42D8ABA4-FC4E-426C-A833-D64D06081F92}.Release|x64.Build.0 = Release|x64
{D0D480B3-816E-4A04-8AE4-75210F8701E0}.Debug|x64.ActiveCfg = Debug|x64
{D0D480B3-816E-4A04-8AE4-75210F8701E0}.Debug|x64.Build.0 = Debug|x64
{D0D480B3-816E-4A04-8AE4-75210F8701E0}.Release|x64.ActiveCfg = Release|x64
{D0D480B3-816E-4A04-8AE4-75210F8701E0}.Release|x64.Build.0 = Release|x64
{635B18E0-2AD7-45A7-914E-831A6B711F89}.Debug|x64.ActiveCfg = Debug|x64
{635B18E0-2AD7-45A7-914E-831A6B711F89}.Debug|x64.Build.0 = Debug|x64
{635B18E0-2AD7-45A7-914E-831A6B711F89}.Release|x64.ActiveCfg = Release|x64
Expand Down
4 changes: 4 additions & 0 deletions msvc/FastPFor.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -61,6 +62,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -75,6 +77,8 @@
<ClCompile Include="..\src\horizontalbitpacking.cpp" />
<ClCompile Include="..\src\simdbitpacking.cpp" />
<ClCompile Include="..\src\simdunalignedbitpacking.cpp" />
<ClCompile Include="..\src\streamvbyte.c" />
<ClCompile Include="..\src\varintdecode.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
2 changes: 2 additions & 0 deletions msvc/benchbitpacking.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -63,6 +64,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand Down
5 changes: 2 additions & 3 deletions msvc/codecs.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers;./getopt</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -63,6 +64,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers;./getopt</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand All @@ -77,9 +79,6 @@
<ProjectReference Include="FastPFor.vcxproj">
<Project>{42d8aba4-fc4e-426c-a833-d64d06081f92}</Project>
</ProjectReference>
<ProjectReference Include="getopt.vcxproj">
<Project>{d0d480b3-816e-4a04-8ae4-75210f8701e0}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
2 changes: 2 additions & 0 deletions msvc/csv2maropu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -65,6 +66,7 @@
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand Down
2 changes: 2 additions & 0 deletions msvc/entropy.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -65,6 +66,7 @@
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand Down
2 changes: 2 additions & 0 deletions msvc/example.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -63,6 +64,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand Down
2 changes: 2 additions & 0 deletions msvc/gapstats.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -65,6 +66,7 @@
<AdditionalIncludeDirectories>../headers</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
Expand Down
77 changes: 0 additions & 77 deletions msvc/getopt.vcxproj

This file was deleted.

Loading

0 comments on commit 055d1c5

Please sign in to comment.