| author | |
| committer | |
| log | 375619820ecb8e34d38749fb4dc339258b2766a6 |
| tree | cdb09fdc9c5b6685ccffdd48f50f4c508c8a7968 |
| parent | d305ba7f2d5ae524fd71365852fb5196e98fdbaf |
3 files changed, 65 insertions(+), 4 deletions(-)
lib/libc/mingw/math/arm-common/scalbn.c created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | /** | |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. | |
| 3 | * This file is part of the mingw-w64 runtime package. | |
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. | |
| 5 | */ | |
| 6 | ||
| 7 | #include <math.h> | |
| 8 | ||
| 9 | double scalbn(double x, int exp) | |
| 10 | { | |
| 11 | return x * exp2(exp); | |
| 12 | } | |
| 13 | ||
| 14 | float scalbnf(float x, int exp) | |
| 15 | { | |
| 16 | return x * exp2f(exp); | |
| 17 | } | |
| 18 | ||
| 19 | long double scalbnl(long double x, int exp) | |
| 20 | { | |
| 21 | #if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) | |
| 22 | return scalbn(x, exp); | |
| 23 | #else | |
| 24 | #error Not supported on your platform yet | |
| 25 | #endif | |
| 26 | } | |
| 27 | ||
| 28 | double scalbln(double x, long exp) | |
| 29 | { | |
| 30 | return x * exp2(exp); | |
| 31 | } | |
| 32 | ||
| 33 | float scalblnf(float x, long exp) | |
| 34 | { | |
| 35 | return x * exp2f(exp); | |
| 36 | } | |
| 37 | ||
| 38 | long double scalblnl(long double x, long exp) | |
| 39 | { | |
| 40 | #if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) | |
| 41 | return scalbln(x, exp); | |
| 42 | #else | |
| 43 | #error Not supported on your platform yet | |
| 44 | #endif | |
| 45 | } |
src/mingw.zig+1| ... | ... | @@ -1025,6 +1025,7 @@ const mingwex_arm64_src = [_][]const u8{ |
| 1025 | 1025 | "misc" ++ path.sep_str ++ "initenv.c", |
| 1026 | 1026 | "math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "log2.c", |
| 1027 | 1027 | "math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "pow.c", |
| 1028 | "math" ++ path.sep_str ++ "arm-common" ++ path.sep_str ++ "scalbn.c", | |
| 1028 | 1029 | "math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "_chgsignl.S", |
| 1029 | 1030 | "math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "rint.c", |
| 1030 | 1031 | "math" ++ path.sep_str ++ "arm64" ++ path.sep_str ++ "rintf.c", |
src/windows_sdk.cpp+19-4| ... | ... | @@ -23,16 +23,19 @@ enum NativeArch { |
| 23 | 23 | NativeArchArm, |
| 24 | 24 | NativeArchi386, |
| 25 | 25 | NativeArchx86_64, |
| 26 | NativeArchAarch64, | |
| 26 | 27 | }; |
| 27 | 28 | |
| 28 | 29 | #if defined(_M_ARM) || defined(__arm_) |
| 29 | 30 | static const NativeArch native_arch = NativeArchArm; |
| 30 | #endif | |
| 31 | #if defined(_M_IX86) || defined(__i386__) | |
| 31 | #elif defined(_M_IX86) || defined(__i386__) | |
| 32 | 32 | static const NativeArch native_arch = NativeArchi386; |
| 33 | #endif | |
| 34 | #if defined(_M_X64) || defined(__x86_64__) | |
| 33 | #elif defined(_M_X64) || defined(__x86_64__) | |
| 35 | 34 | static const NativeArch native_arch = NativeArchx86_64; |
| 35 | #elif defined(__aarch64__) | |
| 36 | static const NativeArch native_arch = NativeArchAarch64; | |
| 37 | #else | |
| 38 | #error unsupported architecture | |
| 36 | 39 | #endif |
| 37 | 40 | |
| 38 | 41 | void zig_free_windows_sdk(struct ZigWindowsSDK *sdk) { |
| ... | ... | @@ -116,6 +119,10 @@ static ZigFindWindowsSdkError find_msvc_lib_dir(ZigWindowsSDKPrivate *priv) { |
| 116 | 119 | case NativeArchArm: |
| 117 | 120 | out_append_ptr += sprintf(out_append_ptr, "arm\\"); |
| 118 | 121 | break; |
| 122 | case NativeArchAarch64: | |
| 123 | // TODO: is this right? | |
| 124 | out_append_ptr += sprintf(out_append_ptr, "aarch64\\"); | |
| 125 | break; | |
| 119 | 126 | } |
| 120 | 127 | sprintf(tmp_buf, "%s%s", output_path, "vcruntime.lib"); |
| 121 | 128 | |
| ... | ... | @@ -161,6 +168,10 @@ com_done:; |
| 161 | 168 | case NativeArchArm: |
| 162 | 169 | tmp_buf_append_ptr += sprintf(tmp_buf_append_ptr, "arm\\"); |
| 163 | 170 | break; |
| 171 | case NativeArchAarch64: | |
| 172 | // TODO: is this right? | |
| 173 | tmp_buf_append_ptr += sprintf(tmp_buf_append_ptr, "aarch64\\"); | |
| 174 | break; | |
| 164 | 175 | } |
| 165 | 176 | |
| 166 | 177 | char *output_path = strdup(tmp_buf); |
| ... | ... | @@ -204,6 +215,10 @@ static ZigFindWindowsSdkError find_10_version(ZigWindowsSDKPrivate *priv) { |
| 204 | 215 | 	case NativeArchArm: |
| 205 | 216 | 		option_name = "OptionId.DesktopCPParm"; |
| 206 | 217 | 		break; |
| 218 | 	case NativeArchAarch64: | |
| 219 | // TODO: is this right? | |
| 220 | 		option_name = "OptionId.DesktopCPParm64"; | |
| 221 | 		break; | |
| 207 | 222 | 	case NativeArchx86_64: |
| 208 | 223 | 		option_name = "OptionId.DesktopCPPx64"; |
| 209 | 224 | 		break; |