Skip to content

Commit

Permalink
Removes .NET Core 2.1 (#79)
Browse files Browse the repository at this point in the history
* Removed .NET Core 2.1

* Rearranged some files

* Dropped .NET Core 2.1 from test-project and rearranged some files
  • Loading branch information
gfoidl authored Oct 31, 2019
1 parent 48def80 commit 161276f
Show file tree
Hide file tree
Showing 24 changed files with 547 additions and 1,493 deletions.
5 changes: 0 additions & 5 deletions .azure/pipelines/jobs/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ jobs:
version: $(SDK_VERSION)
includePreviewVersions: true

- task: UseDotNet@2
displayName: 'Use dotnet sdk 2.1'
inputs:
version: 2.1.x

- bash: |
export PATH="$(pwd)/dotnet:$PATH"
echo 'installed sdks:'
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<PropertyGroup>
<LangVersion>latest</LangVersion>
<StandardTfms>netcoreapp3.0;netcoreapp2.1;netstandard2.0</StandardTfms>
<StandardTfms>netcoreapp3.0;netstandard2.0</StandardTfms>
</PropertyGroup>

<PropertyGroup>
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@ Decoding can read from buffers of type `byte` (for UTF-8) or `char`.

Encoding / decoding supports buffer-chains, for example for very large data or when the data arrives in chunks.

In .NET Core 2.1+ encoding / decoding is done with SIMD-support:
In .NET Core 3.0 onwards encoding / decoding is done with SIMD-support:

| Framework | scalar | SSSE3 | AVX2 |
| -- | -- | -- | -- |
| .NET Core 3.0 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| .NET Core 2.1+ | :heavy_check_mark: | :heavy_check_mark: | :x: |
| .NET Standard 2.0 | :heavy_check_mark: | :x: | :x: |

If available AVX will "eat" up as much as possible, then SSE will "eat" up as much as possible,
finally scalar code processes the rest (including padding).

**Note:** SIMD-support (with HW-intrinsics) is officially supported for .NET Core 3.0 onwards.
Hence SIMD-support for .NET Core 2.1+ is not official, and based on an experimental (but tested) solution.
Further note that future versions of the JIT may not compile these bits anymore. So use this library with caution in a .NET Core 2.1+ project.

## Usage

Basically the entry to encoder / decoder is `Base64.Default` for _base64_, and `Base64.Url` for _base64Url_.
Expand Down
4 changes: 4 additions & 0 deletions source/gfoidl.Base64/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# PUB0001: Pubternal type in public API
dotnet_diagnostic.PUB0001.severity = suggestion
Original file line number Diff line number Diff line change
Expand Up @@ -339,31 +339,31 @@ private static void Ssse3Decode<T>(ref T src, ref byte destBytes, int sourceLeng
destBytes = ref destStart;
}
//---------------------------------------------------------------------
private static ReadOnlySpan<sbyte> s_sseDecodeLutLo => new sbyte[]
private static ReadOnlySpan<sbyte> s_sseDecodeLutLo => new sbyte[16]
{
0x15, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x13, 0x1A,
0x1B, 0x1B, 0x1B, 0x1A
};

private static ReadOnlySpan<sbyte> s_sseDecodeLutHi => new sbyte[]
private static ReadOnlySpan<sbyte> s_sseDecodeLutHi => new sbyte[16]
{
0x10, 0x10, 0x01, 0x02,
0x04, 0x08, 0x04, 0x08,
0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10
};

private static ReadOnlySpan<sbyte> s_sseDecodeLutShift => new sbyte[]
private static ReadOnlySpan<sbyte> s_sseDecodeLutShift => new sbyte[16]
{
0, 16, 19, 4,
-65, -65, -71, -71,
0, 0, 0, 0,
0, 0, 0, 0
};

private static ReadOnlySpan<sbyte> s_avxDecodeLutLo => new sbyte[]
private static ReadOnlySpan<sbyte> s_avxDecodeLutLo => new sbyte[32]
{
0x15, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11,
Expand All @@ -375,7 +375,7 @@ private static void Ssse3Decode<T>(ref T src, ref byte destBytes, int sourceLeng
0x1B, 0x1B, 0x1B, 0x1A
};

private static ReadOnlySpan<sbyte> s_avxDecodeLutHi => new sbyte[]
private static ReadOnlySpan<sbyte> s_avxDecodeLutHi => new sbyte[32]
{
0x10, 0x10, 0x01, 0x02,
0x04, 0x08, 0x04, 0x08,
Expand All @@ -387,7 +387,7 @@ private static void Ssse3Decode<T>(ref T src, ref byte destBytes, int sourceLeng
0x10, 0x10, 0x10, 0x10
};

private static ReadOnlySpan<sbyte> s_avxDecodeLutShift => new sbyte[]
private static ReadOnlySpan<sbyte> s_avxDecodeLutShift => new sbyte[32]
{
0, 16, 19, 4,
-65, -65, -71, -71,
Expand Down

This file was deleted.

Loading

0 comments on commit 161276f

Please sign in to comment.