Skip to content

Instantly share code, notes, and snippets.

View tannergooding's full-sized avatar

Tanner Gooding tannergooding

View GitHub Profile

Creative Commons Attribution-NonCommercial 4.0 International Public License

By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.

Section 1 – Definitions.

a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Publ

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
namespace ConsoleApp30
{
class Program
{
static volatile int done = 0;
add rax, rax
ret
; MathMin & MathMinInlined
00007FFE01A9B9F0 push rax
00007FFE01A9B9F1 vzeroupper
00007FFE01A9B9F4 vucomiss xmm1,xmm0
00007FFE01A9B9F8 ja 00007FFE01A9BA02
00007FFE01A9B9FA vucomiss xmm0,xmm0
00007FFE01A9B9FE jp 00007FFE01A9BA02
00007FFE01A9BA00 je 00007FFE01A9BA07
00007FFE01A9BA02 add rsp,8
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// ------------------------------------------------------------------------------
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Runtime.Intrinsics.Arm
{
// "Current" state of the world: https://apiview.azurewebsites.net/Assemblies/Review/2ddcfab08dfd46b4b1fcbd02594cb648
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace ConsoleApp20
{
class Program
{
const int InnerIterations = 1000000;
const int OuterIterations = 2000;
public Vector<ushort> Process(Vector<ushort> vu16, double a, double b)
{
var v255 = new Vector<double>(255.0f);
var va = new Vector<double>(a);
var vb = new Vector<double>(b);
Vector.Widen(vu16, out var vu32_0, out var vu32_1);
Vector.Widen(vu32_0, out var vu64_0, out var vu64_1);
Vector.Widen(vu32_1, out var vu64_2, out var vu64_3);
@tannergooding
tannergooding / CONTRIBUTOR_LICENSE_AGREEMENT.md
Last active October 4, 2019 01:01
TerraFX - Contributor License Agreement

Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”), and conveys certain license rights to Tanner Gooding (“Tanner Gooding”) for Your contributions to Tanner Gooding open source projects. This Agreement is effective as of the latest signature date below.

1. Definitions.

“Code” means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to Tanner Gooding under this Agreement.

“Project” means any of the projects owned or managed by Tanner Gooding and offered under a license approved by the Open Source Initiative (www.opensource.org).

@tannergooding
tannergooding / GenericSpecialization.cs
Last active September 21, 2019 14:22
Display Generic Specialization
using System;
using System.Runtime.CompilerServices;
using SharpLab.Runtime;
// https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8ABAJgEYBYAKGIAYACY8gOgCUBXAOwwEt8YLAMIR8AB14AbGFADKMgG68wMXAG4a9BrIAW2KGIAy2YO258BG6poDMTckiakGAcRhcZygPJjcDAN40DMEMQSEA9OEMAIIYGFC8wBwYMAwAVhy4GAz42ADWqtp6BsbADLg6EADuDBg6qZAAJjAA5u4MAGbQtfVhwZHlYjBgvB28MI0MbR4JYLUAnkO4fQwA2gBSvBhuM8oAFBiLMBAde7w8AJQXALorG1s7nmAHRyd7ACr8MLJi2FxXt2oITWm227ieLyGb2AEAgkgBK2IdmYjneMUajQAPO8AHwfBiSHS4NAMNFQIkXBhVeqwUkMEDleIcMAYFaBIHAkKjBiQ46nd6UgC8goWUNO5wwVxWwPZnLlDAU+gYsFwHEk2RFZ0uewgwDSw0lhL8AGoeRKLjq9QaLuT1NL5cQAOw8gWW/Usm2qNUYKzyhgAX3twRgklwqW5vLeAoYwtFfI+Xx+fylHLlsr9IUVUGVXvVMYYAFUuLhsB1BNFcNiSZ8BEmuHjYB0CRSGKaiyWyywK1XSYnfvW9o3lRTfRngk7C8XS+XKzXvv3qw2YE2Vd6LqO5YHU5yQ2GgwF98C6lBqgwPDUAHIQDCyDhiMTQFKNACiCBUYj4EC4e3X+63wK3f0gA==
public static class GenericOps {
// Attribute just makes SharpLab show the codegen for the
// specified generic types
@tannergooding
tannergooding / Dll1.cpp
Created September 17, 2019 14:25
TwitterQuestion
typedef int BOOL;
extern "C" {
struct Vector4f {
float x, y, z, w;
};
struct Vector4b {
BOOL x, y, z, w;
};