Comment: | Rename x86_64 to AMD64
It's just a less awkward name and also what the BSDs use. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
b7a4e61b880ddfd9b125171c34cc38e1 |
User & Date: | js on 2023-04-22 20:22:08 |
Other Links: | manifest | tags |
2023-04-23
| ||
10:00 | Check whether we need -Wno-strict-prototypes check-in: b8a90c1477 user: js tags: trunk | |
2023-04-22
| ||
20:22 | Rename x86_64 to AMD64 check-in: b7a4e61b88 user: js tags: trunk | |
19:52 | Add OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES define check-in: 74fea18d17 user: js tags: trunk | |
Modified PLATFORMS.md from [cb8b9b98c6] to [97ce99149c].
︙ | ︙ | |||
41 42 43 44 45 46 47 | * Runtimes: ObjFW DragonFlyBSD ------------ * OS Versions: 3.0, 3.3-DEVELOPMENT | | | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | * Runtimes: ObjFW DragonFlyBSD ------------ * OS Versions: 3.0, 3.3-DEVELOPMENT * Architectures: AMD64, x86 * Compilers: GCC 4.4.7 * Runtimes: ObjFW FreeBSD ------- * OS Versions: 9.1-rc3, 10.0 * Architectures: AMD64 * Compilers: Clang 3.1, Clang 3.3 * Runtimes: ObjFW Haiku ----- |
︙ | ︙ | |||
86 87 88 89 90 91 92 | * Compilers: Clang * Runtimes: Apple Linux ----- | | | < | | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | * Compilers: Clang * Runtimes: Apple Linux ----- * Architectures: Alpha, AMD64, ARMv6, ARMv7, ARM64, Itanium, m68k, MIPS (O32), MIPS64 (N64), RISC-V 64, PowerPC, S390x, SuperH-4, x86 * Compilers: Clang 3.0-10.0, GCC 4.6-10.0 * Runtimes: ObjFW macOS ----- * OS Versions: 10.5, 10.7-10.15, Darling * Architectures: AMD64, PowerPC, PowerPC64, x86 * Compilers: Clang 3.1-10.0, Apple GCC 4.0.1 & 4.2.1 * Runtimes: Apple, ObjFW MiNT ---- |
︙ | ︙ | |||
125 126 127 128 129 130 131 | * Runtimes: ObjFW NetBSD ------ * OS Versions: 5.1-9.0 | | | | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | * Runtimes: ObjFW NetBSD ------ * OS Versions: 5.1-9.0 * Architectures: AMD64, ARM, ARM (big endian, BE8 mode), MIPS (O32), PowerPC, SPARC, SPARC64, x86 * Compilers: Clang 3.0-3.2, GCC 4.1.3 & 4.5.3 & 7.4.0 * Runtimes: ObjFW Nintendo 3DS ------------ |
︙ | ︙ | |||
165 166 167 168 169 170 171 | * Limitations: No sockets, no shared libraries, not tested on real hardware OpenBSD ------- * OS Versions: 5.2-6.7 | | | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | * Limitations: No sockets, no shared libraries, not tested on real hardware OpenBSD ------- * OS Versions: 5.2-6.7 * Architectures: AMD64, MIPS64, PA-RISC, PowerPC, SPARC64 * Compilers: GCC 6.3.0, Clang 4.0 * Runtimes: ObjFW PlayStation Portable -------------------- |
︙ | ︙ | |||
193 194 195 196 197 198 199 | * Runtimes: ObjFW Solaris ------- * OS Versions: OpenIndiana 2015.03 | | | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | * Runtimes: ObjFW Solaris ------- * OS Versions: OpenIndiana 2015.03 * Architectures: AMD64, x86 * Compilers: Clang 3.4.2, GCC 4.8.3 * Runtimes: ObjFW Wii --- |
︙ | ︙ | |||
224 225 226 227 228 229 230 | Windows ------- * OS Versions: 98 SE, NT 4.0, XP (x86), 7 (x64), 8 (x64), 8.1 (x64), 10, 11, Wine (x86 & x64) | | | | | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | Windows ------- * OS Versions: 98 SE, NT 4.0, XP (x86), 7 (x64), 8 (x64), 8.1 (x64), 10, 11, Wine (x86 & x64) * Architectures: AArch64, AMD64, x86 * Compilers: GCC 5.3.0 & 6.2.0 from msys2 (AMD64 & x86), Clang 3.9.0 from msys2 (x86), Clang 10.0 from msys2 (AMD64 & x86), Clang 14.0.4 from msys2 (AArch64) * Runtimes: ObjFW Others ------ |
︙ | ︙ | |||
252 253 254 255 256 257 258 259 260 261 262 263 264 265 | ========== As forwarding needs hand-written assembly for each combination of CPU architecture, executable format and calling convention, it is only available for the following platforms (except resolveClassMethod: and resolveInstanceMethod:, which are always available): * ARM (EABI/ELF, Apple/Mach-O) * ARM64 (ARM64/ELF, Apple/Mach-O) * MIPS (O32/ELF, EABI/ELF) * PowerPC (SysV/ELF, EABI/ELF, Apple/Mach-O) * SPARC (SysV/ELF) * SPARC64 (SysV/ELF) * x86 (SysV/ELF, Apple/Mach-O, Win32/PE) | > < | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | ========== As forwarding needs hand-written assembly for each combination of CPU architecture, executable format and calling convention, it is only available for the following platforms (except resolveClassMethod: and resolveInstanceMethod:, which are always available): * AMD64 (SysV/ELF, Apple/Mach-O, Mach-O, Win64/PE) * ARM (EABI/ELF, Apple/Mach-O) * ARM64 (ARM64/ELF, Apple/Mach-O) * MIPS (O32/ELF, EABI/ELF) * PowerPC (SysV/ELF, EABI/ELF, Apple/Mach-O) * SPARC (SysV/ELF) * SPARC64 (SysV/ELF) * x86 (SysV/ELF, Apple/Mach-O, Win32/PE) Apple/Mach-O means both, the Apple ABI and runtime, while Mach-O means the ObjFW runtime on Mach-O. |
Modified src/OFAtomic.h from [bcb517e893] to [7b3ed1a98e].
︙ | ︙ | |||
165 166 167 168 169 170 171 | } static OF_INLINE void OFReleaseMemoryBarrier(void) { /* nop */ } | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | } static OF_INLINE void OFReleaseMemoryBarrier(void) { /* nop */ } #elif (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) # import "platform/x86/OFAtomic.h" #elif defined(OF_POWERPC) && defined(__GNUC__) && !defined(__APPLE_CC__) && \ !defined(OF_AIX) # import "platform/PowerPC/OFAtomic.h" #elif defined(OF_HAVE_ATOMIC_BUILTINS) # import "platform/GCC4.7/OFAtomic.h" #elif defined(OF_HAVE_SYNC_BUILTINS) # import "platform/GCC4/OFAtomic.h" #elif defined(OF_HAVE_OSATOMIC) # import "platform/macOS/OFAtomic.h" #else # error No atomic operations available! #endif |
Modified src/OFSystemInfo.h from [62b70ba89a] to [d7ddb6bfe4].
︙ | ︙ | |||
65 66 67 68 69 70 71 | @property (class, readonly, nullable, nonatomic) OFString *operatingSystemVersion; @property (class, readonly, nullable, nonatomic) OFIRI *userDataIRI; @property (class, readonly, nullable, nonatomic) OFIRI *userConfigIRI; @property (class, readonly, nullable, nonatomic) OFIRI *temporaryDirectoryIRI; @property (class, readonly, nullable, nonatomic) OFString *CPUVendor; @property (class, readonly, nullable, nonatomic) OFString *CPUModel; | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | @property (class, readonly, nullable, nonatomic) OFString *operatingSystemVersion; @property (class, readonly, nullable, nonatomic) OFIRI *userDataIRI; @property (class, readonly, nullable, nonatomic) OFIRI *userConfigIRI; @property (class, readonly, nullable, nonatomic) OFIRI *temporaryDirectoryIRI; @property (class, readonly, nullable, nonatomic) OFString *CPUVendor; @property (class, readonly, nullable, nonatomic) OFString *CPUModel; # if defined(OF_AMD64) || defined(OF_X86) || defined(DOXYGEN) @property (class, readonly, nonatomic) bool supportsMMX; @property (class, readonly, nonatomic) bool supports3DNow; @property (class, readonly, nonatomic) bool supportsEnhanced3DNow; @property (class, readonly, nonatomic) bool supportsSSE; @property (class, readonly, nonatomic) bool supportsSSE2; @property (class, readonly, nonatomic) bool supportsSSE3; @property (class, readonly, nonatomic) bool supportsSSSE3; |
︙ | ︙ | |||
210 211 212 213 214 215 216 | * * If the model could not be determined, `nil` is returned instead. * * @return The model of the CPU */ + (nullable OFString *)CPUModel; | | | | | | | | | | | | | | | | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | * * If the model could not be determined, `nil` is returned instead. * * @return The model of the CPU */ + (nullable OFString *)CPUModel; #if defined(OF_AMD64) || defined(OF_X86) || defined(DOXYGEN) /** * @brief Returns whether the CPU supports MMX. * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports MMX */ + (bool)supportsMMX; /** * @brief Returns whether the CPU supports 3DNow!. * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports 3DNow! */ + (bool)supports3DNow; /** * @brief Returns whether the CPU supports enhanced 3DNow!. * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports enhanced 3DNow! */ + (bool)supportsEnhanced3DNow; /** * @brief Returns whether the CPU supports SSE. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports SSE */ + (bool)supportsSSE; /** * @brief Returns whether the CPU supports SSE2. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports SSE2 */ + (bool)supportsSSE2; /** * @brief Returns whether the CPU supports SSE3. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports SSE3 */ + (bool)supportsSSE3; /** * @brief Returns whether the CPU supports SSSE3. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports SSSE3 */ + (bool)supportsSSSE3; /** * @brief Returns whether the CPU supports SSE4.1. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports SSE4.1 */ + (bool)supportsSSE41; /** * @brief Returns whether the CPU supports SSE4.2. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports SSE4.2 */ + (bool)supportsSSE42; /** * @brief Returns whether the CPU supports AVX. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports AVX */ + (bool)supportsAVX; /** * @brief Returns whether the CPU supports AVX2. * * @warning This method only checks CPU support and assumes OS support! * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports AVX2 */ + (bool)supportsAVX2; /** * @brief Returns whether the CPU supports AES-NI. * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports AES-NI */ + (bool)supportsAESNI; /** * @brief Returns whether the CPU supports Intel SHA Extensions. * * @note This method is only available on AMD64 and x86. * * @return Whether the CPU supports Intel SHA Extensions */ + (bool)supportsSHAExtensions; #endif #if defined(OF_POWERPC) || defined(OF_POWERPC64) |
︙ | ︙ |
Modified src/OFSystemInfo.m from [9e9c77f12d] to [6c16836067].
︙ | ︙ | |||
114 115 116 117 118 119 120 | extern NSSearchPathEnumerationState NSStartSearchPathEnumeration( NSSearchPathDirectory, NSSearchPathDomainMask); extern NSSearchPathEnumerationState NSGetNextSearchPathEnumeration( NSSearchPathEnumerationState, char *); #endif | | | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | extern NSSearchPathEnumerationState NSStartSearchPathEnumeration( NSSearchPathDirectory, NSSearchPathDomainMask); extern NSSearchPathEnumerationState NSGetNextSearchPathEnumeration( NSSearchPathEnumerationState, char *); #endif #if defined(OF_AMD64) || defined(OF_X86) struct X86Regs { uint32_t eax, ebx, ecx, edx; }; #endif #ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES OFConstantString *const OFNetworkInterfaceAddresses = |
︙ | ︙ | |||
286 287 288 289 290 291 292 | { if (R_SUCCEEDED(fsdevMountTemporaryStorage("tmpfs"))) tmpFSIRI = [[OFIRI alloc] initFileIRIWithPath: @"tmpfs:/" isDirectory: true]; } #endif | | | | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | { if (R_SUCCEEDED(fsdevMountTemporaryStorage("tmpfs"))) tmpFSIRI = [[OFIRI alloc] initFileIRIWithPath: @"tmpfs:/" isDirectory: true]; } #endif #if defined(OF_AMD64) || defined(OF_X86) static OF_INLINE struct X86Regs OF_CONST_FUNC x86CPUID(uint32_t eax, uint32_t ecx) { struct X86Regs regs; # if defined(OF_AMD64) && defined(__GNUC__) __asm__ ( "cpuid" : "=a"(regs.eax), "=b"(regs.ebx), "=c"(regs.ecx), "=d"(regs.edx) : "a"(eax), "c"(ecx) ); # elif defined(OF_X86) && defined(__GNUC__) /* |
︙ | ︙ | |||
651 652 653 654 655 656 657 | #else return nil; #endif } + (OFString *)CPUVendor { | | | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | #else return nil; #endif } + (OFString *)CPUVendor { #if (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) struct X86Regs regs = x86CPUID(0, 0); uint32_t buffer[3]; if (regs.eax == 0) return nil; buffer[0] = regs.ebx; |
︙ | ︙ | |||
674 675 676 677 678 679 680 | #else return nil; #endif } + (OFString *)CPUModel { | | | 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | #else return nil; #endif } + (OFString *)CPUModel { #if (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) struct X86Regs regs = x86CPUID(0x80000000, 0); uint32_t buffer[12]; size_t i; if (regs.eax < 0x80000004) return nil; |
︙ | ︙ | |||
733 734 735 736 737 738 739 | else return @"68000"; #else return nil; #endif } | | | 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | else return @"68000"; #else return nil; #endif } #if defined(OF_AMD64) || defined(OF_X86) + (bool)supportsMMX { return (x86CPUID(1, 0).edx & (1u << 23)); } + (bool)supports3DNow { |
︙ | ︙ |
Name change from src/forwarding/apple-forwarding-x86_64.S to src/forwarding/apple-forwarding-amd64.S.
︙ | ︙ |
Name change from src/forwarding/apple-forwarding-i386.S to src/forwarding/apple-forwarding-x86.S.
︙ | ︙ |
Name change from src/forwarding/forwarding-x86_64-elf.S to src/forwarding/forwarding-amd64-elf.S.
︙ | ︙ |
Name change from src/forwarding/forwarding-x86_64-macho.S to src/forwarding/forwarding-amd64-macho.S.
︙ | ︙ |
Name change from src/forwarding/forwarding-x86_64-win64.S to src/forwarding/forwarding-amd64-win64.S.
︙ | ︙ |
Modified src/forwarding/forwarding.S from [ed5dca4141] to [2a272f6c14].
︙ | ︙ | |||
14 15 16 17 18 19 20 | */ #include "config.h" #include "platform.h" #ifdef OF_APPLE_RUNTIME | | | | | | | | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | */ #include "config.h" #include "platform.h" #ifdef OF_APPLE_RUNTIME # if defined(OF_AMD64) # include "apple-forwarding-amd64.S" # elif defined(OF_X86) # include "apple-forwarding-x86.S" # elif defined(OF_ARM64) # include "apple-forwarding-arm64.S" # elif defined(OF_ARM) # include "apple-forwarding-arm.S" # elif defined(OF_POWERPC) # include "apple-forwarding-powerpc.S" # endif #else # if defined(OF_ELF) # if defined(OF_AMD64) # include "forwarding-amd64-elf.S" # elif defined(OF_X86) # include "forwarding-x86-elf.S" # elif defined(OF_ARM64) # include "forwarding-arm64-elf.S" # elif defined(OF_ARM) # include "forwarding-arm-elf.S" # elif defined(OF_POWERPC) # include "forwarding-powerpc-elf.S" # elif defined(OF_MIPS) # include "forwarding-mips-elf.S" # elif defined(OF_SPARC64) # include "forwarding-sparc64-elf.S" # elif defined(OF_SPARC) # include "forwarding-sparc-elf.S" # endif # elif defined(OF_MACH_O) # if defined(OF_AMD64) # include "forwarding-amd64-macho.S" # endif # elif defined(OF_WINDOWS) # if defined(OF_AMD64) # include "forwarding-amd64-win64.S" # elif defined(OF_X86) # include "forwarding-x86-win32.S" # endif # endif #endif |
Modified src/macros.h from [73ff2f7764] to [4191bc0c4c].
︙ | ︙ | |||
312 313 314 315 316 317 318 | #if __has_attribute(__objc_direct_members__) && defined(OF_APPLE_RUNTIME) # define OF_DIRECT_MEMBERS __attribute__((__objc_direct_members__)) #else # define OF_DIRECT_MEMBERS #endif #ifdef OF_APPLE_RUNTIME | | | | | | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | #if __has_attribute(__objc_direct_members__) && defined(OF_APPLE_RUNTIME) # define OF_DIRECT_MEMBERS __attribute__((__objc_direct_members__)) #else # define OF_DIRECT_MEMBERS #endif #ifdef OF_APPLE_RUNTIME # if defined(OF_AMD64) || defined(OF_X86) || defined(OF_ARM64) || \ defined(OF_ARM) || defined(OF_POWERPC) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif #else # if defined(OF_ELF) # if defined(OF_AMD64) || defined(OF_X86) || \ defined(OF_ARM64) || defined(OF_ARM) || defined(OF_POWERPC) || \ defined(OF_MIPS) || defined(OF_SPARC64) || defined(OF_SPARC) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # if __OBJFW_RUNTIME_ABI__ >= 800 # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif # endif # elif defined(OF_MACH_O) # if defined(OF_AMD64) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # if __OBJFW_RUNTIME_ABI__ >= 800 # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif # endif # elif defined(OF_WINDOWS) # if defined(OF_AMD64) || defined(OF_X86) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # if __OBJFW_RUNTIME_ABI__ >= 800 # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif # endif # endif #endif |
︙ | ︙ | |||
446 447 448 449 450 451 452 | } static OF_INLINE uint16_t OF_CONST_FUNC OFByteSwap16NonConst(uint16_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP16) return __builtin_bswap16(i); | | | 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | } static OF_INLINE uint16_t OF_CONST_FUNC OFByteSwap16NonConst(uint16_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP16) return __builtin_bswap16(i); #elif (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) __asm__ ( "xchgb %h0, %b0" : "=Q"(i) : "0"(i) ); #elif defined(OF_POWERPC) && defined(__GNUC__) __asm__ ( |
︙ | ︙ | |||
476 477 478 479 480 481 482 | } static OF_INLINE uint32_t OF_CONST_FUNC OFByteSwap32NonConst(uint32_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP32) return __builtin_bswap32(i); | | | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | } static OF_INLINE uint32_t OF_CONST_FUNC OFByteSwap32NonConst(uint32_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP32) return __builtin_bswap32(i); #elif (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) __asm__ ( "bswap %0" : "=q"(i) : "0"(i) ); #elif defined(OF_POWERPC) && defined(__GNUC__) __asm__ ( |
︙ | ︙ | |||
508 509 510 511 512 513 514 | } static OF_INLINE uint64_t OF_CONST_FUNC OFByteSwap64NonConst(uint64_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP64) return __builtin_bswap64(i); | | | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | } static OF_INLINE uint64_t OF_CONST_FUNC OFByteSwap64NonConst(uint64_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP64) return __builtin_bswap64(i); #elif defined(OF_AMD64) && defined(__GNUC__) __asm__ ( "bswap %0" : "=r"(i) : "0"(i) ); #elif defined(OF_X86) && defined(__GNUC__) __asm__ ( |
︙ | ︙ |
Modified src/platform.h from [6c5c8a63a5] to [f76a065372].
︙ | ︙ | |||
22 23 24 25 26 27 28 | # define OF_FLOAT_BIG_ENDIAN # elif !__LITTLE_ENDIAN__ # error OF_UNIVERSAL defined, but neither __BIG_ENDIAN__ nor __LITTLE_ENDIAN__! # endif #endif #if defined(__x86_64__) || defined(__amd64__) | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # define OF_FLOAT_BIG_ENDIAN # elif !__LITTLE_ENDIAN__ # error OF_UNIVERSAL defined, but neither __BIG_ENDIAN__ nor __LITTLE_ENDIAN__! # endif #endif #if defined(__x86_64__) || defined(__amd64__) # define OF_AMD64 #elif defined(__i386__) # define OF_X86 #elif defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) # define OF_POWERPC64 #elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) # define OF_POWERPC #elif defined(__arm64__) || defined(__aarch64__) || defined(__ARM64_ARCH_8__) |
︙ | ︙ |
Modified src/platform/x86/OFAtomic.h from [5121669f4a] to [07765f0312].
︙ | ︙ | |||
22 23 24 25 26 27 28 | __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %2\n\t" "addl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %2\n\t" "addl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "lock\n\t" "xaddq %0, %2\n\t" "addq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) |
︙ | ︙ | |||
55 56 57 58 59 60 61 | return i; } static OF_INLINE void *_Nullable OFAtomicPointerAdd(void *volatile _Nullable *_Nonnull p, intptr_t i) { | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | return i; } static OF_INLINE void *_Nullable OFAtomicPointerAdd(void *volatile _Nullable *_Nonnull p, intptr_t i) { #if defined(OF_AMD64) __asm__ __volatile__ ( "lock\n\t" "xaddq %0, %2\n\t" "addq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); |
︙ | ︙ | |||
90 91 92 93 94 95 96 | "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" "subl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); | | | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" "subl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "negq %0\n\t" "lock\n\t" "xaddq %0, %2\n\t" "subq %1, %0" : "+&r"(i) |
︙ | ︙ | |||
125 126 127 128 129 130 131 | return i; } static OF_INLINE void *_Nullable OFAtomicPointerSubtract(void *volatile _Nullable *_Nonnull p, intptr_t i) { | | | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | return i; } static OF_INLINE void *_Nullable OFAtomicPointerSubtract(void *volatile _Nullable *_Nonnull p, intptr_t i) { #if defined(OF_AMD64) __asm__ __volatile__ ( "negq %0\n\t" "lock\n\t" "xaddq %0, %2\n\t" "subq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) |
︙ | ︙ | |||
165 166 167 168 169 170 171 | "incl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" "incl %0" : "=&r"(i) : "m"(*p) ); | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | "incl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" "incl %0" : "=&r"(i) : "m"(*p) ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "xorq %0, %0\n\t" "incq %0\n\t" "lock\n\t" "xaddq %0, %1\n\t" "incq %0" |
︙ | ︙ | |||
216 217 218 219 220 221 222 | "decl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" "decl %0" : "=&r"(i) : "m"(*p) ); | | | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | "decl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" "decl %0" : "=&r"(i) : "m"(*p) ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "xorq %0, %0\n\t" "decq %0\n\t" "lock\n\t" "xaddq %0, %1\n\t" "decq %0" |
︙ | ︙ | |||
268 269 270 271 272 273 274 | "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0b" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); | | | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0b" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "0:\n\t" "movq %2, %0\n\t" "movq %0, %%rax\n\t" "orq %1, %0\n\t" "lock\n\t" |
︙ | ︙ | |||
324 325 326 327 328 329 330 | "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0b" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); | | | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0b" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "0:\n\t" "movq %2, %0\n\t" "movq %0, %%rax\n\t" "andq %1, %0\n\t" "lock\n\t" |
︙ | ︙ | |||
380 381 382 383 384 385 386 | "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0b" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); | | | 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0b" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); #ifdef OF_AMD64 else if (sizeof(int) == 8) __asm__ __volatile__ ( "0:\n\t" "movq %2, %0\n\t" "movq %0, %%rax\n\t" "xorq %1, %0\n\t" "lock\n\t" |
︙ | ︙ | |||
478 479 480 481 482 483 484 | return r; } static OF_INLINE void OFMemoryBarrier(void) { | | | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | return r; } static OF_INLINE void OFMemoryBarrier(void) { #ifdef OF_AMD64 __asm__ __volatile__ ( "lock orq $0, (%%rsp)" ::: "memory", "cc" ); #else __asm__ __volatile__ ( "lock orl $0, (%%esp)" ::: "memory", "cc" ); |
︙ | ︙ |
Name change from src/runtime/lookup-asm/lookup-asm-x86_64-elf.S to src/runtime/lookup-asm/lookup-asm-amd64-elf.S.
︙ | ︙ |
Name change from src/runtime/lookup-asm/lookup-asm-x86_64-macho.S to src/runtime/lookup-asm/lookup-asm-amd64-macho.S.
︙ | ︙ |
Name change from src/runtime/lookup-asm/lookup-asm-x86_64-win64.S to src/runtime/lookup-asm/lookup-asm-amd64-win64.S.
︙ | ︙ |
Modified src/runtime/lookup-asm/lookup-asm.S from [f8040fae10] to [59fd89901b].
︙ | ︙ | |||
14 15 16 17 18 19 20 | */ #include "config.h" #include "platform.h" #if defined(OF_ELF) | | | | | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | */ #include "config.h" #include "platform.h" #if defined(OF_ELF) # if defined(OF_AMD64) # include "lookup-asm-amd64-elf.S" # elif defined(OF_X86) # include "lookup-asm-x86-elf.S" # elif defined(OF_ARM64) # include "lookup-asm-arm64-elf.S" # elif defined(OF_ARM) # include "lookup-asm-arm-elf.S" # elif defined(OF_POWERPC64) # include "lookup-asm-powerpc64-elf.S" # elif defined(OF_POWERPC) # include "lookup-asm-powerpc-elf.S" # elif defined(OF_MIPS64_N64) # include "lookup-asm-mips64-n64-elf.S" # elif defined(OF_MIPS) # include "lookup-asm-mips-elf.S" # elif defined(OF_SPARC64) # include "lookup-asm-sparc64-elf.S" # elif defined(OF_SPARC) # include "lookup-asm-sparc-elf.S" # endif #elif defined(OF_MACH_O) # if defined(OF_AMD64) # include "lookup-asm-amd64-macho.S" # endif #elif defined(OF_WINDOWS) # if defined(OF_AMD64) # include "lookup-asm-amd64-win64.S" # elif defined(OF_X86) # include "lookup-asm-x86-win32.S" # endif #endif |
Modified src/runtime/private.h from [98d483fe2d] to [9ac7fac548].
︙ | ︙ | |||
353 354 355 356 357 358 359 | extern void OF_NO_RETURN_FUNC objc_error(const char *_Nonnull title, const char *_Nonnull format, ...); #define OBJC_ERROR(...) \ objc_error("ObjFWRT @ " __FILE__ ":" OF_STRINGIFY(__LINE__), \ __VA_ARGS__) #if defined(OF_ELF) | | | | | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | extern void OF_NO_RETURN_FUNC objc_error(const char *_Nonnull title, const char *_Nonnull format, ...); #define OBJC_ERROR(...) \ objc_error("ObjFWRT @ " __FILE__ ":" OF_STRINGIFY(__LINE__), \ __VA_ARGS__) #if defined(OF_ELF) # if defined(OF_AMD64) || defined(OF_X86) || \ defined(OF_POWERPC64) || defined(OF_POWERPC) || \ defined(OF_ARM64) || defined(OF_ARM) || \ defined(OF_MIPS64_N64) || defined(OF_MIPS) || \ defined(OF_SPARC64) || defined(OF_SPARC) # define OF_ASM_LOOKUP # endif #elif defined(OF_MACH_O) # if defined(OF_AMD64) # define OF_ASM_LOOKUP # endif #elif defined(OF_WINDOWS) # if defined(OF_AMD64) || defined(OF_X86) # define OF_ASM_LOOKUP # endif #endif @interface DummyObject { Class _Nonnull isa; |
︙ | ︙ |
Modified tests/OFStringTests.m from [f5fa768efd] to [4230f34f7e].
︙ | ︙ | |||
1152 1153 1154 1155 1156 1157 1158 | #else /* Android, Solaris, HP-UX, DJGPP and AmigaOS 3 do not accept 0x for strtod() */ # if (!defined(OF_SOLARIS) || !defined(OF_X86)) && !defined(OF_AMIGAOS_M68K) # define INPUT @"\t-0.123456789 " # define EXPECTED -0.123456789 # else /* | | | 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | #else /* Android, Solaris, HP-UX, DJGPP and AmigaOS 3 do not accept 0x for strtod() */ # if (!defined(OF_SOLARIS) || !defined(OF_X86)) && !defined(OF_AMIGAOS_M68K) # define INPUT @"\t-0.123456789 " # define EXPECTED -0.123456789 # else /* * Solaris' strtod() has weird rounding on x86, but not on AMD64. * AmigaOS 3 with libnix has weird rounding as well. */ # define INPUT @"\t-0.125 " # define EXPECTED -0.125 # endif #endif TEST(@"-[doubleValue]", |
︙ | ︙ |