Skip to content

Commit

Permalink
Clean up and modernize the DigitConverter directory. Add some AVX2 co…
Browse files Browse the repository at this point in the history
…depaths.
  • Loading branch information
Mysticial committed Feb 2, 2016
1 parent 82d6d53 commit eee5361
Show file tree
Hide file tree
Showing 119 changed files with 5,456 additions and 5,881 deletions.
18 changes: 15 additions & 3 deletions README.md
Expand Up @@ -5,15 +5,27 @@ This is the full self-contained source code for y-cruncher's integrated Digit Vi
It includes everything including the heavily optimized back-end conversion code.

To Compile (Windows):
- Open the Visual Studio project and compile from within the IDE. The options are x86/Release, x86/SSE3, x64/SSE3, x64/SSE4.1.
- Visual Studio 2013 is required.
- Open the Visual Studio project and compile from within the IDE.
- Visual Studio 2015 is required.

To Compile (Linux):
- Run `VSS - DigitViewer/Compile-Linux.sh` from the directory it is in. It will create a folder `Binaries` with the two executables.
- Run `VSS - DigitViewer/Compile-Linux.sh` from the directory it is in. It will create a folder `Binaries` with the three executables.
- x64 and a sufficiently new version of GCC is required.

-----

The supported build modes are:

- x86 : Release
- x86 : 04-SSE3
- x64 : 04-SSE3
- x64 : 07-Penryn (SSE4.1)
- x64 : 13-Haswell (AVX2)

The x86 modes are not supported in Linux.

-----

To date, I've been too lazy to write a document on the compression format and how the .ycd files are laid out.
But it should be pretty easy to see from just examining it through a hex viewer.

