|
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
| 2 | +// The .NET Foundation licenses this file to you under the MIT license. |
| 3 | + |
| 4 | +using System.Runtime.CompilerServices; |
| 5 | + |
| 6 | +namespace System.Runtime.Intrinsics.LoongArch |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// This class provides access to the LoongArch base hardware instructions via intrinsics |
| 10 | + /// </summary> |
| 11 | + [Intrinsic] |
| 12 | + [CLSCompliant(false)] |
| 13 | + public abstract class LoongArchBase |
| 14 | + { |
| 15 | + internal LoongArchBase() { } |
| 16 | + |
| 17 | + public static bool IsSupported { get => IsSupported; } |
| 18 | + |
| 19 | + [Intrinsic] |
| 20 | + public abstract class LoongArch64 |
| 21 | + { |
| 22 | + internal LoongArch64() { } |
| 23 | + |
| 24 | + public static bool IsSupported { get => IsSupported; } |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// LA64: CLO.W rd, rj |
| 28 | + /// </summary> |
| 29 | + public static int LeadingSignCount(int value) => LeadingSignCount(value); |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// LA64: CLO.W rd, rj |
| 33 | + /// </summary> |
| 34 | + public static int LeadingSignCount(uint value) => LeadingSignCount(value); |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// LA64: CLO.D rd, rj |
| 38 | + /// </summary> |
| 39 | + public static int LeadingSignCount(long value) => LeadingSignCount(value); |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// LA64: CLO.D rd, rj |
| 43 | + /// </summary> |
| 44 | + public static int LeadingSignCount(ulong value) => LeadingSignCount(value); |
| 45 | + |
| 46 | + /// <summary> |
| 47 | + /// LA64: CLZ.W rd, rj |
| 48 | + /// </summary> |
| 49 | + public static int LeadingZeroCount(int value) => LeadingZeroCount(value); |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// LA64: CLZ.W rd, rj |
| 53 | + /// </summary> |
| 54 | + public static int LeadingZeroCount(uint value) => LeadingZeroCount(value); |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// LA64: CLZ.D rd, rj |
| 58 | + /// </summary> |
| 59 | + public static int LeadingZeroCount(long value) => LeadingZeroCount(value); |
| 60 | + |
| 61 | + /// <summary> |
| 62 | + /// LA64: CLZ.D rd, rj |
| 63 | + /// </summary> |
| 64 | + public static int LeadingZeroCount(ulong value) => LeadingZeroCount(value); |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// LA64: CTO.W rd, rj |
| 68 | + /// </summary> |
| 69 | + public static int TrailingOneCount(int value) => TrailingOneCount(value); |
| 70 | + |
| 71 | + /// <summary> |
| 72 | + /// LA64: CTO.W rd, rj |
| 73 | + /// </summary> |
| 74 | + public static int TrailingOneCount(uint value) => TrailingOneCount(value); |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// LA64: CTO.D rd, rj |
| 78 | + /// </summary> |
| 79 | + public static int TrailingOneCount(long value) => TrailingOneCount(value); |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// LA64: CTO.D rd, rj |
| 83 | + /// </summary> |
| 84 | + public static int TrailingOneCount(ulong value) => TrailingOneCount(value); |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// LA64: CTZ.W rd, rj |
| 88 | + /// </summary> |
| 89 | + public static int TrailingZeroCount(int value) => TrailingZeroCount(value); |
| 90 | + |
| 91 | + /// <summary> |
| 92 | + /// LA64: CTZ.W rd, rj |
| 93 | + /// </summary> |
| 94 | + public static int TrailingZeroCount(uint value) => TrailingZeroCount(value); |
| 95 | + |
| 96 | + /// <summary> |
| 97 | + /// LA64: CTZ.D rd, rj |
| 98 | + /// </summary> |
| 99 | + public static int TrailingZeroCount(long value) => TrailingZeroCount(value); |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// LA64: CTZ.D rd, rj |
| 103 | + /// </summary> |
| 104 | + public static int TrailingZeroCount(ulong value) => TrailingZeroCount(value); |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// LA64: MULH.D rd, rj, rk |
| 108 | + /// </summary> |
| 109 | + public static long MultiplyHigh(long left, long right) => MultiplyHigh(left, right); |
| 110 | + |
| 111 | + /// <summary> |
| 112 | + /// LA64: MULH.DU rd, rj, rk |
| 113 | + /// </summary> |
| 114 | + public static ulong MultiplyHigh(ulong left, ulong right) => MultiplyHigh(left, right); |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// LA64: BITREV.D rd, rj |
| 118 | + /// </summary> |
| 119 | + public static long ReverseElementBits(long value) => ReverseElementBits(value); |
| 120 | + |
| 121 | + /// <summary> |
| 122 | + /// LA64: BITREV.D rd, rj |
| 123 | + /// </summary> |
| 124 | + public static ulong ReverseElementBits(ulong value) => ReverseElementBits(value); |
| 125 | + |
| 126 | + /// <summary> |
| 127 | + /// LA64: BITREV.W rd, rj |
| 128 | + /// </summary> |
| 129 | + public static long ReverseElementBits(int value) => ReverseElementBits(value); |
| 130 | + |
| 131 | + /// <summary> |
| 132 | + /// LA64: BITREV.W rd, rj |
| 133 | + /// </summary> |
| 134 | + public static ulong ReverseElementBits(uint value) => ReverseElementBits(value); |
| 135 | + |
| 136 | + /// <summary> |
| 137 | + /// LA64: REVB.2W rd, rj |
| 138 | + /// </summary> |
| 139 | + public static int ReverseElementBits(int value) => ReverseElementBits(value); |
| 140 | + |
| 141 | + /// <summary> |
| 142 | + /// LA64: REVB.2W rd, rj |
| 143 | + /// </summary> |
| 144 | + public static uint ReverseElementBits(uint value) => ReverseElementBits(value); |
| 145 | + |
| 146 | + /// <summary> |
| 147 | + /// LA64: REVB.D rd, rj |
| 148 | + /// </summary> |
| 149 | + public static long ReverseElementBits(long value) => ReverseElementBits(value); |
| 150 | + |
| 151 | + /// <summary> |
| 152 | + /// LA64: REVB.D rd, rj |
| 153 | + /// </summary> |
| 154 | + public static ulong ReverseElementBits(ulong value) => ReverseElementBits(value); |
| 155 | + |
| 156 | + } |
| 157 | + |
| 158 | + /// <summary> |
| 159 | + /// LA32: MULH.W rd, rj, rk |
| 160 | + /// </summary> |
| 161 | + public static long MultiplyHigh(int left, int right) => MultiplyHigh(left, right); |
| 162 | + |
| 163 | + /// <summary> |
| 164 | + /// LA32: MULH.WU rd, rj, rk |
| 165 | + /// </summary> |
| 166 | + public static ulong MultiplyHigh(uint left, uint right) => MultiplyHigh(left, right); |
| 167 | + |
| 168 | + /// <summary> |
| 169 | + /// LA32: FSQRT.S fd, fj |
| 170 | + /// </summary> |
| 171 | + public static float SquareRoot(float value) => SquareRoot(value); |
| 172 | + |
| 173 | + /// <summary> |
| 174 | + /// LA32: FSQRT.D fd, fj |
| 175 | + /// </summary> |
| 176 | + public static double SquareRoot(double value) => SquareRoot(value); |
| 177 | + |
| 178 | + /// <summary> |
| 179 | + /// LA32: FRECIP.S fd, fj |
| 180 | + /// </summary> |
| 181 | + public static float Reciprocal(float value) => Reciprocal(value); |
| 182 | + |
| 183 | + /// <summary> |
| 184 | + /// LA32: FRECIP.D fd, fj |
| 185 | + /// </summary> |
| 186 | + public static double Reciprocal(double value) => Reciprocal(value); |
| 187 | + |
| 188 | + /// <summary> |
| 189 | + /// LA32: FRSQRT.S fd, fj |
| 190 | + /// </summary> |
| 191 | + public static float ReciprocalSqrt(float value) => ReciprocalSqrt(value); |
| 192 | + |
| 193 | + /// <summary> |
| 194 | + /// LA32: FRSQRT.D fd, fj |
| 195 | + /// </summary> |
| 196 | + public static double ReciprocalSqrt(double value) => ReciprocalSqrt(value); |
| 197 | + } |
| 198 | +} |
0 commit comments