This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Versioning; | |
using TerraFX.Interop; | |
using TerraFX.Interop.Windows; | |
using static TerraFX.Interop.Windows.E; | |
using static TerraFX.Interop.Windows.IID; | |
using static TerraFX.Interop.Windows.S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Intrinsics; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
public unsafe class Proga | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public float Sum(float[] values) { | |
if (values is null) | |
{ | |
throw new ArgumentNullException(); | |
} | |
if (Vector128.IsHardwareAccelerated) | |
{ | |
ref var value = ref MemoryMarshal.GetArrayDataReference(values); | |
var vsum = Vector128<float>.Zero; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "lib.h" | |
#include "common.h" | |
#include <iostream> | |
void thing() | |
{ | |
auto lib_id1 = get_next_lib_id_int32(); | |
auto lib_id2 = get_next_lib_id_size(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
const int limit = 100_000_000; | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Collections.Immutable; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.Text; | |
using TerraFX.CodeAnalysis.Source; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------ | |
// gtFoldExprCast: see if a cast is foldable | |
// | |
// Arguments: | |
// cast - cast to examine | |
// | |
// Returns: | |
// The original cast if no folding happened. | |
// An alternative tree if folding happens. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
public unsafe class NetStandardPlus | |
{ | |
[UnmanagedFunctionPointer(CallingConvention.StdCall)] | |
public delegate void MyStdcallDelegate(); | |
public static void Call(delegate*<void> action) => action(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.CompilerServices; | |
public interface IComparer<T> | |
{ | |
int CompareTo(T other); | |
} | |
public static class ArrayExtensions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a port of the amd/win-libm implementation provided in assembly here: https://github.com/amd/win-libm/blob/master/sinf.asm | |
// The original source is Copyright (c) 2002-2019 Advanced Micro Devices, Inc. and provided under the MIT License. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this Software and associated documentaon files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
NewerOlder