Expand Down
141 changes: 141 additions & 0 deletions Source/DigitViewer/DigitConverter/DigitConverter.cpp
@@ -0,0 +1,141 @@
/* DigitConverter.cpp
*
* Author : Alexander J. Yee
* Date Created : 02/02/2012
* Last Modified : 01/24/2016
*
*/

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Dependencies
#include "PublicLibs/ConsoleIO/Label.h"
#include "PublicLibs/ConsoleIO/Margin.h"
#include "PublicLibs/ProcessorCapability/cpu_x86_Macros.h"
#include "DigitConverter.h"
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#if 0
#elif defined YMP_Arch_2013_x64_Haswell
#include "rawhex/rawhex_forward_convert_AVX2.ipp"
#include "rawdec/rawdec_forward_convert_AVX2.ipp"
#include "rawhex/rawhex_inverse_convert_AVX2.ipp"
#include "rawdec/rawdec_inverse_convert_AVX2.ipp"
#include "u32h8/u32h8_forward_convert_SSE41.ipp"
#include "u32d9/u32d9_forward_convert_SSE41.ipp"
#include "u64h16/u64h16_forward_convert_SSE41.ipp"
#include "u64h16/u64h16_inverse_convert_SSE2.ipp"
#include "u64d19/u64d19_forward_convert_AVX2.ipp"
#include "u64d19/u64d19_inverse_convert_SSE41.ipp"
namespace DigitViewer{
void CompileOptions_DigitConverter(){
const upL_t MARGIN = 20;
Console::println_labelm(MARGIN, " raw_to_hex", "AVX2", 'P');
Console::println_labelm(MARGIN, " raw_to_dec", "AVX2", 'P');
Console::println_labelm(MARGIN, " hex_to_raw", "AVX2", 'P');
Console::println_labelm(MARGIN, " dec_to_raw", "AVX2", 'P');
Console::println_labelm(MARGIN, " u32_to_h8", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " u32_to_d8", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " u64_to_h16", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " u64_to_d19", "AVX2", 'P');
Console::println_labelm(MARGIN, " h16_to_u64", "SSE2", 'B');
Console::println_labelm(MARGIN, " d19_to_u64", "SSE4.1", 'T');
Console::println();
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#elif defined YMP_Arch_2007_x64_Penryn
#include "rawhex/rawhex_forward_convert_SSE2.ipp"
#include "rawdec/rawdec_forward_convert_SSE2.ipp"
#include "rawhex/rawhex_inverse_convert_SSE2.ipp"
#include "rawdec/rawdec_inverse_convert_SSE2.ipp"
#include "u32h8/u32h8_forward_convert_SSE41.ipp"
#include "u32d9/u32d9_forward_convert_SSE41.ipp"
#include "u64h16/u64h16_forward_convert_SSE41.ipp"
#include "u64h16/u64h16_inverse_convert_SSE2.ipp"
#include "u64d19/u64d19_forward_convert_SSE41.ipp"
#include "u64d19/u64d19_inverse_convert_SSE41.ipp"
namespace DigitViewer{
void CompileOptions_DigitConverter(){
const upL_t MARGIN = 20;
Console::println_labelm(MARGIN, " raw_to_hex", "SSE2", 'B');
Console::println_labelm(MARGIN, " raw_to_dec", "SSE2", 'B');
Console::println_labelm(MARGIN, " hex_to_raw", "SSE2", 'B');
Console::println_labelm(MARGIN, " dec_to_raw", "SSE2", 'B');
Console::println_labelm(MARGIN, " u32_to_h8", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " u32_to_d8", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " u64_to_h16", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " u64_to_d19", "SSE4.1", 'T');
Console::println_labelm(MARGIN, " h16_to_u64", "SSE2", 'B');
Console::println_labelm(MARGIN, " d19_to_u64", "SSE4.1", 'T');
Console::println();
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#elif (defined YMP_Arch_2001_x86_SSE2) || (defined YMP_Arch_2004_x64_SSE3)
#include "rawhex/rawhex_forward_convert_SSE2.ipp"
#include "rawdec/rawdec_forward_convert_SSE2.ipp"
#include "rawhex/rawhex_inverse_convert_SSE2.ipp"
#include "rawdec/rawdec_inverse_convert_SSE2.ipp"
#include "u32h8/u32h8_forward_convert_Default.ipp"
#include "u32d9/u32d9_forward_convert_Default.ipp"
#include "u64h16/u64h16_forward_convert_Default.ipp"
#include "u64h16/u64h16_inverse_convert_SSE2.ipp"
#include "u64d19/u64d19_forward_convert_Default.ipp"
#include "u64d19/u64d19_inverse_convert_Default.ipp"
namespace DigitViewer{
void CompileOptions_DigitConverter(){
const upL_t MARGIN = 20;
Console::println_labelm(MARGIN, " raw_to_hex", "SSE2", 'B');
Console::println_labelm(MARGIN, " raw_to_dec", "SSE2", 'B');
Console::println_labelm(MARGIN, " hex_to_raw", "SSE2", 'B');
Console::println_labelm(MARGIN, " dec_to_raw", "SSE2", 'B');
Console::println_labelm(MARGIN, " u32_to_h8", "Default", 'w');
Console::println_labelm(MARGIN, " u32_to_d8", "Default", 'w');
Console::println_labelm(MARGIN, " u64_to_h16", "Default", 'w');
Console::println_labelm(MARGIN, " u64_to_d19", "Default", 'w');
Console::println_labelm(MARGIN, " h16_to_u64", "SSE2", 'B');
Console::println_labelm(MARGIN, " d19_to_u64", "Default", 'w');
Console::println();
}
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#else
#include "rawhex/rawhex_forward_convert_Default.ipp"
#include "rawdec/rawdec_forward_convert_Default.ipp"
#include "rawhex/rawhex_inverse_convert_Default.ipp"
#include "rawdec/rawdec_inverse_convert_Default.ipp"
#include "u32h8/u32h8_forward_convert_Default.ipp"
#include "u32d9/u32d9_forward_convert_Default.ipp"
#include "u64h16/u64h16_forward_convert_Default.ipp"
#include "u64h16/u64h16_inverse_convert_Default.ipp"
#include "u64d19/u64d19_forward_convert_Default.ipp"
#include "u64d19/u64d19_inverse_convert_Default.ipp"
namespace DigitViewer{
void CompileOptions_DigitConverter(){
const upL_t MARGIN = 20;
Console::println_labelm(MARGIN, " raw_to_hex", "Default", 'w');
Console::println_labelm(MARGIN, " raw_to_dec", "Default", 'w');
Console::println_labelm(MARGIN, " hex_to_raw", "Default", 'w');
Console::println_labelm(MARGIN, " dec_to_raw", "Default", 'w');
Console::println_labelm(MARGIN, " u32_to_h8", "Default", 'w');
Console::println_labelm(MARGIN, " u32_to_d8", "Default", 'w');
Console::println_labelm(MARGIN, " u64_to_h16", "Default", 'w');
Console::println_labelm(MARGIN, " u64_to_d19", "Default", 'w');
Console::println_labelm(MARGIN, " h16_to_u64", "Default", 'w');
Console::println_labelm(MARGIN, " d19_to_u64", "Default", 'w');
Console::println();
}
}
#endif
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@@ -1,12 +1,8 @@
/* ymb_CVN_headers.h
/* DigitConverter.h
*
* Author : Alexander J. Yee
* Date Created : 11/09/2011
* Last Modified : 04/07/2012
*
*
* ymb = Basic Function
* CVN = Format Conversion Unit
* Last Modified : 01/24/2016
*
*/

Expand All @@ -19,32 +15,34 @@
////////////////////////////////////////////////////////////////////////////////
// Dependencies
#include "PublicLibs/Types.h"
using namespace ymp;
#include "rawhex/rawhex.h"
#include "rawdec/rawdec.h"
#include "u32h8/u32h8.h"
#include "u32d9/u32d9.h"
#include "u64h16/u64h16.h"
#include "u64d19/u64d19.h"
namespace DigitViewer{
using namespace ymp;
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// u64_forward (use by Digit Viewer)
void yma_CVN_u64_forward ();
void ymb_CVN_rawh_to_strh_f (char* T, upL_t L);
void ymb_CVN_rawd_to_strd_f (char* T, upL_t L);
int ymb_CVN_strh_to_rawh_f (char* T, upL_t L);
int ymb_CVN_strd_to_rawd_f (char* T, upL_t L);
void ymb_CVN_rawh_to_u64b_f (u64_t* T, const char* A, upL_t TL);
void ymb_CVN_rawd_to_u64d_f (u64_t* T, const char* A, upL_t TL);
void ymb_CVN_u64b_to_rawh_f (char* T, const u64_t* A, upL_t AL);
void ymb_CVN_u64d_to_rawd_f (char* T, const u64_t* A, upL_t AL);
void ymb_CVN_u64b_to_strh_f (char* T, const u64_t* A, upL_t AL);
void ymb_CVN_u64d_to_strd_f (char* T, const u64_t* A, upL_t AL);
void CompileOptions_DigitConverter();
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cdi_reverse (use by y-cruncher)
namespace DigitViewer{
void yma_CVN_cdi_reverse ();
void ymb_CVN_ci_to_rawh_r (char* T, const u32_t* A, upL_t AL);
void ymb_CVN_ci_to_rawh_r (char* T, const u64_t* A, upL_t AL);
void ymb_CVN_ci_to_rawd_r (char* T, const u32_t* A, upL_t AL);
void ymb_CVN_ci_to_rawd_r (char* T, const u64_t* A, upL_t AL);
// Wrap these with overloads for template deduction. (used by y-cruncher)
inline void words_to_hex(char* T, const u32_t* A, upL_t AL){
u32r_to_h8r(T, A, AL);
}
inline void words_to_hex(char* T, const u64_t* A, upL_t AL){
u64r_to_h16r(T, A, AL);
}
inline void words_to_dec(char* T, const u32_t* A, upL_t AL){
u32r_to_d9r(T, A, AL);
}
inline void words_to_dec(char* T, const u64_t* A, upL_t AL){
u64r_to_d19r(T, A, AL);
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Expand Down

This file was deleted.

0 comments on commit eee5361

Please sign in to comment.