authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2024-12-09 18:54:49-05:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-13 03:55:54+01:00
loga68119f8f1d54b70e713e1e8ce07491ddba0f093
treeeb688cf3883ebeba15bed380a54e8c7034287f5b
parent130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3

macos: vendored libc: bump to SDK 15.1


185 files changed, 12524 insertions(+), 4241 deletions(-)

lib/libc/darwin/SDKSettings.json+1-1
...@@ -1 +1 @@...@@ -1 +1 @@
1{"MinimalDisplayName":"14.0"}1{"MinimalDisplayName":"15.1"}
lib/libc/darwin/libSystem.tbd+815-763
...@@ -1,14 +1,10 @@...@@ -1,14 +1,10 @@
1--- !tapi-tbd1--- !tapi-tbd
2tbd-version: 42tbd-version: 4
3targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 3targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
4 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]4 arm64e-macos, arm64e-maccatalyst ]
5install-name: '/usr/lib/libSystem.B.dylib'5install-name: '/usr/lib/libSystem.B.dylib'
6current-version: 13366current-version: 1351
7reexported-libraries:7reexported-libraries:
8 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
9 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
10 libraries: [ '/usr/lib/system/libsystem_kernel.dylib', '/usr/lib/system/libsystem_platform.dylib',
11 '/usr/lib/system/libsystem_pthread.dylib' ]
12 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 8 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
13 arm64e-macos, arm64e-maccatalyst ]9 arm64e-macos, arm64e-maccatalyst ]
14 libraries: [ '/usr/lib/system/libcache.dylib', '/usr/lib/system/libcommonCrypto.dylib', 10 libraries: [ '/usr/lib/system/libcache.dylib', '/usr/lib/system/libcommonCrypto.dylib',
...@@ -21,13 +17,15 @@ reexported-libraries:...@@ -21,13 +17,15 @@ reexported-libraries:
21 '/usr/lib/system/libsystem_collections.dylib', '/usr/lib/system/libsystem_configuration.dylib', 17 '/usr/lib/system/libsystem_collections.dylib', '/usr/lib/system/libsystem_configuration.dylib',
22 '/usr/lib/system/libsystem_containermanager.dylib', '/usr/lib/system/libsystem_coreservices.dylib', 18 '/usr/lib/system/libsystem_containermanager.dylib', '/usr/lib/system/libsystem_coreservices.dylib',
23 '/usr/lib/system/libsystem_darwin.dylib', '/usr/lib/system/libsystem_darwindirectory.dylib', 19 '/usr/lib/system/libsystem_darwin.dylib', '/usr/lib/system/libsystem_darwindirectory.dylib',
24 '/usr/lib/system/libsystem_dnssd.dylib', '/usr/lib/system/libsystem_featureflags.dylib', 20 '/usr/lib/system/libsystem_dnssd.dylib', '/usr/lib/system/libsystem_eligibility.dylib',
25 '/usr/lib/system/libsystem_info.dylib', '/usr/lib/system/libsystem_m.dylib', 21 '/usr/lib/system/libsystem_featureflags.dylib', '/usr/lib/system/libsystem_info.dylib',
22 '/usr/lib/system/libsystem_kernel.dylib', '/usr/lib/system/libsystem_m.dylib',
26 '/usr/lib/system/libsystem_malloc.dylib', '/usr/lib/system/libsystem_networkextension.dylib', 23 '/usr/lib/system/libsystem_malloc.dylib', '/usr/lib/system/libsystem_networkextension.dylib',
27 '/usr/lib/system/libsystem_notify.dylib', '/usr/lib/system/libsystem_sandbox.dylib', 24 '/usr/lib/system/libsystem_notify.dylib', '/usr/lib/system/libsystem_platform.dylib',
28 '/usr/lib/system/libsystem_secinit.dylib', '/usr/lib/system/libsystem_symptoms.dylib', 25 '/usr/lib/system/libsystem_pthread.dylib', '/usr/lib/system/libsystem_sandbox.dylib',
29 '/usr/lib/system/libsystem_trace.dylib', '/usr/lib/system/libunwind.dylib', 26 '/usr/lib/system/libsystem_sanitizers.dylib', '/usr/lib/system/libsystem_secinit.dylib',
30 '/usr/lib/system/libxpc.dylib' ]27 '/usr/lib/system/libsystem_symptoms.dylib', '/usr/lib/system/libsystem_trace.dylib',
28 '/usr/lib/system/libunwind.dylib', '/usr/lib/system/libxpc.dylib' ]
31exports:29exports:
32 - targets: [ x86_64-macos, x86_64-maccatalyst ]30 - targets: [ x86_64-macos, x86_64-maccatalyst ]
33 symbols: [ 'R8289209$_close', 'R8289209$_fork', 'R8289209$_fsync', 'R8289209$_getattrlist', 31 symbols: [ 'R8289209$_close', 'R8289209$_fork', 'R8289209$_fsync', 'R8289209$_getattrlist',
...@@ -48,7 +46,7 @@ tbd-version: 4...@@ -48,7 +46,7 @@ tbd-version: 4
48targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 46targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
49 arm64e-macos, arm64e-maccatalyst ]47 arm64e-macos, arm64e-maccatalyst ]
50install-name: '/usr/lib/system/libcache.dylib'48install-name: '/usr/lib/system/libcache.dylib'
51current-version: 9249current-version: 95
52parent-umbrella:50parent-umbrella:
53 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 51 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
54 arm64e-macos, arm64e-maccatalyst ]52 arm64e-macos, arm64e-maccatalyst ]
...@@ -91,14 +89,18 @@ exports:...@@ -91,14 +89,18 @@ exports:
91 _CCBigNumModExp, _CCBigNumModI, _CCBigNumMul, _CCBigNumMulI, 89 _CCBigNumModExp, _CCBigNumModI, _CCBigNumMul, _CCBigNumMulI,
92 _CCBigNumMulMod, _CCBigNumRightShift, _CCBigNumSetI, _CCBigNumSetNegative, 90 _CCBigNumMulMod, _CCBigNumRightShift, _CCBigNumSetI, _CCBigNumSetNegative,
93 _CCBigNumSub, _CCBigNumSubI, _CCBigNumToData, _CCBigNumToDecimalString, 91 _CCBigNumSub, _CCBigNumSubI, _CCBigNumToData, _CCBigNumToDecimalString,
94 _CCBigNumToHexString, _CCBigNumZeroLSBCount, _CCCKGContributorCommit, 92 _CCBigNumToHexString, _CCBigNumZeroLSBCount, _CCCKG2ContributorCommit,
95 _CCCKGContributorCreate, _CCCKGContributorDestroy, _CCCKGContributorFinish, 93 _CCCKG2ContributorCreate, _CCCKG2ContributorDestroy, _CCCKG2ContributorFinish,
96 _CCCKGGetCommitmentSize, _CCCKGGetOpeningSize, _CCCKGGetShareSize, 94 _CCCKG2GetCommitmentSize, _CCCKG2GetOpeningSize, _CCCKG2GetShareSize,
97 _CCCKGOwnerCreate, _CCCKGOwnerDestroy, _CCCKGOwnerFinish, 95 _CCCKG2OwnerCreate, _CCCKG2OwnerDestroy, _CCCKG2OwnerFinish,
98 _CCCKGOwnerGenerateShare, _CCCalibratePBKDF, _CCCreateBigNum, 96 _CCCKG2OwnerGenerateShare, _CCCKG2ParamsP224Sha256Version2,
99 _CCCrypt, _CCCryptorAddParameter, _CCCryptorChaCha20, _CCCryptorChaCha20Poly1305OneshotDecrypt, 97 _CCCKGContributorCommit, _CCCKGContributorCreate, _CCCKGContributorDestroy,
100 _CCCryptorChaCha20Poly1305OneshotEncrypt, _CCCryptorCreate, 98 _CCCKGContributorFinish, _CCCKGGetCommitmentSize, _CCCKGGetOpeningSize,
101 _CCCryptorCreateFromData, _CCCryptorCreateFromDataWithMode, 99 _CCCKGGetShareSize, _CCCKGOwnerCreate, _CCCKGOwnerDestroy,
100 _CCCKGOwnerFinish, _CCCKGOwnerGenerateShare, _CCCalibratePBKDF,
101 _CCCreateBigNum, _CCCrypt, _CCCryptorAddParameter, _CCCryptorChaCha20,
102 _CCCryptorChaCha20Poly1305OneshotDecrypt, _CCCryptorChaCha20Poly1305OneshotEncrypt,
103 _CCCryptorCreate, _CCCryptorCreateFromData, _CCCryptorCreateFromDataWithMode,
102 _CCCryptorCreateWithMode, _CCCryptorDecryptDataBlock, _CCCryptorEncryptDataBlock, 104 _CCCryptorCreateWithMode, _CCCryptorDecryptDataBlock, _CCCryptorEncryptDataBlock,
103 _CCCryptorFinal, _CCCryptorGCM, _CCCryptorGCMAddAAD, _CCCryptorGCMAddADD, 105 _CCCryptorFinal, _CCCryptorGCM, _CCCryptorGCMAddAAD, _CCCryptorGCMAddADD,
104 _CCCryptorGCMAddIV, _CCCryptorGCMDecrypt, _CCCryptorGCMEncrypt, 106 _CCCryptorGCMAddIV, _CCCryptorGCMDecrypt, _CCCryptorGCMEncrypt,
...@@ -154,7 +156,7 @@ exports:...@@ -154,7 +156,7 @@ exports:
154tbd-version: 4156tbd-version: 4
155targets: [ x86_64-macos, arm64-macos, arm64e-macos ]157targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
156install-name: '/usr/lib/system/libcompiler_rt.dylib'158install-name: '/usr/lib/system/libcompiler_rt.dylib'
157current-version: 103.1159current-version: 103.3
158parent-umbrella:160parent-umbrella:
159 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]161 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
160 umbrella: System162 umbrella: System
...@@ -397,7 +399,7 @@ tbd-version: 4...@@ -397,7 +399,7 @@ tbd-version: 4
397targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 399targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
398 arm64e-macos, arm64e-maccatalyst ]400 arm64e-macos, arm64e-maccatalyst ]
399install-name: '/usr/lib/system/libcorecrypto.dylib'401install-name: '/usr/lib/system/libcorecrypto.dylib'
400current-version: 1608.0.18402current-version: 1736.40.7
401parent-umbrella:403parent-umbrella:
402 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 404 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
403 arm64e-macos, arm64e-maccatalyst ]405 arm64e-macos, arm64e-maccatalyst ]
...@@ -432,36 +434,10 @@ exports:...@@ -432,36 +434,10 @@ exports:
432 _ccapsic_client_generate_match_response, _ccapsic_client_init, 434 _ccapsic_client_generate_match_response, _ccapsic_client_init,
433 _ccapsic_client_state_sizeof, _ccapsic_server_determine_intersection, 435 _ccapsic_client_state_sizeof, _ccapsic_server_determine_intersection,
434 _ccapsic_server_encode_element, _ccapsic_server_init, _ccapsic_server_state_sizeof, 436 _ccapsic_server_encode_element, _ccapsic_server_init, _ccapsic_server_state_sizeof,
435 _ccbfv_bytes_to_coeffs, _ccbfv_ciphertext_apply_galois, _ccbfv_ciphertext_coeff_compose, 437 _ccascon_ascon128a, _ccascon_ascon128a_cmac, _ccascon_ascon128a_cmac_ref,
436 _ccbfv_ciphertext_coeff_dcrt_plaintext_mul, _ccbfv_ciphertext_coeff_decompose, 438 _ccascon_ascon128a_decrypt, _ccascon_ascon128a_encrypt, _ccascon_ascon128a_ref,
437 _ccbfv_ciphertext_coeff_decompose_nptexts, _ccbfv_ciphertext_coeff_plaintext_mul, 439 _ccascon_cmac_init, _ccascon_cmac_process, _ccascon_cmac_tag,
438 _ccbfv_ciphertext_eval_dcrt_plaintext_mul, _ccbfv_ciphertext_eval_plaintext_mul, 440 _ccascon_cmac_verify, _ccblowfish_cbc_decrypt_mode, _ccblowfish_cbc_encrypt_mode,
439 _ccbfv_ciphertext_fresh_npolys, _ccbfv_ciphertext_fwd_ntt,
440 _ccbfv_ciphertext_galois_elt_rotate_rows_left, _ccbfv_ciphertext_galois_elt_rotate_rows_right,
441 _ccbfv_ciphertext_galois_elt_swap_columns, _ccbfv_ciphertext_inv_ntt,
442 _ccbfv_ciphertext_plaintext_add, _ccbfv_ciphertext_sizeof,
443 _ccbfv_coeffs_to_bytes, _ccbfv_dcrt_plaintext_encode, _ccbfv_dcrt_plaintext_sizeof,
444 _ccbfv_decode_poly_uint64, _ccbfv_decode_simd_int64, _ccbfv_decode_simd_uint64,
445 _ccbfv_decrypt, _ccbfv_deserialize_ciphertext_coeff, _ccbfv_deserialize_ciphertext_eval,
446 _ccbfv_deserialize_seeded_ciphertext_coeff, _ccbfv_deserialize_seeded_ciphertext_eval,
447 _ccbfv_encode_poly_uint64, _ccbfv_encode_simd_int64, _ccbfv_encode_simd_uint64,
448 _ccbfv_encrypt_symmetric, _ccbfv_encryption_params_coefficient_moduli,
449 _ccbfv_encryption_params_coefficient_nmoduli, _ccbfv_encryption_params_plaintext_modulus,
450 _ccbfv_encryption_params_polynomial_degree, _ccbfv_galois_key_generate,
451 _ccbfv_galois_key_load, _ccbfv_galois_key_save, _ccbfv_galois_key_sizeof,
452 _ccbfv_param_ctx_ciphertext_ctx_nmoduli, _ccbfv_param_ctx_init,
453 _ccbfv_param_ctx_key_ctx_nmoduli, _ccbfv_param_ctx_key_ctx_poly_nbytes,
454 _ccbfv_param_ctx_plaintext_modulus, _ccbfv_param_ctx_plaintext_modulus_inverse,
455 _ccbfv_param_ctx_polynomial_degree, _ccbfv_param_ctx_sizeof,
456 _ccbfv_param_ctx_supports_simd_encoding, _ccbfv_plaintext_sizeof,
457 _ccbfv_relin_key_generate, _ccbfv_relin_key_load, _ccbfv_relin_key_save,
458 _ccbfv_relin_key_sizeof, _ccbfv_rng_seed_sizeof, _ccbfv_secret_key_generate,
459 _ccbfv_secret_key_generate_from_seed, _ccbfv_secret_key_sizeof,
460 _ccbfv_serialize_ciphertext_coeff, _ccbfv_serialize_ciphertext_coeff_nbytes,
461 _ccbfv_serialize_ciphertext_eval, _ccbfv_serialize_ciphertext_eval_nbytes,
462 _ccbfv_serialize_seeded_ciphertext_coeff, _ccbfv_serialize_seeded_ciphertext_coeff_nbytes,
463 _ccbfv_serialize_seeded_ciphertext_eval, _ccbfv_serialize_seeded_ciphertext_eval_nbytes,
464 _ccblowfish_cbc_decrypt_mode, _ccblowfish_cbc_encrypt_mode,
465 _ccblowfish_cfb8_decrypt_mode, _ccblowfish_cfb8_encrypt_mode, 441 _ccblowfish_cfb8_decrypt_mode, _ccblowfish_cfb8_encrypt_mode,
466 _ccblowfish_cfb_decrypt_mode, _ccblowfish_cfb_encrypt_mode, 442 _ccblowfish_cfb_decrypt_mode, _ccblowfish_cfb_encrypt_mode,
467 _ccblowfish_ctr_crypt_mode, _ccblowfish_ecb_decrypt_mode, 443 _ccblowfish_ctr_crypt_mode, _ccblowfish_ecb_decrypt_mode,
...@@ -486,13 +462,17 @@ exports:...@@ -486,13 +462,17 @@ exports:
486 _ccchacha20poly1305_finalize, _ccchacha20poly1305_incnonce, 462 _ccchacha20poly1305_finalize, _ccchacha20poly1305_incnonce,
487 _ccchacha20poly1305_info, _ccchacha20poly1305_init, _ccchacha20poly1305_reset, 463 _ccchacha20poly1305_info, _ccchacha20poly1305_init, _ccchacha20poly1305_reset,
488 _ccchacha20poly1305_setnonce, _ccchacha20poly1305_verify, 464 _ccchacha20poly1305_setnonce, _ccchacha20poly1305_verify,
489 _ccckg_contributor_commit, _ccckg_contributor_finish, _ccckg_init, 465 _ccckg2_contributor_commit, _ccckg2_contributor_finish, _ccckg2_ctx_cp,
490 _ccckg_owner_finish, _ccckg_owner_generate_share, _ccckg_sizeof_commitment, 466 _ccckg2_ctx_di, _ccckg2_init, _ccckg2_owner_finish, _ccckg2_owner_generate_share,
491 _ccckg_sizeof_ctx, _ccckg_sizeof_opening, _ccckg_sizeof_share, 467 _ccckg2_params_p224_sha256_v2, _ccckg2_sizeof_commitment,
492 _cccmac_final_generate, _cccmac_final_verify, _cccmac_init, 468 _ccckg2_sizeof_ctx, _ccckg2_sizeof_opening, _ccckg2_sizeof_share,
493 _cccmac_one_shot_generate, _cccmac_one_shot_verify, _cccmac_update, 469 _ccckg_contributor_commit, _ccckg_contributor_finish, _ccckg_ctx_cp,
494 _ccctr_block_size, _ccctr_context_size, _ccctr_init, _ccctr_one_shot, 470 _ccckg_ctx_di, _ccckg_init, _ccckg_owner_finish, _ccckg_owner_generate_share,
495 _ccctr_update, _cccurve25519, _cccurve25519_make_key_pair, 471 _ccckg_sizeof_commitment, _ccckg_sizeof_ctx, _ccckg_sizeof_opening,
472 _ccckg_sizeof_share, _cccmac_final_generate, _cccmac_final_verify,
473 _cccmac_init, _cccmac_one_shot_generate, _cccmac_one_shot_verify,
474 _cccmac_update, _ccctr_block_size, _ccctr_context_size, _ccctr_init,
475 _ccctr_one_shot, _ccctr_update, _cccurve25519, _cccurve25519_make_key_pair,
496 _cccurve25519_make_priv, _cccurve25519_make_pub, _cccurve25519_make_pub_with_rng, 476 _cccurve25519_make_priv, _cccurve25519_make_pub, _cccurve25519_make_pub_with_rng,
497 _cccurve25519_with_rng, _cccurve448, _cccurve448_make_key_pair, 477 _cccurve25519_with_rng, _cccurve448, _cccurve448_make_key_pair,
498 _cccurve448_make_priv, _cccurve448_make_pub, _ccder_blob_decode_bitstring, 478 _cccurve448_make_priv, _cccurve448_make_pub, _ccder_blob_decode_bitstring,
...@@ -566,9 +546,9 @@ exports:...@@ -566,9 +546,9 @@ exports:
566 _ccec_der_import_priv, _ccec_der_import_priv_keytype, _ccec_diversify_min_entropy_len, 546 _ccec_der_import_priv, _ccec_der_import_priv_keytype, _ccec_diversify_min_entropy_len,
567 _ccec_diversify_priv_twin, _ccec_diversify_pub, _ccec_diversify_pub_twin, 547 _ccec_diversify_priv_twin, _ccec_diversify_pub, _ccec_diversify_pub_twin,
568 _ccec_export_affine_point, _ccec_export_affine_point_size, 548 _ccec_export_affine_point, _ccec_export_affine_point_size,
569 _ccec_export_pub, _ccec_extract_rs, _ccec_full_add, _ccec_generate_blinding_keys, 549 _ccec_export_pub, _ccec_extract_rs, _ccec_full_add, _ccec_full_sub,
570 _ccec_generate_key, _ccec_generate_key_deterministic, _ccec_generate_key_fips, 550 _ccec_generate_blinding_keys, _ccec_generate_key, _ccec_generate_key_deterministic,
571 _ccec_generate_key_legacy, _ccec_generate_scalar_fips_retry, 551 _ccec_generate_key_fips, _ccec_generate_key_legacy, _ccec_generate_scalar_fips_retry,
572 _ccec_get_cp, _ccec_get_fullkey_components, _ccec_get_pubkey_components, 552 _ccec_get_cp, _ccec_get_fullkey_components, _ccec_get_pubkey_components,
573 _ccec_import_affine_point, _ccec_import_pub, _ccec_is_compactable_pub, 553 _ccec_import_affine_point, _ccec_import_pub, _ccec_is_compactable_pub,
574 _ccec_keysize_is_supported, _ccec_make_priv, _ccec_make_pub, 554 _ccec_keysize_is_supported, _ccec_make_priv, _ccec_make_pub,
...@@ -596,39 +576,70 @@ exports:...@@ -596,39 +576,70 @@ exports:
596 _cced25519_make_pub_with_rng, _cced25519_sign, _cced25519_sign_with_rng, 576 _cced25519_make_pub_with_rng, _cced25519_sign, _cced25519_sign_with_rng,
597 _cced25519_verify, _cced448_make_key_pair, _cced448_make_pub, 577 _cced25519_verify, _cced448_make_key_pair, _cced448_make_pub,
598 _cced448_sign, _cced448_verify, _ccentropy_add_entropy, _ccentropy_digest_init, 578 _cced448_sign, _cced448_verify, _ccentropy_add_entropy, _ccentropy_digest_init,
599 _ccentropy_get_seed, _ccentropy_rng_init, _ccgcm_aad, _ccgcm_block_size, 579 _ccentropy_get_seed, _ccentropy_list_init, _ccentropy_lock_init,
580 _ccentropy_reset, _ccentropy_rng_init, _ccgcm_aad, _ccgcm_block_size,
600 _ccgcm_context_size, _ccgcm_finalize, _ccgcm_gmac, _ccgcm_inc_iv, 581 _ccgcm_context_size, _ccgcm_finalize, _ccgcm_gmac, _ccgcm_inc_iv,
601 _ccgcm_init, _ccgcm_init_with_iv, _ccgcm_one_shot, _ccgcm_one_shot_legacy, 582 _ccgcm_init, _ccgcm_init_with_iv, _ccgcm_one_shot, _ccgcm_one_shot_legacy,
602 _ccgcm_reset, _ccgcm_set_iv, _ccgcm_set_iv_legacy, _ccgcm_update, 583 _ccgcm_reset, _ccgcm_set_iv, _ccgcm_set_iv_legacy, _ccgcm_update,
603 _cch2c, _cch2c_name, _cch2c_p256_sha256_sae_compat_info, _cch2c_p256_sha256_sswu_ro_info, 584 _cch2c, _cch2c_name, _cch2c_p256_sha256_sae_compat_info, _cch2c_p256_sha256_sswu_ro_info,
604 _cch2c_p384_sha384_sae_compat_info, _cch2c_p384_sha512_sswu_ro_info, 585 _cch2c_p384_sha384_sae_compat_info, _cch2c_p384_sha512_sswu_ro_info,
605 _cch2c_p521_sha512_sswu_ro_info, _cchkdf, _cchkdf_expand, 586 _cch2c_p521_sha512_sswu_ro_info, _cche_bytes_to_coeffs, _cche_ciphertext_apply_galois,
606 _cchkdf_extract, _cchmac, _cchmac_final, _cchmac_init, _cchmac_update, 587 _cche_ciphertext_coeff_compose, _cche_ciphertext_coeff_dcrt_plaintext_mul,
607 _cchpke_initiator_encrypt, _cchpke_initiator_export, _cchpke_initiator_seal, 588 _cche_ciphertext_coeff_decompose, _cche_ciphertext_coeff_decompose_nptexts,
608 _cchpke_initiator_setup, _cchpke_kem_generate_key_pair, _cchpke_params_sizeof_aead_key, 589 _cche_ciphertext_coeff_plaintext_mul, _cche_ciphertext_correction_factor,
609 _cchpke_params_sizeof_aead_nonce, _cchpke_params_sizeof_aead_tag, 590 _cche_ciphertext_eval_dcrt_plaintext_mul, _cche_ciphertext_eval_plaintext_mul,
610 _cchpke_params_sizeof_kdf_hash, _cchpke_params_sizeof_kem_enc, 591 _cche_ciphertext_fresh_correction_factor, _cche_ciphertext_fresh_npolys,
611 _cchpke_params_sizeof_kem_pk, _cchpke_params_sizeof_kem_pk_marshalled, 592 _cche_ciphertext_fwd_ntt, _cche_ciphertext_galois_elt_rotate_rows_left,
612 _cchpke_params_sizeof_kem_shared_secret, _cchpke_params_sizeof_kem_sk, 593 _cche_ciphertext_galois_elt_rotate_rows_right, _cche_ciphertext_galois_elt_swap_columns,
613 _cchpke_params_x25519_AESGCM128_HKDF_SHA256, _cchpke_responder_decrypt, 594 _cche_ciphertext_inv_ntt, _cche_ciphertext_plaintext_add,
614 _cchpke_responder_export, _cchpke_responder_open, _cchpke_responder_setup, 595 _cche_ciphertext_sizeof, _cche_coeffs_to_bytes, _cche_crt_compose,
615 _cckem_decapsulate, _cckem_encapsulate, _cckem_encapsulated_key_nbytes_ctx, 596 _cche_dcrt_plaintext_encode, _cche_dcrt_plaintext_sizeof,
616 _cckem_encapsulated_key_nbytes_info, _cckem_export_privkey, 597 _cche_decode_poly_uint64, _cche_decode_simd_int64, _cche_decode_simd_uint64,
617 _cckem_export_pubkey, _cckem_full_ctx_init, _cckem_generate_key, 598 _cche_decrypt, _cche_deserialize_ciphertext_coeff, _cche_deserialize_ciphertext_eval,
618 _cckem_import_privkey, _cckem_import_pubkey, _cckem_kyber768, 599 _cche_deserialize_seeded_ciphertext_coeff, _cche_deserialize_seeded_ciphertext_eval,
619 _cckem_privkey_nbytes_ctx, _cckem_privkey_nbytes_info, _cckem_pub_ctx_init, 600 _cche_encode_poly_uint64, _cche_encode_simd_int64, _cche_encode_simd_reduced_int64,
620 _cckem_pubkey_nbytes_ctx, _cckem_pubkey_nbytes_info, _cckem_public_ctx, 601 _cche_encode_simd_uint64, _cche_encrypt_symmetric, _cche_encryption_params_coefficient_moduli,
621 _cckem_shared_key_nbytes_ctx, _cckem_shared_key_nbytes_info, 602 _cche_encryption_params_coefficient_nmoduli, _cche_encryption_params_plaintext_modulus,
622 _cckem_sizeof_full_ctx, _cckem_sizeof_pub_ctx, _cclr_aes_init, 603 _cche_encryption_params_polynomial_degree, _cche_galois_key_generate,
623 _cclr_block_nbytes, _cclr_decrypt_block, _cclr_encrypt_block, 604 _cche_galois_key_load, _cche_galois_key_save, _cche_galois_key_sizeof,
605 _cche_param_ctx_ciphertext_ctx_nmoduli, _cche_param_ctx_coefficient_moduli,
606 _cche_param_ctx_he_scheme, _cche_param_ctx_init, _cche_param_ctx_key_ctx_nmoduli,
607 _cche_param_ctx_key_ctx_poly_nbytes, _cche_param_ctx_plaintext_modulus,
608 _cche_param_ctx_plaintext_modulus_inverse, _cche_param_ctx_polynomial_degree,
609 _cche_param_ctx_sizeof, _cche_param_ctx_supports_simd_encoding,
610 _cche_plaintext_sizeof, _cche_relin_key_generate, _cche_relin_key_load,
611 _cche_relin_key_save, _cche_relin_key_sizeof, _cche_rng_seed_sizeof,
612 _cche_secret_key_generate, _cche_secret_key_generate_from_seed,
613 _cche_secret_key_sizeof, _cche_serialize_ciphertext_coeff,
614 _cche_serialize_ciphertext_coeff_max_nskip_lsbs, _cche_serialize_ciphertext_coeff_nbytes,
615 _cche_serialize_ciphertext_eval, _cche_serialize_ciphertext_eval_nbytes,
616 _cche_serialize_seeded_ciphertext_coeff, _cche_serialize_seeded_ciphertext_coeff_nbytes,
617 _cche_serialize_seeded_ciphertext_eval, _cche_serialize_seeded_ciphertext_eval_nbytes,
618 _cchkdf, _cchkdf_expand, _cchkdf_extract, _cchmac, _cchmac_final,
619 _cchmac_init, _cchmac_update, _cchpke_initiator_encrypt, _cchpke_initiator_export,
620 _cchpke_initiator_seal, _cchpke_initiator_setup, _cchpke_kem_generate_key_pair,
621 _cchpke_params_sizeof_aead_key, _cchpke_params_sizeof_aead_nonce,
622 _cchpke_params_sizeof_aead_tag, _cchpke_params_sizeof_kdf_hash,
623 _cchpke_params_sizeof_kem_enc, _cchpke_params_sizeof_kem_pk,
624 _cchpke_params_sizeof_kem_pk_marshalled, _cchpke_params_sizeof_kem_shared_secret,
625 _cchpke_params_sizeof_kem_sk, _cchpke_params_x25519_AESGCM128_HKDF_SHA256,
626 _cchpke_responder_decrypt, _cchpke_responder_export, _cchpke_responder_open,
627 _cchpke_responder_setup, _cckem_decapsulate, _cckem_derive_key_from_seed,
628 _cckem_encapsulate, _cckem_encapsulated_key_nbytes_ctx, _cckem_encapsulated_key_nbytes_info,
629 _cckem_export_privkey, _cckem_export_pubkey, _cckem_full_ctx_init,
630 _cckem_generate_key, _cckem_import_privkey, _cckem_import_pubkey,
631 _cckem_kyber1024, _cckem_kyber768, _cckem_privkey_nbytes_ctx,
632 _cckem_privkey_nbytes_info, _cckem_pub_ctx_init, _cckem_pubkey_nbytes_ctx,
633 _cckem_pubkey_nbytes_info, _cckem_public_ctx, _cckem_shared_key_nbytes_ctx,
634 _cckem_shared_key_nbytes_info, _cckem_sizeof_full_ctx, _cckem_sizeof_pub_ctx,
635 _cclr_aes_init, _cclr_block_nbytes, _cclr_decrypt_block, _cclr_encrypt_block,
624 _ccmd2_ltc_di, _ccmd4_ltc_di, _ccmd5_di, _ccmd5_ltc_di, _ccmgf, 636 _ccmd2_ltc_di, _ccmd4_ltc_di, _ccmd5_di, _ccmd5_ltc_di, _ccmgf,
625 _ccmode_factory_cbc_decrypt, _ccmode_factory_cbc_encrypt, 637 _ccmode_factory_cbc_decrypt, _ccmode_factory_cbc_encrypt,
626 _ccmode_factory_ccm_decrypt, _ccmode_factory_ccm_encrypt, 638 _ccmode_factory_ccm_decrypt, _ccmode_factory_ccm_encrypt,
627 _ccmode_factory_cfb8_decrypt, _ccmode_factory_cfb8_encrypt, 639 _ccmode_factory_cfb8_decrypt, _ccmode_factory_cfb8_encrypt,
628 _ccmode_factory_cfb_decrypt, _ccmode_factory_cfb_encrypt, 640 _ccmode_factory_cfb_decrypt, _ccmode_factory_cfb_encrypt,
629 _ccmode_factory_ctr_crypt, _ccmode_factory_gcm_decrypt, _ccmode_factory_gcm_encrypt, 641 _ccmode_factory_ctr_crypt, _ccmode_factory_gcm_decrypt, _ccmode_factory_gcm_encrypt,
630 _ccmode_factory_ofb_crypt, _ccmode_factory_omac_decrypt, _ccmode_factory_omac_encrypt, 642 _ccmode_factory_ofb_crypt, _ccmode_factory_siv_decrypt, _ccmode_factory_siv_encrypt,
631 _ccmode_factory_siv_decrypt, _ccmode_factory_siv_encrypt,
632 _ccmode_factory_xts_decrypt, _ccmode_factory_xts_encrypt, 643 _ccmode_factory_xts_decrypt, _ccmode_factory_xts_encrypt,
633 _ccn_add, _ccn_add1, _ccn_bitlen, _ccn_cmp, _ccn_cmpn, _ccn_lprint, 644 _ccn_add, _ccn_add1, _ccn_bitlen, _ccn_cmp, _ccn_cmpn, _ccn_lprint,
634 _ccn_print, _ccn_read_uint, _ccn_set_bit, _ccn_seti, _ccn_sub, 645 _ccn_print, _ccn_read_uint, _ccn_set_bit, _ccn_seti, _ccn_sub,
...@@ -637,26 +648,25 @@ exports:...@@ -637,26 +648,25 @@ exports:
637 _ccn_xor, _ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed, 648 _ccn_xor, _ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed,
638 _ccnistkdf_ctr_hmac, _ccnistkdf_ctr_hmac_fixed, _ccofb_block_size, 649 _ccnistkdf_ctr_hmac, _ccnistkdf_ctr_hmac_fixed, _ccofb_block_size,
639 _ccofb_context_size, _ccofb_init, _ccofb_one_shot, _ccofb_update, 650 _ccofb_context_size, _ccofb_init, _ccofb_one_shot, _ccofb_update,
640 _ccoid_equal, _ccoid_payload, _ccoid_size, _ccomac_block_size, 651 _ccoid_equal, _ccoid_payload, _ccoid_size, _ccpad_cts1_decrypt,
641 _ccomac_context_size, _ccomac_init, _ccomac_one_shot, _ccomac_update, 652 _ccpad_cts1_encrypt, _ccpad_cts2_decrypt, _ccpad_cts2_encrypt,
642 _ccpad_cts1_decrypt, _ccpad_cts1_encrypt, _ccpad_cts2_decrypt, 653 _ccpad_cts3_decrypt, _ccpad_cts3_encrypt, _ccpad_pkcs7_decode,
643 _ccpad_cts2_encrypt, _ccpad_cts3_decrypt, _ccpad_cts3_encrypt, 654 _ccpad_pkcs7_decrypt, _ccpad_pkcs7_ecb_decrypt, _ccpad_pkcs7_ecb_encrypt,
644 _ccpad_pkcs7_decode, _ccpad_pkcs7_decrypt, _ccpad_pkcs7_ecb_decrypt, 655 _ccpad_pkcs7_encrypt, _ccpad_xts_decrypt, _ccpad_xts_encrypt,
645 _ccpad_pkcs7_ecb_encrypt, _ccpad_pkcs7_encrypt, _ccpad_xts_decrypt, 656 _ccpbkdf2_hmac, _ccpoly1305, _ccpoly1305_final, _ccpoly1305_init,
646 _ccpad_xts_encrypt, _ccpbkdf2_hmac, _ccpoly1305, _ccpoly1305_final, 657 _ccpoly1305_update, _ccpost, _ccrc2_cbc_decrypt_mode, _ccrc2_cbc_encrypt_mode,
647 _ccpoly1305_init, _ccpoly1305_update, _ccrc2_cbc_decrypt_mode, 658 _ccrc2_cfb8_decrypt_mode, _ccrc2_cfb8_encrypt_mode, _ccrc2_cfb_decrypt_mode,
648 _ccrc2_cbc_encrypt_mode, _ccrc2_cfb8_decrypt_mode, _ccrc2_cfb8_encrypt_mode, 659 _ccrc2_cfb_encrypt_mode, _ccrc2_ctr_crypt_mode, _ccrc2_ecb_decrypt_mode,
649 _ccrc2_cfb_decrypt_mode, _ccrc2_cfb_encrypt_mode, _ccrc2_ctr_crypt_mode, 660 _ccrc2_ecb_encrypt_mode, _ccrc2_ofb_crypt_mode, _ccrc4, _ccrc4_eay,
650 _ccrc2_ecb_decrypt_mode, _ccrc2_ecb_encrypt_mode, _ccrc2_ofb_crypt_mode, 661 _ccrmd160_ltc_di, _ccrng, _ccrng_drbg_done, _ccrng_drbg_init,
651 _ccrc4, _ccrc4_eay, _ccrmd160_ltc_di, _ccrng, _ccrng_drbg_done, 662 _ccrng_drbg_init_withdrbg, _ccrng_drbg_reseed, _ccrng_ecfips_test_init,
652 _ccrng_drbg_init, _ccrng_drbg_init_withdrbg, _ccrng_drbg_reseed, 663 _ccrng_pbkdf2_prng_init, _ccrng_prng, _ccrng_rsafips_test_init,
653 _ccrng_ecfips_test_init, _ccrng_pbkdf2_prng_init, _ccrng_prng, 664 _ccrng_rsafips_test_set_next, _ccrng_sequence_init, _ccrng_system_done,
654 _ccrng_rsafips_test_init, _ccrng_rsafips_test_set_next, _ccrng_sequence_init, 665 _ccrng_system_init, _ccrng_test_done, _ccrng_test_init, _ccrng_trng,
655 _ccrng_system_done, _ccrng_system_init, _ccrng_test_done, 666 _ccrng_uniform, _ccrsa_block_size, _ccrsa_block_start, _ccrsa_ctx_private_zp,
656 _ccrng_test_init, _ccrng_trng, _ccrng_uniform, _ccrsa_block_size, 667 _ccrsa_ctx_public, _ccrsa_decrypt_eme_pkcs1v15, _ccrsa_decrypt_oaep,
657 _ccrsa_block_start, _ccrsa_ctx_private_zp, _ccrsa_ctx_public, 668 _ccrsa_dump_full_key, _ccrsa_dump_public_key, _ccrsa_eme_pkcs1v15_decode,
658 _ccrsa_decrypt_eme_pkcs1v15, _ccrsa_decrypt_oaep, _ccrsa_dump_full_key, 669 _ccrsa_eme_pkcs1v15_decode_safe, _ccrsa_eme_pkcs1v15_encode,
659 _ccrsa_dump_public_key, _ccrsa_eme_pkcs1v15_decode, _ccrsa_eme_pkcs1v15_encode,
660 _ccrsa_emsa_pkcs1v15_encode, _ccrsa_emsa_pkcs1v15_verify, 670 _ccrsa_emsa_pkcs1v15_encode, _ccrsa_emsa_pkcs1v15_verify,
661 _ccrsa_emsa_pss_decode, _ccrsa_emsa_pss_encode, _ccrsa_encrypt_eme_pkcs1v15, 671 _ccrsa_emsa_pss_decode, _ccrsa_emsa_pss_encode, _ccrsa_encrypt_eme_pkcs1v15,
662 _ccrsa_encrypt_oaep, _ccrsa_export_priv, _ccrsa_export_priv_size, 672 _ccrsa_encrypt_oaep, _ccrsa_export_priv, _ccrsa_export_priv_size,
...@@ -751,14 +761,15 @@ exports:...@@ -751,14 +761,15 @@ exports:
751 _ccaes_arm_ecb_decrypt_mode, _ccaes_arm_ecb_encrypt_mode, 761 _ccaes_arm_ecb_decrypt_mode, _ccaes_arm_ecb_encrypt_mode,
752 _ccaes_arm_ofb_crypt_mode, _ccaes_arm_xts_decrypt_mode, _ccaes_arm_xts_encrypt_mode, 762 _ccaes_arm_ofb_crypt_mode, _ccaes_arm_xts_decrypt_mode, _ccaes_arm_xts_encrypt_mode,
753 _ccsha1_vng_arm_di, _ccsha224_vng_arm_di, _ccsha256_vng_arm64neon_di, 763 _ccsha1_vng_arm_di, _ccsha224_vng_arm_di, _ccsha256_vng_arm64neon_di,
754 _ccsha256_vng_arm_di, _ccsha384_vng_arm_di, _ccsha512_256_vng_arm_di, 764 _ccsha256_vng_arm_di, _ccsha384_vng_arm_di, _ccsha384_vng_arm_hw_di,
755 _ccsha512_vng_arm_di ]765 _ccsha512_256_vng_arm_di, _ccsha512_256_vng_arm_hw_di, _ccsha512_vng_arm_di,
766 _ccsha512_vng_arm_hw_di ]
756--- !tapi-tbd767--- !tapi-tbd
757tbd-version: 4768tbd-version: 4
758targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 769targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
759 arm64e-macos, arm64e-maccatalyst ]770 arm64e-macos, arm64e-maccatalyst ]
760install-name: '/usr/lib/system/libdispatch.dylib'771install-name: '/usr/lib/system/libdispatch.dylib'
761current-version: 1462.0.4772current-version: 1502.0.1
762parent-umbrella:773parent-umbrella:
763 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 774 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
764 arm64e-macos, arm64e-maccatalyst ]775 arm64e-macos, arm64e-maccatalyst ]
...@@ -785,38 +796,40 @@ exports:...@@ -785,38 +796,40 @@ exports:
785 __dispatch_runloop_root_queue_perform_4CF, __dispatch_runloop_root_queue_wakeup_4CF, 796 __dispatch_runloop_root_queue_perform_4CF, __dispatch_runloop_root_queue_wakeup_4CF,
786 __dispatch_source_set_runloop_timer_4CF, __dispatch_source_type_data_add, 797 __dispatch_source_set_runloop_timer_4CF, __dispatch_source_type_data_add,
787 __dispatch_source_type_data_or, __dispatch_source_type_data_replace, 798 __dispatch_source_type_data_or, __dispatch_source_type_data_replace,
788 __dispatch_source_type_interval, __dispatch_source_type_mach_recv, 799 __dispatch_source_type_exclaves_notification, __dispatch_source_type_interval,
789 __dispatch_source_type_mach_send, __dispatch_source_type_memorypressure, 800 __dispatch_source_type_mach_recv, __dispatch_source_type_mach_send,
790 __dispatch_source_type_memorystatus, __dispatch_source_type_nw_channel, 801 __dispatch_source_type_memorypressure, __dispatch_source_type_memorystatus,
791 __dispatch_source_type_proc, __dispatch_source_type_read, 802 __dispatch_source_type_nw_channel, __dispatch_source_type_proc,
792 __dispatch_source_type_signal, __dispatch_source_type_sock, 803 __dispatch_source_type_read, __dispatch_source_type_signal,
793 __dispatch_source_type_timer, __dispatch_source_type_vfs, 804 __dispatch_source_type_sock, __dispatch_source_type_timer,
794 __dispatch_source_type_vm, __dispatch_source_type_vnode, __dispatch_source_type_write, 805 __dispatch_source_type_vfs, __dispatch_source_type_vm, __dispatch_source_type_vnode,
795 __dispatch_source_will_reenable_kevent_4NW, __dispatch_wait_for_enqueuer, 806 __dispatch_source_type_write, __dispatch_source_will_reenable_kevent_4NW,
796 __dispatch_workloop_set_observer_hooks_4IOHID, __dispatch_workloop_should_yield_4NW, 807 __dispatch_wait_for_enqueuer, __dispatch_workloop_set_observer_hooks_4IOHID,
797 __firehose_spi_version, __os_object_alloc, __os_object_alloc_realized, 808 __dispatch_workloop_should_yield_4NW, __firehose_spi_version,
809 __os_object_alloc, __os_object_alloc_bridged, __os_object_alloc_realized,
798 __os_object_dealloc, __os_object_release, __os_object_release_internal, 810 __os_object_dealloc, __os_object_release, __os_object_release_internal,
799 __os_object_release_internal_n, __os_object_release_without_xref_dispose, 811 __os_object_release_internal_n, __os_object_release_without_xref_dispose,
800 __os_object_retain, __os_object_retain_internal, __os_object_retain_internal_n, 812 __os_object_retain, __os_object_retain_internal, __os_object_retain_internal_n,
801 __os_object_retain_with_resurrect, _dispatch_activate, _dispatch_after, 813 __os_object_retain_with_resurrect, _dispatch_activate, _dispatch_after,
802 _dispatch_after_f, _dispatch_allocator_layout, _dispatch_apply, 814 _dispatch_after_f, _dispatch_allocator_layout, _dispatch_allow_send_signals,
803 _dispatch_apply_attr_destroy, _dispatch_apply_attr_init, _dispatch_apply_attr_query, 815 _dispatch_apply, _dispatch_apply_attr_destroy, _dispatch_apply_attr_init,
804 _dispatch_apply_attr_set_parallelism, _dispatch_apply_f, _dispatch_apply_with_attr, 816 _dispatch_apply_attr_query, _dispatch_apply_attr_set_parallelism,
805 _dispatch_apply_with_attr_f, _dispatch_assert_queue, '_dispatch_assert_queue$V2', 817 _dispatch_apply_f, _dispatch_apply_with_attr, _dispatch_apply_with_attr_f,
806 _dispatch_assert_queue_barrier, _dispatch_assert_queue_not, 818 _dispatch_assert_queue, '_dispatch_assert_queue$V2', _dispatch_assert_queue_barrier,
807 '_dispatch_assert_queue_not$V2', _dispatch_async, _dispatch_async_and_wait, 819 _dispatch_assert_queue_not, '_dispatch_assert_queue_not$V2',
808 _dispatch_async_and_wait_f, _dispatch_async_enforce_qos_class_f, 820 _dispatch_async, _dispatch_async_and_wait, _dispatch_async_and_wait_f,
809 _dispatch_async_f, _dispatch_async_swift_job, _dispatch_atfork_child, 821 _dispatch_async_enforce_qos_class_f, _dispatch_async_f, _dispatch_async_swift_job,
810 _dispatch_atfork_parent, _dispatch_atfork_prepare, _dispatch_barrier_async, 822 _dispatch_atfork_child, _dispatch_atfork_parent, _dispatch_atfork_prepare,
811 _dispatch_barrier_async_and_wait, _dispatch_barrier_async_and_wait_f, 823 _dispatch_barrier_async, _dispatch_barrier_async_and_wait,
812 _dispatch_barrier_async_f, _dispatch_barrier_sync, _dispatch_barrier_sync_f, 824 _dispatch_barrier_async_and_wait_f, _dispatch_barrier_async_f,
813 _dispatch_benchmark, _dispatch_benchmark_f, _dispatch_block_cancel, 825 _dispatch_barrier_sync, _dispatch_barrier_sync_f, _dispatch_benchmark,
814 _dispatch_block_create, _dispatch_block_create_with_qos_class, 826 _dispatch_benchmark_f, _dispatch_block_cancel, _dispatch_block_create,
815 _dispatch_block_create_with_voucher, _dispatch_block_create_with_voucher_and_qos_class, 827 _dispatch_block_create_with_qos_class, _dispatch_block_create_with_voucher,
816 _dispatch_block_notify, _dispatch_block_perform, _dispatch_block_testcancel, 828 _dispatch_block_create_with_voucher_and_qos_class, _dispatch_block_notify,
817 _dispatch_block_wait, _dispatch_channel_async, _dispatch_channel_async_f, 829 _dispatch_block_perform, _dispatch_block_testcancel, _dispatch_block_wait,
818 _dispatch_channel_cancel, _dispatch_channel_create, _dispatch_channel_drain, 830 _dispatch_channel_async, _dispatch_channel_async_f, _dispatch_channel_cancel,
819 _dispatch_channel_drain_f, _dispatch_channel_enqueue, _dispatch_channel_foreach_work_item_peek, 831 _dispatch_channel_create, _dispatch_channel_drain, _dispatch_channel_drain_f,
832 _dispatch_channel_enqueue, _dispatch_channel_foreach_work_item_peek,
820 _dispatch_channel_foreach_work_item_peek_f, _dispatch_channel_testcancel, 833 _dispatch_channel_foreach_work_item_peek_f, _dispatch_channel_testcancel,
821 _dispatch_channel_wakeup, _dispatch_data_apply, _dispatch_data_apply_f, 834 _dispatch_channel_wakeup, _dispatch_data_apply, _dispatch_data_apply_f,
822 _dispatch_data_copy_region, _dispatch_data_create, _dispatch_data_create_alloc, 835 _dispatch_data_copy_region, _dispatch_data_create, _dispatch_data_create_alloc,
...@@ -879,7 +892,8 @@ exports:...@@ -879,7 +892,8 @@ exports:
879 _dispatch_workloop_set_autorelease_frequency, _dispatch_workloop_set_cpupercent, 892 _dispatch_workloop_set_autorelease_frequency, _dispatch_workloop_set_cpupercent,
880 _dispatch_workloop_set_os_workgroup, _dispatch_workloop_set_qos_class, 893 _dispatch_workloop_set_os_workgroup, _dispatch_workloop_set_qos_class,
881 _dispatch_workloop_set_qos_class_floor, _dispatch_workloop_set_scheduler_priority, 894 _dispatch_workloop_set_qos_class_floor, _dispatch_workloop_set_scheduler_priority,
882 _dispatch_write, _dispatch_write_f, _libdispatch_init, _mach_voucher_persona_for_originator, 895 _dispatch_workloop_set_uses_bound_thread, _dispatch_write,
896 _dispatch_write_f, _libdispatch_init, _mach_voucher_persona_for_originator,
883 _mach_voucher_persona_self, _os_eventlink_activate, _os_eventlink_associate, 897 _mach_voucher_persona_self, _os_eventlink_activate, _os_eventlink_associate,
884 _os_eventlink_cancel, _os_eventlink_create, _os_eventlink_create_remote_with_eventlink, 898 _os_eventlink_cancel, _os_eventlink_create, _os_eventlink_create_remote_with_eventlink,
885 _os_eventlink_create_with_port, _os_eventlink_disassociate, 899 _os_eventlink_create_with_port, _os_eventlink_disassociate,
...@@ -898,18 +912,18 @@ exports:...@@ -898,18 +912,18 @@ exports:
898 _os_workgroup_leave, _os_workgroup_leave_self, _os_workgroup_max_parallel_threads, 912 _os_workgroup_leave, _os_workgroup_leave_self, _os_workgroup_max_parallel_threads,
899 _os_workgroup_parallel_create, _os_workgroup_set_working_arena, 913 _os_workgroup_parallel_create, _os_workgroup_set_working_arena,
900 _os_workgroup_testcancel, _voucher_activity_create_with_data, 914 _os_workgroup_testcancel, _voucher_activity_create_with_data,
901 _voucher_activity_create_with_location, _voucher_activity_flush, 915 _voucher_activity_create_with_data_2, _voucher_activity_create_with_location,
902 _voucher_activity_get_logging_preferences, _voucher_activity_get_metadata_buffer, 916 _voucher_activity_flush, _voucher_activity_get_logging_preferences,
903 _voucher_activity_id_allocate, _voucher_activity_initialize_4libtrace, 917 _voucher_activity_get_metadata_buffer, _voucher_activity_id_allocate,
904 _voucher_activity_should_send_strings, _voucher_activity_trace, 918 _voucher_activity_initialize_4libtrace, _voucher_activity_should_send_strings,
905 _voucher_activity_trace_v, _voucher_activity_trace_v_2, _voucher_adopt, 919 _voucher_activity_trace, _voucher_activity_trace_v, _voucher_activity_trace_v_2,
906 _voucher_copy, _voucher_copy_with_persona_mach_voucher, _voucher_copy_without_importance, 920 _voucher_adopt, _voucher_copy, _voucher_copy_with_persona_mach_voucher,
907 _voucher_create_with_mach_msg, _voucher_decrement_importance_count4CF, 921 _voucher_copy_without_importance, _voucher_create_with_mach_msg,
908 _voucher_get_activity_id, _voucher_get_activity_id_and_creator, 922 _voucher_decrement_importance_count4CF, _voucher_get_activity_id,
909 _voucher_get_current_persona, _voucher_get_current_persona_originator_info, 923 _voucher_get_activity_id_and_creator, _voucher_get_current_persona,
910 _voucher_get_current_persona_proximate_info, _voucher_kvoucher_debug, 924 _voucher_get_current_persona_originator_info, _voucher_get_current_persona_proximate_info,
911 _voucher_process_can_use_arbitrary_personas, _voucher_release, 925 _voucher_kvoucher_debug, _voucher_process_can_use_arbitrary_personas,
912 _voucher_replace_default_voucher, _voucher_retain ]926 _voucher_release, _voucher_replace_default_voucher, _voucher_retain ]
913 objc-classes: [ OS_dispatch_channel, OS_dispatch_data, OS_dispatch_disk, OS_dispatch_group, 927 objc-classes: [ OS_dispatch_channel, OS_dispatch_data, OS_dispatch_disk, OS_dispatch_group,
914 OS_dispatch_io, OS_dispatch_mach, OS_dispatch_mach_msg, OS_dispatch_object, 928 OS_dispatch_io, OS_dispatch_mach, OS_dispatch_mach_msg, OS_dispatch_object,
915 OS_dispatch_operation, OS_dispatch_queue, OS_dispatch_queue_attr, 929 OS_dispatch_operation, OS_dispatch_queue, OS_dispatch_queue_attr,
...@@ -933,41 +947,45 @@ exports:...@@ -933,41 +947,45 @@ exports:
933 symbols: [ _NSVersionOfLinkTimeLibrary, _NSVersionOfRunTimeLibrary, _NXArgc, 947 symbols: [ _NSVersionOfLinkTimeLibrary, _NSVersionOfRunTimeLibrary, _NXArgc,
934 _NXArgv, __NSGetExecutablePath, ___progname, __dyld_atfork_parent, 948 _NXArgv, __NSGetExecutablePath, ___progname, __dyld_atfork_parent,
935 __dyld_atfork_prepare, __dyld_dlopen_atfork_child, __dyld_dlopen_atfork_parent, 949 __dyld_atfork_prepare, __dyld_dlopen_atfork_child, __dyld_dlopen_atfork_parent,
936 __dyld_dlopen_atfork_prepare, __dyld_find_foreign_type_protocol_conformance, 950 __dyld_dlopen_atfork_prepare, __dyld_dlsym_blocked, __dyld_find_foreign_type_protocol_conformance,
937 __dyld_find_foreign_type_protocol_conformance_on_disk, __dyld_find_protocol_conformance, 951 __dyld_find_foreign_type_protocol_conformance_on_disk, __dyld_find_pointer_hash_table_entry,
938 __dyld_find_protocol_conformance_on_disk, __dyld_find_unwind_sections, 952 __dyld_find_protocol_conformance, __dyld_find_protocol_conformance_on_disk,
939 __dyld_for_each_objc_class, __dyld_for_each_objc_protocol, 953 __dyld_find_unwind_sections, __dyld_for_each_objc_class, __dyld_for_each_objc_protocol,
940 __dyld_for_objc_header_opt_ro, __dyld_for_objc_header_opt_rw, 954 __dyld_for_objc_header_opt_ro, __dyld_for_objc_header_opt_rw,
941 __dyld_fork_child, __dyld_get_dlopen_image_header, __dyld_get_image_header, 955 __dyld_fork_child, __dyld_get_dlopen_image_header, __dyld_get_image_header,
942 __dyld_get_image_name, __dyld_get_image_slide, __dyld_get_image_uuid, 956 __dyld_get_image_name, __dyld_get_image_slide, __dyld_get_image_uuid,
943 __dyld_get_image_vmaddr_slide, __dyld_get_objc_selector, __dyld_get_prog_image_header, 957 __dyld_get_image_vmaddr_slide, __dyld_get_objc_selector, __dyld_get_prog_image_header,
944 __dyld_get_shared_cache_range, __dyld_get_shared_cache_uuid, 958 __dyld_get_shared_cache_range, __dyld_get_shared_cache_uuid,
945 __dyld_has_fix_for_radar, __dyld_has_preoptimized_swift_protocol_conformances, 959 __dyld_get_swift_prespecialized_data, __dyld_has_fix_for_radar,
946 __dyld_image_count, __dyld_images_for_addresses, __dyld_initializer, 960 __dyld_has_preoptimized_swift_protocol_conformances, __dyld_image_count,
947 __dyld_is_memory_immutable, __dyld_is_objc_constant, __dyld_is_preoptimized_objc_image_loaded, 961 __dyld_images_for_addresses, __dyld_initializer, __dyld_is_memory_immutable,
948 __dyld_launch_mode, __dyld_lookup_section_info, __dyld_missing_symbol_abort, 962 __dyld_is_objc_constant, __dyld_is_preoptimized_objc_image_loaded,
949 __dyld_objc_class_count, __dyld_objc_notify_register, __dyld_objc_register_callbacks, 963 __dyld_is_pseudodylib, __dyld_launch_mode, __dyld_lookup_section_info,
950 __dyld_objc_uses_large_shared_cache, __dyld_process_info_create, 964 __dyld_missing_symbol_abort, __dyld_objc_class_count, __dyld_objc_notify_register,
951 __dyld_process_info_for_each_image, __dyld_process_info_for_each_segment, 965 __dyld_objc_register_callbacks, __dyld_objc_uses_large_shared_cache,
952 __dyld_process_info_get_aot_cache, __dyld_process_info_get_cache, 966 __dyld_process_info_create, __dyld_process_info_for_each_image,
953 __dyld_process_info_get_platform, __dyld_process_info_get_state, 967 __dyld_process_info_for_each_segment, __dyld_process_info_get_aot_cache,
954 __dyld_process_info_notify, __dyld_process_info_notify_main, 968 __dyld_process_info_get_cache, __dyld_process_info_get_platform,
955 __dyld_process_info_notify_release, __dyld_process_info_notify_retain, 969 __dyld_process_info_get_state, __dyld_process_info_notify,
956 __dyld_process_info_release, __dyld_process_info_retain, __dyld_pseudodylib_deregister, 970 __dyld_process_info_notify_main, __dyld_process_info_notify_release,
971 __dyld_process_info_notify_retain, __dyld_process_info_release,
972 __dyld_process_info_retain, __dyld_pseudodylib_deregister,
957 __dyld_pseudodylib_deregister_callbacks, __dyld_pseudodylib_register, 973 __dyld_pseudodylib_deregister_callbacks, __dyld_pseudodylib_register,
958 __dyld_pseudodylib_register_callbacks, __dyld_register_driverkit_main, 974 __dyld_pseudodylib_register_callbacks, __dyld_register_dlsym_notifier,
959 __dyld_register_for_bulk_image_loads, __dyld_register_for_image_loads, 975 __dyld_register_driverkit_main, __dyld_register_for_bulk_image_loads,
960 __dyld_register_func_for_add_image, __dyld_register_func_for_remove_image, 976 __dyld_register_for_image_loads, __dyld_register_func_for_add_image,
961 __dyld_shared_cache_contains_path, __dyld_shared_cache_is_locally_built, 977 __dyld_register_func_for_remove_image, __dyld_shared_cache_contains_path,
962 __dyld_shared_cache_optimized, __dyld_shared_cache_real_path, 978 __dyld_shared_cache_is_locally_built, __dyld_shared_cache_optimized,
963 __dyld_swift_optimizations_version, __dyld_visit_objc_classes, 979 __dyld_shared_cache_real_path, __dyld_swift_optimizations_version,
964 __tlv_atexit, __tlv_bootstrap, __tlv_exit, _dladdr, _dlclose, 980 __dyld_visit_objc_classes, __tlv_atexit, __tlv_bootstrap,
965 _dlerror, _dlopen, _dlopen_audited, _dlopen_from, _dlopen_preflight, 981 __tlv_exit, _dladdr, _dlclose, _dlerror, _dlopen, _dlopen_audited,
966 _dlsym, _dyldVersionNumber, _dyldVersionString, _dyld_dynamic_interpose, 982 _dlopen_from, _dlopen_preflight, _dlsym, _dyldVersionNumber,
967 _dyld_for_each_installed_shared_cache, _dyld_for_each_installed_shared_cache_with_system_path, 983 _dyldVersionString, _dyld_dynamic_interpose, _dyld_for_each_installed_shared_cache,
968 _dyld_get_active_platform, _dyld_get_base_platform, _dyld_get_image_versions, 984 _dyld_for_each_installed_shared_cache_with_system_path, _dyld_get_active_platform,
969 _dyld_get_min_os_version, _dyld_get_program_min_os_version, 985 _dyld_get_base_platform, _dyld_get_image_versions, _dyld_get_min_os_version,
970 _dyld_get_program_sdk_version, _dyld_get_sdk_version, _dyld_has_inserted_or_interposing_libraries, 986 _dyld_get_program_min_os_version, _dyld_get_program_minos_version_token,
987 _dyld_get_program_sdk_version, _dyld_get_program_sdk_version_token,
988 _dyld_get_sdk_version, _dyld_has_inserted_or_interposing_libraries,
971 _dyld_image_content_for_section, _dyld_image_content_for_segment, 989 _dyld_image_content_for_section, _dyld_image_content_for_segment,
972 _dyld_image_copy_uuid, _dyld_image_for_each_section_info, 990 _dyld_image_copy_uuid, _dyld_image_for_each_section_info,
973 _dyld_image_for_each_segment_info, _dyld_image_get_file_path, 991 _dyld_image_for_each_segment_info, _dyld_image_get_file_path,
...@@ -987,9 +1005,12 @@ exports:...@@ -987,9 +1005,12 @@ exports:
987 _dyld_shared_cache_get_base_address, _dyld_shared_cache_get_mapped_size, 1005 _dyld_shared_cache_get_base_address, _dyld_shared_cache_get_mapped_size,
988 _dyld_shared_cache_is_mapped_private, _dyld_shared_cache_iterate_text, 1006 _dyld_shared_cache_is_mapped_private, _dyld_shared_cache_iterate_text,
989 _dyld_shared_cache_pin_mapping, _dyld_shared_cache_some_image_overridden, 1007 _dyld_shared_cache_pin_mapping, _dyld_shared_cache_some_image_overridden,
990 _dyld_shared_cache_unpin_mapping, _environ, _macho_arch_name_for_cpu_type, 1008 _dyld_shared_cache_unpin_mapping, _dyld_version_token_at_least,
1009 _dyld_version_token_get_platform, _environ, _macho_arch_name_for_cpu_type,
991 _macho_arch_name_for_mach_header, _macho_best_slice, _macho_best_slice_in_fd, 1010 _macho_arch_name_for_mach_header, _macho_best_slice, _macho_best_slice_in_fd,
992 _macho_cpu_type_for_arch_name, _macho_dylib_install_name, 1011 _macho_cpu_type_for_arch_name, _macho_dylib_install_name,
1012 _macho_for_each_defined_rpath, _macho_for_each_dependent_dylib,
1013 _macho_for_each_exported_symbol, _macho_for_each_imported_symbol,
993 _macho_for_each_slice, _macho_for_each_slice_in_fd, dyld_stub_binder ]1014 _macho_for_each_slice, _macho_for_each_slice_in_fd, dyld_stub_binder ]
994 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]1015 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
995 symbols: [ _NSAddImage, _NSAddLibrary, _NSAddLibraryWithSearching, _NSAddressOfSymbol, 1016 symbols: [ _NSAddImage, _NSAddLibrary, _NSAddLibraryWithSearching, _NSAddressOfSymbol,
...@@ -1030,7 +1051,7 @@ exports:...@@ -1030,7 +1051,7 @@ exports:
1030tbd-version: 41051tbd-version: 4
1031targets: [ x86_64-macos, arm64-macos, arm64e-macos ]1052targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1032install-name: '/usr/lib/system/libmacho.dylib'1053install-name: '/usr/lib/system/libmacho.dylib'
1033current-version: 10091054current-version: 1021.4
1034parent-umbrella:1055parent-umbrella:
1035 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]1056 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1036 umbrella: System1057 umbrella: System
...@@ -1077,7 +1098,7 @@ tbd-version: 4...@@ -1077,7 +1098,7 @@ tbd-version: 4
1077targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1098targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1078 arm64e-macos, arm64e-maccatalyst ]1099 arm64e-macos, arm64e-maccatalyst ]
1079install-name: '/usr/lib/system/libquarantine.dylib'1100install-name: '/usr/lib/system/libquarantine.dylib'
1080current-version: 1691101current-version: 181.0.7
1081parent-umbrella:1102parent-umbrella:
1082 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1103 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1083 arm64e-macos, arm64e-maccatalyst ]1104 arm64e-macos, arm64e-maccatalyst ]
...@@ -1105,24 +1126,25 @@ exports:...@@ -1105,24 +1126,25 @@ exports:
1105 _responsibility_get_uniqueid_responsible_for_pid, _responsibility_init, 1126 _responsibility_get_uniqueid_responsible_for_pid, _responsibility_init,
1106 _responsibility_set_pid_responsible_for_pid ]1127 _responsibility_set_pid_responsible_for_pid ]
1107 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]1128 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1108 symbols: [ _responsibility_get_attribution_for_audittoken, _responsibility_get_responsible_audit_token_for_audit_token, 1129 symbols: [ _qtn_spawnattrs_get_tracking_data, _qtn_spawnattrs_set_tracking_data,
1130 _responsibility_get_attribution_for_audittoken, _responsibility_get_responsible_audit_token_for_audit_token,
1109 _responsibility_identity_get_binary_entitlement_data, _responsibility_identity_get_binary_is_platform, 1131 _responsibility_identity_get_binary_entitlement_data, _responsibility_identity_get_binary_is_platform,
1110 _responsibility_identity_get_binary_offset, _responsibility_identity_get_binary_path, 1132 _responsibility_identity_get_binary_offset, _responsibility_identity_get_binary_path,
1111 _responsibility_identity_get_binary_signing_id, _responsibility_identity_get_binary_team_id, 1133 _responsibility_identity_get_binary_signing_id, _responsibility_identity_get_binary_team_id,
1112 _responsibility_identity_get_csflags, _responsibility_identity_get_hosted_path, 1134 _responsibility_identity_get_csflags, _responsibility_identity_get_hosted_path,
1113 _responsibility_identity_get_hosted_team_id, _responsibility_identity_get_persistent_identifier, 1135 _responsibility_identity_get_hosted_team_id, _responsibility_identity_get_persistent_identifier,
1114 _responsibility_identity_get_platform, _responsibility_identity_get_sdk, 1136 _responsibility_identity_get_platform, _responsibility_identity_get_sdk,
1115 _responsibility_identity_get_user_uuid, _responsibility_identity_release, 1137 _responsibility_identity_get_user_uuid, _responsibility_identity_open_binary_fd,
1116 _responsibility_set_audittoken_responsible_for_caller, _responsibility_set_audittoken_responsible_for_self, 1138 _responsibility_identity_release, _responsibility_set_audittoken_responsible_for_caller,
1117 _responsibility_set_caller_responsible_for_self, _responsibility_set_hosted_path, 1139 _responsibility_set_audittoken_responsible_for_self, _responsibility_set_caller_responsible_for_self,
1118 _responsibility_set_hosted_team_id, _responsibility_spawnattrs_getdisclaim, 1140 _responsibility_set_hosted_path, _responsibility_set_hosted_team_id,
1119 _responsibility_spawnattrs_setdisclaim ]1141 _responsibility_spawnattrs_getdisclaim, _responsibility_spawnattrs_setdisclaim ]
1120--- !tapi-tbd1142--- !tapi-tbd
1121tbd-version: 41143tbd-version: 4
1122targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1144targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1123 arm64e-macos, arm64e-maccatalyst ]1145 arm64e-macos, arm64e-maccatalyst ]
1124install-name: '/usr/lib/system/libremovefile.dylib'1146install-name: '/usr/lib/system/libremovefile.dylib'
1125current-version: 701147current-version: 75
1126parent-umbrella:1148parent-umbrella:
1127 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1149 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1128 arm64e-macos, arm64e-maccatalyst ]1150 arm64e-macos, arm64e-maccatalyst ]
...@@ -1140,7 +1162,7 @@ tbd-version: 4...@@ -1140,7 +1162,7 @@ tbd-version: 4
1140targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1162targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1141 arm64e-macos, arm64e-maccatalyst ]1163 arm64e-macos, arm64e-maccatalyst ]
1142install-name: '/usr/lib/system/libsystem_asl.dylib'1164install-name: '/usr/lib/system/libsystem_asl.dylib'
1143current-version: 3981165current-version: 402
1144parent-umbrella:1166parent-umbrella:
1145 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1167 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1146 arm64e-macos, arm64e-maccatalyst ]1168 arm64e-macos, arm64e-maccatalyst ]
...@@ -1221,7 +1243,7 @@ tbd-version: 4...@@ -1221,7 +1243,7 @@ tbd-version: 4
1221targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1243targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1222 arm64e-macos, arm64e-maccatalyst ]1244 arm64e-macos, arm64e-maccatalyst ]
1223install-name: '/usr/lib/system/libsystem_blocks.dylib'1245install-name: '/usr/lib/system/libsystem_blocks.dylib'
1224current-version: 901246current-version: 94
1225parent-umbrella:1247parent-umbrella:
1226 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1248 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1227 arm64e-macos, arm64e-maccatalyst ]1249 arm64e-macos, arm64e-maccatalyst ]
...@@ -1240,7 +1262,7 @@ tbd-version: 4...@@ -1240,7 +1262,7 @@ tbd-version: 4
1240targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1262targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1241 arm64e-macos, arm64e-maccatalyst ]1263 arm64e-macos, arm64e-maccatalyst ]
1242install-name: '/usr/lib/system/libsystem_c.dylib'1264install-name: '/usr/lib/system/libsystem_c.dylib'
1243current-version: 1583.0.141265current-version: 1669.40.2
1244parent-umbrella:1266parent-umbrella:
1245 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1267 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1246 arm64e-macos, arm64e-maccatalyst ]1268 arm64e-macos, arm64e-maccatalyst ]
...@@ -1308,48 +1330,49 @@ exports:...@@ -1308,48 +1330,49 @@ exports:
1308 ___tens_D2A, ___tinytens_D2A, ___tolower, ___tolower_l, ___toupper, 1330 ___tens_D2A, ___tinytens_D2A, ___tolower, ___tolower_l, ___toupper,
1309 ___toupper_l, ___trailz_D2A, ___ulp_D2A, ___ungetc, ___ungetwc, 1331 ___toupper_l, ___trailz_D2A, ___ulp_D2A, ___ungetc, ___ungetwc,
1310 ___vsnprintf_chk, ___vsprintf_chk, ___wcwidth, ___wcwidth_l, 1332 ___vsnprintf_chk, ___vsprintf_chk, ___wcwidth, ___wcwidth_l,
1311 __allocenvstate, __atexit_receipt, __c_locale, __cleanup, 1333 ___xlocale_C_collate, __allocenvstate, __atexit_receipt, __c_locale,
1312 __closeutx, __copyenv, __cthread_init_routine, __deallocenvstate, 1334 __cleanup, __closeutx, __copyenv, __cthread_init_routine,
1313 __endutxent, __flockfile_debug_stub, __fseeko, __ftello, __fwalk, 1335 __deallocenvstate, __endutxent, __flockfile_debug_stub, __fseeko,
1314 __getenvp, __getutxent, __getutxid, __getutxline, __inet_aton_check, 1336 __ftello, __fwalk, __getenvp, __getutxent, __getutxid, __getutxline,
1315 __init_clock_port, __int_to_time, __libc_fork_child, __libc_fork_parent, 1337 __inet_aton_check, __init_clock_port, __int_to_time, __libc_fork_child,
1316 __libc_fork_prepare, __libc_initializer, __long_to_time, __mkpath_np, 1338 __libc_fork_parent, __libc_fork_prepare, __libc_initializer,
1317 __mktemp, __openutx, __os_assert_log, __os_assert_log_ctx, 1339 __long_to_time, __mkpath_np, __mktemp, __openutx, __os_assert_log,
1318 __os_assumes_log, __os_assumes_log_ctx, __os_avoid_tail_call, 1340 __os_assert_log_ctx, __os_assumes_log, __os_assumes_log_ctx,
1319 __os_crash, __os_crash_callback, __os_crash_fmt, __os_crash_msg, 1341 __os_avoid_tail_call, __os_crash, __os_crash_callback, __os_crash_fmt,
1320 __os_debug_log, __os_debug_log_error_offset, __os_debug_log_error_str, 1342 __os_crash_msg, __os_debug_log, __os_debug_log_error_offset,
1321 __putenvp, __pututxline, __rand48_add, __rand48_mult, __rand48_seed, 1343 __os_debug_log_error_str, __putenvp, __pututxline, __rand48_add,
1322 __readdir_unlocked, __reclaim_telldir, __seekdir, __setenvp, 1344 __rand48_mult, __rand48_seed, __readdir_unlocked, __reclaim_telldir,
1323 __setutxent, __sigaction_nobind, __sigintr, __signal_nobind, 1345 __seekdir, __setenvp, __setutxent, __sigaction_nobind, __sigintr,
1324 __sigvec_nobind, __sread, __sseek, __subsystem_init, __swrite, 1346 __signal_nobind, __sigvec_nobind, __sread, __sseek, __subsystem_init,
1325 __time32_to_time, __time64_to_time, __time_to_int, __time_to_long, 1347 __swrite, __time32_to_time, __time64_to_time, __time_to_int,
1326 __time_to_time32, __time_to_time64, __unsetenvp, __utmpxname, 1348 __time_to_long, __time_to_time32, __time_to_time64, __unsetenvp,
1327 _a64l, _abort, _abort_report_np, _abs, _acl_add_flag_np, _acl_add_perm, 1349 __utmpxname, _a64l, _abort, _abort_report_np, _abs, _acl_add_flag_np,
1328 _acl_calc_mask, _acl_clear_flags_np, _acl_clear_perms, _acl_copy_entry, 1350 _acl_add_perm, _acl_calc_mask, _acl_clear_flags_np, _acl_clear_perms,
1329 _acl_copy_ext, _acl_copy_ext_native, _acl_copy_int, _acl_copy_int_native, 1351 _acl_copy_entry, _acl_copy_ext, _acl_copy_ext_native, _acl_copy_int,
1330 _acl_create_entry, _acl_create_entry_np, _acl_delete_def_file, 1352 _acl_copy_int_native, _acl_create_entry, _acl_create_entry_np,
1331 _acl_delete_entry, _acl_delete_fd_np, _acl_delete_file_np, 1353 _acl_delete_def_file, _acl_delete_entry, _acl_delete_fd_np,
1332 _acl_delete_flag_np, _acl_delete_link_np, _acl_delete_perm, 1354 _acl_delete_file_np, _acl_delete_flag_np, _acl_delete_link_np,
1333 _acl_dup, _acl_free, _acl_from_text, _acl_get_entry, _acl_get_fd, 1355 _acl_delete_perm, _acl_dup, _acl_free, _acl_from_text, _acl_get_entry,
1334 _acl_get_fd_np, _acl_get_file, _acl_get_flag_np, _acl_get_flagset_np, 1356 _acl_get_fd, _acl_get_fd_np, _acl_get_file, _acl_get_flag_np,
1335 _acl_get_link_np, _acl_get_perm_np, _acl_get_permset, _acl_get_permset_mask_np, 1357 _acl_get_flagset_np, _acl_get_link_np, _acl_get_perm_np, _acl_get_permset,
1336 _acl_get_qualifier, _acl_get_tag_type, _acl_init, _acl_maximal_permset_mask_np, 1358 _acl_get_permset_mask_np, _acl_get_qualifier, _acl_get_tag_type,
1337 _acl_set_fd, _acl_set_fd_np, _acl_set_file, _acl_set_flagset_np, 1359 _acl_init, _acl_maximal_permset_mask_np, _acl_set_fd, _acl_set_fd_np,
1338 _acl_set_link_np, _acl_set_permset, _acl_set_permset_mask_np, 1360 _acl_set_file, _acl_set_flagset_np, _acl_set_link_np, _acl_set_permset,
1339 _acl_set_qualifier, _acl_set_tag_type, _acl_size, _acl_to_text, 1361 _acl_set_permset_mask_np, _acl_set_qualifier, _acl_set_tag_type,
1340 _acl_valid, _acl_valid_fd_np, _acl_valid_file_np, _acl_valid_link, 1362 _acl_size, _acl_to_text, _acl_valid, _acl_valid_fd_np, _acl_valid_file_np,
1341 _addr2ascii, _alarm, _alphasort, _arc4random, _arc4random_addrandom, 1363 _acl_valid_link, _addr2ascii, _alarm, _alphasort, _arc4random,
1342 _arc4random_buf, _arc4random_stir, _arc4random_uniform, _ascii2addr, 1364 _arc4random_addrandom, _arc4random_buf, _arc4random_stir,
1343 _asctime, _asctime_r, _asprintf, _asprintf_l, _asxprintf, 1365 _arc4random_uniform, _ascii2addr, _asctime, _asctime_r, _asprintf,
1344 _asxprintf_exec, _atexit, _atexit_b, _atof, _atof_l, _atoi, 1366 _asprintf_l, _asxprintf, _asxprintf_exec, _at_quick_exit,
1345 _atoi_l, _atol, _atol_l, _atoll, _atoll_l, _backtrace, _backtrace_async, 1367 _atexit, _atexit_b, _atof, _atof_l, _atoi, _atoi_l, _atol,
1346 _backtrace_from_fp, _backtrace_image_offsets, _backtrace_set_pcs_func, 1368 _atol_l, _atoll, _atoll_l, _backtrace, _backtrace_async, _backtrace_from_fp,
1347 _backtrace_symbols, _backtrace_symbols_fd, _basename, _basename_r, 1369 _backtrace_image_offsets, _backtrace_set_pcs_func, _backtrace_symbols,
1348 _bcopy, _brk, _bsd_signal, _bsearch, _bsearch_b, _btowc, _btowc_l, 1370 _backtrace_symbols_fd, _basename, _basename_r, _bcopy, _brk,
1349 _catclose, _catgets, _catopen, _cfgetispeed, _cfgetospeed, 1371 _bsd_signal, _bsearch, _bsearch_b, _btowc, _btowc_l, _catclose,
1350 _cfmakeraw, _cfsetispeed, _cfsetospeed, _cfsetspeed, _cgetcap, 1372 _catgets, _catopen, _cfgetispeed, _cfgetospeed, _cfmakeraw,
1351 _cgetclose, _cgetent, _cgetfirst, _cgetmatch, _cgetnext, _cgetnum, 1373 _cfsetispeed, _cfsetospeed, _cfsetspeed, _cgetcap, _cgetclose,
1352 _cgetset, _cgetstr, _cgetustr, _chmodx_np, _clearerr, _clearerr_unlocked, 1374 _cgetent, _cgetfirst, _cgetmatch, _cgetnext, _cgetnum, _cgetset,
1375 _cgetstr, _cgetustr, _chmodx_np, _clearerr, _clearerr_unlocked,
1353 _clock, _clock_getres, _clock_gettime, _clock_gettime_nsec_np, 1376 _clock, _clock_getres, _clock_gettime, _clock_gettime_nsec_np,
1354 _clock_port, _clock_sem, _clock_settime, _closedir, _compat_mode, 1377 _clock_port, _clock_sem, _clock_settime, _closedir, _compat_mode,
1355 _confstr, _copy_printf_domain, _creat, '_creat$NOCANCEL', 1378 _confstr, _copy_printf_domain, _creat, '_creat$NOCANCEL',
...@@ -1412,23 +1435,23 @@ exports:...@@ -1412,23 +1435,23 @@ exports:
1412 _iswspecial, _iswspecial_l, _iswupper, _iswupper_l, _iswxdigit, 1435 _iswspecial, _iswspecial_l, _iswupper, _iswupper_l, _iswxdigit,
1413 _iswxdigit_l, _isxdigit, _isxdigit_l, _jrand48, _kOSThermalNotificationPressureLevelName, 1436 _iswxdigit_l, _isxdigit, _isxdigit_l, _jrand48, _kOSThermalNotificationPressureLevelName,
1414 _killpg, _l64a, _labs, _lchflags, _lchmod, _lcong48, _ldiv, 1437 _killpg, _l64a, _labs, _lchflags, _lchmod, _lcong48, _ldiv,
1415 _lfind, _link_addr, _link_ntoa, _llabs, _lldiv, _localeconv, 1438 _lfind, _libc_set_introspection_hooks, _link_addr, _link_ntoa,
1416 _localeconv_l, _localtime, _localtime_r, _lockf, '_lockf$NOCANCEL', 1439 _llabs, _lldiv, _localeconv, _localeconv_l, _localtime, _localtime_r,
1417 _login, _login_tty, _logout, _logwtmp, _lrand48, _lsearch, 1440 _lockf, '_lockf$NOCANCEL', _login, _login_tty, _logout, _logwtmp,
1418 _lstatx_np, _lutimes, _mblen, _mblen_l, _mbmb, _mbrlen, _mbrlen_l, 1441 _lrand48, _lsearch, _lstatx_np, _lutimes, _mblen, _mblen_l,
1419 _mbrrune, _mbrtowc, _mbrtowc_l, _mbrune, _mbsinit, _mbsinit_l, 1442 _mbmb, _mbrlen, _mbrlen_l, _mbrrune, _mbrtowc, _mbrtowc_l,
1420 _mbsnrtowcs, _mbsnrtowcs_l, _mbsrtowcs, _mbsrtowcs_l, _mbstowcs, 1443 _mbrune, _mbsinit, _mbsinit_l, _mbsnrtowcs, _mbsnrtowcs_l,
1421 _mbstowcs_l, _mbtowc, _mbtowc_l, _memmem, _memset_s, _mergesort, 1444 _mbsrtowcs, _mbsrtowcs_l, _mbstowcs, _mbstowcs_l, _mbtowc,
1422 _mergesort_b, _mkdirx_np, _mkdtemp, _mkdtempat_np, _mkfifox_np, 1445 _mbtowc_l, _memmem, _memset_s, _mergesort, _mergesort_b, _mkdirx_np,
1423 _mkostemp, _mkostemps, _mkostempsat_np, _mkpath_np, _mkpathat_np, 1446 _mkdtemp, _mkdtempat_np, _mkfifox_np, _mkostemp, _mkostemps,
1424 _mkstemp, _mkstemp_dprotected_np, _mkstemps, _mkstempsat_np, 1447 _mkostempsat_np, _mkpath_np, _mkpathat_np, _mkstemp, _mkstemp_dprotected_np,
1425 _mktemp, _mktime, _monaddition, _moncontrol, _moncount, _moninit, 1448 _mkstemps, _mkstempsat_np, _mktemp, _mktime, _monaddition,
1426 _monitor, _monoutput, _monreset, _monstartup, _mpool_close, 1449 _moncontrol, _moncount, _moninit, _monitor, _monoutput, _monreset,
1427 _mpool_filter, _mpool_get, _mpool_new, _mpool_open, _mpool_put, 1450 _monstartup, _mpool_close, _mpool_filter, _mpool_get, _mpool_new,
1428 _mpool_sync, _mrand48, _nanosleep, '_nanosleep$NOCANCEL', 1451 _mpool_open, _mpool_put, _mpool_sync, _mrand48, _nanosleep,
1429 _new_printf_comp, _new_printf_domain, _newlocale, _nextwctype, 1452 '_nanosleep$NOCANCEL', _new_printf_comp, _new_printf_domain,
1430 _nextwctype_l, _nftw, _nice, _nl_langinfo, _nl_langinfo_l, 1453 _newlocale, _nextwctype, _nextwctype_l, _nftw, _nice, _nl_langinfo,
1431 _nrand48, _nvis, _off32, _off64, _offtime, _open_memstream, 1454 _nl_langinfo_l, _nrand48, _nvis, _offtime, _open_memstream,
1432 _open_with_subsystem, _open_wmemstream, _opendev, _opendir, 1455 _open_with_subsystem, _open_wmemstream, _opendev, _opendir,
1433 _openpty, _openx_np, _optarg, _opterr, _optind, _optopt, _optreset, 1456 _openpty, _openx_np, _optarg, _opterr, _optind, _optopt, _optreset,
1434 _pause, '_pause$NOCANCEL', _pclose, _perror, _popen, '_popen$DARWIN_EXTSN', 1457 _pause, '_pause$NOCANCEL', _pclose, _perror, _popen, '_popen$DARWIN_EXTSN',
...@@ -1436,27 +1459,26 @@ exports:...@@ -1436,27 +1459,26 @@ exports:
1436 _psignal, _psort, _psort_b, _psort_r, _ptsname, _ptsname_r, 1459 _psignal, _psort, _psort_b, _psort_r, _ptsname, _ptsname_r,
1437 _putc, _putc_unlocked, _putchar, _putchar_unlocked, _putenv, 1460 _putc, _putc_unlocked, _putchar, _putchar_unlocked, _putenv,
1438 _puts, _pututxline, _putw, _putwc, _putwc_l, _putwchar, _putwchar_l, 1461 _puts, _pututxline, _putw, _putwc, _putwc_l, _putwchar, _putwchar_l,
1439 _qsort, _qsort_b, _qsort_r, _querylocale, _radixsort, _raise, 1462 _qsort, _qsort_b, _qsort_r, _querylocale, _quick_exit, _radixsort,
1440 _rand, _rand_r, _random, _rb_tree_count, _rb_tree_find_node, 1463 _raise, _rand, _rand_r, _random, _rb_tree_count, _rb_tree_find_node,
1441 _rb_tree_find_node_geq, _rb_tree_find_node_leq, _rb_tree_init, 1464 _rb_tree_find_node_geq, _rb_tree_find_node_leq, _rb_tree_init,
1442 _rb_tree_insert_node, _rb_tree_iterate, _rb_tree_remove_node, 1465 _rb_tree_insert_node, _rb_tree_iterate, _rb_tree_remove_node,
1443 _readdir, _readdir_r, _readpassphrase, _reallocf, _realpath, 1466 _readdir, _readdir_r, _readpassphrase, _realpath, '_realpath$DARWIN_EXTSN',
1444 '_realpath$DARWIN_EXTSN', _recv, '_recv$NOCANCEL', _regcomp, 1467 _recv, '_recv$NOCANCEL', _regcomp, _regcomp_l, _regerror,
1445 _regcomp_l, _regerror, _regexec, _regfree, _register_printf_domain_function, 1468 _regexec, _regfree, _register_printf_domain_function, _register_printf_domain_render_std,
1446 _register_printf_domain_render_std, _regncomp, _regncomp_l, 1469 _regncomp, _regncomp_l, _regnexec, _regwcomp, _regwcomp_l,
1447 _regnexec, _regwcomp, _regwcomp_l, _regwexec, _regwncomp, 1470 _regwexec, _regwncomp, _regwncomp_l, _regwnexec, _remove,
1448 _regwncomp_l, _regwnexec, _remove, _remque, _rewind, _rewinddir, 1471 _remque, _rewind, _rewinddir, _rindex, _rpmatch, _sbrk, _scandir,
1449 _rindex, _rpmatch, _sbrk, _scandir, _scandir_b, _scanf, _scanf_l, 1472 _scandir_b, _scanf, _scanf_l, _seed48, _seekdir, _send, '_send$NOCANCEL',
1450 _seed48, _seekdir, _send, '_send$NOCANCEL', _setbuf, _setbuffer, 1473 _setbuf, _setbuffer, _setenv, _sethostid, _sethostname, _setinvalidrune,
1451 _setenv, _sethostid, _sethostname, _setinvalidrune, _setipv4sourcefilter, 1474 _setipv4sourcefilter, _setkey, _setlinebuf, _setlocale, _setlogin,
1452 _setkey, _setlinebuf, _setlocale, _setlogin, _setmode, _setpgrp, 1475 _setmode, _setpgrp, _setprogname, _setrgid, _setruid, _setrunelocale,
1453 _setprogname, _setrgid, _setruid, _setrunelocale, _setsourcefilter, 1476 _setsourcefilter, _setstate, _settimeofday, _setttyent, _setusershell,
1454 _setstate, _settimeofday, _setttyent, _setusershell, _setutxent, 1477 _setutxent, _setutxent_wtmp, _setvbuf, _sigaction, _sigaddset,
1455 _setutxent_wtmp, _setvbuf, _sigaction, _sigaddset, _sigaltstack, 1478 _sigaltstack, _sigblock, _sigdelset, _sigemptyset, _sigfillset,
1456 _sigblock, _sigdelset, _sigemptyset, _sigfillset, _sighold, 1479 _sighold, _sigignore, _siginterrupt, _sigismember, _signal,
1457 _sigignore, _siginterrupt, _sigismember, _signal, _sigpause, 1480 _sigpause, '_sigpause$NOCANCEL', _sigrelse, _sigset, _sigsetmask,
1458 '_sigpause$NOCANCEL', _sigrelse, _sigset, _sigsetmask, _sigvec, 1481 _sigvec, _sl_add, _sl_find, _sl_free, _sl_init, _sleep, '_sleep$NOCANCEL',
1459 _skip, _sl_add, _sl_find, _sl_free, _sl_init, _sleep, '_sleep$NOCANCEL',
1460 _snprintf, _snprintf_l, _snvis, _sockatmark, _sprintf, _sprintf_l, 1482 _snprintf, _snprintf_l, _snvis, _sockatmark, _sprintf, _sprintf_l,
1461 _sradixsort, _srand, _srand48, _sranddev, _srandom, _srandomdev, 1483 _sradixsort, _srand, _srand48, _sranddev, _srandom, _srandomdev,
1462 _sscanf, _sscanf_l, _stat_with_subsystem, _statvfs, _statx_np, 1484 _sscanf, _sscanf_l, _stat_with_subsystem, _statvfs, _statx_np,
...@@ -1522,6 +1544,7 @@ exports:...@@ -1522,6 +1544,7 @@ exports:
1522 _wmemcmp, _wmemcpy, _wmemmove, _wmemset, _wordexp, _wordfree, 1544 _wmemcmp, _wmemcpy, _wmemmove, _wmemset, _wordexp, _wordfree,
1523 _wprintf, _wprintf_l, _wscanf, _wscanf_l, _wtmpxname, _xprintf, 1545 _wprintf, _wprintf_l, _wscanf, _wscanf_l, _wtmpxname, _xprintf,
1524 _xprintf_exec ]1546 _xprintf_exec ]
1547 weak-symbols: [ __os_debug_log_redirect_func ]
1525reexports:1548reexports:
1526 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1549 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1527 arm64e-macos, arm64e-maccatalyst ]1550 arm64e-macos, arm64e-maccatalyst ]
...@@ -1534,7 +1557,7 @@ tbd-version: 4...@@ -1534,7 +1557,7 @@ tbd-version: 4
1534targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1557targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1535 arm64e-macos, arm64e-maccatalyst ]1558 arm64e-macos, arm64e-maccatalyst ]
1536install-name: '/usr/lib/system/libsystem_collections.dylib'1559install-name: '/usr/lib/system/libsystem_collections.dylib'
1537current-version: 1583.0.141560current-version: 1669.40.2
1538parent-umbrella:1561parent-umbrella:
1539 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1562 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1540 arm64e-macos, arm64e-maccatalyst ]1563 arm64e-macos, arm64e-maccatalyst ]
...@@ -1564,7 +1587,7 @@ tbd-version: 4...@@ -1564,7 +1587,7 @@ tbd-version: 4
1564targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1587targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1565 arm64e-macos, arm64e-maccatalyst ]1588 arm64e-macos, arm64e-maccatalyst ]
1566install-name: '/usr/lib/system/libsystem_configuration.dylib'1589install-name: '/usr/lib/system/libsystem_configuration.dylib'
1567current-version: 1296.0.11590current-version: 1347.40.1
1568parent-umbrella:1591parent-umbrella:
1569 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1592 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1570 arm64e-macos, arm64e-maccatalyst ]1593 arm64e-macos, arm64e-maccatalyst ]
...@@ -1600,8 +1623,13 @@ exports:...@@ -1600,8 +1623,13 @@ exports:
1600 arm64e-macos, arm64e-maccatalyst ]1623 arm64e-macos, arm64e-maccatalyst ]
1601 symbols: [ _CMFSSEAM_DEFAULT, _CONTAINER_NOTIFY_USER_INVALIDATED, _CONTAINER_PERSONA_CURRENT, 1624 symbols: [ _CMFSSEAM_DEFAULT, _CONTAINER_NOTIFY_USER_INVALIDATED, _CONTAINER_PERSONA_CURRENT,
1602 _CONTAINER_PERSONA_PRIMARY, __container_init, __container_query_get_servicing_pid, 1625 _CONTAINER_PERSONA_PRIMARY, __container_init, __container_query_get_servicing_pid,
1603 __container_references_get_servicing_pid, _container_acquire_sandbox_extension, 1626 __container_references_get_servicing_pid, __container_traverse_continuation_create,
1604 _container_audit_token_copy_codesign_hash, _container_audit_token_copy_codesign_identifier, 1627 __container_traverse_continuation_free, __container_traverse_continuation_pop,
1628 __container_traverse_continuation_push, __container_traverse_get_last_path_component,
1629 __container_traverse_path_pop, __container_traverse_path_push,
1630 __container_traverse_state_deinit, __container_traverse_state_init,
1631 _container_acquire_sandbox_extension, _container_audit_token_copy_codesign_hash,
1632 _container_audit_token_copy_codesign_identifier, _container_audit_token_copy_codesign_team_identifier,
1605 _container_audit_token_copy_entitlement, _container_audit_token_copy_executable_name, 1633 _container_audit_token_copy_entitlement, _container_audit_token_copy_executable_name,
1606 _container_audit_token_for_pid, _container_audit_token_get_codesign_status, 1634 _container_audit_token_for_pid, _container_audit_token_get_codesign_status,
1607 _container_audit_token_get_egid, _container_audit_token_get_euid, 1635 _container_audit_token_get_egid, _container_audit_token_get_euid,
...@@ -1615,15 +1643,16 @@ exports:...@@ -1615,15 +1643,16 @@ exports:
1615 _container_client_copy_decoded_from_xpc_object, _container_client_copy_encoded_xpc_object, 1643 _container_client_copy_decoded_from_xpc_object, _container_client_copy_encoded_xpc_object,
1616 _container_client_copy_entitlement, _container_client_create_from_audit_token, 1644 _container_client_copy_entitlement, _container_client_create_from_audit_token,
1617 _container_client_get_audit_token, _container_client_get_codesign_identifier, 1645 _container_client_get_audit_token, _container_client_get_codesign_identifier,
1618 _container_client_get_egid, _container_client_get_euid, _container_client_get_persona_unique_string, 1646 _container_client_get_codesign_team_identifier, _container_client_get_egid,
1647 _container_client_get_euid, _container_client_get_persona_unique_string,
1619 _container_client_get_pid, _container_client_get_platform, 1648 _container_client_get_pid, _container_client_get_platform,
1620 _container_client_initializer, _container_client_is_alive, 1649 _container_client_initializer, _container_client_is_alive,
1621 _container_client_is_platform_binary, _container_client_is_sandboxed, 1650 _container_client_is_platform_binary, _container_client_is_sandboxed,
1622 _container_client_is_signature_valid, _container_client_is_signed, 1651 _container_client_is_signature_valid, _container_client_is_signed,
1623 _container_client_is_test_client, _container_codesign_copy_cdhash, 1652 _container_client_is_test_client, _container_codesign_copy_cdhash,
1624 _container_codesign_copy_cs_identity, _container_codesign_copy_current_identifier, 1653 _container_codesign_copy_cs_identity, _container_codesign_copy_cs_team_identifier,
1625 _container_codesign_get_self_audit_token, _container_codesign_get_status, 1654 _container_codesign_copy_current_identifier, _container_codesign_get_self_audit_token,
1626 _container_copy_client, _container_copy_code_signing_info_for_identifier, 1655 _container_codesign_get_status, _container_copy_client, _container_copy_code_signing_info_for_identifier,
1627 _container_copy_from_path, _container_copy_info, _container_copy_info_value_for_key, 1656 _container_copy_from_path, _container_copy_info, _container_copy_info_value_for_key,
1628 _container_copy_object, _container_copy_path, _container_copy_persona_unique_strings, 1657 _container_copy_object, _container_copy_path, _container_copy_persona_unique_strings,
1629 _container_copy_sandbox_token, _container_copy_unlocalized_description, 1658 _container_copy_sandbox_token, _container_copy_unlocalized_description,
...@@ -1652,8 +1681,8 @@ exports:...@@ -1652,8 +1681,8 @@ exports:
1652 _container_frozenset_create, _container_frozenset_create_from_external_bytes, 1681 _container_frozenset_create, _container_frozenset_create_from_external_bytes,
1653 _container_frozenset_destroy, _container_frozenset_enumerate_matches, 1682 _container_frozenset_destroy, _container_frozenset_enumerate_matches,
1654 _container_frozenset_get_container_class_of_container_at_index, 1683 _container_frozenset_get_container_class_of_container_at_index,
1655 _container_frozenset_get_count, _container_frozenset_get_generation, 1684 _container_frozenset_get_count, _container_frozenset_get_creator_of_container_at_index,
1656 _container_frozenset_get_identifier_of_container_at_index, 1685 _container_frozenset_get_generation, _container_frozenset_get_identifier_of_container_at_index,
1657 _container_frozenset_get_is_new_of_container_at_index, _container_frozenset_get_is_transient_of_container_at_index, 1686 _container_frozenset_get_is_new_of_container_at_index, _container_frozenset_get_is_transient_of_container_at_index,
1658 _container_frozenset_get_path_of_container_at_index, _container_frozenset_get_persona_unique_string_of_container_at_index, 1687 _container_frozenset_get_path_of_container_at_index, _container_frozenset_get_persona_unique_string_of_container_at_index,
1659 _container_frozenset_get_stored_string, _container_frozenset_get_uid_of_container_at_index, 1688 _container_frozenset_get_stored_string, _container_frozenset_get_uid_of_container_at_index,
...@@ -1664,46 +1693,50 @@ exports:...@@ -1664,46 +1693,50 @@ exports:
1664 _container_fs_item_exists_at, _container_fs_load_plist_at, 1693 _container_fs_item_exists_at, _container_fs_load_plist_at,
1665 _container_fs_path_at, _container_fs_resolve_dirent_type_at, 1694 _container_fs_path_at, _container_fs_resolve_dirent_type_at,
1666 _container_get_all_with_class_for_current_user, _container_get_class, 1695 _container_get_all_with_class_for_current_user, _container_get_class,
1667 _container_get_error_description, _container_get_identifier, 1696 _container_get_creator_codesign_identifier, _container_get_error_description,
1668 _container_get_info, _container_get_info_value_for_key, _container_get_path, 1697 _container_get_identifier, _container_get_info, _container_get_info_value_for_key,
1669 _container_get_persona_unique_string, _container_get_uid, 1698 _container_get_path, _container_get_persona_unique_string,
1670 _container_get_unique_path_component, _container_get_user_managed_assets_relative_path, 1699 _container_get_uid, _container_get_unique_path_component,
1671 _container_group_container_identifiers_for_current_user, _container_internal_get_first_boot_uuid, 1700 _container_get_user_managed_assets_relative_path, _container_group_container_identifiers_for_current_user,
1672 _container_invalidate_code_signing_cache, _container_is_equal, 1701 _container_internal_get_first_boot_uuid, _container_invalidate_code_signing_cache,
1673 _container_is_new, _container_is_transient, _container_log_client_fault_logging_is_enabled, 1702 _container_is_equal, _container_is_new, _container_is_transient,
1674 _container_log_error, _container_log_error_with_faults, _container_log_ext_error, 1703 _container_log_client_fault_logging_is_enabled, _container_log_error,
1704 _container_log_error_with_faults, _container_log_ext_error,
1675 _container_log_ext_error_with_faults, _container_log_handle_for_category, 1705 _container_log_ext_error_with_faults, _container_log_handle_for_category,
1676 _container_log_replication_disable, _container_log_replication_enable_to_uid_relative_path, 1706 _container_log_replication_disable, _container_log_replication_enable_to_uid_relative_path,
1677 _container_log_replication_prune_for_uid, _container_log_set_client_fault_logging, 1707 _container_log_replication_prune_for_uid, _container_log_set_client_fault_logging,
1678 _container_object_copy, _container_object_create, _container_object_create_blank, 1708 _container_object_copy, _container_object_create, _container_object_create_blank,
1679 _container_object_free, _container_object_get_class, _container_object_get_identifier, 1709 _container_object_free, _container_object_get_class, _container_object_get_creator_codesign_identifier,
1680 _container_object_get_info, _container_object_get_path, _container_object_get_persona_unique_string, 1710 _container_object_get_identifier, _container_object_get_info,
1711 _container_object_get_path, _container_object_get_persona_unique_string,
1681 _container_object_get_query, _container_object_get_sandbox_token, 1712 _container_object_get_query, _container_object_get_sandbox_token,
1682 _container_object_get_uid, _container_object_get_unique_path_component, 1713 _container_object_get_uid, _container_object_get_unique_path_component,
1683 _container_object_get_user_managed_assets_relative_path, _container_object_get_uuid, 1714 _container_object_get_user_managed_assets_relative_path, _container_object_get_uuid,
1684 _container_object_is_new, _container_object_is_transient, 1715 _container_object_is_new, _container_object_is_transient,
1685 _container_object_sandbox_extension_activate, _container_object_set_backing_store_from_query, 1716 _container_object_sandbox_extension_activate, _container_object_set_backing_store_from_query,
1686 _container_object_set_class, _container_object_set_info, _container_object_set_path, 1717 _container_object_set_class, _container_object_set_creator_codesign_identifier,
1687 _container_object_set_sandbox_token, _container_object_set_transient, 1718 _container_object_set_info, _container_object_set_is_new,
1688 _container_object_set_unique_path_component, _container_object_set_user_managed_assets_relative_path, 1719 _container_object_set_path, _container_object_set_sandbox_token,
1689 _container_object_set_uuid, _container_object_update_metadata, 1720 _container_object_set_transient, _container_object_set_unique_path_component,
1690 _container_operation_complete_background_tasks, _container_operation_delete, 1721 _container_object_set_user_managed_assets_relative_path, _container_object_set_uuid,
1691 _container_operation_delete_array, _container_operation_delete_reclaim_disk_space, 1722 _container_object_update_metadata, _container_operation_complete_background_tasks,
1692 _container_paths_context_create, _container_paths_context_free, 1723 _container_operation_delete, _container_operation_delete_array,
1693 _container_paths_context_set_class, _container_paths_context_set_flags, 1724 _container_operation_delete_reclaim_disk_space, _container_paths_context_create,
1694 _container_paths_context_set_persona_unique_string, _container_paths_context_set_transient, 1725 _container_paths_context_free, _container_paths_context_set_class,
1695 _container_paths_context_set_uid, _container_paths_copy_container_at, 1726 _container_paths_context_set_flags, _container_paths_context_set_persona_unique_string,
1696 _container_paths_copy_container_from_path, _container_paths_copy_container_root_path_for_context, 1727 _container_paths_context_set_transient, _container_paths_context_set_uid,
1697 _container_paths_copy_uid_home_relative, _container_paths_create_uid_home_relative, 1728 _container_paths_copy_container_at, _container_paths_copy_container_from_path,
1698 _container_paths_enumerate_containers_at, _container_perfect_hash_copyout_external_bytes, 1729 _container_paths_copy_container_root_path_for_context, _container_paths_copy_uid_home_relative,
1699 _container_perfect_hash_count, _container_perfect_hash_create, 1730 _container_paths_create_uid_home_relative, _container_paths_enumerate_containers_at,
1700 _container_perfect_hash_create_from_external_bytes, _container_perfect_hash_destroy, 1731 _container_perfect_hash_copyout_external_bytes, _container_perfect_hash_count,
1701 _container_perfect_hash_index_of, _container_perfect_hash_num_indexes, 1732 _container_perfect_hash_create, _container_perfect_hash_create_from_external_bytes,
1702 _container_perform_with_client_context, _container_persona_collect_all_ids, 1733 _container_perfect_hash_destroy, _container_perfect_hash_index_of,
1703 _container_persona_convert_unique_string_to_persona_uid, _container_persona_foreach, 1734 _container_perfect_hash_num_indexes, _container_perform_with_client_context,
1704 _container_process_restored_container, _container_pwd_copy_user_home_path, 1735 _container_persona_collect_all_ids, _container_persona_convert_unique_string_to_persona_uid,
1705 _container_pwd_for_name, _container_pwd_for_uid, _container_query_copy, 1736 _container_persona_foreach, _container_process_restored_container,
1706 _container_query_count_results, _container_query_create, _container_query_create_from_container, 1737 _container_pwd_copy_user_home_path, _container_pwd_for_name,
1738 _container_pwd_for_uid, _container_query_copy, _container_query_count_results,
1739 _container_query_create, _container_query_create_from_container,
1707 _container_query_free, _container_query_get_last_error, _container_query_get_single_result, 1740 _container_query_free, _container_query_get_last_error, _container_query_get_single_result,
1708 _container_query_iterate_results_sync, _container_query_iterate_results_with_identifier_sync, 1741 _container_query_iterate_results_sync, _container_query_iterate_results_with_identifier_sync,
1709 _container_query_iterate_results_with_subquery_sync, _container_query_operation_set_client, 1742 _container_query_iterate_results_with_subquery_sync, _container_query_operation_set_client,
...@@ -1711,13 +1744,13 @@ exports:...@@ -1711,13 +1744,13 @@ exports:
1711 _container_query_set_class, _container_query_set_group_identifiers, 1744 _container_query_set_class, _container_query_set_group_identifiers,
1712 _container_query_set_identifiers, _container_query_set_include_other_owners, 1745 _container_query_set_identifiers, _container_query_set_include_other_owners,
1713 _container_query_set_persona_unique_string, _container_query_set_transient, 1746 _container_query_set_persona_unique_string, _container_query_set_transient,
1714 _container_query_set_uid, _container_realpath, _container_recreate_structure, 1747 _container_query_set_uid, _container_realpath, _container_realpathat,
1715 _container_references_get_last_error, _container_regenerate_uuid, 1748 _container_recreate_structure, _container_references_get_last_error,
1716 _container_repair_user_data, _container_replace, _container_retry_test, 1749 _container_regenerate_uuid, _container_repair_user_data, _container_replace,
1717 _container_sandbox_extension_consume, _container_sandbox_extension_revoke, 1750 _container_retry_test, _container_sandbox_extension_consume,
1718 _container_sandbox_issue_custom_extension, _container_sandbox_issue_extension, 1751 _container_sandbox_extension_revoke, _container_sandbox_issue_custom_extension,
1719 _container_seam_fs_ensure_lazy_loaded, _container_seam_fs_reset, 1752 _container_sandbox_issue_extension, _container_seam_fs_ensure_lazy_loaded,
1720 _container_seam_fs_set_common, _container_serialize_copy_deserialized_reference, 1753 _container_seam_fs_reset, _container_seam_fs_set_common, _container_serialize_copy_deserialized_reference,
1721 _container_serialize_copy_serialized_reference, _container_set_code_signing_info_for_identifier, 1754 _container_serialize_copy_serialized_reference, _container_set_code_signing_info_for_identifier,
1722 _container_set_data_protection_for_current_user, _container_set_info_value, 1755 _container_set_data_protection_for_current_user, _container_set_info_value,
1723 _container_set_test_lock, _container_stage_shared_system_content, 1756 _container_set_test_lock, _container_stage_shared_system_content,
...@@ -1726,6 +1759,17 @@ exports:...@@ -1726,6 +1759,17 @@ exports:
1726 _container_string_rom_destroy, _container_string_rom_index_of, 1759 _container_string_rom_destroy, _container_string_rom_index_of,
1727 _container_string_rom_string_at_index, _container_subdirectories_for_class, 1760 _container_string_rom_string_at_index, _container_subdirectories_for_class,
1728 _container_system_group_path_for_identifier, _container_system_path_for_identifier, 1761 _container_system_group_path_for_identifier, _container_system_path_for_identifier,
1762 _container_test_set_locks_and_restart, _container_traverse_directory,
1763 _container_traverse_node_copy, _container_traverse_node_copy_unlocalized_description,
1764 _container_traverse_node_free, _container_traverse_node_get_depth_from_origin,
1765 _container_traverse_node_get_name, _container_traverse_node_get_optional_alloc_size,
1766 _container_traverse_node_get_optional_dp_class, _container_traverse_node_get_optional_file_id,
1767 _container_traverse_node_get_optional_flags, _container_traverse_node_get_optional_gid,
1768 _container_traverse_node_get_optional_link_count, _container_traverse_node_get_optional_mode,
1769 _container_traverse_node_get_optional_parent_fd, _container_traverse_node_get_optional_uid,
1770 _container_traverse_node_get_path, _container_traverse_node_get_subordinate_count,
1771 _container_traverse_node_is_directory, _container_traverse_node_is_regular_file,
1772 _container_traverse_node_is_symlink, _container_traverse_node_optional_has_acl,
1729 _container_update_with_container, _container_user_managed_assets_path, 1773 _container_update_with_container, _container_user_managed_assets_path,
1730 _container_user_managed_assets_relative_path, _container_xpc_connection_is_shared, 1774 _container_user_managed_assets_relative_path, _container_xpc_connection_is_shared,
1731 _container_xpc_create_connection, _container_xpc_decode_container_object, 1775 _container_xpc_create_connection, _container_xpc_decode_container_object,
...@@ -1773,7 +1817,8 @@ exports:...@@ -1773,7 +1817,8 @@ exports:
1773 __libcoreservices_fork_child, __set_user_dir_suffix, _sysdir_get_next_search_path_enumeration, 1817 __libcoreservices_fork_child, __set_user_dir_suffix, _sysdir_get_next_search_path_enumeration,
1774 _sysdir_start_search_path_enumeration, _sysdir_start_search_path_enumeration_private ]1818 _sysdir_start_search_path_enumeration, _sysdir_start_search_path_enumeration_private ]
1775 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]1819 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1776 symbols: [ __idle_exit ]1820 symbols: [ ___user_relative_dirname_with_hints, __dirhelper_relative_with_hints,
1821 __idle_exit ]
1777--- !tapi-tbd1822--- !tapi-tbd
1778tbd-version: 41823tbd-version: 4
1779targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1824targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
...@@ -1826,13 +1871,14 @@ parent-umbrella:...@@ -1826,13 +1871,14 @@ parent-umbrella:
1826exports:1871exports:
1827 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1872 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1828 arm64e-macos, arm64e-maccatalyst ]1873 arm64e-macos, arm64e-maccatalyst ]
1829 symbols: [ _DarwinDirectoryRecordStoreApply, _DarwinDirectoryRecordStoreApplyWithFilter ]1874 symbols: [ _DarwinDirectoryGetGeneration, _DarwinDirectoryRecordStoreApply,
1875 _DarwinDirectoryRecordStoreApplyWithFilter ]
1830--- !tapi-tbd1876--- !tapi-tbd
1831tbd-version: 41877tbd-version: 4
1832targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1878targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1833 arm64e-macos, arm64e-maccatalyst ]1879 arm64e-macos, arm64e-maccatalyst ]
1834install-name: '/usr/lib/system/libsystem_dnssd.dylib'1880install-name: '/usr/lib/system/libsystem_dnssd.dylib'
1835current-version: 2200.0.81881current-version: 2559.40.32
1836parent-umbrella:1882parent-umbrella:
1837 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1883 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1838 arm64e-macos, arm64e-maccatalyst ]1884 arm64e-macos, arm64e-maccatalyst ]
...@@ -1844,6 +1890,7 @@ exports:...@@ -1844,6 +1890,7 @@ exports:
1844 _DNSServiceAttrSetFailoverPolicy, _DNSServiceAttrSetValidationData, 1890 _DNSServiceAttrSetFailoverPolicy, _DNSServiceAttrSetValidationData,
1845 _DNSServiceAttrSetValidationPolicy, _DNSServiceAttributeCreate, 1891 _DNSServiceAttrSetValidationPolicy, _DNSServiceAttributeCreate,
1846 _DNSServiceAttributeDeallocate, _DNSServiceAttributeSetAAAAPolicy, 1892 _DNSServiceAttributeDeallocate, _DNSServiceAttributeSetAAAAPolicy,
1893 _DNSServiceAttributeSetHostKeyHash, _DNSServiceAttributeSetResolverOverride,
1847 _DNSServiceAttributeSetTimestamp, _DNSServiceBrowse, _DNSServiceBrowseEx, 1894 _DNSServiceAttributeSetTimestamp, _DNSServiceBrowse, _DNSServiceBrowseEx,
1848 _DNSServiceConstructFullName, _DNSServiceCreateConnection, 1895 _DNSServiceConstructFullName, _DNSServiceCreateConnection,
1849 _DNSServiceCreateDelegateConnection, _DNSServiceEnumerateDomains, 1896 _DNSServiceCreateDelegateConnection, _DNSServiceEnumerateDomains,
...@@ -1866,10 +1913,27 @@ exports:...@@ -1866,10 +1913,27 @@ exports:
1866 _kDNSServiceAttributeAAAAFallback ]1913 _kDNSServiceAttributeAAAAFallback ]
1867--- !tapi-tbd1914--- !tapi-tbd
1868tbd-version: 41915tbd-version: 4
1916targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1917install-name: '/usr/lib/system/libsystem_eligibility.dylib'
1918current-version: 129.40.7
1919parent-umbrella:
1920 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1921 umbrella: System
1922exports:
1923 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
1924 symbols: [ _load_eligibility_plist, _os_eligibility_domain_for_name,
1925 _os_eligibility_dump_sysdiagnose_data_to_dir, _os_eligibility_force_domain_answer,
1926 _os_eligibility_force_domain_set_answers, _os_eligibility_get_all_domain_answers,
1927 _os_eligibility_get_domain_answer, _os_eligibility_get_domain_notification_name,
1928 _os_eligibility_get_internal_state, _os_eligibility_get_state_dump,
1929 _os_eligibility_reset_all_domains, _os_eligibility_reset_domain,
1930 _os_eligibility_set_input, _os_eligibility_set_test_mode ]
1931--- !tapi-tbd
1932tbd-version: 4
1869targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1933targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1870 arm64e-macos, arm64e-maccatalyst ]1934 arm64e-macos, arm64e-maccatalyst ]
1871install-name: '/usr/lib/system/libsystem_featureflags.dylib'1935install-name: '/usr/lib/system/libsystem_featureflags.dylib'
1872current-version: 851936current-version: 94
1873parent-umbrella:1937parent-umbrella:
1874 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 1938 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
1875 arm64e-macos, arm64e-maccatalyst ]1939 arm64e-macos, arm64e-maccatalyst ]
...@@ -2004,54 +2068,21 @@ exports:...@@ -2004,54 +2068,21 @@ exports:
2004 _yp_next, _yp_order, _yp_unbind, _yperr_string, _ypprot_err ]2068 _yp_next, _yp_order, _yp_unbind, _yperr_string, _ypprot_err ]
2005--- !tapi-tbd2069--- !tapi-tbd
2006tbd-version: 42070tbd-version: 4
2007targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 2071targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2008 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2072 arm64e-macos, arm64e-maccatalyst ]
2009install-name: '/usr/lib/system/libsystem_kernel.dylib'2073install-name: '/usr/lib/system/libsystem_kernel.dylib'
2010current-version: 10002.1.112074current-version: 11215.41.2
2011parent-umbrella:2075parent-umbrella:
2012 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 2076 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2013 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2077 arm64e-macos, arm64e-maccatalyst ]
2014 umbrella: System2078 umbrella: System
2015exports:2079exports:
2016 - targets: [ i386-macos, i386-maccatalyst ]2080 - targets: [ x86_64-macos, x86_64-maccatalyst ]
2017 symbols: [ ___aio_suspend, ___close, ___fsync, ___msgrcv, ___msgsnd,
2018 ___poll, ___pread, ___preadv, ___pwrite, ___pwritev, ___read,
2019 ___readv, ___sem_wait, ___waitid, ___write, ___writev, __mach_make_memory_entry,
2020 __sysenter_trap, '_accept$NOCANCEL$UNIX2003', '_accept$UNIX2003',
2021 '_aio_suspend$NOCANCEL$UNIX2003', '_aio_suspend$UNIX2003',
2022 '_bind$UNIX2003', '_chmod$UNIX2003', '_close$NOCANCEL$UNIX2003',
2023 '_close$UNIX2003', '_connect$NOCANCEL$UNIX2003', '_connect$UNIX2003',
2024 '_fchmod$UNIX2003', '_fcntl$NOCANCEL$UNIX2003', '_fcntl$UNIX2003',
2025 '_fsync$NOCANCEL$UNIX2003', '_fsync$UNIX2003', '_getattrlist$UNIX2003',
2026 '_getpeername$UNIX2003', '_getrlimit$UNIX2003', '_getsockname$UNIX2003',
2027 '_kill$UNIX2003', '_lchown$UNIX2003', '_listen$UNIX2003',
2028 _mach_host_self_, _mach_vm_region_info, _mach_vm_region_info_64,
2029 '_mmap$UNIX2003', '_mprotect$UNIX2003', '_msgctl$UNIX2003',
2030 '_msgrcv$NOCANCEL$UNIX2003', '_msgrcv$UNIX2003', '_msgsnd$NOCANCEL$UNIX2003',
2031 '_msgsnd$UNIX2003', '_msync$NOCANCEL$UNIX2003', '_msync$UNIX2003',
2032 '_munmap$UNIX2003', '_open$NOCANCEL$UNIX2003', '_open$UNIX2003',
2033 '_poll$NOCANCEL$UNIX2003', '_poll$UNIX2003', '_pread$NOCANCEL$UNIX2003',
2034 '_pread$UNIX2003', '_pselect$NOCANCEL$UNIX2003', '_pselect$UNIX2003',
2035 '_pwrite$NOCANCEL$UNIX2003', '_pwrite$UNIX2003', '_read$NOCANCEL$UNIX2003',
2036 '_read$UNIX2003', '_readv$NOCANCEL$UNIX2003', '_readv$UNIX2003',
2037 '_recvfrom$NOCANCEL$UNIX2003', '_recvfrom$UNIX2003', '_recvmsg$NOCANCEL$UNIX2003',
2038 '_recvmsg$UNIX2003', '_select$NOCANCEL$UNIX2003', '_select$UNIX2003',
2039 '_sem_wait$NOCANCEL$UNIX2003', '_sem_wait$UNIX2003', '_semctl$UNIX2003',
2040 '_sendmsg$NOCANCEL$UNIX2003', '_sendmsg$UNIX2003', '_sendto$NOCANCEL$UNIX2003',
2041 '_sendto$UNIX2003', '_setattrlist$UNIX2003', _setpgrp, '_setregid$UNIX2003',
2042 '_setreuid$UNIX2003', '_setrlimit$UNIX2003', '_shmctl$UNIX2003',
2043 _sigaltstack, '_sigsuspend$NOCANCEL$UNIX2003', '_sigsuspend$UNIX2003',
2044 '_socketpair$UNIX2003', _task_wire, _vm_map_64, _vm_map_exec_lockdown,
2045 _vm_mapped_pages_info, _vm_region, _vm_region_recurse, '_waitid$NOCANCEL$UNIX2003',
2046 '_waitid$UNIX2003', '_write$NOCANCEL$UNIX2003', '_write$UNIX2003',
2047 '_writev$NOCANCEL$UNIX2003', '_writev$UNIX2003', tramp_cerror,
2048 tramp_cerror_nocancel ]
2049 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst ]
2050 symbols: [ '_fstat$INODE64', '_fstatat$INODE64', '_fstatfs$INODE64', 2081 symbols: [ '_fstat$INODE64', '_fstatat$INODE64', '_fstatfs$INODE64',
2051 '_getfsstat$INODE64', _i386_get_ldt, _i386_set_ldt, '_lstat$INODE64', 2082 '_getfsstat$INODE64', _i386_get_ldt, _i386_set_ldt, '_lstat$INODE64',
2052 '_stat$INODE64', '_statfs$INODE64' ]2083 '_pselect$1050', '_select$1050', '_stat$INODE64', '_statfs$INODE64' ]
2053 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 2084 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2054 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2085 arm64e-macos, arm64e-maccatalyst ]
2055 symbols: [ _NDR_record, _____sigwait_nocancel, ____kernelVersionNumber, 2086 symbols: [ _NDR_record, _____sigwait_nocancel, ____kernelVersionNumber,
2056 ____kernelVersionString, ___abort_with_payload, ___accept, 2087 ____kernelVersionString, ___abort_with_payload, ___accept,
2057 ___accept_nocancel, ___access_extended, ___aio_suspend_nocancel, 2088 ___accept_nocancel, ___access_extended, ___aio_suspend_nocancel,
...@@ -2150,6 +2181,7 @@ exports:...@@ -2150,6 +2181,7 @@ exports:
2150 __kernelrpc_mach_port_special_reply_port_reset_link, __kernelrpc_mach_port_swap_guard, 2181 __kernelrpc_mach_port_special_reply_port_reset_link, __kernelrpc_mach_port_swap_guard,
2151 __kernelrpc_mach_port_type, __kernelrpc_mach_port_type_trap, 2182 __kernelrpc_mach_port_type, __kernelrpc_mach_port_type_trap,
2152 __kernelrpc_mach_port_unguard, __kernelrpc_mach_port_unguard_trap, 2183 __kernelrpc_mach_port_unguard, __kernelrpc_mach_port_unguard_trap,
2184 __kernelrpc_mach_ports_lookup3, __kernelrpc_mach_ports_register3,
2153 __kernelrpc_mach_task_is_self, __kernelrpc_mach_vm_allocate, 2185 __kernelrpc_mach_task_is_self, __kernelrpc_mach_vm_allocate,
2154 __kernelrpc_mach_vm_allocate_trap, __kernelrpc_mach_vm_deallocate, 2186 __kernelrpc_mach_vm_allocate_trap, __kernelrpc_mach_vm_deallocate,
2155 __kernelrpc_mach_vm_deallocate_trap, __kernelrpc_mach_vm_map, 2187 __kernelrpc_mach_vm_deallocate_trap, __kernelrpc_mach_vm_map,
...@@ -2164,43 +2196,52 @@ exports:...@@ -2164,43 +2196,52 @@ exports:
2164 __mach_errors, __mach_fork_child, __mach_snprintf, __mach_vsnprintf, 2196 __mach_errors, __mach_fork_child, __mach_snprintf, __mach_vsnprintf,
2165 __os_alloc_once_table, __os_xbs_chrooted, __register_gethostuuid_callback, 2197 __os_alloc_once_table, __os_xbs_chrooted, __register_gethostuuid_callback,
2166 __thread_set_tsd_base, _abort_with_payload, _abort_with_reason, 2198 __thread_set_tsd_base, _abort_with_payload, _abort_with_reason,
2167 _accept, _access, _accessx_np, _acct, _act_get_state, _act_set_state, 2199 _accept, '_accept$NOCANCEL', _access, _accessx_np, _acct,
2168 _adjtime, _aio_cancel, _aio_error, _aio_fsync, _aio_read, 2200 _act_get_state, _act_set_state, _adjtime, _aio_cancel, _aio_error,
2169 _aio_return, _aio_suspend, _aio_write, _audit, _audit_session_join, 2201 _aio_fsync, _aio_read, _aio_return, _aio_suspend, '_aio_suspend$NOCANCEL',
2170 _audit_session_port, _audit_session_self, _auditctl, _auditon, 2202 _aio_write, _audit, _audit_session_join, _audit_session_port,
2171 _bind, _bootstrap_port, _cerror, _cerror_nocancel, _change_fdguard_np, 2203 _audit_session_self, _auditctl, _auditon, _bind, _bootstrap_port,
2172 _chdir, _chflags, _chmod, _chown, _chroot, _clock_alarm, _clock_alarm_reply, 2204 _cerror, _cerror_nocancel, _change_fdguard_np, _chdir, _chflags,
2205 _chmod, _chown, _chroot, _clock_alarm, _clock_alarm_reply,
2173 _clock_get_attributes, _clock_get_time, _clock_set_attributes, 2206 _clock_get_attributes, _clock_get_time, _clock_set_attributes,
2174 _clock_set_time, _clock_sleep, _clock_sleep_trap, _clonefile, 2207 _clock_set_time, _clock_sleep, _clock_sleep_trap, _clonefile,
2175 _clonefileat, _close, _coalition_create, _coalition_info_debug_info, 2208 _clonefileat, _close, '_close$NOCANCEL', _coalition_create,
2176 _coalition_info_resource_usage, _coalition_info_set_efficiency, 2209 _coalition_info_debug_info, _coalition_info_resource_usage,
2177 _coalition_info_set_name, _coalition_ledger_set_logical_writes_limit, 2210 _coalition_info_set_efficiency, _coalition_info_set_name,
2178 _coalition_reap, _coalition_terminate, _connect, _connectx, 2211 _coalition_ledger_set_logical_writes_limit, _coalition_policy_get,
2179 _csops, _csops_audittoken, _csr_check, _csr_get_active_config, 2212 _coalition_policy_set, _coalition_reap, _coalition_terminate,
2180 _debug_control_port_for_pid, _debug_syscall_reject, _debug_syscall_reject_config, 2213 _connect, '_connect$NOCANCEL', _connectx, _csops, _csops_audittoken,
2181 _denap_boost_assertion_token, _disconnectx, _dup, _dup2, _errno, 2214 _csr_check, _csr_get_active_config, _debug_control_port_for_pid,
2182 _etap_trace_thread, _exc_server, _exc_server_routine, _exception_raise, 2215 _debug_syscall_reject, _debug_syscall_reject_config, _denap_boost_assertion_token,
2183 _exception_raise_state, _exception_raise_state_identity, _exchangedata, 2216 _disconnectx, _dup, _dup2, _errno, _etap_trace_thread, _exc_server,
2184 _exclaves_boot, _exclaves_endpoint_call, _exclaves_named_buffer_copyin, 2217 _exc_server_routine, _exception_raise, _exception_raise_state,
2218 _exception_raise_state_identity, _exchangedata, _exclaves_audio_buffer_copyout,
2219 _exclaves_audio_buffer_create, _exclaves_boot, _exclaves_endpoint_call,
2220 _exclaves_inbound_buffer_copyin, _exclaves_inbound_buffer_create,
2221 _exclaves_launch_conclave, _exclaves_lookup_service, _exclaves_named_buffer_copyin,
2185 _exclaves_named_buffer_copyout, _exclaves_named_buffer_create, 2222 _exclaves_named_buffer_copyout, _exclaves_named_buffer_create,
2223 _exclaves_notification_create, _exclaves_outbound_buffer_copyout,
2224 _exclaves_outbound_buffer_create, _exclaves_sensor_create,
2225 _exclaves_sensor_start, _exclaves_sensor_status, _exclaves_sensor_stop,
2186 _execve, _faccessat, _fchdir, _fchflags, _fchmod, _fchmodat, 2226 _execve, _faccessat, _fchdir, _fchflags, _fchmod, _fchmodat,
2187 _fchown, _fchownat, _fclonefileat, _fcntl, _fdatasync, _ffsctl, 2227 _fchown, _fchownat, _fclonefileat, _fcntl, '_fcntl$NOCANCEL',
2188 _fgetattrlist, _fgetxattr, _fhopen, _fileport_makefd, _fileport_makeport, 2228 _fdatasync, _ffsctl, _fgetattrlist, _fgetxattr, _fhopen, _fileport_makefd,
2189 _flistxattr, _flock, _fmount, _fpathconf, _freadlink, _fremovexattr, 2229 _fileport_makeport, _flistxattr, _flock, _fmount, _fpathconf,
2190 _fs_snapshot_create, _fs_snapshot_delete, _fs_snapshot_list, 2230 _freadlink, _fremovexattr, _fs_snapshot_create, _fs_snapshot_delete,
2191 _fs_snapshot_mount, _fs_snapshot_rename, _fs_snapshot_revert, 2231 _fs_snapshot_list, _fs_snapshot_mount, _fs_snapshot_rename,
2192 _fs_snapshot_root, _fsctl, _fsetattrlist, _fsetxattr, _fsgetpath, 2232 _fs_snapshot_revert, _fs_snapshot_root, _fsctl, _fsetattrlist,
2193 _fsgetpath_ext, _fstat, _fstat64, _fstatat, _fstatat64, _fstatfs, 2233 _fsetxattr, _fsgetpath, _fsgetpath_ext, _fstat, _fstat64,
2194 _fstatfs64, _fsync, _ftruncate, _futimens, _futimes, _getattrlist, 2234 _fstatat, _fstatat64, _fstatfs, _fstatfs64, _fsync, '_fsync$NOCANCEL',
2195 _getattrlistat, _getattrlistbulk, _getaudit, _getaudit_addr, 2235 _ftruncate, _futimens, _futimes, _getattrlist, _getattrlistat,
2196 _getauid, _getdirentries, _getdirentriesattr, _getdtablesize, 2236 _getattrlistbulk, _getaudit, _getaudit_addr, _getauid, _getdirentries,
2197 _getegid, _getentropy, _geteuid, _getfh, _getfsstat, _getfsstat64, 2237 _getdirentriesattr, _getdtablesize, _getegid, _getentropy,
2198 _getgid, _getgroups, _gethostuuid, _getiopolicy_np, _getitimer, 2238 _geteuid, _getfh, _getfsstat, _getfsstat64, _getgid, _getgroups,
2199 _getpeername, _getpgid, _getpgrp, _getpid, _getppid, _getpriority, 2239 _gethostuuid, _getiopolicy_np, _getitimer, _getpeername, _getpgid,
2200 _getrlimit, _getrusage, _getsgroups_np, _getsid, _getsockname, 2240 _getpgrp, _getpid, _getppid, _getpriority, _getrlimit, _getrusage,
2201 _getsockopt, _getuid, _getwgroups_np, _getxattr, _grab_pgo_data, 2241 _getsgroups_np, _getsid, _getsockname, _getsockopt, _getuid,
2202 _graftdmg, _guarded_close_np, _guarded_kqueue_np, _guarded_open_dprotected_np, 2242 _getwgroups_np, _getxattr, _grab_pgo_data, _graftdmg, _guarded_close_np,
2203 _guarded_open_np, _guarded_pwrite_np, _guarded_write_np, _guarded_writev_np, 2243 _guarded_kqueue_np, _guarded_open_dprotected_np, _guarded_open_np,
2244 _guarded_pwrite_np, _guarded_write_np, _guarded_writev_np,
2204 _host_check_multiuser_mode, _host_create_mach_voucher, _host_create_mach_voucher_trap, 2245 _host_check_multiuser_mode, _host_create_mach_voucher, _host_create_mach_voucher_trap,
2205 _host_default_memory_manager, _host_get_UNDServer, _host_get_atm_diagnostic_flag, 2246 _host_default_memory_manager, _host_get_UNDServer, _host_get_atm_diagnostic_flag,
2206 _host_get_boot_info, _host_get_clock_control, _host_get_clock_service, 2247 _host_get_boot_info, _host_get_clock_control, _host_get_clock_service,
...@@ -2237,11 +2278,11 @@ exports:...@@ -2237,11 +2278,11 @@ exports:
2237 _mach_init, _mach_make_memory_entry, _mach_make_memory_entry_64, 2278 _mach_init, _mach_make_memory_entry, _mach_make_memory_entry_64,
2238 _mach_memory_entry_access_tracking, _mach_memory_entry_ownership, 2279 _mach_memory_entry_access_tracking, _mach_memory_entry_ownership,
2239 _mach_memory_entry_purgable_control, _mach_memory_info, _mach_memory_object_memory_entry, 2280 _mach_memory_entry_purgable_control, _mach_memory_info, _mach_memory_object_memory_entry,
2240 _mach_memory_object_memory_entry_64, _mach_msg, _mach_msg_destroy, 2281 _mach_memory_object_memory_entry_64, _mach_msg, _mach_msg2_internal,
2241 _mach_msg_overwrite, _mach_msg_overwrite_trap, _mach_msg_priority_encode, 2282 _mach_msg2_trap, _mach_msg_destroy, _mach_msg_overwrite, _mach_msg_overwrite_trap,
2242 _mach_msg_priority_is_pthread_priority, _mach_msg_priority_overide_qos, 2283 _mach_msg_priority_encode, _mach_msg_priority_is_pthread_priority,
2243 _mach_msg_priority_qos, _mach_msg_priority_relpri, _mach_msg_receive, 2284 _mach_msg_priority_overide_qos, _mach_msg_priority_qos, _mach_msg_priority_relpri,
2244 _mach_msg_send, _mach_msg_server, _mach_msg_server_importance, 2285 _mach_msg_receive, _mach_msg_send, _mach_msg_server, _mach_msg_server_importance,
2245 _mach_msg_server_once, _mach_msg_trap, _mach_notify_dead_name, 2286 _mach_msg_server_once, _mach_msg_trap, _mach_notify_dead_name,
2246 _mach_notify_no_senders, _mach_notify_port_deleted, _mach_notify_port_destroyed, 2287 _mach_notify_no_senders, _mach_notify_port_deleted, _mach_notify_port_destroyed,
2247 _mach_notify_send_once, _mach_port_allocate, _mach_port_allocate_full, 2288 _mach_notify_send_once, _mach_port_allocate, _mach_port_allocate_full,
...@@ -2273,6 +2314,10 @@ exports:...@@ -2273,6 +2314,10 @@ exports:
2273 _mach_vm_msync, _mach_vm_page_info, _mach_vm_page_query, _mach_vm_page_range_query, 2314 _mach_vm_msync, _mach_vm_page_info, _mach_vm_page_query, _mach_vm_page_range_query,
2274 _mach_vm_protect, _mach_vm_purgable_control, _mach_vm_range_create, 2315 _mach_vm_protect, _mach_vm_purgable_control, _mach_vm_range_create,
2275 _mach_vm_read, _mach_vm_read_list, _mach_vm_read_overwrite, 2316 _mach_vm_read, _mach_vm_read_list, _mach_vm_read_overwrite,
2317 _mach_vm_reclaim_is_available, _mach_vm_reclaim_is_reclaimed,
2318 _mach_vm_reclaim_mark_free, _mach_vm_reclaim_mark_free_with_id,
2319 _mach_vm_reclaim_mark_used, _mach_vm_reclaim_ringbuffer_init,
2320 _mach_vm_reclaim_synchronize, _mach_vm_reclaim_update_kernel_accounting,
2276 _mach_vm_region, _mach_vm_region_recurse, _mach_vm_remap, 2321 _mach_vm_region, _mach_vm_region_recurse, _mach_vm_remap,
2277 _mach_vm_remap_new, _mach_vm_wire, _mach_vm_write, _mach_voucher_attr_command, 2322 _mach_vm_remap_new, _mach_vm_wire, _mach_vm_write, _mach_voucher_attr_command,
2278 _mach_voucher_deallocate, _mach_voucher_debug_info, _mach_voucher_extract_all_attr_recipes, 2323 _mach_voucher_deallocate, _mach_voucher_debug_info, _mach_voucher_extract_all_attr_recipes,
...@@ -2289,21 +2334,22 @@ exports:...@@ -2289,21 +2334,22 @@ exports:
2289 _mk_timer_arm, _mk_timer_arm_leeway, _mk_timer_cancel, _mk_timer_create, 2334 _mk_timer_arm, _mk_timer_arm_leeway, _mk_timer_cancel, _mk_timer_create,
2290 _mk_timer_destroy, _mkdir, _mkdirat, _mkfifo, _mkfifoat, _mknod, 2335 _mk_timer_destroy, _mkdir, _mkdirat, _mkfifo, _mkfifoat, _mknod,
2291 _mknodat, _mlock, _mlockall, _mmap, _mount, _mprotect, _mremap_encrypted, 2336 _mknodat, _mlock, _mlockall, _mmap, _mount, _mprotect, _mremap_encrypted,
2292 _msg_receive, _msg_rpc, _msg_send, _msgget, _msgrcv, _msgsnd, 2337 _msg_receive, _msg_rpc, _msg_send, _msgctl, _msgget, _msgrcv,
2293 _msgsys, _msync, _munlock, _munlockall, _munmap, _necp_client_action, 2338 '_msgrcv$NOCANCEL', _msgsnd, '_msgsnd$NOCANCEL', _msgsys,
2294 _necp_match_policy, _necp_open, _necp_session_action, _necp_session_open, 2339 _msync, '_msync$NOCANCEL', _munlock, _munlockall, _munmap,
2295 _net_qos_guideline, _netagent_trigger, _netname_check_in, 2340 _necp_client_action, _necp_match_policy, _necp_open, _necp_session_action,
2296 _netname_check_out, _netname_look_up, _netname_version, _nfsclnt, 2341 _necp_session_open, _net_qos_guideline, _netagent_trigger,
2297 _nfssvc, _non_boost_assertion_token, _normal_boost_assertion_token, 2342 _netname_check_in, _netname_check_out, _netname_look_up, _netname_version,
2343 _nfsclnt, _nfssvc, _non_boost_assertion_token, _normal_boost_assertion_token,
2298 _ntp_adjtime, _ntp_gettime, _objc_bp_assist_cfg_np, _open, 2344 _ntp_adjtime, _ntp_gettime, _objc_bp_assist_cfg_np, _open,
2299 _open_dprotected_np, _openat, '_openat$NOCANCEL', _openat_authenticated_np, 2345 '_open$NOCANCEL', _open_dprotected_np, _openat, '_openat$NOCANCEL',
2300 _openat_dprotected_np, _openbyid_np, _os_buflet_get_data_address, 2346 _openat_authenticated_np, _openat_dprotected_np, _openbyid_np,
2301 _os_buflet_get_data_length, _os_buflet_get_data_limit, _os_buflet_get_data_offset, 2347 _os_buflet_get_data_address, _os_buflet_get_data_length, _os_buflet_get_data_limit,
2302 _os_buflet_get_object_address, _os_buflet_get_object_limit, 2348 _os_buflet_get_data_offset, _os_buflet_get_object_address,
2303 _os_buflet_set_data_length, _os_buflet_set_data_offset, _os_channel_advance_slot, 2349 _os_buflet_get_object_limit, _os_buflet_set_data_length, _os_buflet_set_data_offset,
2304 _os_channel_attr_clone, _os_channel_attr_create, _os_channel_attr_destroy, 2350 _os_channel_advance_slot, _os_channel_attr_clone, _os_channel_attr_create,
2305 _os_channel_attr_get, _os_channel_attr_get_key, _os_channel_attr_set, 2351 _os_channel_attr_destroy, _os_channel_attr_get, _os_channel_attr_get_key,
2306 _os_channel_attr_set_key, _os_channel_available_slot_count, 2352 _os_channel_attr_set, _os_channel_attr_set_key, _os_channel_available_slot_count,
2307 _os_channel_buflet_alloc, _os_channel_buflet_free, _os_channel_configure_interface_advisory, 2353 _os_channel_buflet_alloc, _os_channel_buflet_free, _os_channel_configure_interface_advisory,
2308 _os_channel_create, _os_channel_create_extended, _os_channel_destroy, 2354 _os_channel_create, _os_channel_create_extended, _os_channel_destroy,
2309 _os_channel_event_free, _os_channel_event_get_event_data, 2355 _os_channel_event_free, _os_channel_event_get_event_data,
...@@ -2359,8 +2405,8 @@ exports:...@@ -2359,8 +2405,8 @@ exports:
2359 _pathconf, _peeloff, _pid_for_task, _pid_hibernate, _pid_resume, 2405 _pathconf, _peeloff, _pid_for_task, _pid_hibernate, _pid_resume,
2360 _pid_shutdown_networking, _pid_shutdown_sockets, _pid_suspend, 2406 _pid_shutdown_networking, _pid_shutdown_sockets, _pid_suspend,
2361 _pipe, _pivot_root, _pkt_subtype_assert_fail, _pkt_type_assert_fail, 2407 _pipe, _pivot_root, _pkt_subtype_assert_fail, _pkt_type_assert_fail,
2362 _poll, _port_obj_init, _port_obj_table, _port_obj_table_size, 2408 _poll, '_poll$NOCANCEL', _port_obj_init, _port_obj_table,
2363 _posix_madvise, _posix_spawn, _posix_spawn_file_actions_add_fileportdup2_np, 2409 _port_obj_table_size, _posix_madvise, _posix_spawn, _posix_spawn_file_actions_add_fileportdup2_np,
2364 _posix_spawn_file_actions_addchdir_np, _posix_spawn_file_actions_addclose, 2410 _posix_spawn_file_actions_addchdir_np, _posix_spawn_file_actions_addclose,
2365 _posix_spawn_file_actions_adddup2, _posix_spawn_file_actions_addfchdir_np, 2411 _posix_spawn_file_actions_adddup2, _posix_spawn_file_actions_addfchdir_np,
2366 _posix_spawn_file_actions_addinherit_np, _posix_spawn_file_actions_addopen, 2412 _posix_spawn_file_actions_addinherit_np, _posix_spawn_file_actions_addopen,
...@@ -2378,14 +2424,15 @@ exports:...@@ -2378,14 +2424,15 @@ exports:
2378 _posix_spawnattr_set_csm_np, _posix_spawnattr_set_darwin_role_np, 2424 _posix_spawnattr_set_csm_np, _posix_spawnattr_set_darwin_role_np,
2379 _posix_spawnattr_set_filedesclimit_ext, _posix_spawnattr_set_gid_np, 2425 _posix_spawnattr_set_filedesclimit_ext, _posix_spawnattr_set_gid_np,
2380 _posix_spawnattr_set_groups_np, _posix_spawnattr_set_importancewatch_port_np, 2426 _posix_spawnattr_set_groups_np, _posix_spawnattr_set_importancewatch_port_np,
2381 _posix_spawnattr_set_jetsam_ttr_np, _posix_spawnattr_set_launch_type_np, 2427 _posix_spawnattr_set_jetsam_ttr_np, _posix_spawnattr_set_kqworklooplimit_ext,
2382 _posix_spawnattr_set_login_np, _posix_spawnattr_set_max_addr_np, 2428 _posix_spawnattr_set_launch_type_np, _posix_spawnattr_set_login_np,
2383 _posix_spawnattr_set_persona_gid_np, _posix_spawnattr_set_persona_groups_np, 2429 _posix_spawnattr_set_max_addr_np, _posix_spawnattr_set_persona_gid_np,
2384 _posix_spawnattr_set_persona_np, _posix_spawnattr_set_persona_uid_np, 2430 _posix_spawnattr_set_persona_groups_np, _posix_spawnattr_set_persona_np,
2385 _posix_spawnattr_set_platform_np, _posix_spawnattr_set_portlimits_ext, 2431 _posix_spawnattr_set_persona_uid_np, _posix_spawnattr_set_platform_np,
2386 _posix_spawnattr_set_ptrauth_task_port_np, _posix_spawnattr_set_qos_clamp_np, 2432 _posix_spawnattr_set_portlimits_ext, _posix_spawnattr_set_ptrauth_task_port_np,
2387 _posix_spawnattr_set_registered_ports_np, _posix_spawnattr_set_subsystem_root_path_np, 2433 _posix_spawnattr_set_qos_clamp_np, _posix_spawnattr_set_registered_ports_np,
2388 _posix_spawnattr_set_threadlimit_ext, _posix_spawnattr_set_uid_np, 2434 _posix_spawnattr_set_subsystem_root_path_np, _posix_spawnattr_set_threadlimit_ext,
2435 _posix_spawnattr_set_uid_np, _posix_spawnattr_set_use_sec_transition_shims_np,
2389 _posix_spawnattr_setarchpref_np, _posix_spawnattr_setauditsessionport_np, 2436 _posix_spawnattr_setarchpref_np, _posix_spawnattr_setauditsessionport_np,
2390 _posix_spawnattr_setbinpref_np, _posix_spawnattr_setcoalition_np, 2437 _posix_spawnattr_setbinpref_np, _posix_spawnattr_setcoalition_np,
2391 _posix_spawnattr_setcpumonitor, _posix_spawnattr_setcpumonitor_default, 2438 _posix_spawnattr_setcpumonitor, _posix_spawnattr_setcpumonitor_default,
...@@ -2395,7 +2442,7 @@ exports:...@@ -2395,7 +2442,7 @@ exports:
2395 _posix_spawnattr_setpcontrol_np, _posix_spawnattr_setpgroup, 2442 _posix_spawnattr_setpcontrol_np, _posix_spawnattr_setpgroup,
2396 _posix_spawnattr_setprocesstype_np, _posix_spawnattr_setsigdefault, 2443 _posix_spawnattr_setprocesstype_np, _posix_spawnattr_setsigdefault,
2397 _posix_spawnattr_setsigmask, _posix_spawnattr_setspecialport_np, 2444 _posix_spawnattr_setsigmask, _posix_spawnattr_setspecialport_np,
2398 _pread, _preadv, '_preadv$NOCANCEL', _proc_clear_cpulimits, 2445 _pread, '_pread$NOCANCEL', _preadv, '_preadv$NOCANCEL', _proc_clear_cpulimits,
2399 _proc_clear_delayidlesleep, _proc_clear_dirty, _proc_clear_vmpressure, 2446 _proc_clear_delayidlesleep, _proc_clear_dirty, _proc_clear_vmpressure,
2400 _proc_current_thread_schedinfo, _proc_denap_assertion_begin_with_msg, 2447 _proc_current_thread_schedinfo, _proc_denap_assertion_begin_with_msg,
2401 _proc_denap_assertion_complete, _proc_disable_apptype, _proc_disable_cpumon, 2448 _proc_denap_assertion_complete, _proc_disable_apptype, _proc_disable_cpumon,
...@@ -2414,39 +2461,44 @@ exports:...@@ -2414,39 +2461,44 @@ exports:
2414 _proc_set_no_smt, _proc_set_owner_vmpressure, _proc_set_wakemon_defaults, 2461 _proc_set_no_smt, _proc_set_owner_vmpressure, _proc_set_wakemon_defaults,
2415 _proc_set_wakemon_params, _proc_setcpu_percentage, _proc_setpcontrol, 2462 _proc_set_wakemon_params, _proc_setcpu_percentage, _proc_setpcontrol,
2416 _proc_setthread_cpupercent, _proc_setthread_csm, _proc_setthread_no_smt, 2463 _proc_setthread_cpupercent, _proc_setthread_csm, _proc_setthread_no_smt,
2417 _proc_suppress, _proc_terminate, _proc_terminate_all_rsr, 2464 _proc_signal_delegate, _proc_signal_with_audittoken, _proc_suppress,
2418 _proc_trace_log, _proc_track_dirty, _proc_udata_info, _proc_uuid_policy, 2465 _proc_terminate, _proc_terminate_all_rsr, _proc_terminate_delegate,
2419 _processor_assign, _processor_control, _processor_exit, _processor_get_assignment, 2466 _proc_terminate_with_audittoken, _proc_trace_log, _proc_track_dirty,
2420 _processor_info, _processor_set_create, _processor_set_default, 2467 _proc_udata_info, _proc_uuid_policy, _processor_assign, _processor_control,
2421 _processor_set_destroy, _processor_set_info, _processor_set_max_priority, 2468 _processor_exit, _processor_get_assignment, _processor_info,
2422 _processor_set_policy_control, _processor_set_policy_disable, 2469 _processor_set_create, _processor_set_default, _processor_set_destroy,
2423 _processor_set_policy_enable, _processor_set_stack_usage, 2470 _processor_set_info, _processor_set_max_priority, _processor_set_policy_control,
2424 _processor_set_statistics, _processor_set_tasks, _processor_set_tasks_with_flavor, 2471 _processor_set_policy_disable, _processor_set_policy_enable,
2425 _processor_set_threads, _processor_start, _pselect, '_pselect$DARWIN_EXTSN', 2472 _processor_set_stack_usage, _processor_set_statistics, _processor_set_tasks,
2426 '_pselect$DARWIN_EXTSN$NOCANCEL', _pthread_getugid_np, _pthread_setugid_np, 2473 _processor_set_tasks_with_flavor, _processor_set_threads,
2427 _ptrace, _pwrite, _pwritev, '_pwritev$NOCANCEL', _quota, _quotactl, 2474 _processor_start, _pselect, '_pselect$DARWIN_EXTSN', '_pselect$DARWIN_EXTSN$NOCANCEL',
2428 _read, _readlink, _readlinkat, _readv, _reboot, _reboot_np, 2475 '_pselect$NOCANCEL', _pthread_getugid_np, _pthread_setugid_np,
2429 _record_system_event_as_kernel, _recvfrom, _recvmsg, _recvmsg_x, 2476 _ptrace, _pwrite, '_pwrite$NOCANCEL', _pwritev, '_pwritev$NOCANCEL',
2430 _register_uexc_handler, _removexattr, _rename, _rename_ext, 2477 _quota, _quotactl, _read, '_read$NOCANCEL', _readlink, _readlinkat,
2431 _renameat, _renameatx_np, _renamex_np, _revoke, _rmdir, _searchfs, 2478 _readv, '_readv$NOCANCEL', _reboot, _reboot_np, _record_system_event_as_kernel,
2432 _select, '_select$DARWIN_EXTSN', '_select$DARWIN_EXTSN$NOCANCEL', 2479 _recvfrom, '_recvfrom$NOCANCEL', _recvmsg, '_recvmsg$NOCANCEL',
2433 _sem_close, _sem_destroy, _sem_getvalue, _sem_init, _sem_open, 2480 _recvmsg_x, _register_uexc_handler, _removexattr, _rename,
2434 _sem_post, _sem_trywait, _sem_unlink, _sem_wait, _semaphore_create, 2481 _rename_ext, _renameat, _renameatx_np, _renamex_np, _revoke,
2435 _semaphore_destroy, _semaphore_signal, _semaphore_signal_all, 2482 _rmdir, _searchfs, _select, '_select$DARWIN_EXTSN', '_select$DARWIN_EXTSN$NOCANCEL',
2436 _semaphore_signal_all_trap, _semaphore_signal_thread, _semaphore_signal_thread_trap, 2483 '_select$NOCANCEL', _sem_close, _sem_destroy, _sem_getvalue,
2437 _semaphore_signal_trap, _semaphore_timedwait, _semaphore_timedwait_signal, 2484 _sem_init, _sem_open, _sem_post, _sem_trywait, _sem_unlink,
2438 _semaphore_timedwait_signal_trap, _semaphore_timedwait_trap, 2485 _sem_wait, '_sem_wait$NOCANCEL', _semaphore_create, _semaphore_destroy,
2439 _semaphore_wait, _semaphore_wait_signal, _semaphore_wait_signal_trap, 2486 _semaphore_signal, _semaphore_signal_all, _semaphore_signal_all_trap,
2440 _semaphore_wait_trap, _semget, _semop, _semsys, _sendfile, 2487 _semaphore_signal_thread, _semaphore_signal_thread_trap, _semaphore_signal_trap,
2441 _sendmsg, _sendmsg_x, _sendto, _setattrlist, _setattrlistat, 2488 _semaphore_timedwait, _semaphore_timedwait_signal, _semaphore_timedwait_signal_trap,
2489 _semaphore_timedwait_trap, _semaphore_wait, _semaphore_wait_signal,
2490 _semaphore_wait_signal_trap, _semaphore_wait_trap, _semctl,
2491 _semget, _semop, _semsys, _sendfile, _sendmsg, '_sendmsg$NOCANCEL',
2492 _sendmsg_x, _sendto, '_sendto$NOCANCEL', _setattrlist, _setattrlistat,
2442 _setaudit, _setaudit_addr, _setauid, _setegid, _seteuid, _setgid, 2493 _setaudit, _setaudit_addr, _setauid, _setegid, _seteuid, _setgid,
2443 _setgroups, _setiopolicy_np, _setitimer, _setpgid, _setpriority, 2494 _setgroups, _setiopolicy_np, _setitimer, _setpgid, _setpriority,
2444 _setprivexec, _setquota, _setrlimit, _setsgroups_np, _setsid, 2495 _setprivexec, _setquota, _setregid, _setreuid, _setrlimit,
2445 _setsockopt, _setuid, _setwgroups_np, _setxattr, _sfi_get_class_offtime, 2496 _setsgroups_np, _setsid, _setsockopt, _setuid, _setwgroups_np,
2446 _sfi_process_get_flags, _sfi_process_set_flags, _sfi_set_class_offtime, 2497 _setxattr, _sfi_get_class_offtime, _sfi_process_get_flags,
2447 _shm_open, _shm_unlink, _shmat, _shmdt, _shmget, _shmsys, 2498 _sfi_process_set_flags, _sfi_set_class_offtime, _shm_open,
2448 _shutdown, _sigpending, _sigprocmask, _sigsuspend, _socket, 2499 _shm_unlink, _shmat, _shmctl, _shmdt, _shmget, _shmsys, _shutdown,
2449 _socket_delegate, _socketpair, _stackshot_capture_with_config, 2500 _sigpending, _sigprocmask, _sigsuspend, '_sigsuspend$NOCANCEL',
2501 _socket, _socket_delegate, _socketpair, _stackshot_capture_with_config,
2450 _stackshot_config_create, _stackshot_config_dealloc, _stackshot_config_dealloc_buffer, 2502 _stackshot_config_create, _stackshot_config_dealloc, _stackshot_config_dealloc_buffer,
2451 _stackshot_config_get_stackshot_buffer, _stackshot_config_get_stackshot_size, 2503 _stackshot_config_get_stackshot_buffer, _stackshot_config_get_stackshot_size,
2452 _stackshot_config_set_delta_timestamp, _stackshot_config_set_flags, 2504 _stackshot_config_set_delta_timestamp, _stackshot_config_set_flags,
...@@ -2454,12 +2506,12 @@ exports:...@@ -2454,12 +2506,12 @@ exports:
2454 _stackshot_config_set_size_hint, _stat, _stat64, _statfs, 2506 _stackshot_config_set_size_hint, _stat, _stat64, _statfs,
2455 _statfs64, _swapon, _swtch, _swtch_pri, _symlink, _symlinkat, 2507 _statfs64, _swapon, _swtch, _swtch_pri, _symlink, _symlinkat,
2456 _sync, _syscall, _syscall_thread_switch, _system_get_sfi_window, 2508 _sync, _syscall, _syscall_thread_switch, _system_get_sfi_window,
2457 _system_override, _system_set_sfi_window, _task_assign, _task_assign_default, 2509 _system_override, _system_set_sfi_window, _system_version_compat_mode,
2458 _task_create, _task_create_identity_token, _task_dyld_process_info_notify_deregister, 2510 _task_assign, _task_assign_default, _task_create, _task_create_identity_token,
2459 _task_dyld_process_info_notify_get, _task_dyld_process_info_notify_register, 2511 _task_dyld_process_info_notify_deregister, _task_dyld_process_info_notify_get,
2460 _task_for_pid, _task_generate_corpse, _task_get_assignment, 2512 _task_dyld_process_info_notify_register, _task_for_pid, _task_generate_corpse,
2461 _task_get_dyld_image_infos, _task_get_emulation_vector, _task_get_exc_guard_behavior, 2513 _task_get_assignment, _task_get_dyld_image_infos, _task_get_emulation_vector,
2462 _task_get_exception_ports, _task_get_exception_ports_info, 2514 _task_get_exc_guard_behavior, _task_get_exception_ports, _task_get_exception_ports_info,
2463 _task_get_mach_voucher, _task_get_special_port, _task_get_state, 2515 _task_get_mach_voucher, _task_get_special_port, _task_get_state,
2464 _task_identity_token_get_task_port, _task_info, _task_inspect, 2516 _task_identity_token_get_task_port, _task_info, _task_inspect,
2465 _task_inspect_for_pid, _task_map_corpse_info, _task_map_corpse_info_64, 2517 _task_inspect_for_pid, _task_map_corpse_info, _task_map_corpse_info_64,
...@@ -2467,20 +2519,22 @@ exports:...@@ -2467,20 +2519,22 @@ exports:
2467 _task_policy_get, _task_policy_set, _task_purgable_info, _task_read_for_pid, 2519 _task_policy_get, _task_policy_set, _task_purgable_info, _task_read_for_pid,
2468 _task_register_dyld_get_process_state, _task_register_dyld_image_infos, 2520 _task_register_dyld_get_process_state, _task_register_dyld_image_infos,
2469 _task_register_dyld_set_dyld_state, _task_register_dyld_shared_cache_image_info, 2521 _task_register_dyld_set_dyld_state, _task_register_dyld_shared_cache_image_info,
2470 _task_restartable_ranges_register, _task_restartable_ranges_synchronize, 2522 _task_register_hardened_exception_handler, _task_restartable_ranges_register,
2471 _task_resume, _task_resume2, _task_sample, _task_self_, _task_self_trap, 2523 _task_restartable_ranges_synchronize, _task_resume, _task_resume2,
2472 _task_set_corpse_forking_behavior, _task_set_emulation, _task_set_emulation_vector, 2524 _task_sample, _task_self_, _task_self_trap, _task_set_corpse_forking_behavior,
2473 _task_set_exc_guard_behavior, _task_set_exception_ports, _task_set_info, 2525 _task_set_emulation, _task_set_emulation_vector, _task_set_exc_guard_behavior,
2474 _task_set_mach_voucher, _task_set_phys_footprint_limit, _task_set_policy, 2526 _task_set_exception_ports, _task_set_info, _task_set_mach_voucher,
2475 _task_set_port_space, _task_set_ras_pc, _task_set_special_port, 2527 _task_set_phys_footprint_limit, _task_set_policy, _task_set_port_space,
2476 _task_set_state, _task_suspend, _task_suspend2, _task_swap_exception_ports, 2528 _task_set_ras_pc, _task_set_special_port, _task_set_state,
2529 _task_suspend, _task_suspend2, _task_swap_exception_ports,
2477 _task_swap_mach_voucher, _task_terminate, _task_test_async_upcall_propagation, 2530 _task_swap_mach_voucher, _task_terminate, _task_test_async_upcall_propagation,
2478 _task_test_sync_upcall, _task_threads, _task_unregister_dyld_image_infos, 2531 _task_test_sync_upcall, _task_threads, _task_unregister_dyld_image_infos,
2479 _task_zone_info, _terminate_with_payload, _terminate_with_reason, 2532 _task_zone_info, _terminate_with_payload, _terminate_with_reason,
2480 _thread_abort, _thread_abort_safely, _thread_assign, _thread_assign_default, 2533 _thread_abort, _thread_abort_safely, _thread_adopt_exception_handler,
2481 _thread_convert_thread_state, _thread_create, _thread_create_running, 2534 _thread_assign, _thread_assign_default, _thread_convert_thread_state,
2482 _thread_depress_abort, _thread_destruct_special_reply_port, 2535 _thread_create, _thread_create_running, _thread_depress_abort,
2483 _thread_get_assignment, _thread_get_exception_ports, _thread_get_exception_ports_info, 2536 _thread_destruct_special_reply_port, _thread_get_assignment,
2537 _thread_get_exception_ports, _thread_get_exception_ports_info,
2484 _thread_get_mach_voucher, _thread_get_register_pointer_values, 2538 _thread_get_mach_voucher, _thread_get_register_pointer_values,
2485 _thread_get_special_port, _thread_get_special_reply_port, 2539 _thread_get_special_port, _thread_get_special_reply_port,
2486 _thread_get_state, _thread_info, _thread_policy, _thread_policy_get, 2540 _thread_get_state, _thread_info, _thread_policy, _thread_policy_get,
...@@ -2499,35 +2553,19 @@ exports:...@@ -2499,35 +2553,19 @@ exports:
2499 _vm_read_overwrite, _vm_region_64, _vm_region_recurse_64, 2553 _vm_read_overwrite, _vm_region_64, _vm_region_recurse_64,
2500 _vm_remap, _vm_remap_new, _vm_wire, _vm_write, _voucher_mach_msg_adopt, 2554 _vm_remap, _vm_remap_new, _vm_wire, _vm_write, _voucher_mach_msg_adopt,
2501 _voucher_mach_msg_clear, _voucher_mach_msg_revert, _voucher_mach_msg_set, 2555 _voucher_mach_msg_clear, _voucher_mach_msg_revert, _voucher_mach_msg_set,
2502 _vprintf_stderr_func, _wait4, _waitid, _work_interval_copy_port, 2556 _vprintf_stderr_func, _wait4, _waitid, '_waitid$NOCANCEL',
2503 _work_interval_create, _work_interval_destroy, _work_interval_get_flags_from_port, 2557 _work_interval_copy_port, _work_interval_create, _work_interval_destroy,
2504 _work_interval_instance_alloc, _work_interval_instance_clear, 2558 _work_interval_get_flags_from_port, _work_interval_instance_alloc,
2505 _work_interval_instance_finish, _work_interval_instance_free, 2559 _work_interval_instance_clear, _work_interval_instance_finish,
2506 _work_interval_instance_get_complexity, _work_interval_instance_get_deadline, 2560 _work_interval_instance_free, _work_interval_instance_get_complexity,
2507 _work_interval_instance_get_finish, _work_interval_instance_get_id, 2561 _work_interval_instance_get_deadline, _work_interval_instance_get_finish,
2508 _work_interval_instance_get_start, _work_interval_instance_get_telemetry_data, 2562 _work_interval_instance_get_id, _work_interval_instance_get_start,
2509 _work_interval_instance_set_complexity, _work_interval_instance_set_deadline, 2563 _work_interval_instance_get_telemetry_data, _work_interval_instance_set_complexity,
2510 _work_interval_instance_set_finish, _work_interval_instance_set_start, 2564 _work_interval_instance_set_deadline, _work_interval_instance_set_finish,
2511 _work_interval_instance_start, _work_interval_instance_update, 2565 _work_interval_instance_set_start, _work_interval_instance_start,
2512 _work_interval_join, _work_interval_join_port, _work_interval_leave, 2566 _work_interval_instance_update, _work_interval_join, _work_interval_join_port,
2513 _work_interval_notify, _work_interval_notify_simple, _write, 2567 _work_interval_leave, _work_interval_notify, _work_interval_notify_simple,
2514 _writev ]2568 _write, '_write$NOCANCEL', _writev, '_writev$NOCANCEL' ]
2515 - targets: [ x86_64-macos, x86_64-maccatalyst ]
2516 symbols: [ '_pselect$1050', '_select$1050' ]
2517 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2518 arm64e-macos, arm64e-maccatalyst ]
2519 symbols: [ '_accept$NOCANCEL', '_aio_suspend$NOCANCEL', '_close$NOCANCEL',
2520 '_connect$NOCANCEL', '_fcntl$NOCANCEL', '_fsync$NOCANCEL',
2521 _mach_msg2_internal, _mach_msg2_trap, _mach_vm_reclaim_is_available,
2522 _mach_vm_reclaim_mark_free, _mach_vm_reclaim_mark_used, _mach_vm_reclaim_ringbuffer_init,
2523 _mach_vm_reclaim_synchronize, _mach_vm_reclaim_update_kernel_accounting,
2524 _msgctl, '_msgrcv$NOCANCEL', '_msgsnd$NOCANCEL', '_msync$NOCANCEL',
2525 '_open$NOCANCEL', '_poll$NOCANCEL', '_pread$NOCANCEL', '_pselect$NOCANCEL',
2526 '_pwrite$NOCANCEL', '_read$NOCANCEL', '_readv$NOCANCEL', '_recvfrom$NOCANCEL',
2527 '_recvmsg$NOCANCEL', '_select$NOCANCEL', '_sem_wait$NOCANCEL',
2528 _semctl, '_sendmsg$NOCANCEL', '_sendto$NOCANCEL', _setregid,
2529 _setreuid, _shmctl, '_sigsuspend$NOCANCEL', _system_version_compat_mode,
2530 '_waitid$NOCANCEL', '_write$NOCANCEL', '_writev$NOCANCEL' ]
2531 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2569 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2532 symbols: [ ___fstat, ___fstatat, ___fstatfs, ___getfsstat, ___lstat, 2570 symbols: [ ___fstat, ___fstatat, ___fstatfs, ___getfsstat, ___lstat,
2533 ___stat, ___statfs, __current_pid, _mach_absolute_time_kernel, 2571 ___stat, ___statfs, __current_pid, _mach_absolute_time_kernel,
...@@ -2537,7 +2575,7 @@ tbd-version: 4...@@ -2537,7 +2575,7 @@ tbd-version: 4
2537targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst, 2575targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
2538 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2576 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2539install-name: '/usr/lib/system/libsystem_m.dylib'2577install-name: '/usr/lib/system/libsystem_m.dylib'
2540current-version: 32522578current-version: 3289
2541parent-umbrella:2579parent-umbrella:
2542 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst, 2580 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
2543 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2581 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
...@@ -2583,21 +2621,24 @@ exports:...@@ -2583,21 +2621,24 @@ exports:
2583 __simd_tgamma_f8 ]2621 __simd_tgamma_f8 ]
2584 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst, 2622 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
2585 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2623 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2586 symbols: [ __FE_DFL_ENV, ___Libm_version, ___cos_d2, ___cos_f4, ___cospi, 2624 symbols: [ __FE_DFL_ENV, ___Libm_version, ___ceilf16, ___copysignf16,
2587 ___cospif, ___exp10, ___exp10f, ___fegetfltrounds, ___fpclassifyd, 2625 ___cos_d2, ___cos_f4, ___cospi, ___cospif, ___exp10, ___exp10f,
2588 ___fpclassifyf, ___fpclassifyl, ___inline_isfinited, ___inline_isfinitef, 2626 ___fabsf16, ___fegetfltrounds, ___floorf16, ___fmaf16, ___fmaxf16,
2589 ___inline_isfinitel, ___inline_isinfd, ___inline_isinff, ___inline_isinfl, 2627 ___fminf16, ___fpclassifyd, ___fpclassifyf, ___fpclassifyl,
2590 ___inline_isnand, ___inline_isnanf, ___inline_isnanl, ___inline_isnormald, 2628 ___hypotf16, ___inline_isfinited, ___inline_isfinitef, ___inline_isfinitel,
2591 ___inline_isnormalf, ___inline_isnormall, ___inline_signbitd, 2629 ___inline_isinfd, ___inline_isinff, ___inline_isinfl, ___inline_isnand,
2592 ___inline_signbitf, ___inline_signbitl, ___invert_d2, ___invert_d3, 2630 ___inline_isnanf, ___inline_isnanl, ___inline_isnormald, ___inline_isnormalf,
2593 ___invert_d4, ___invert_f2, ___invert_f3, ___invert_f4, ___isfinited, 2631 ___inline_isnormall, ___inline_signbitd, ___inline_signbitf,
2594 ___isfinitef, ___isfinitel, ___isinfd, ___isinff, ___isinfl, 2632 ___inline_signbitl, ___invert_d2, ___invert_d3, ___invert_d4,
2595 ___isnand, ___isnanf, ___isnanl, ___isnormald, ___isnormalf, 2633 ___invert_f2, ___invert_f3, ___invert_f4, ___invert_h2, ___invert_h3,
2596 ___isnormall, ___math_errhandling, ___signbitd, ___signbitf, 2634 ___invert_h4, ___isfinited, ___isfinitef, ___isfinitel, ___isinfd,
2597 ___signbitl, ___sin_d2, ___sin_f4, ___sincos, ___sincos_stret, 2635 ___isinff, ___isinfl, ___isnand, ___isnanf, ___isnanl, ___isnormald,
2598 ___sincosf, ___sincosf_stret, ___sincospi, ___sincospi_stret, 2636 ___isnormalf, ___isnormall, ___math_errhandling, ___nextafterf16,
2599 ___sincospif, ___sincospif_stret, ___sinpi, ___sinpif, ___tanpi, 2637 ___rintf16, ___roundf16, ___signbitd, ___signbitf, ___signbitl,
2600 ___tanpif, __simd_acos_d2, __simd_acos_f4, __simd_acosh_d2, 2638 ___sin_d2, ___sin_f4, ___sincos, ___sincos_stret, ___sincosf,
2639 ___sincosf_stret, ___sincospi, ___sincospi_stret, ___sincospif,
2640 ___sincospif_stret, ___sinpi, ___sinpif, ___sqrtf16, ___tanpi,
2641 ___tanpif, ___truncf16, __simd_acos_d2, __simd_acos_f4, __simd_acosh_d2,
2601 __simd_acosh_f4, __simd_asin_d2, __simd_asin_f4, __simd_asinh_d2, 2642 __simd_acosh_f4, __simd_asin_d2, __simd_asin_f4, __simd_asinh_d2,
2602 __simd_asinh_f4, __simd_atan2_d2, __simd_atan2_f4, __simd_atan_d2, 2643 __simd_asinh_f4, __simd_atan2_d2, __simd_atan2_f4, __simd_atan_d2,
2603 __simd_atan_f4, __simd_atanh_d2, __simd_atanh_f4, __simd_cbrt_d2, 2644 __simd_atan_f4, __simd_atanh_d2, __simd_atanh_f4, __simd_cbrt_d2,
...@@ -2608,13 +2649,15 @@ exports:...@@ -2608,13 +2649,15 @@ exports:
2608 __simd_exp_f4, __simd_expm1_d2, __simd_expm1_f4, __simd_fma_d2, 2649 __simd_exp_f4, __simd_expm1_d2, __simd_expm1_f4, __simd_fma_d2,
2609 __simd_fma_f4, __simd_fmod_d2, __simd_fmod_f4, __simd_hypot_d2, 2650 __simd_fma_f4, __simd_fmod_d2, __simd_fmod_f4, __simd_hypot_d2,
2610 __simd_hypot_f4, __simd_incircle_pd2, __simd_incircle_pf2, 2651 __simd_hypot_f4, __simd_incircle_pd2, __simd_incircle_pf2,
2611 __simd_insphere_pd3, __simd_insphere_pf3, __simd_lgamma_d2, 2652 __simd_incircle_ph2, __simd_insphere_pd3, __simd_insphere_pf3,
2612 __simd_lgamma_f4, __simd_log10_d2, __simd_log10_f4, __simd_log1p_d2, 2653 __simd_insphere_ph3, __simd_lgamma_d2, __simd_lgamma_f4, __simd_log10_d2,
2613 __simd_log1p_f4, __simd_log2_d2, __simd_log2_f4, __simd_log_d2, 2654 __simd_log10_f4, __simd_log1p_d2, __simd_log1p_f4, __simd_log2_d2,
2614 __simd_log_f4, __simd_nextafter_d2, __simd_nextafter_f4, __simd_orient_pd2, 2655 __simd_log2_f4, __simd_log_d2, __simd_log_f4, __simd_nextafter_d2,
2615 __simd_orient_pd3, __simd_orient_pf2, __simd_orient_pf3, __simd_orient_vd2, 2656 __simd_nextafter_f4, __simd_orient_pd2, __simd_orient_pd3,
2616 __simd_orient_vd3, __simd_orient_vf2, __simd_orient_vf3, __simd_pow_d2, 2657 __simd_orient_pf2, __simd_orient_pf3, __simd_orient_ph2, __simd_orient_ph3,
2617 __simd_pow_f4, __simd_remainder_d2, __simd_remainder_f4, __simd_round_d2, 2658 __simd_orient_vd2, __simd_orient_vd3, __simd_orient_vf2, __simd_orient_vf3,
2659 __simd_orient_vh2, __simd_orient_vh3, __simd_pow_d2, __simd_pow_f4,
2660 __simd_remainder_d2, __simd_remainder_f4, __simd_round_d2,
2618 __simd_round_f4, __simd_sin_d2, __simd_sin_f4, __simd_sincos_d2, 2661 __simd_round_f4, __simd_sin_d2, __simd_sin_f4, __simd_sincos_d2,
2619 __simd_sincos_f4, __simd_sincospi_d2, __simd_sincospi_f4, 2662 __simd_sincos_f4, __simd_sincospi_d2, __simd_sincospi_f4,
2620 __simd_sinh_d2, __simd_sinh_f4, __simd_sinpi_d2, __simd_sinpi_f4, 2663 __simd_sinh_d2, __simd_sinh_f4, __simd_sinpi_d2, __simd_sinpi_f4,
...@@ -2649,7 +2692,8 @@ exports:...@@ -2649,7 +2692,8 @@ exports:
2649 _log2f, _log2l, _logb, _logbf, _logbl, _logf, _logl, _lrint, 2692 _log2f, _log2l, _logb, _logbf, _logbl, _logf, _logl, _lrint,
2650 _lrintf, _lrintl, _lround, _lroundf, _lroundl, _matrix_identity_double2x2, 2693 _lrintf, _lrintl, _lround, _lroundf, _lroundl, _matrix_identity_double2x2,
2651 _matrix_identity_double3x3, _matrix_identity_double4x4, _matrix_identity_float2x2, 2694 _matrix_identity_double3x3, _matrix_identity_double4x4, _matrix_identity_float2x2,
2652 _matrix_identity_float3x3, _matrix_identity_float4x4, _modf, 2695 _matrix_identity_float3x3, _matrix_identity_float4x4, _matrix_identity_half2x2,
2696 _matrix_identity_half3x3, _matrix_identity_half4x4, _modf,
2653 _modff, _modfl, _nan, _nanf, _nanl, _nearbyint, _nearbyintf, 2697 _modff, _modfl, _nan, _nanf, _nanl, _nearbyint, _nearbyintf,
2654 _nearbyintl, _nextafter, _nextafterf, _nextafterl, _nexttoward, 2698 _nearbyintl, _nextafter, _nextafterf, _nextafterl, _nexttoward,
2655 _nexttowardf, _nexttowardl, _pow, _powf, _powl, _remainder, 2699 _nexttowardf, _nexttowardl, _pow, _powf, _powl, _remainder,
...@@ -2753,7 +2797,7 @@ tbd-version: 4...@@ -2753,7 +2797,7 @@ tbd-version: 4
2753targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2797targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2754 arm64e-macos, arm64e-maccatalyst ]2798 arm64e-macos, arm64e-maccatalyst ]
2755install-name: '/usr/lib/system/libsystem_malloc.dylib'2799install-name: '/usr/lib/system/libsystem_malloc.dylib'
2756current-version: 474.0.132800current-version: 646.40.3
2757parent-umbrella:2801parent-umbrella:
2758 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2802 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2759 arm64e-macos, arm64e-maccatalyst ]2803 arm64e-macos, arm64e-maccatalyst ]
...@@ -2761,15 +2805,7 @@ parent-umbrella:...@@ -2761,15 +2805,7 @@ parent-umbrella:
2761exports:2805exports:
2762 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2806 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2763 arm64e-macos, arm64e-maccatalyst ]2807 arm64e-macos, arm64e-maccatalyst ]
2764 symbols: [ ___mach_stack_logging_copy_uniquing_table, ___mach_stack_logging_enumerate_records, 2808 symbols: [ ___mach_stack_logging_shared_memory_address, ___malloc_init,
2765 ___mach_stack_logging_frames_for_uniqued_stack, ___mach_stack_logging_get_frames,
2766 ___mach_stack_logging_get_frames_for_stackid, ___mach_stack_logging_set_file_path,
2767 ___mach_stack_logging_shared_memory_address, ___mach_stack_logging_stackid_for_vm_region,
2768 ___mach_stack_logging_start_reading, ___mach_stack_logging_stop_reading,
2769 ___mach_stack_logging_uniquing_table_copy_from_serialized,
2770 ___mach_stack_logging_uniquing_table_read_stack, ___mach_stack_logging_uniquing_table_release,
2771 ___mach_stack_logging_uniquing_table_retain, ___mach_stack_logging_uniquing_table_serialize,
2772 ___mach_stack_logging_uniquing_table_sizeof, ___malloc_init,
2773 ___malloc_late_init, __malloc_fork_child, __malloc_fork_parent, 2809 ___malloc_late_init, __malloc_fork_child, __malloc_fork_parent,
2774 __malloc_fork_prepare, __malloc_no_asl_log, __os_cpu_number_override, 2810 __malloc_fork_prepare, __malloc_no_asl_log, __os_cpu_number_override,
2775 _aligned_alloc, _calloc, _free, _mag_set_thread_index, _malloc, 2811 _aligned_alloc, _calloc, _free, _mag_set_thread_index, _malloc,
...@@ -2777,11 +2813,11 @@ exports:...@@ -2777,11 +2813,11 @@ exports:
2777 _malloc_claimed_address, _malloc_create_legacy_default_zone, 2813 _malloc_claimed_address, _malloc_create_legacy_default_zone,
2778 _malloc_create_zone, _malloc_debug, _malloc_default_purgeable_zone, 2814 _malloc_create_zone, _malloc_debug, _malloc_default_purgeable_zone,
2779 _malloc_default_zone, _malloc_destroy_zone, _malloc_engaged_nano, 2815 _malloc_default_zone, _malloc_destroy_zone, _malloc_engaged_nano,
2780 _malloc_enter_process_memory_limit_warn_mode, _malloc_error, 2816 _malloc_engaged_secure_allocator, _malloc_enter_process_memory_limit_warn_mode,
2781 _malloc_freezedry, _malloc_get_all_zones, _malloc_get_thread_options, 2817 _malloc_error, _malloc_freezedry, _malloc_get_all_zones, _malloc_get_thread_options,
2782 _malloc_get_zone_name, _malloc_good_size, _malloc_jumpstart, 2818 _malloc_get_wrapped_zone, _malloc_get_zone_name, _malloc_good_size,
2783 _malloc_logger, _malloc_make_nonpurgeable, _malloc_make_purgeable, 2819 _malloc_jumpstart, _malloc_logger, _malloc_make_nonpurgeable,
2784 _malloc_memory_event_handler, _malloc_memorypressure_mask_default_4libdispatch, 2820 _malloc_make_purgeable, _malloc_memory_event_handler, _malloc_memorypressure_mask_default_4libdispatch,
2785 _malloc_memorypressure_mask_msl_4libdispatch, _malloc_num_zones, 2821 _malloc_memorypressure_mask_msl_4libdispatch, _malloc_num_zones,
2786 _malloc_num_zones_allocated, _malloc_printf, _malloc_register_stack_logger, 2822 _malloc_num_zones_allocated, _malloc_printf, _malloc_register_stack_logger,
2787 _malloc_sanitizer_get_functions, _malloc_sanitizer_is_enabled, 2823 _malloc_sanitizer_get_functions, _malloc_sanitizer_is_enabled,
...@@ -2790,24 +2826,27 @@ exports:...@@ -2790,24 +2826,27 @@ exports:
2790 _malloc_type_aligned_alloc, _malloc_type_calloc, _malloc_type_free, 2826 _malloc_type_aligned_alloc, _malloc_type_calloc, _malloc_type_free,
2791 _malloc_type_malloc, _malloc_type_posix_memalign, _malloc_type_realloc, 2827 _malloc_type_malloc, _malloc_type_posix_memalign, _malloc_type_realloc,
2792 _malloc_type_valloc, _malloc_type_zone_calloc, _malloc_type_zone_free, 2828 _malloc_type_valloc, _malloc_type_zone_calloc, _malloc_type_zone_free,
2793 _malloc_type_zone_malloc, _malloc_type_zone_memalign, _malloc_type_zone_realloc, 2829 _malloc_type_zone_malloc, _malloc_type_zone_malloc_with_options_internal,
2794 _malloc_type_zone_valloc, _malloc_zero_on_free_disable, _malloc_zone_batch_free, 2830 _malloc_type_zone_malloc_with_options_np, _malloc_type_zone_memalign,
2795 _malloc_zone_batch_malloc, _malloc_zone_calloc, _malloc_zone_check, 2831 _malloc_type_zone_realloc, _malloc_type_zone_valloc, _malloc_variant_is_debug_4test,
2796 _malloc_zone_claimed_address, _malloc_zone_disable_discharge_checking, 2832 _malloc_zero_on_free_disable, _malloc_zone_batch_free, _malloc_zone_batch_malloc,
2797 _malloc_zone_discharge, _malloc_zone_enable_discharge_checking, 2833 _malloc_zone_calloc, _malloc_zone_check, _malloc_zone_claimed_address,
2798 _malloc_zone_enumerate_discharged_pointers, _malloc_zone_free, 2834 _malloc_zone_disable_discharge_checking, _malloc_zone_discharge,
2799 _malloc_zone_from_ptr, _malloc_zone_log, _malloc_zone_malloc, 2835 _malloc_zone_enable_discharge_checking, _malloc_zone_enumerate_discharged_pointers,
2836 _malloc_zone_free, _malloc_zone_from_ptr, _malloc_zone_log,
2837 _malloc_zone_malloc, _malloc_zone_malloc_with_options_np,
2800 _malloc_zone_memalign, _malloc_zone_pressure_relief, _malloc_zone_print, 2838 _malloc_zone_memalign, _malloc_zone_pressure_relief, _malloc_zone_print,
2801 _malloc_zone_print_ptr_info, _malloc_zone_realloc, _malloc_zone_register, 2839 _malloc_zone_print_ptr_info, _malloc_zone_realloc, _malloc_zone_register,
2802 _malloc_zone_statistics, _malloc_zone_unregister, _malloc_zone_valloc, 2840 _malloc_zone_statistics, _malloc_zone_unregister, _malloc_zone_valloc,
2803 _malloc_zones, _mstats, _pgm_diagnose_fault_from_crash_reporter, 2841 _malloc_zones, _mstats, _pgm_extract_report_from_corpse, _posix_memalign,
2804 _pgm_extract_report_from_corpse, _posix_memalign, _realloc, 2842 _realloc, '_reallocarray$DARWIN_EXTSN', '_reallocarrayf$DARWIN_EXTSN',
2805 '_reallocarray$DARWIN_EXTSN', '_reallocarrayf$DARWIN_EXTSN', 2843 _reallocf, _sanitizer_diagnose_fault_from_crash_reporter,
2806 _sanitizer_diagnose_fault_from_crash_reporter, _scalable_zone_info, 2844 _scalable_zone_info, _scalable_zone_statistics, _set_malloc_singlethreaded,
2807 _scalable_zone_statistics, _set_malloc_singlethreaded, _stack_logging_enable_logging, 2845 _stack_logging_enable_logging, _szone_check_counter, _szone_check_modulo,
2808 _szone_check_counter, _szone_check_modulo, _szone_check_start, 2846 _szone_check_start, _tiny_print_region_free_list, _turn_off_stack_logging,
2809 _tiny_print_region_free_list, _turn_off_stack_logging, _turn_on_stack_logging, 2847 _turn_on_stack_logging, _valloc, _vfree, _xzm_malloc_zone_introspect,
2810 _valloc, _vfree, _xzm_ptr_lookup_4test, _zeroify_scalable_zone ]2848 _xzm_ptr_lookup_4test, _xzm_type_choose_ptr_bucket_4test,
2849 _zeroify_scalable_zone ]
2811--- !tapi-tbd2850--- !tapi-tbd
2812tbd-version: 42851tbd-version: 4
2813targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2852targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
...@@ -2821,9 +2860,10 @@ exports:...@@ -2821,9 +2860,10 @@ exports:
2821 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2860 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2822 arm64e-macos, arm64e-maccatalyst ]2861 arm64e-macos, arm64e-maccatalyst ]
2823 symbols: [ _NEHelperCacheAddRedirectedAddress, _NEHelperCacheClearRedirectedAddresses, 2862 symbols: [ _NEHelperCacheAddRedirectedAddress, _NEHelperCacheClearRedirectedAddresses,
2824 _NEHelperCacheClearUUIDs, _NEHelperCacheCopyAppUUIDMapping, 2863 _NEHelperCacheClearUUIDs, _NEHelperCacheClearUUIDsForBundleID,
2825 _NEHelperCacheCopyAppUUIDMappingExtended, _NEHelperCacheCopyAppUUIDMappingForUIDExtended, 2864 _NEHelperCacheCopyAppUUIDMapping, _NEHelperCacheCopyAppUUIDMappingExtended,
2826 _NEHelperCacheCopySigningIdentifierMapping, _NEHelperCacheSetDomainDictionaries, 2865 _NEHelperCacheCopyAppUUIDMappingForUIDExtended, _NEHelperCacheCopySigningIdentifierMapping,
2866 _NEHelperCachePopulateUUIDsForConfiguration, _NEHelperCacheSetDomainDictionaries,
2827 _NEHelperCacheSetMatchDomains, _NEHelperCacheSetRoutes, _NEHelperCopyAggregatePathRules, 2867 _NEHelperCacheSetMatchDomains, _NEHelperCacheSetRoutes, _NEHelperCopyAggregatePathRules,
2828 _NEHelperCopyAppInfo, _NEHelperCopyCurrentNetworkAsync, _NEHelperCopyCurrentNetworkInfo, 2868 _NEHelperCopyAppInfo, _NEHelperCopyCurrentNetworkAsync, _NEHelperCopyCurrentNetworkInfo,
2829 _NEHelperCopyDataForCertificate, _NEHelperCopyPerAppDomains, 2869 _NEHelperCopyDataForCertificate, _NEHelperCopyPerAppDomains,
...@@ -2856,9 +2896,9 @@ exports:...@@ -2856,9 +2896,9 @@ exports:
2856 _ne_session_disable_restrictions, _ne_session_dns_proxy_configs_present, 2896 _ne_session_disable_restrictions, _ne_session_dns_proxy_configs_present,
2857 _ne_session_dns_settings_configs_present, _ne_session_establish_ipc, 2897 _ne_session_dns_settings_configs_present, _ne_session_establish_ipc,
2858 _ne_session_fallback_advisory, _ne_session_fallback_default, 2898 _ne_session_fallback_advisory, _ne_session_fallback_default,
2859 _ne_session_get_config_id_from_network_agent, _ne_session_get_configuration_id, 2899 _ne_session_get_boot_session_uuid, _ne_session_get_config_id_from_network_agent,
2860 _ne_session_get_info, _ne_session_get_info2, _ne_session_get_status, 2900 _ne_session_get_configuration_id, _ne_session_get_info, _ne_session_get_info2,
2861 _ne_session_info_type_to_string, _ne_session_initialize_necp_drop_all, 2901 _ne_session_get_status, _ne_session_info_type_to_string, _ne_session_initialize_necp_drop_all,
2862 _ne_session_is_always_on_vpn_enabled, _ne_session_is_safeboot, 2902 _ne_session_is_always_on_vpn_enabled, _ne_session_is_safeboot,
2863 _ne_session_local_communication_configs_present, _ne_session_local_communication_send_info, 2903 _ne_session_local_communication_configs_present, _ne_session_local_communication_send_info,
2864 _ne_session_manager_get_pid, _ne_session_manager_has_active_sessions, 2904 _ne_session_manager_get_pid, _ne_session_manager_has_active_sessions,
...@@ -2873,18 +2913,18 @@ exports:...@@ -2873,18 +2913,18 @@ exports:
2873 _ne_session_release, _ne_session_retain, _ne_session_send_barrier, 2913 _ne_session_release, _ne_session_retain, _ne_session_send_barrier,
2874 _ne_session_service_copy_cached_match_domains, _ne_session_service_get_dns_service_id, 2914 _ne_session_service_copy_cached_match_domains, _ne_session_service_get_dns_service_id,
2875 _ne_session_service_get_dns_service_id_for_interface, _ne_session_service_matches_address, 2915 _ne_session_service_get_dns_service_id_for_interface, _ne_session_service_matches_address,
2876 _ne_session_service_matches_address_for_interface, _ne_session_set_event_handler, 2916 _ne_session_service_matches_address_for_interface, _ne_session_set_device_communication_exception,
2877 _ne_session_set_socket_attributes, _ne_session_set_socket_context_attribute, 2917 _ne_session_set_event_handler, _ne_session_set_socket_attributes,
2878 _ne_session_set_socket_tracker_attributes, _ne_session_should_disable_nexus, 2918 _ne_session_set_socket_context_attribute, _ne_session_set_socket_tracker_attributes,
2879 _ne_session_start, _ne_session_start_on_behalf_of, _ne_session_start_with_options, 2919 _ne_session_should_disable_nexus, _ne_session_start, _ne_session_start_on_behalf_of,
2880 _ne_session_status_to_string, _ne_session_stop, _ne_session_stop_all_with_plugin_type, 2920 _ne_session_start_with_options, _ne_session_status_to_string,
2881 _ne_session_stop_reason_to_string, _ne_session_type_to_string, 2921 _ne_session_stop, _ne_session_stop_all_with_plugin_type, _ne_session_stop_reason_to_string,
2882 _ne_session_use_as_system_vpn, _ne_session_vod_evaluate_connection_present, 2922 _ne_session_type_to_string, _ne_session_use_as_system_vpn,
2883 _ne_session_vpn_include_all_networks_configs_present, _ne_socket_set_attribution, 2923 _ne_session_vod_evaluate_connection_present, _ne_session_vpn_include_all_networks_configs_present,
2884 _ne_socket_set_domains, _ne_socket_set_is_app_initiated, _ne_socket_set_website_attribution, 2924 _ne_socket_set_attribution, _ne_socket_set_domains, _ne_socket_set_is_app_initiated,
2885 _ne_tracker_build_cache, _ne_tracker_build_trie, _ne_tracker_check_info_changed, 2925 _ne_socket_set_website_attribution, _ne_tracker_build_cache,
2886 _ne_tracker_check_is_hostname_blocked, _ne_tracker_check_tcc, 2926 _ne_tracker_build_trie, _ne_tracker_check_info_changed, _ne_tracker_check_is_hostname_blocked,
2887 _ne_tracker_clear_cache, _ne_tracker_context_can_block_request, 2927 _ne_tracker_check_tcc, _ne_tracker_clear_cache, _ne_tracker_context_can_block_request,
2888 _ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner, 2928 _ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner,
2889 _ne_tracker_context_is_from_app_list, _ne_tracker_context_is_from_web_list, 2929 _ne_tracker_context_is_from_app_list, _ne_tracker_context_is_from_web_list,
2890 _ne_tracker_copy_current_stacktrace, _ne_tracker_create_xcode_issue, 2930 _ne_tracker_copy_current_stacktrace, _ne_tracker_create_xcode_issue,
...@@ -2901,7 +2941,7 @@ tbd-version: 4...@@ -2901,7 +2941,7 @@ tbd-version: 4
2901targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2941targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2902 arm64e-macos, arm64e-maccatalyst ]2942 arm64e-macos, arm64e-maccatalyst ]
2903install-name: '/usr/lib/system/libsystem_notify.dylib'2943install-name: '/usr/lib/system/libsystem_notify.dylib'
2904current-version: 3172944current-version: 327.0.5
2905parent-umbrella:2945parent-umbrella:
2906 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 2946 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2907 arm64e-macos, arm64e-maccatalyst ]2947 arm64e-macos, arm64e-maccatalyst ]
...@@ -2918,21 +2958,23 @@ exports:...@@ -2918,21 +2958,23 @@ exports:
2918 _notify_simple_post, _notify_suspend, _notify_suspend_pid ]2958 _notify_simple_post, _notify_suspend, _notify_suspend_pid ]
2919--- !tapi-tbd2959--- !tapi-tbd
2920tbd-version: 42960tbd-version: 4
2921targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 2961targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2922 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2962 arm64e-macos, arm64e-maccatalyst ]
2923install-name: '/usr/lib/system/libsystem_platform.dylib'2963install-name: '/usr/lib/system/libsystem_platform.dylib'
2924current-version: 306.0.12964current-version: 340
2925parent-umbrella:2965parent-umbrella:
2926 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 2966 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2927 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2967 arm64e-macos, arm64e-maccatalyst ]
2928 umbrella: System2968 umbrella: System
2929exports:2969exports:
2930 - targets: [ i386-macos, i386-maccatalyst ]2970 - targets: [ x86_64-macos, x86_64-maccatalyst ]
2931 symbols: [ _MKGetTimeBaseInfo, _udiv10 ]2971 symbols: [ '_OSAtomicFifoDequeue$VARIANT$PFZ', '_OSAtomicFifoDequeue$VARIANT$UnfairLock',
2932 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst ]2972 '_OSAtomicFifoEnqueue$VARIANT$PFZ', '_OSAtomicFifoEnqueue$VARIANT$UnfairLock',
2933 symbols: [ __sigtramp, _longjmperror ]2973 ___no_overread_variant_setup, __sigtramp, _bzero_sse_np, _longjmperror,
2934 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst, 2974 _memmove_sse_np, _memset_pattern16_sse_np, _memset_pattern4_sse_np,
2935 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]2975 _memset_pattern8_sse_np, _memset_sse_np ]
2976 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2977 arm64e-macos, arm64e-maccatalyst ]
2936 symbols: [ _OSAtomicAdd32, _OSAtomicAdd32Barrier, _OSAtomicAdd64, _OSAtomicAdd64Barrier, 2978 symbols: [ _OSAtomicAdd32, _OSAtomicAdd32Barrier, _OSAtomicAdd64, _OSAtomicAdd64Barrier,
2937 _OSAtomicAnd32, _OSAtomicAnd32Barrier, _OSAtomicAnd32Orig, 2979 _OSAtomicAnd32, _OSAtomicAnd32Barrier, _OSAtomicAnd32Orig,
2938 _OSAtomicAnd32OrigBarrier, _OSAtomicCompareAndSwap32, _OSAtomicCompareAndSwap32Barrier, 2980 _OSAtomicAnd32OrigBarrier, _OSAtomicCompareAndSwap32, _OSAtomicCompareAndSwap32Barrier,
...@@ -2975,9 +3017,12 @@ exports:...@@ -2975,9 +3017,12 @@ exports:
2975 __spin_lock, __spin_lock_try, __spin_unlock, _ffs, _ffsl, 3017 __spin_lock, __spin_lock_try, __spin_unlock, _ffs, _ffsl,
2976 _ffsll, _fls, _flsl, _flsll, _getcontext, _longjmp, _makecontext, 3018 _ffsll, _fls, _flsl, _flsll, _getcontext, _longjmp, _makecontext,
2977 _os_lock_lock, _os_lock_trylock, _os_lock_unlock, _os_log_simple_now, 3019 _os_lock_lock, _os_lock_trylock, _os_lock_unlock, _os_log_simple_now,
2978 _os_log_simple_type_from_asl, _os_unfair_lock_assert_not_owner, 3020 _os_log_simple_type_from_asl, _os_sync_wait_on_address, _os_sync_wait_on_address_with_deadline,
3021 _os_sync_wait_on_address_with_timeout, _os_sync_wake_by_address_all,
3022 _os_sync_wake_by_address_any, _os_unfair_lock_assert_not_owner,
2979 _os_unfair_lock_assert_owner, _os_unfair_lock_lock, _os_unfair_lock_lock_no_tsd, 3023 _os_unfair_lock_assert_owner, _os_unfair_lock_lock, _os_unfair_lock_lock_no_tsd,
2980 _os_unfair_lock_lock_with_options, _os_unfair_lock_trylock, 3024 _os_unfair_lock_lock_with_flags, _os_unfair_lock_lock_with_options,
3025 _os_unfair_lock_trylock, _os_unfair_lock_trylock_with_options,
2981 _os_unfair_lock_unlock, _os_unfair_lock_unlock_no_tsd, _os_unfair_recursive_lock_lock_with_options, 3026 _os_unfair_lock_unlock, _os_unfair_lock_unlock_no_tsd, _os_unfair_recursive_lock_lock_with_options,
2982 _os_unfair_recursive_lock_owned, _os_unfair_recursive_lock_trylock, 3027 _os_unfair_recursive_lock_owned, _os_unfair_recursive_lock_trylock,
2983 _os_unfair_recursive_lock_tryunlock4objc, _os_unfair_recursive_lock_unlock, 3028 _os_unfair_recursive_lock_tryunlock4objc, _os_unfair_recursive_lock_unlock,
...@@ -2985,39 +3030,21 @@ exports:...@@ -2985,39 +3030,21 @@ exports:
2985 _setjmp, _siglongjmp, _sigsetjmp, _spin_lock, _spin_lock_try, 3030 _setjmp, _siglongjmp, _sigsetjmp, _spin_lock, _spin_lock_try,
2986 _spin_unlock, _swapcontext, _sys_cache_control, _sys_dcache_flush, 3031 _spin_unlock, _swapcontext, _sys_cache_control, _sys_dcache_flush,
2987 _sys_icache_invalidate ]3032 _sys_icache_invalidate ]
2988 - targets: [ x86_64-macos, x86_64-maccatalyst ]
2989 symbols: [ '_OSAtomicFifoDequeue$VARIANT$PFZ', '_OSAtomicFifoDequeue$VARIANT$UnfairLock',
2990 '_OSAtomicFifoEnqueue$VARIANT$PFZ', '_OSAtomicFifoEnqueue$VARIANT$UnfairLock',
2991 ___no_overread_variant_setup, _bzero_sse_np, _memmove_sse_np,
2992 _memset_pattern16_sse_np, _memset_pattern4_sse_np, _memset_pattern8_sse_np,
2993 _memset_sse_np ]
2994 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]3033 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2995 symbols: [ __ctx_done ]3034 symbols: [ __ctx_done ]
2996--- !tapi-tbd3035--- !tapi-tbd
2997tbd-version: 43036tbd-version: 4
2998targets: [ i386-macos, x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3037targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2999 arm64e-macos, arm64e-maccatalyst ]3038 arm64e-macos, arm64e-maccatalyst ]
3000install-name: '/usr/lib/system/libsystem_pthread.dylib'3039install-name: '/usr/lib/system/libsystem_pthread.dylib'
3001current-version: 5193040current-version: 535
3002parent-umbrella:3041parent-umbrella:
3003 - targets: [ i386-macos, x86_64-macos, x86_64-maccatalyst, arm64-macos, 3042 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3004 arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]3043 arm64e-macos, arm64e-maccatalyst ]
3005 umbrella: System3044 umbrella: System
3006exports:3045exports:
3007 - targets: [ i386-macos ]3046 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3008 symbols: [ '_pthread_cancel$UNIX2003', '_pthread_cond_init$UNIX2003', 3047 arm64e-macos, arm64e-maccatalyst ]
3009 '_pthread_cond_timedwait$NOCANCEL$UNIX2003', '_pthread_cond_timedwait$UNIX2003',
3010 '_pthread_cond_wait$NOCANCEL$UNIX2003', '_pthread_cond_wait$UNIX2003',
3011 '_pthread_join$NOCANCEL$UNIX2003', '_pthread_join$UNIX2003',
3012 '_pthread_mutexattr_destroy$UNIX2003', '_pthread_rwlock_destroy$UNIX2003',
3013 '_pthread_rwlock_init$UNIX2003', '_pthread_rwlock_rdlock$UNIX2003',
3014 '_pthread_rwlock_tryrdlock$UNIX2003', '_pthread_rwlock_trywrlock$UNIX2003',
3015 '_pthread_rwlock_unlock$UNIX2003', '_pthread_rwlock_wrlock$UNIX2003',
3016 '_pthread_setcancelstate$UNIX2003', '_pthread_setcanceltype$UNIX2003',
3017 '_pthread_sigmask$UNIX2003', '_pthread_testcancel$UNIX2003',
3018 '_sigwait$NOCANCEL$UNIX2003', '_sigwait$UNIX2003' ]
3019 - targets: [ i386-macos, x86_64-macos, x86_64-maccatalyst, arm64-macos,
3020 arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
3021 symbols: [ ____chkstk_darwin, ___is_threaded, ___pthread_init, ___pthread_late_init, 3048 symbols: [ ____chkstk_darwin, ___is_threaded, ___pthread_init, ___pthread_late_init,
3022 ___pthread_workqueue_setkill, ___unix_conforming, __pthread_atfork_child, 3049 ___pthread_workqueue_setkill, ___unix_conforming, __pthread_atfork_child,
3023 __pthread_atfork_child_handlers, __pthread_atfork_parent, 3050 __pthread_atfork_child_handlers, __pthread_atfork_parent,
...@@ -3033,8 +3060,8 @@ exports:...@@ -3033,8 +3060,8 @@ exports:
3033 __pthread_set_properties_self, __pthread_set_self, __pthread_setspecific_static, 3060 __pthread_set_properties_self, __pthread_set_self, __pthread_setspecific_static,
3034 __pthread_start, __pthread_tsd_shared_cache_first, __pthread_tsd_shared_cache_last, 3061 __pthread_start, __pthread_tsd_shared_cache_first, __pthread_tsd_shared_cache_last,
3035 __pthread_workloop_create, __pthread_workloop_destroy, __pthread_workqueue_add_cooperativethreads, 3062 __pthread_workloop_create, __pthread_workloop_destroy, __pthread_workqueue_add_cooperativethreads,
3036 __pthread_workqueue_addthreads, __pthread_workqueue_asynchronous_override_add, 3063 __pthread_workqueue_addthreads, __pthread_workqueue_allow_send_signals,
3037 __pthread_workqueue_asynchronous_override_reset_all_self, 3064 __pthread_workqueue_asynchronous_override_add, __pthread_workqueue_asynchronous_override_reset_all_self,
3038 __pthread_workqueue_asynchronous_override_reset_self, __pthread_workqueue_init, 3065 __pthread_workqueue_asynchronous_override_reset_self, __pthread_workqueue_init,
3039 __pthread_workqueue_init_with_kevent, __pthread_workqueue_init_with_workloop, 3066 __pthread_workqueue_init_with_kevent, __pthread_workqueue_init_with_workloop,
3040 __pthread_workqueue_override_reset, __pthread_workqueue_override_start_direct, 3067 __pthread_workqueue_override_reset, __pthread_workqueue_override_start_direct,
...@@ -3051,13 +3078,14 @@ exports:...@@ -3051,13 +3078,14 @@ exports:
3051 _pthread_attr_setdetachstate, _pthread_attr_setguardsize, 3078 _pthread_attr_setdetachstate, _pthread_attr_setguardsize,
3052 _pthread_attr_setinheritsched, _pthread_attr_setschedparam, 3079 _pthread_attr_setinheritsched, _pthread_attr_setschedparam,
3053 _pthread_attr_setschedpolicy, _pthread_attr_setscope, _pthread_attr_setstack, 3080 _pthread_attr_setschedpolicy, _pthread_attr_setscope, _pthread_attr_setstack,
3054 _pthread_attr_setstackaddr, _pthread_attr_setstacksize, _pthread_cancel, 3081 _pthread_attr_setstackaddr, _pthread_attr_setstacksize, _pthread_attr_setworkinterval_np,
3055 _pthread_chdir_np, _pthread_cond_broadcast, _pthread_cond_destroy, 3082 _pthread_cancel, _pthread_chdir_np, _pthread_cond_broadcast,
3056 _pthread_cond_init, _pthread_cond_signal, _pthread_cond_signal_thread_np, 3083 _pthread_cond_destroy, _pthread_cond_init, _pthread_cond_signal,
3057 _pthread_cond_timedwait, _pthread_cond_timedwait_relative_np, 3084 _pthread_cond_signal_thread_np, _pthread_cond_timedwait, '_pthread_cond_timedwait$NOCANCEL',
3058 _pthread_cond_wait, _pthread_condattr_destroy, _pthread_condattr_getpshared, 3085 _pthread_cond_timedwait_relative_np, _pthread_cond_wait, '_pthread_cond_wait$NOCANCEL',
3059 _pthread_condattr_init, _pthread_condattr_setpshared, _pthread_cpu_number_np, 3086 _pthread_condattr_destroy, _pthread_condattr_getpshared, _pthread_condattr_init,
3060 _pthread_create, _pthread_create_from_mach_thread, _pthread_create_suspended_np, 3087 _pthread_condattr_setpshared, _pthread_cpu_number_np, _pthread_create,
3088 _pthread_create_from_mach_thread, _pthread_create_suspended_np,
3061 _pthread_create_with_workgroup_np, _pthread_current_stack_contains_np, 3089 _pthread_create_with_workgroup_np, _pthread_current_stack_contains_np,
3062 _pthread_dependency_fulfill_np, _pthread_dependency_init_np, 3090 _pthread_dependency_fulfill_np, _pthread_dependency_init_np,
3063 _pthread_dependency_wait_np, _pthread_detach, _pthread_equal, 3091 _pthread_dependency_wait_np, _pthread_detach, _pthread_equal,
...@@ -3067,7 +3095,9 @@ exports:...@@ -3067,7 +3095,9 @@ exports:
3067 _pthread_getspecific, _pthread_install_workgroup_functions_np, 3095 _pthread_getspecific, _pthread_install_workgroup_functions_np,
3068 _pthread_introspection_getspecific_np, _pthread_introspection_hook_install, 3096 _pthread_introspection_getspecific_np, _pthread_introspection_hook_install,
3069 _pthread_introspection_setspecific_np, _pthread_is_threaded_np, 3097 _pthread_introspection_setspecific_np, _pthread_is_threaded_np,
3070 _pthread_join, _pthread_key_create, _pthread_key_delete, _pthread_key_init_np, 3098 _pthread_jit_write_freeze_callbacks_np, _pthread_jit_write_protect_supported_np,
3099 _pthread_jit_write_with_callback_np, _pthread_join, '_pthread_join$NOCANCEL',
3100 _pthread_key_create, _pthread_key_delete, _pthread_key_init_np,
3071 _pthread_kill, _pthread_layout_offsets, _pthread_mach_thread_np, 3101 _pthread_kill, _pthread_layout_offsets, _pthread_mach_thread_np,
3072 _pthread_main_np, _pthread_main_thread_np, _pthread_mutex_destroy, 3102 _pthread_main_np, _pthread_main_thread_np, _pthread_mutex_destroy,
3073 _pthread_mutex_getprioceiling, _pthread_mutex_init, _pthread_mutex_lock, 3103 _pthread_mutex_getprioceiling, _pthread_mutex_init, _pthread_mutex_lock,
...@@ -3094,22 +3124,16 @@ exports:...@@ -3094,22 +3124,16 @@ exports:
3094 _pthread_workqueue_addthreads_np, _pthread_workqueue_setdispatch_np, 3124 _pthread_workqueue_addthreads_np, _pthread_workqueue_setdispatch_np,
3095 _pthread_workqueue_setdispatchoffset_np, _pthread_workqueue_setup, 3125 _pthread_workqueue_setdispatchoffset_np, _pthread_workqueue_setup,
3096 _pthread_yield_np, _qos_class_main, _qos_class_self, _sched_get_priority_max, 3126 _pthread_yield_np, _qos_class_main, _qos_class_self, _sched_get_priority_max,
3097 _sched_get_priority_min, _sched_yield, _sigwait, _start_wqthread, 3127 _sched_get_priority_min, _sched_yield, _sigwait, '_sigwait$NOCANCEL',
3098 _thread_chkstk_darwin, _thread_start ]3128 _start_wqthread, _thread_chkstk_darwin, _thread_start ]
3099 - targets: [ i386-macos, x86_64-macos, arm64-macos, arm64e-macos ]3129 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
3100 symbols: [ __pthread_mutex_enable_legacy_mode, _pthread_jit_write_freeze_callbacks_np, 3130 symbols: [ __pthread_mutex_enable_legacy_mode, _pthread_jit_write_protect_np ]
3101 _pthread_jit_write_protect_np, _pthread_jit_write_protect_supported_np,
3102 _pthread_jit_write_with_callback_np ]
3103 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3104 arm64e-macos, arm64e-maccatalyst ]
3105 symbols: [ '_pthread_cond_timedwait$NOCANCEL', '_pthread_cond_wait$NOCANCEL',
3106 '_pthread_join$NOCANCEL', '_sigwait$NOCANCEL' ]
3107--- !tapi-tbd3131--- !tapi-tbd
3108tbd-version: 43132tbd-version: 4
3109targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3133targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3110 arm64e-macos, arm64e-maccatalyst ]3134 arm64e-macos, arm64e-maccatalyst ]
3111install-name: '/usr/lib/system/libsystem_sandbox.dylib'3135install-name: '/usr/lib/system/libsystem_sandbox.dylib'
3112current-version: 2169.0.123136current-version: 2401.40.25
3113parent-umbrella:3137parent-umbrella:
3114 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3138 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3115 arm64e-macos, arm64e-maccatalyst ]3139 arm64e-macos, arm64e-maccatalyst ]
...@@ -3121,13 +3145,14 @@ exports:...@@ -3121,13 +3145,14 @@ exports:
3121 _APP_SANDBOX_READ_WRITE, _IOS_SANDBOX_APPLICATION_GROUP, _IOS_SANDBOX_CONTAINER, 3145 _APP_SANDBOX_READ_WRITE, _IOS_SANDBOX_APPLICATION_GROUP, _IOS_SANDBOX_CONTAINER,
3122 _SANDBOX_CHECK_ALLOW_APPROVAL, _SANDBOX_CHECK_CANONICAL, _SANDBOX_CHECK_NOFOLLOW, 3146 _SANDBOX_CHECK_ALLOW_APPROVAL, _SANDBOX_CHECK_CANONICAL, _SANDBOX_CHECK_NOFOLLOW,
3123 _SANDBOX_CHECK_NO_APPROVAL, _SANDBOX_CHECK_NO_REPORT, _SANDBOX_CHECK_POSIX_READABLE, 3147 _SANDBOX_CHECK_NO_APPROVAL, _SANDBOX_CHECK_NO_REPORT, _SANDBOX_CHECK_POSIX_READABLE,
3124 _SANDBOX_EXTENSION_CANONICAL, _SANDBOX_EXTENSION_DEFAULT, 3148 _SANDBOX_CHECK_POSIX_WRITEABLE, _SANDBOX_EXTENSION_CANONICAL,
3125 _SANDBOX_EXTENSION_MAGIC, _SANDBOX_EXTENSION_NOFOLLOW, _SANDBOX_EXTENSION_NO_REPORT, 3149 _SANDBOX_EXTENSION_DEFAULT, _SANDBOX_EXTENSION_MAGIC, _SANDBOX_EXTENSION_NOFOLLOW,
3150 _SANDBOX_EXTENSION_NOFOLLOW_ANY, _SANDBOX_EXTENSION_NO_REPORT,
3126 _SANDBOX_EXTENSION_NO_STORAGE_CLASS, _SANDBOX_EXTENSION_PREFIXMATCH, 3151 _SANDBOX_EXTENSION_NO_STORAGE_CLASS, _SANDBOX_EXTENSION_PREFIXMATCH,
3127 _SANDBOX_EXTENSION_UNRESOLVED, __amkrtemp, __sandbox_in_a_container, 3152 _SANDBOX_EXTENSION_UNRESOLVED, __amkrtemp, __sandbox_enter_notify_libxpc,
3128 __sandbox_register_app_bundle_0, __sandbox_register_app_bundle_1, 3153 __sandbox_in_a_container, __sandbox_register_app_bundle_0,
3129 _kSBXProfileNoInternet, _kSBXProfileNoNetwork, _kSBXProfileNoWrite, 3154 __sandbox_register_app_bundle_1, _kSBXProfileNoInternet, _kSBXProfileNoNetwork,
3130 _kSBXProfileNoWriteExceptTemporary, _kSBXProfilePureComputation, 3155 _kSBXProfileNoWrite, _kSBXProfileNoWriteExceptTemporary, _kSBXProfilePureComputation,
3131 _kSandboxAppBundleAnySigningId, _kSandboxAppBundlePlatformTeamId, 3156 _kSandboxAppBundleAnySigningId, _kSandboxAppBundlePlatformTeamId,
3132 _kSandboxAppContainerAnySigningId, _kSandboxAppContainerPlatformTeamId, 3157 _kSandboxAppContainerAnySigningId, _kSandboxAppContainerPlatformTeamId,
3133 _rootless_allows_task_for_pid, _rootless_check_datavault_flag, 3158 _rootless_allows_task_for_pid, _rootless_check_datavault_flag,
...@@ -3139,14 +3164,17 @@ exports:...@@ -3139,14 +3164,17 @@ exports:
3139 _rootless_remove_datavault_in_favor_of_static_storage_class, 3164 _rootless_remove_datavault_in_favor_of_static_storage_class,
3140 _rootless_remove_restricted_in_favor_of_static_storage_class, 3165 _rootless_remove_restricted_in_favor_of_static_storage_class,
3141 _rootless_restricted_environment, _rootless_suspend, _rootless_trusted_by_self_token, 3166 _rootless_restricted_environment, _rootless_suspend, _rootless_trusted_by_self_token,
3142 _rootless_verify_trusted_by_self_token, _sandbox_builtin_query, 3167 _rootless_verify_trusted_by_self_token, _sandbox_apply_bytecode,
3143 _sandbox_check, _sandbox_check_bulk, _sandbox_check_by_audit_token, 3168 _sandbox_builtin_query, _sandbox_check, _sandbox_check_bulk,
3144 _sandbox_check_by_reference, _sandbox_check_by_uniqueid, _sandbox_check_message_filter_integer, 3169 _sandbox_check_by_audit_token, _sandbox_check_by_reference,
3145 _sandbox_check_message_filter_string, _sandbox_check_protected_app_container, 3170 _sandbox_check_by_uniqueid, _sandbox_check_message_filter_integer,
3171 _sandbox_check_message_filter_string, _sandbox_check_process_signal_target,
3172 _sandbox_check_protected_app_container, _sandbox_check_self_signal_target,
3146 _sandbox_consume_extension, _sandbox_consume_fs_extension, 3173 _sandbox_consume_extension, _sandbox_consume_fs_extension,
3147 _sandbox_consume_mach_extension, _sandbox_container_path_for_audit_token, 3174 _sandbox_consume_mach_extension, _sandbox_container_path_for_audit_token,
3148 _sandbox_container_path_for_pid, _sandbox_enable_root_translation, 3175 _sandbox_container_path_for_pid, _sandbox_enable_local_state_flag,
3149 _sandbox_enable_state_flag, _sandbox_extension_consume, _sandbox_extension_issue_file, 3176 _sandbox_enable_root_translation, _sandbox_enable_state_flag,
3177 _sandbox_extension_consume, _sandbox_extension_issue_file,
3150 _sandbox_extension_issue_file_to_process, _sandbox_extension_issue_file_to_process_by_pid, 3178 _sandbox_extension_issue_file_to_process, _sandbox_extension_issue_file_to_process_by_pid,
3151 _sandbox_extension_issue_file_to_self, _sandbox_extension_issue_generic, 3179 _sandbox_extension_issue_file_to_self, _sandbox_extension_issue_generic,
3152 _sandbox_extension_issue_generic_to_process, _sandbox_extension_issue_generic_to_process_by_pid, 3180 _sandbox_extension_issue_generic_to_process, _sandbox_extension_issue_generic_to_process_by_pid,
...@@ -3155,10 +3183,11 @@ exports:...@@ -3155,10 +3183,11 @@ exports:
3155 _sandbox_extension_issue_iokit_user_client_class, _sandbox_extension_issue_mach, 3183 _sandbox_extension_issue_iokit_user_client_class, _sandbox_extension_issue_mach,
3156 _sandbox_extension_issue_mach_to_process, _sandbox_extension_issue_mach_to_process_by_pid, 3184 _sandbox_extension_issue_mach_to_process, _sandbox_extension_issue_mach_to_process_by_pid,
3157 _sandbox_extension_issue_posix_ipc, _sandbox_extension_issue_related_file_to_process, 3185 _sandbox_extension_issue_posix_ipc, _sandbox_extension_issue_related_file_to_process,
3158 _sandbox_extension_reap, _sandbox_extension_release, _sandbox_extension_release_file, 3186 _sandbox_extension_reap, _sandbox_extension_release, _sandbox_extension_release_and_detect_last_reference,
3159 _sandbox_extension_update_file, _sandbox_extension_update_file_by_fileid, 3187 _sandbox_extension_release_file, _sandbox_extension_update_file,
3160 _sandbox_free_error, _sandbox_get_container_expected, _sandbox_init, 3188 _sandbox_extension_update_file_by_fileid, _sandbox_free_error,
3161 _sandbox_init_from_pid, _sandbox_init_with_extensions, _sandbox_init_with_parameters, 3189 _sandbox_get_container_expected, _sandbox_init, _sandbox_init_from_pid,
3190 _sandbox_init_with_extensions, _sandbox_init_with_parameters,
3162 _sandbox_issue_extension, _sandbox_issue_fs_extension, _sandbox_issue_fs_rw_extension, 3191 _sandbox_issue_extension, _sandbox_issue_fs_extension, _sandbox_issue_fs_rw_extension,
3163 _sandbox_issue_mach_extension, _sandbox_message_filter_query, 3192 _sandbox_issue_mach_extension, _sandbox_message_filter_query,
3164 _sandbox_message_filter_release, _sandbox_message_filter_retain, 3193 _sandbox_message_filter_release, _sandbox_message_filter_retain,
...@@ -3185,10 +3214,42 @@ exports:...@@ -3185,10 +3214,42 @@ exports:
3185 _rootless_manifest_parse, _rootless_preflight ]3214 _rootless_manifest_parse, _rootless_preflight ]
3186--- !tapi-tbd3215--- !tapi-tbd
3187tbd-version: 43216tbd-version: 4
3217targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
3218install-name: '/usr/lib/system/libsystem_sanitizers.dylib'
3219parent-umbrella:
3220 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
3221 umbrella: System
3222exports:
3223 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
3224 symbols: [ ___asan_abi_addr_is_in_fake_stack, ___asan_abi_address_is_poisoned,
3225 ___asan_abi_after_dynamic_init, ___asan_abi_alloca_poison,
3226 ___asan_abi_allocas_unpoison, ___asan_abi_before_dynamic_init,
3227 ___asan_abi_exp_load_n, ___asan_abi_exp_store_n, ___asan_abi_get_current_fake_stack,
3228 ___asan_abi_handle_no_return, ___asan_abi_init, ___asan_abi_load_cxx_array_cookie,
3229 ___asan_abi_load_n, ___asan_abi_memcpy, ___asan_abi_memmove,
3230 ___asan_abi_memset, ___asan_abi_poison_cxx_array_cookie, ___asan_abi_poison_intra_object_redzone,
3231 ___asan_abi_poison_memory_region, ___asan_abi_poison_stack_memory,
3232 ___asan_abi_region_is_poisoned, ___asan_abi_register_elf_globals,
3233 ___asan_abi_register_globals, ___asan_abi_register_image_globals,
3234 ___asan_abi_report_exp_load_n, ___asan_abi_report_exp_store_n,
3235 ___asan_abi_report_load_n, ___asan_abi_report_store_n, ___asan_abi_set_shadow_xx_n,
3236 ___asan_abi_stack_free_n, ___asan_abi_stack_malloc_always_n,
3237 ___asan_abi_stack_malloc_n, ___asan_abi_store_n, ___asan_abi_unpoison_intra_object_redzone,
3238 ___asan_abi_unpoison_memory_region, ___asan_abi_unpoison_stack_memory,
3239 ___asan_abi_unregister_elf_globals, ___asan_abi_unregister_globals,
3240 ___asan_abi_unregister_image_globals, ___asan_get_alloc_stack,
3241 ___asan_get_free_stack, ___asan_get_report_access_size, ___asan_get_report_access_type,
3242 ___asan_get_report_address, ___asan_get_report_bp, ___asan_get_report_description,
3243 ___asan_get_report_pc, ___asan_get_report_sp, ___asan_get_shadow_mapping,
3244 ___asan_locate_address, ___asan_report_present, __sanitizers_init,
3245 _sanitizers_address_on_report, _sanitizers_diagnose_memory_error,
3246 _sanitizers_report_globals ]
3247--- !tapi-tbd
3248tbd-version: 4
3188targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3249targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3189 arm64e-macos, arm64e-maccatalyst ]3250 arm64e-macos, arm64e-maccatalyst ]
3190install-name: '/usr/lib/system/libsystem_secinit.dylib'3251install-name: '/usr/lib/system/libsystem_secinit.dylib'
3191current-version: 1393252current-version: 153.0.6
3192parent-umbrella:3253parent-umbrella:
3193 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3254 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3194 arm64e-macos, arm64e-maccatalyst ]3255 arm64e-macos, arm64e-maccatalyst ]
...@@ -3221,7 +3282,7 @@ tbd-version: 4...@@ -3221,7 +3282,7 @@ tbd-version: 4
3221targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3282targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3222 arm64e-macos, arm64e-maccatalyst ]3283 arm64e-macos, arm64e-maccatalyst ]
3223install-name: '/usr/lib/system/libsystem_trace.dylib'3284install-name: '/usr/lib/system/libsystem_trace.dylib'
3224current-version: 1481.0.123285current-version: 1612.40.4
3225parent-umbrella:3286parent-umbrella:
3226 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3287 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3227 arm64e-macos, arm64e-maccatalyst ]3288 arm64e-macos, arm64e-maccatalyst ]
...@@ -3238,8 +3299,9 @@ exports:...@@ -3238,8 +3299,9 @@ exports:
3238 __os_log_get_nscf_formatter, __os_log_impl, __os_log_internal, 3299 __os_log_get_nscf_formatter, __os_log_impl, __os_log_internal,
3239 __os_log_pack_fill, __os_log_pack_size, __os_log_preferences_compute, 3300 __os_log_pack_fill, __os_log_pack_size, __os_log_preferences_compute,
3240 __os_log_preferences_copy_cache, __os_log_preferences_load, 3301 __os_log_preferences_copy_cache, __os_log_preferences_load,
3241 __os_log_preferences_load_sysprefs, __os_log_release, __os_log_send_and_compose_impl, 3302 __os_log_preferences_load_sysprefs, __os_log_preferences_merge,
3242 __os_log_set_nscf_formatter, __os_signpost_emit_impl, __os_signpost_emit_unreliably_with_name_impl, 3303 __os_log_release, __os_log_send_and_compose_impl, __os_log_set_nscf_formatter,
3304 __os_log_unreliable_impl, __os_signpost_emit_impl, __os_signpost_emit_unreliably_with_name_impl,
3243 __os_signpost_emit_with_name_impl, __os_signpost_pack_fill, 3305 __os_signpost_emit_with_name_impl, __os_signpost_pack_fill,
3244 __os_signpost_pack_send, __os_state_request_for_pidlist, __os_trace_app_cryptex_sysprefsdir_path, 3306 __os_signpost_pack_send, __os_state_request_for_pidlist, __os_trace_app_cryptex_sysprefsdir_path,
3245 __os_trace_atm_diagnostic_config, __os_trace_basesystem_storage_available, 3307 __os_trace_atm_diagnostic_config, __os_trace_basesystem_storage_available,
...@@ -3247,8 +3309,9 @@ exports:...@@ -3247,8 +3309,9 @@ exports:
3247 __os_trace_get_boot_uuid, __os_trace_get_image_info, __os_trace_get_mode_for_pid, 3309 __os_trace_get_boot_uuid, __os_trace_get_image_info, __os_trace_get_mode_for_pid,
3248 __os_trace_get_times_now, __os_trace_getxattr_at, __os_trace_intprefsdir_path, 3310 __os_trace_get_times_now, __os_trace_getxattr_at, __os_trace_intprefsdir_path,
3249 __os_trace_is_development_build, __os_trace_lazy_init_completed_4libxpc, 3311 __os_trace_is_development_build, __os_trace_lazy_init_completed_4libxpc,
3250 __os_trace_log_simple, __os_trace_macho_for_each_slice, __os_trace_malloc, 3312 __os_trace_lazy_init_completed_4swift, __os_trace_log_simple,
3251 __os_trace_memdup, __os_trace_mmap, __os_trace_mmap_at, __os_trace_mmap_offset, 3313 __os_trace_macho_for_each_slice, __os_trace_malloc, __os_trace_memdup,
3314 __os_trace_mmap, __os_trace_mmap_at, __os_trace_mmap_offset,
3252 __os_trace_mode_match_4tests, __os_trace_os_cryptex_sysprefsdir_path, 3315 __os_trace_mode_match_4tests, __os_trace_os_cryptex_sysprefsdir_path,
3253 __os_trace_prefs_latest_version_4tests, __os_trace_prefsdir_path, 3316 __os_trace_prefs_latest_version_4tests, __os_trace_prefsdir_path,
3254 __os_trace_read_file_at, __os_trace_read_plist_at, __os_trace_realloc, 3317 __os_trace_read_file_at, __os_trace_read_plist_at, __os_trace_realloc,
...@@ -3278,58 +3341,23 @@ exports:...@@ -3278,58 +3341,23 @@ exports:
3278 _os_log_set_hook, _os_log_set_hook_with_params, _os_log_set_test_callback, 3341 _os_log_set_hook, _os_log_set_hook_with_params, _os_log_set_test_callback,
3279 _os_log_shim_enabled, _os_log_shim_legacy_logging_enabled, 3342 _os_log_shim_enabled, _os_log_shim_legacy_logging_enabled,
3280 _os_log_shim_with_CFString, _os_log_type_enabled, _os_log_type_get_name, 3343 _os_log_shim_with_CFString, _os_log_type_enabled, _os_log_type_get_name,
3281 _os_log_with_args, _os_signpost_enabled, _os_signpost_id_generate, 3344 _os_log_with_args, _os_set_logging_unreliable_for_current_thread,
3282 _os_signpost_id_make_with_pointer, _os_signpost_set_introspection_hook_4Perf, 3345 _os_signpost_enabled, _os_signpost_id_generate, _os_signpost_id_make_with_pointer,
3283 _os_state_add_handler, _os_state_remove_handler, _os_trace_debug_enabled, 3346 _os_signpost_set_introspection_hook_4Perf, _os_state_add_handler,
3284 _os_trace_get_mode, _os_trace_get_type, _os_trace_info_enabled, 3347 _os_state_remove_handler, _os_trace_debug_enabled, _os_trace_get_mode,
3285 _os_trace_set_mode ]3348 _os_trace_get_type, _os_trace_info_enabled, _os_trace_set_mode ]
3286 objc-classes: [ OS_os_log ]3349 objc-classes: [ OS_os_log ]
3287--- !tapi-tbd3350--- !tapi-tbd
3288tbd-version: 43351tbd-version: 4
3289targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3352targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3290 arm64e-macos, arm64e-maccatalyst ]3353 arm64e-macos, arm64e-maccatalyst ]
3291install-name: '/usr/lib/system/libunwind.dylib'3354install-name: '/usr/lib/system/libunwind.dylib'
3292current-version: 1600.1123355current-version: 1800.85
3293parent-umbrella:3356parent-umbrella:
3294 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3357 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3295 arm64e-macos, arm64e-maccatalyst ]3358 arm64e-macos, arm64e-maccatalyst ]
3296 umbrella: System3359 umbrella: System
3297exports:3360exports:
3298 - targets: [ x86_64-macos, x86_64-maccatalyst ]
3299 symbols: [ '$ld$hide$os10.4$__Unwind_Backtrace', '$ld$hide$os10.4$__Unwind_DeleteException',
3300 '$ld$hide$os10.4$__Unwind_FindEnclosingFunction', '$ld$hide$os10.4$__Unwind_Find_FDE',
3301 '$ld$hide$os10.4$__Unwind_ForcedUnwind', '$ld$hide$os10.4$__Unwind_GetCFA',
3302 '$ld$hide$os10.4$__Unwind_GetDataRelBase', '$ld$hide$os10.4$__Unwind_GetGR',
3303 '$ld$hide$os10.4$__Unwind_GetIP', '$ld$hide$os10.4$__Unwind_GetIPInfo',
3304 '$ld$hide$os10.4$__Unwind_GetLanguageSpecificData', '$ld$hide$os10.4$__Unwind_GetRegionStart',
3305 '$ld$hide$os10.4$__Unwind_GetTextRelBase', '$ld$hide$os10.4$__Unwind_RaiseException',
3306 '$ld$hide$os10.4$__Unwind_Resume', '$ld$hide$os10.4$__Unwind_Resume_or_Rethrow',
3307 '$ld$hide$os10.4$__Unwind_SetGR', '$ld$hide$os10.4$__Unwind_SetIP',
3308 '$ld$hide$os10.4$___deregister_frame', '$ld$hide$os10.4$___deregister_frame_info',
3309 '$ld$hide$os10.4$___deregister_frame_info_bases', '$ld$hide$os10.4$___register_frame',
3310 '$ld$hide$os10.4$___register_frame_info', '$ld$hide$os10.4$___register_frame_info_bases',
3311 '$ld$hide$os10.4$___register_frame_info_table', '$ld$hide$os10.4$___register_frame_info_table_bases',
3312 '$ld$hide$os10.4$___register_frame_table', '$ld$hide$os10.5$__Unwind_Backtrace',
3313 '$ld$hide$os10.5$__Unwind_DeleteException', '$ld$hide$os10.5$__Unwind_FindEnclosingFunction',
3314 '$ld$hide$os10.5$__Unwind_Find_FDE', '$ld$hide$os10.5$__Unwind_ForcedUnwind',
3315 '$ld$hide$os10.5$__Unwind_GetCFA', '$ld$hide$os10.5$__Unwind_GetDataRelBase',
3316 '$ld$hide$os10.5$__Unwind_GetGR', '$ld$hide$os10.5$__Unwind_GetIP',
3317 '$ld$hide$os10.5$__Unwind_GetIPInfo', '$ld$hide$os10.5$__Unwind_GetLanguageSpecificData',
3318 '$ld$hide$os10.5$__Unwind_GetRegionStart', '$ld$hide$os10.5$__Unwind_GetTextRelBase',
3319 '$ld$hide$os10.5$__Unwind_RaiseException', '$ld$hide$os10.5$__Unwind_Resume',
3320 '$ld$hide$os10.5$__Unwind_Resume_or_Rethrow', '$ld$hide$os10.5$__Unwind_SetGR',
3321 '$ld$hide$os10.5$__Unwind_SetIP', '$ld$hide$os10.5$___deregister_frame',
3322 '$ld$hide$os10.5$___deregister_frame_info', '$ld$hide$os10.5$___deregister_frame_info_bases',
3323 '$ld$hide$os10.5$___register_frame', '$ld$hide$os10.5$___register_frame_info',
3324 '$ld$hide$os10.5$___register_frame_info_bases', '$ld$hide$os10.5$___register_frame_info_table',
3325 '$ld$hide$os10.5$___register_frame_info_table_bases', '$ld$hide$os10.5$___register_frame_table',
3326 '$ld$hide$os10.6$___deregister_frame_info', '$ld$hide$os10.6$___deregister_frame_info_bases',
3327 '$ld$hide$os10.6$___register_frame_info', '$ld$hide$os10.6$___register_frame_info_bases',
3328 '$ld$hide$os10.6$___register_frame_info_table', '$ld$hide$os10.6$___register_frame_info_table_bases',
3329 '$ld$hide$os10.6$___register_frame_table', ___deregister_frame_info,
3330 ___deregister_frame_info_bases, ___register_frame_info, ___register_frame_info_bases,
3331 ___register_frame_info_table, ___register_frame_info_table_bases,
3332 ___register_frame_table ]
3333 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3361 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3334 arm64e-macos, arm64e-maccatalyst ]3362 arm64e-macos, arm64e-maccatalyst ]
3335 symbols: [ __Unwind_Backtrace, __Unwind_DeleteException, __Unwind_FindEnclosingFunction, 3363 symbols: [ __Unwind_Backtrace, __Unwind_DeleteException, __Unwind_FindEnclosingFunction,
...@@ -3347,12 +3375,14 @@ exports:...@@ -3347,12 +3375,14 @@ exports:
3347 _unw_init_local, _unw_is_fpreg, _unw_is_signal_frame, _unw_iterate_dwarf_unwind_cache, 3375 _unw_init_local, _unw_is_fpreg, _unw_is_signal_frame, _unw_iterate_dwarf_unwind_cache,
3348 _unw_local_addr_space, _unw_regname, _unw_resume, _unw_set_fpreg, 3376 _unw_local_addr_space, _unw_regname, _unw_resume, _unw_set_fpreg,
3349 _unw_set_reg, _unw_step ]3377 _unw_set_reg, _unw_step ]
3378 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
3379 symbols: [ ___unw_is_pointer_auth_enabled ]
3350--- !tapi-tbd3380--- !tapi-tbd
3351tbd-version: 43381tbd-version: 4
3352targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3382targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3353 arm64e-macos, arm64e-maccatalyst ]3383 arm64e-macos, arm64e-maccatalyst ]
3354install-name: '/usr/lib/system/libxpc.dylib'3384install-name: '/usr/lib/system/libxpc.dylib'
3355current-version: 2679.0.253385current-version: 2866.40.11
3356parent-umbrella:3386parent-umbrella:
3357 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 3387 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3358 arm64e-macos, arm64e-maccatalyst ]3388 arm64e-macos, arm64e-maccatalyst ]
...@@ -3397,15 +3427,16 @@ exports:...@@ -3397,15 +3427,16 @@ exports:
3397 _XPC_ACTIVITY_USES_DUET_POWER_BUDGETING, _XPC_COALITION_INFO_KEY_BUNDLE_IDENTIFIER, 3427 _XPC_ACTIVITY_USES_DUET_POWER_BUDGETING, _XPC_COALITION_INFO_KEY_BUNDLE_IDENTIFIER,
3398 _XPC_COALITION_INFO_KEY_CID, _XPC_COALITION_INFO_KEY_NAME, 3428 _XPC_COALITION_INFO_KEY_CID, _XPC_COALITION_INFO_KEY_NAME,
3399 _XPC_COALITION_INFO_KEY_RESOURCE_USAGE_BLOB, ___xpc_connection_set_logging, 3429 _XPC_COALITION_INFO_KEY_RESOURCE_USAGE_BLOB, ___xpc_connection_set_logging,
3400 __availability_version_check, __launch_job_routine, __launch_job_routine_async, 3430 __availability_version_check, __launch_job_query_routine,
3401 __launch_msg2, __launch_server_test_routine, __launch_service_stats_copy_4ppse_impl, 3431 __launch_job_routine, __launch_job_routine_async, __launch_msg2,
3432 __launch_server_test_routine, __launch_service_stats_copy_4ppse_impl,
3402 __launch_service_stats_copy_impl, __libxpc_initializer, __spawn_via_launchd, 3433 __launch_service_stats_copy_impl, __libxpc_initializer, __spawn_via_launchd,
3403 __system_ios_support_version_copy_string_sysctl, __system_version_copy_string_plist, 3434 __system_ios_support_version_copy_string_sysctl, __system_version_copy_string_plist,
3404 __system_version_copy_string_sysctl, __system_version_fallback, 3435 __system_version_copy_string_sysctl, __system_version_fallback,
3405 __system_version_parse_string, __vproc_get_last_exit_status, 3436 __system_version_parse_string, __system_version_plist_path,
3406 __vproc_grab_subset, __vproc_kickstart_by_label, __vproc_log, 3437 __vproc_get_last_exit_status, __vproc_grab_subset, __vproc_kickstart_by_label,
3407 __vproc_log_error, __vproc_logv, __vproc_pid_is_managed, __vproc_post_fork_ping, 3438 __vproc_log, __vproc_log_error, __vproc_logv, __vproc_pid_is_managed,
3408 __vproc_send_signal_by_label, __vproc_set_global_on_demand, 3439 __vproc_post_fork_ping, __vproc_send_signal_by_label, __vproc_set_global_on_demand,
3409 __vproc_standby_begin, __vproc_standby_count, __vproc_standby_end, 3440 __vproc_standby_begin, __vproc_standby_count, __vproc_standby_end,
3410 __vproc_standby_timeout, __vproc_transaction_begin, __vproc_transaction_count, 3441 __vproc_standby_timeout, __vproc_transaction_begin, __vproc_transaction_count,
3411 __vproc_transaction_count_for_pid, __vproc_transaction_end, 3442 __vproc_transaction_count_for_pid, __vproc_transaction_end,
...@@ -3419,19 +3450,22 @@ exports:...@@ -3419,19 +3450,22 @@ exports:
3419 __xpc_connection_set_event_handler_f, __xpc_data_set_value, 3450 __xpc_connection_set_event_handler_f, __xpc_data_set_value,
3420 __xpc_dictionary_create_reply_with_port, __xpc_dictionary_extract_mach_send, 3451 __xpc_dictionary_create_reply_with_port, __xpc_dictionary_extract_mach_send,
3421 __xpc_dictionary_extract_reply_msg_id, __xpc_dictionary_extract_reply_port, 3452 __xpc_dictionary_extract_reply_msg_id, __xpc_dictionary_extract_reply_port,
3422 __xpc_dictionary_get_reply_msg_id, __xpc_dictionary_set_remote_connection, 3453 __xpc_dictionary_get_reply_msg_id, __xpc_dictionary_get_transaction,
3423 __xpc_dictionary_set_reply_msg_id, __xpc_domain_routine, __xpc_double_set_value, 3454 __xpc_dictionary_set_remote_connection, __xpc_dictionary_set_reply_msg_id,
3424 __xpc_error_connection_interrupted, __xpc_error_connection_invalid, 3455 __xpc_domain_routine, __xpc_double_set_value, __xpc_error_connection_interrupted,
3425 __xpc_error_key_description, __xpc_error_peer_code_signing_requirement, 3456 __xpc_error_connection_invalid, __xpc_error_key_description,
3426 __xpc_error_termination_imminent, __xpc_event_key_name, __xpc_event_key_stream_name, 3457 __xpc_error_peer_code_signing_requirement, __xpc_error_termination_imminent,
3427 __xpc_fd_get_port, __xpc_int64_set_value, __xpc_payload_create_from_mach_msg, 3458 __xpc_event_key_name, __xpc_event_key_stream_name, __xpc_fd_get_port,
3459 __xpc_int64_set_value, __xpc_payload_create_from_mach_msg,
3428 __xpc_pipe_handle_mig, __xpc_pipe_interface_routine, __xpc_pipe_interface_routine_async, 3460 __xpc_pipe_handle_mig, __xpc_pipe_interface_routine, __xpc_pipe_interface_routine_async,
3429 __xpc_pipe_interface_simpleroutine, __xpc_runtime_get_entitlements_data, 3461 __xpc_pipe_interface_simpleroutine, __xpc_runtime_get_entitlements_data,
3430 __xpc_runtime_get_self_entitlements, __xpc_runtime_is_app_sandboxed, 3462 __xpc_runtime_get_self_entitlements, __xpc_runtime_is_app_sandboxed,
3431 __xpc_service_last_xref_cancel, __xpc_service_routine, __xpc_shmem_get_mach_port, 3463 __xpc_runtime_process_has_entered_sandbox, __xpc_service_last_xref_cancel,
3432 __xpc_spawnattr_binprefs_pack, __xpc_spawnattr_binprefs_size, 3464 __xpc_service_routine, __xpc_session_create_from_connection_4SWIFT,
3433 __xpc_spawnattr_binprefs_unpack, __xpc_spawnattr_pack_bytes, 3465 __xpc_session_extract_connection_4SWIFT, __xpc_session_get_peer_audit_token_4SWIFT,
3434 __xpc_spawnattr_pack_string, __xpc_spawnattr_pack_string_fragment, 3466 __xpc_shmem_get_mach_port, __xpc_spawnattr_binprefs_pack,
3467 __xpc_spawnattr_binprefs_size, __xpc_spawnattr_binprefs_unpack,
3468 __xpc_spawnattr_pack_bytes, __xpc_spawnattr_pack_string, __xpc_spawnattr_pack_string_fragment,
3435 __xpc_spawnattr_unpack_bytes, __xpc_spawnattr_unpack_string, 3469 __xpc_spawnattr_unpack_bytes, __xpc_spawnattr_unpack_string,
3436 __xpc_spawnattr_unpack_strings, __xpc_string_set_value, __xpc_type_activity, 3470 __xpc_spawnattr_unpack_strings, __xpc_string_set_value, __xpc_type_activity,
3437 __xpc_type_array, __xpc_type_base, __xpc_type_bool, __xpc_type_bundle, 3471 __xpc_type_array, __xpc_type_base, __xpc_type_bool, __xpc_type_bundle,
...@@ -3442,13 +3476,20 @@ exports:...@@ -3442,13 +3476,20 @@ exports:
3442 __xpc_type_null, __xpc_type_pipe, __xpc_type_pointer, __xpc_type_rich_error, 3476 __xpc_type_null, __xpc_type_pipe, __xpc_type_pointer, __xpc_type_rich_error,
3443 __xpc_type_serializer, __xpc_type_service, __xpc_type_service_instance, 3477 __xpc_type_serializer, __xpc_type_service, __xpc_type_service_instance,
3444 __xpc_type_session, __xpc_type_shmem, __xpc_type_string, __xpc_type_uint64, 3478 __xpc_type_session, __xpc_type_shmem, __xpc_type_string, __xpc_type_uint64,
3445 __xpc_type_uuid, __xpc_vtables, _bootstrap_check_in, _bootstrap_check_in2, 3479 __xpc_type_uuid, __xpc_vtables, _amfi_developer_mode_resolved,
3446 _bootstrap_check_in3, _bootstrap_create_server, _bootstrap_create_service, 3480 _amfi_developer_mode_status, _amfi_interface_authorize_local_signing,
3447 _bootstrap_get_root, _bootstrap_info, _bootstrap_init, _bootstrap_look_up, 3481 _amfi_interface_cdhash_in_trustcache, _amfi_interface_get_local_signing_private_key,
3448 _bootstrap_look_up2, _bootstrap_look_up3, _bootstrap_look_up_per_user, 3482 _amfi_interface_get_local_signing_public_key, _amfi_interface_query_bootarg_state,
3449 _bootstrap_lookup_children, _bootstrap_parent, _bootstrap_register, 3483 _amfi_interface_set_local_signing_public_key, _amfi_launch_constraint_matches_process,
3450 _bootstrap_register2, _bootstrap_status, _bootstrap_strerror, 3484 _amfi_launch_constraint_set_spawnattr, _amfi_restricted_execution_mode_enable,
3451 _bootstrap_subset, _bootstrap_unprivileged, _create_and_switch_to_per_session_launchd, 3485 _amfi_restricted_execution_mode_status, _bootstrap_check_in,
3486 _bootstrap_check_in2, _bootstrap_check_in3, _bootstrap_create_server,
3487 _bootstrap_create_service, _bootstrap_get_root, _bootstrap_info,
3488 _bootstrap_init, _bootstrap_look_up, _bootstrap_look_up2,
3489 _bootstrap_look_up3, _bootstrap_look_up_per_user, _bootstrap_lookup_children,
3490 _bootstrap_parent, _bootstrap_register, _bootstrap_register2,
3491 _bootstrap_status, _bootstrap_strerror, _bootstrap_subset,
3492 _bootstrap_unprivileged, _create_and_switch_to_per_session_launchd,
3452 _launch_activate_socket, _launch_active_user_login, _launch_active_user_logout, 3493 _launch_activate_socket, _launch_active_user_login, _launch_active_user_logout,
3453 _launch_active_user_switch, _launch_add_external_service, 3494 _launch_active_user_switch, _launch_add_external_service,
3454 _launch_bootout_user_service_4coresim, _launch_copy_busy_extension_instances, 3495 _launch_bootout_user_service_4coresim, _launch_copy_busy_extension_instances,
...@@ -3474,27 +3515,28 @@ exports:...@@ -3474,27 +3515,28 @@ exports:
3474 _launch_extension_property_path, _launch_extension_property_pid, 3515 _launch_extension_property_path, _launch_extension_property_pid,
3475 _launch_extension_property_version, _launch_extension_property_xpc_bundle, 3516 _launch_extension_property_version, _launch_extension_property_xpc_bundle,
3476 _launch_get_fd, _launch_get_service_enabled, _launch_get_system_service_enabled, 3517 _launch_get_fd, _launch_get_service_enabled, _launch_get_system_service_enabled,
3477 _launch_load_mounted_jetsam_properties, _launch_msg, _launch_path_for_user_service_4coresim, 3518 _launch_job_query_get_additional_job_properties, _launch_load_mounted_jetsam_properties,
3478 _launch_perfcheck_property_endpoint_active, _launch_perfcheck_property_endpoint_event, 3519 _launch_msg, _launch_path_for_user_service_4coresim, _launch_perfcheck_property_endpoint_active,
3479 _launch_perfcheck_property_endpoint_name, _launch_perfcheck_property_endpoint_needs_activation, 3520 _launch_perfcheck_property_endpoint_event, _launch_perfcheck_property_endpoint_name,
3480 _launch_perfcheck_property_endpoints, _launch_remove_external_service, 3521 _launch_perfcheck_property_endpoint_needs_activation, _launch_perfcheck_property_endpoints,
3481 _launch_service_instance_copy_uuids, _launch_service_instance_create, 3522 _launch_remove_external_service, _launch_service_instance_copy_uuids,
3482 _launch_service_instance_remove, _launch_service_stats_disable, 3523 _launch_service_instance_create, _launch_service_instance_remove,
3483 _launch_service_stats_disable_4ppse, _launch_service_stats_enable, 3524 _launch_service_stats_disable, _launch_service_stats_disable_4ppse,
3484 _launch_service_stats_enable_4ppse, _launch_service_stats_is_enabled, 3525 _launch_service_stats_enable, _launch_service_stats_enable_4ppse,
3485 _launch_service_stats_is_enabled_4ppse, _launch_set_service_enabled, 3526 _launch_service_stats_is_enabled, _launch_service_stats_is_enabled_4ppse,
3486 _launch_set_system_service_enabled, _launch_socket_service_check_in, 3527 _launch_set_service_enabled, _launch_set_system_service_enabled,
3528 _launch_socket_service_check_in, _launch_userspace_reboot_with_purpose,
3487 _launch_version_for_user_service_4coresim, _launch_wait, _launchd_close, 3529 _launch_version_for_user_service_4coresim, _launch_wait, _launchd_close,
3488 _launchd_fdopen, _launchd_getfd, _launchd_msg_recv, _launchd_msg_send, 3530 _launchd_fdopen, _launchd_getfd, _launchd_msg_recv, _launchd_msg_send,
3489 _load_launchd_jobs_at_loginwindow_prompt, _mpm_uncork_fork, 3531 _load_launchd_jobs_at_loginwindow_prompt, _mpm_uncork_fork,
3490 _mpm_wait, _os_system_version_get_current_version, _os_system_version_get_ios_support_version, 3532 _mpm_wait, _os_system_version_get_current_version, _os_system_version_get_ios_support_version,
3491 _os_system_version_sim_get_current_host_version, _os_transaction_copy_description, 3533 _os_system_version_sim_get_current_host_version, _os_transaction_copy_description,
3492 _os_transaction_create, _os_transaction_get_description, _os_transaction_get_timestamp, 3534 _os_transaction_create, _os_transaction_get_description, _os_transaction_get_ra,
3493 _os_transaction_needs_more_time, _place_hold_on_real_loginwindow, 3535 _os_transaction_get_timestamp, _os_transaction_needs_more_time,
3494 _reboot2, _reboot3, _vproc_release, _vproc_retain, _vproc_standby_begin, 3536 _place_hold_on_real_loginwindow, _reboot2, _reboot3, _vproc_release,
3495 _vproc_standby_end, _vproc_swap_complex, _vproc_swap_integer, 3537 _vproc_retain, _vproc_standby_begin, _vproc_standby_end, _vproc_swap_complex,
3496 _vproc_swap_string, _vproc_transaction_begin, _vproc_transaction_end, 3538 _vproc_swap_integer, _vproc_swap_string, _vproc_transaction_begin,
3497 _vprocmgr_lookup_vproc, _xpc_activity_add_eligibility_changed_handler, 3539 _vproc_transaction_end, _vprocmgr_lookup_vproc, _xpc_activity_add_eligibility_changed_handler,
3498 _xpc_activity_copy_criteria, _xpc_activity_copy_dispatch_queue, 3540 _xpc_activity_copy_criteria, _xpc_activity_copy_dispatch_queue,
3499 _xpc_activity_copy_identifier, _xpc_activity_debug, _xpc_activity_defer_until_network_change, 3541 _xpc_activity_copy_identifier, _xpc_activity_debug, _xpc_activity_defer_until_network_change,
3500 _xpc_activity_defer_until_percentage, _xpc_activity_get_percentage, 3542 _xpc_activity_defer_until_percentage, _xpc_activity_get_percentage,
...@@ -3548,10 +3590,13 @@ exports:...@@ -3548,10 +3590,13 @@ exports:
3548 _xpc_connection_set_instance, _xpc_connection_set_instance_binpref, 3590 _xpc_connection_set_instance, _xpc_connection_set_instance_binpref,
3549 _xpc_connection_set_legacy, _xpc_connection_set_non_launching, 3591 _xpc_connection_set_legacy, _xpc_connection_set_non_launching,
3550 _xpc_connection_set_oneshot_instance, _xpc_connection_set_peer_code_signing_requirement, 3592 _xpc_connection_set_oneshot_instance, _xpc_connection_set_peer_code_signing_requirement,
3551 _xpc_connection_set_privileged, _xpc_connection_set_qos_class_fallback, 3593 _xpc_connection_set_peer_entitlement_exists_requirement, _xpc_connection_set_peer_entitlement_matches_value_requirement,
3552 _xpc_connection_set_qos_class_floor, _xpc_connection_set_target_queue, 3594 _xpc_connection_set_peer_lightweight_code_requirement, _xpc_connection_set_peer_platform_identity_requirement,
3553 _xpc_connection_set_target_uid, _xpc_connection_set_target_user_session_uid, 3595 _xpc_connection_set_peer_team_identity_requirement, _xpc_connection_set_privileged,
3554 _xpc_connection_suspend, _xpc_copy, _xpc_copy_bootstrap, _xpc_copy_clean_description, 3596 _xpc_connection_set_qos_class_fallback, _xpc_connection_set_qos_class_floor,
3597 _xpc_connection_set_target_queue, _xpc_connection_set_target_uid,
3598 _xpc_connection_set_target_user_session_uid, _xpc_connection_suspend,
3599 _xpc_copy, _xpc_copy_bootstrap, _xpc_copy_clean_description,
3555 _xpc_copy_code_signing_identity_for_token, _xpc_copy_debug_description, 3600 _xpc_copy_code_signing_identity_for_token, _xpc_copy_debug_description,
3556 _xpc_copy_description, _xpc_copy_domain, _xpc_copy_entitlement_for_self, 3601 _xpc_copy_description, _xpc_copy_domain, _xpc_copy_entitlement_for_self,
3557 _xpc_copy_entitlement_for_token, _xpc_copy_entitlements_data_for_token, 3602 _xpc_copy_entitlement_for_token, _xpc_copy_entitlements_data_for_token,
...@@ -3587,31 +3632,36 @@ exports:...@@ -3587,31 +3632,36 @@ exports:
3587 _xpc_dictionary_set_string, _xpc_dictionary_set_uint64, _xpc_dictionary_set_uuid, 3632 _xpc_dictionary_set_string, _xpc_dictionary_set_uint64, _xpc_dictionary_set_uuid,
3588 _xpc_dictionary_set_value, _xpc_double_create, _xpc_double_get_value, 3633 _xpc_dictionary_set_value, _xpc_double_create, _xpc_double_get_value,
3589 _xpc_endpoint_compare, _xpc_endpoint_copy_listener_port_4sim, 3634 _xpc_endpoint_compare, _xpc_endpoint_copy_listener_port_4sim,
3590 _xpc_endpoint_create, _xpc_endpoint_create_bs_named, _xpc_endpoint_create_bs_service, 3635 _xpc_endpoint_create, _xpc_endpoint_create_bs_from_port, _xpc_endpoint_create_bs_named,
3591 _xpc_endpoint_create_mach_port_4sim, _xpc_endpoint_get_bs_job_handle, 3636 _xpc_endpoint_create_bs_service, _xpc_endpoint_create_mach_port_4sim,
3592 _xpc_equal, _xpc_event_publisher_activate, _xpc_event_publisher_copy_event, 3637 _xpc_endpoint_get_bs_job_handle, _xpc_equal, _xpc_event_publisher_activate,
3593 _xpc_event_publisher_create, _xpc_event_publisher_fire, _xpc_event_publisher_fire_noboost, 3638 _xpc_event_publisher_copy_event, _xpc_event_publisher_create,
3639 _xpc_event_publisher_create_subscription, _xpc_event_publisher_fire,
3640 _xpc_event_publisher_fire_barrier, _xpc_event_publisher_fire_noboost,
3594 _xpc_event_publisher_fire_with_reply, _xpc_event_publisher_fire_with_reply_sync, 3641 _xpc_event_publisher_fire_with_reply, _xpc_event_publisher_fire_with_reply_sync,
3595 _xpc_event_publisher_get_subscriber_asid, _xpc_event_publisher_set_error_handler, 3642 _xpc_event_publisher_get_subscriber_asid, _xpc_event_publisher_set_error_handler,
3596 _xpc_event_publisher_set_event, _xpc_event_publisher_set_handler, 3643 _xpc_event_publisher_set_event, _xpc_event_publisher_set_handler,
3597 _xpc_event_publisher_set_initial_load_completed_handler_4remoted, 3644 _xpc_event_publisher_set_initial_load_completed_handler_4remoted,
3598 _xpc_event_publisher_set_subscriber_keepalive, _xpc_event_stream_check_in, 3645 _xpc_event_publisher_set_subscriber_keepalive, _xpc_event_publisher_set_throttling,
3599 _xpc_event_stream_check_in2, _xpc_exit_reason_get_label, _xpc_extension_type_init, 3646 _xpc_event_stream_check_in, _xpc_event_stream_check_in2, _xpc_exit_reason_get_label,
3600 _xpc_fd_create, _xpc_fd_dup, _xpc_file_transfer_cancel, _xpc_file_transfer_copy_io, 3647 _xpc_extension_type_init, _xpc_fd_create, _xpc_fd_dup, _xpc_file_transfer_cancel,
3601 _xpc_file_transfer_create_with_fd, _xpc_file_transfer_create_with_path, 3648 _xpc_file_transfer_copy_io, _xpc_file_transfer_create_with_fd,
3602 _xpc_file_transfer_get_size, _xpc_file_transfer_get_transfer_id, 3649 _xpc_file_transfer_create_with_path, _xpc_file_transfer_get_size,
3603 _xpc_file_transfer_send_finished, _xpc_file_transfer_set_transport_writing_callbacks, 3650 _xpc_file_transfer_get_transfer_id, _xpc_file_transfer_send_finished,
3604 _xpc_file_transfer_write_finished, _xpc_file_transfer_write_to_fd, 3651 _xpc_file_transfer_set_transport_writing_callbacks, _xpc_file_transfer_write_finished,
3605 _xpc_file_transfer_write_to_path, _xpc_generate_audit_token, 3652 _xpc_file_transfer_write_to_fd, _xpc_file_transfer_write_to_path,
3606 _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC, _xpc_get_event_name, 3653 _xpc_generate_audit_token, _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC,
3607 _xpc_get_instance, _xpc_get_type, _xpc_handle_service, _xpc_handle_subservice, 3654 _xpc_get_event_name, _xpc_get_instance, _xpc_get_service_identifier_for_token,
3655 _xpc_get_service_name_from_pid, _xpc_get_service_uid_for_token,
3656 _xpc_get_type, _xpc_handle_service, _xpc_handle_subservice,
3608 _xpc_hash, _xpc_impersonate_user, _xpc_init_services, _xpc_inspect_copy_description, 3657 _xpc_hash, _xpc_impersonate_user, _xpc_init_services, _xpc_inspect_copy_description,
3609 _xpc_inspect_copy_description_local, _xpc_inspect_copy_short_description, 3658 _xpc_inspect_copy_description_local, _xpc_inspect_copy_short_description,
3610 _xpc_inspect_copy_short_description_local, _xpc_install_remote_hooks, 3659 _xpc_inspect_copy_short_description_local, _xpc_install_remote_hooks,
3611 _xpc_int64_create, _xpc_int64_get_value, _xpc_is_kind_of_xpc_object4NSXPC, 3660 _xpc_int64_create, _xpc_int64_get_value, _xpc_is_kind_of_xpc_object4NSXPC,
3612 _xpc_is_system_session, _xpc_listener_activate, _xpc_listener_cancel, 3661 _xpc_is_system_session, _xpc_is_xpcservice, _xpc_listener_activate,
3613 _xpc_listener_copy_description, _xpc_listener_create, _xpc_listener_create_anonymous, 3662 _xpc_listener_cancel, _xpc_listener_copy_description, _xpc_listener_create,
3614 _xpc_listener_create_endpoint, _xpc_listener_reject_peer, 3663 _xpc_listener_create_anonymous, _xpc_listener_create_endpoint,
3664 _xpc_listener_reject_peer, _xpc_listener_set_peer_code_signing_requirement,
3615 _xpc_mach_recv_create, _xpc_mach_recv_extract_right, _xpc_mach_send_copy_right, 3665 _xpc_mach_recv_create, _xpc_mach_recv_extract_right, _xpc_mach_send_copy_right,
3616 _xpc_mach_send_create, _xpc_mach_send_create_with_disposition, 3666 _xpc_mach_send_create, _xpc_mach_send_create_with_disposition,
3617 _xpc_mach_send_get_right, _xpc_mach_send_once_create, _xpc_mach_send_once_extract_right, 3667 _xpc_mach_send_get_right, _xpc_mach_send_once_create, _xpc_mach_send_once_extract_right,
...@@ -3622,9 +3672,10 @@ exports:...@@ -3622,9 +3672,10 @@ exports:
3622 _xpc_pipe_routine_async, _xpc_pipe_routine_forward, _xpc_pipe_routine_reply, 3672 _xpc_pipe_routine_async, _xpc_pipe_routine_forward, _xpc_pipe_routine_reply,
3623 _xpc_pipe_routine_with_flags, _xpc_pipe_simpleroutine, _xpc_pipe_try_receive, 3673 _xpc_pipe_routine_with_flags, _xpc_pipe_simpleroutine, _xpc_pipe_try_receive,
3624 _xpc_pointer_create, _xpc_pointer_get_value, _xpc_receive_mach_msg, 3674 _xpc_pointer_create, _xpc_pointer_get_value, _xpc_receive_mach_msg,
3625 _xpc_receive_remote_msg, _xpc_release, _xpc_retain, _xpc_rich_error_can_retry, 3675 _xpc_receive_mach_msg_validate_hdr, _xpc_receive_remote_msg,
3626 _xpc_rich_error_copy_description, _xpc_service_attach, _xpc_service_attach_with_flags, 3676 _xpc_release, _xpc_retain, _xpc_rich_error_can_retry, _xpc_rich_error_copy_description,
3627 _xpc_service_create, _xpc_service_create_from_specifier, _xpc_service_get_rendezvous_token, 3677 _xpc_service_attach, _xpc_service_attach_with_flags, _xpc_service_create,
3678 _xpc_service_create_from_specifier, _xpc_service_get_rendezvous_token,
3628 _xpc_service_instance_dup2, _xpc_service_instance_get_context, 3679 _xpc_service_instance_dup2, _xpc_service_instance_get_context,
3629 _xpc_service_instance_get_host_pid, _xpc_service_instance_get_pid, 3680 _xpc_service_instance_get_host_pid, _xpc_service_instance_get_pid,
3630 _xpc_service_instance_get_type, _xpc_service_instance_is_configurable, 3681 _xpc_service_instance_get_type, _xpc_service_instance_is_configurable,
...@@ -3639,7 +3690,8 @@ exports:...@@ -3639,7 +3690,8 @@ exports:
3639 _xpc_session_create_xpc_endpoint, _xpc_session_create_xpc_service, 3690 _xpc_session_create_xpc_endpoint, _xpc_session_create_xpc_service,
3640 _xpc_session_send_message, _xpc_session_send_message_with_reply_async, 3691 _xpc_session_send_message, _xpc_session_send_message_with_reply_async,
3641 _xpc_session_send_message_with_reply_sync, _xpc_session_set_cancel_handler, 3692 _xpc_session_send_message_with_reply_sync, _xpc_session_set_cancel_handler,
3642 _xpc_session_set_incoming_message_handler, _xpc_session_set_target_queue, 3693 _xpc_session_set_incoming_message_handler, _xpc_session_set_instance,
3694 _xpc_session_set_peer_code_signing_requirement, _xpc_session_set_target_queue,
3643 _xpc_session_set_target_user_session_uid, _xpc_set_event, 3695 _xpc_session_set_target_user_session_uid, _xpc_set_event,
3644 _xpc_set_event_state, _xpc_set_event_stream_handler, _xpc_set_event_with_flags, 3696 _xpc_set_event_state, _xpc_set_event_stream_handler, _xpc_set_event_with_flags,
3645 _xpc_set_idle_handler, _xpc_shmem_create, _xpc_shmem_create_readonly, 3697 _xpc_set_idle_handler, _xpc_shmem_create, _xpc_shmem_create_readonly,
lib/libc/include/any-macos-any/AssertMacros.h+26-12
...@@ -218,18 +218,32 @@...@@ -218,18 +218,32 @@
218 #ifdef KERNEL218 #ifdef KERNEL
219 #include <libkern/libkern.h>219 #include <libkern/libkern.h>
220 #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \220 #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \
221 printf( "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value));221 printf( "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", assertion, (message!=0) ? message : "", file, line, (long long) (value));
222 #elif TARGET_OS_DRIVERKIT222 #elif TARGET_OS_DRIVERKIT
223 #include <os/log.h>223 #include <os/log.h>
224 #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \224 #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \
225 os_log(OS_LOG_DEFAULT, "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value));225 os_log(OS_LOG_DEFAULT, "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", assertion, (message!=0) ? message : "", file, line, (long long) (value));
226 #else226 #else
227 #include <stdio.h>227 #include <stdio.h>
228 #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \228 #define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \
229 fprintf(stderr, "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value));229 fprintf(stderr, "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", assertion, (message!=0) ? message : "", file, line, (long long) (value));
230 #endif230 #endif
231#endif231#endif
232232
233/*
234 * DEBUG_ASSERT_FORCE_64_BIT_ERROR_CODE
235 *
236 * Summary:
237 * By default the errorCode passed to DEBUG_ASSERT_MESSAGE will be the system word
238 * length. If DEBUG_ASSERT_FORCE_64_BIT_ERROR_CODE is set then it will be changed
239 * to a 64 bit integer, even on 32 bit platforms.
240 */
241#ifndef DEBUG_ASSERT_FORCE_64_BIT_ERROR_CODE
242 #define DEBUG_ASSERT_ERROR_TYPE long
243#else
244 #define DEBUG_ASSERT_ERROR_TYPE long long
245#endif
246
233247
234248
235249
...@@ -361,7 +375,7 @@...@@ -361,7 +375,7 @@
361 #define __Check_noErr(errorCode) \375 #define __Check_noErr(errorCode) \
362 do \376 do \
363 { \377 { \
364 long evalOnceErrorCode = (errorCode); \378 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
365 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \379 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
366 { \380 { \
367 DEBUG_ASSERT_MESSAGE( \381 DEBUG_ASSERT_MESSAGE( \
...@@ -397,7 +411,7 @@...@@ -397,7 +411,7 @@
397 #define __Check_noErr_String(errorCode, message) \411 #define __Check_noErr_String(errorCode, message) \
398 do \412 do \
399 { \413 { \
400 long evalOnceErrorCode = (errorCode); \414 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
401 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \415 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
402 { \416 { \
403 DEBUG_ASSERT_MESSAGE( \417 DEBUG_ASSERT_MESSAGE( \
...@@ -523,7 +537,7 @@...@@ -523,7 +537,7 @@
523 #define __Verify_noErr(errorCode) \537 #define __Verify_noErr(errorCode) \
524 do \538 do \
525 { \539 { \
526 long evalOnceErrorCode = (errorCode); \540 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
527 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \541 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
528 { \542 { \
529 DEBUG_ASSERT_MESSAGE( \543 DEBUG_ASSERT_MESSAGE( \
...@@ -565,7 +579,7 @@...@@ -565,7 +579,7 @@
565 #define __Verify_noErr_String(errorCode, message) \579 #define __Verify_noErr_String(errorCode, message) \
566 do \580 do \
567 { \581 { \
568 long evalOnceErrorCode = (errorCode); \582 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
569 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \583 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
570 { \584 { \
571 DEBUG_ASSERT_MESSAGE( \585 DEBUG_ASSERT_MESSAGE( \
...@@ -605,7 +619,7 @@...@@ -605,7 +619,7 @@
605 #else619 #else
606 #define __Verify_noErr_Action(errorCode, action) \620 #define __Verify_noErr_Action(errorCode, action) \
607 do { \621 do { \
608 long evalOnceErrorCode = (errorCode); \622 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
609 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) { \623 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) { \
610 DEBUG_ASSERT_MESSAGE( \624 DEBUG_ASSERT_MESSAGE( \
611 DEBUG_ASSERT_COMPONENT_NAME_STRING, \625 DEBUG_ASSERT_COMPONENT_NAME_STRING, \
...@@ -970,7 +984,7 @@...@@ -970,7 +984,7 @@
970 #define __Require_noErr(errorCode, exceptionLabel) \984 #define __Require_noErr(errorCode, exceptionLabel) \
971 do \985 do \
972 { \986 { \
973 long evalOnceErrorCode = (errorCode); \987 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
974 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \988 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
975 { \989 { \
976 DEBUG_ASSERT_MESSAGE( \990 DEBUG_ASSERT_MESSAGE( \
...@@ -1022,7 +1036,7 @@...@@ -1022,7 +1036,7 @@
1022 #define __Require_noErr_Action(errorCode, exceptionLabel, action) \1036 #define __Require_noErr_Action(errorCode, exceptionLabel, action) \
1023 do \1037 do \
1024 { \1038 { \
1025 long evalOnceErrorCode = (errorCode); \1039 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
1026 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \1040 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
1027 { \1041 { \
1028 DEBUG_ASSERT_MESSAGE( \1042 DEBUG_ASSERT_MESSAGE( \
...@@ -1131,7 +1145,7 @@...@@ -1131,7 +1145,7 @@
1131 #define __Require_noErr_String(errorCode, exceptionLabel, message) \1145 #define __Require_noErr_String(errorCode, exceptionLabel, message) \
1132 do \1146 do \
1133 { \1147 { \
1134 long evalOnceErrorCode = (errorCode); \1148 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
1135 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \1149 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
1136 { \1150 { \
1137 DEBUG_ASSERT_MESSAGE( \1151 DEBUG_ASSERT_MESSAGE( \
...@@ -1186,7 +1200,7 @@...@@ -1186,7 +1200,7 @@
1186 #define __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) \1200 #define __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) \
1187 do \1201 do \
1188 { \1202 { \
1189 long evalOnceErrorCode = (errorCode); \1203 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
1190 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \1204 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
1191 { \1205 { \
1192 DEBUG_ASSERT_MESSAGE( \1206 DEBUG_ASSERT_MESSAGE( \
lib/libc/include/any-macos-any/Availability.h+31-10
...@@ -159,13 +159,26 @@...@@ -159,13 +159,26 @@
159#define __API_TO_BE_DEPRECATED_DRIVERKIT 100000159#define __API_TO_BE_DEPRECATED_DRIVERKIT 100000
160#endif160#endif
161161
162#ifndef __API_TO_BE_DEPRECATED_XROS162#ifndef __API_TO_BE_DEPRECATED_VISIONOS
163#define __API_TO_BE_DEPRECATED_XROS 100000163#define __API_TO_BE_DEPRECATED_VISIONOS 100000
164#endif164#endif
165165
166#ifndef __API_TO_BE_DEPRECATED_EXCLAVEKIT
167
168#endif
169
170
171
172#ifndef __OPEN_SOURCE__
173
174#endif /* __OPEN_SOURCE__ */
166175
167#include <AvailabilityVersions.h>176#include <AvailabilityVersions.h>
168#include <AvailabilityInternal.h>177#include <AvailabilityInternal.h>
178#include <AvailabilityInternalLegacy.h>
179#if __has_include(<AvailabilityInternalPrivate.h>)
180 #include <AvailabilityInternalPrivate.h>
181#endif
169182
170#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED183#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
171 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios184 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
...@@ -419,9 +432,9 @@...@@ -419,9 +432,9 @@
419 * __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))432 * __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
420 * __API_AVAILABLE(driverkit(19.0))433 * __API_AVAILABLE(driverkit(19.0))
421 */434 */
422 #define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)435 #define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE8,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
423436
424 #define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)437 #define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN8,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
425 #define __API_AVAILABLE_END _Pragma("clang attribute pop")438 #define __API_AVAILABLE_END _Pragma("clang attribute pop")
426439
427 /*440 /*
...@@ -440,13 +453,13 @@...@@ -440,13 +453,13 @@
440 * __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))453 * __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
441 * __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))454 * __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
442 */455 */
443 #define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)456 #define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
444 #define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)457 #define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
445458
446 #define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)459 #define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN8,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
447 #define __API_DEPRECATED_END _Pragma("clang attribute pop")460 #define __API_DEPRECATED_END _Pragma("clang attribute pop")
448461
449 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)462 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN8,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
450 #define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")463 #define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
451464
452 /*465 /*
...@@ -457,9 +470,9 @@...@@ -457,9 +470,9 @@
457 * __API_UNAVAILABLE(macos)470 * __API_UNAVAILABLE(macos)
458 * __API_UNAVAILABLE(watchos, tvos)471 * __API_UNAVAILABLE(watchos, tvos)
459 */472 */
460 #define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)473 #define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE8,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
461 474
462 #define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)475 #define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN8,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
463 #define __API_UNAVAILABLE_END _Pragma("clang attribute pop")476 #define __API_UNAVAILABLE_END _Pragma("clang attribute pop")
464 #endif /* __has_attribute(availability) */477 #endif /* __has_attribute(availability) */
465#endif /* #if defined(__has_feature) && defined(__has_attribute) */478#endif /* #if defined(__has_feature) && defined(__has_attribute) */
...@@ -524,6 +537,14 @@...@@ -524,6 +537,14 @@
524 #define __SPI_AVAILABLE(...)537 #define __SPI_AVAILABLE(...)
525#endif538#endif
526539
540#ifndef __SPI_AVAILABLE_BEGIN
541 #define __SPI_AVAILABLE_BEGIN(...)
542#endif
543
544#ifndef __SPI_AVAILABLE_END
545 #define __SPI_AVAILABLE_END(...)
546#endif
547
527#ifndef __SPI_DEPRECATED548#ifndef __SPI_DEPRECATED
528 #define __SPI_DEPRECATED(...)549 #define __SPI_DEPRECATED(...)
529#endif550#endif
lib/libc/include/any-macos-any/AvailabilityInternal.h+79-59
...@@ -30,19 +30,17 @@...@@ -30,19 +30,17 @@
30#ifndef __AVAILABILITY_INTERNAL__30#ifndef __AVAILABILITY_INTERNAL__
31#define __AVAILABILITY_INTERNAL__31#define __AVAILABILITY_INTERNAL__
3232
33#if __has_include(<AvailabilityInternalPrivate.h>)33#include <AvailabilityVersions.h>
34 #include <AvailabilityInternalPrivate.h>
35#endif
3634
37#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED35#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
38 #if defined(__has_builtin) && __has_builtin(__is_target_os)36 #if defined(__has_builtin) && __has_builtin(__is_target_os)
39 #if __is_target_os(macos)37 #if __is_target_os(macos)
40 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__38 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
41 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_039 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
42 #endif40 #endif
43 #elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 41 #elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
44 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__42 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
45 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_043 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
46 #endif /* __has_builtin(__is_target_os) && __is_target_os(macos) */44 #endif /* __has_builtin(__is_target_os) && __is_target_os(macos) */
47#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */45#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
4846
...@@ -50,11 +48,11 @@...@@ -50,11 +48,11 @@
50 #if defined(__has_builtin) && __has_builtin(__is_target_os)48 #if defined(__has_builtin) && __has_builtin(__is_target_os)
51 #if __is_target_os(ios)49 #if __is_target_os(ios)
52 #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__50 #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
53 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_051 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
54 #endif52 #endif
55 #elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ 53 #elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
56 #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__54 #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
57 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_055 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
58 #endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */56 #endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */
59#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */57#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
6058
...@@ -62,13 +60,13 @@...@@ -62,13 +60,13 @@
62 #if defined(__has_builtin) && __has_builtin(__is_target_os)60 #if defined(__has_builtin) && __has_builtin(__is_target_os)
63 #if __is_target_os(watchos)61 #if __is_target_os(watchos)
64 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__62 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
65 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_063 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
66 /* for compatibility with existing code. New code should use platform specific checks */64 /* for compatibility with existing code. New code should use platform specific checks */
67 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_065 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
68 #endif66 #endif
69 #elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ 67 #elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
70 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__68 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
71 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_069 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
72 /* for compatibility with existing code. New code should use platform specific checks */70 /* for compatibility with existing code. New code should use platform specific checks */
73 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_071 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
74 #endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */72 #endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */
...@@ -78,13 +76,13 @@...@@ -78,13 +76,13 @@
78 #if defined(__has_builtin) && __has_builtin(__is_target_os)76 #if defined(__has_builtin) && __has_builtin(__is_target_os)
79 #if __is_target_os(tvos)77 #if __is_target_os(tvos)
80 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__78 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
81 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_079 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
82 /* for compatibility with existing code. New code should use platform specific checks */80 /* for compatibility with existing code. New code should use platform specific checks */
83 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_081 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
84 #endif82 #endif
85 #elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ 83 #elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
86 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__84 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
87 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_085 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
88 /* for compatibility with existing code. New code should use platform specific checks */86 /* for compatibility with existing code. New code should use platform specific checks */
89 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_087 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
90 #endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */88 #endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */
...@@ -94,7 +92,7 @@...@@ -94,7 +92,7 @@
94 #if defined(__has_builtin) && __has_builtin(__is_target_os)92 #if defined(__has_builtin) && __has_builtin(__is_target_os)
95 #if __is_target_os(bridgeos)93 #if __is_target_os(bridgeos)
96 #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__94 #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
97 #define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_8_095 #define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_9_1
98 /* for compatibility with existing code. New code should use platform specific checks */96 /* for compatibility with existing code. New code should use platform specific checks */
99 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_097 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_0
100 #endif98 #endif
...@@ -105,22 +103,45 @@...@@ -105,22 +103,45 @@
105 #if defined(__has_builtin) && __has_builtin(__is_target_os)103 #if defined(__has_builtin) && __has_builtin(__is_target_os)
106 #if __is_target_os(driverkit)104 #if __is_target_os(driverkit)
107 #define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__105 #define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
108 #define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_23_0106 #define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_24_1
109 #endif107 #endif
110 #endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */108 #endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */
111#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */109#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */
112110
113#ifndef __XR_OS_VERSION_MIN_REQUIRED111#ifndef __VISION_OS_VERSION_MIN_REQUIRED
112 #if defined(__has_builtin) && __has_builtin(__is_target_os)
113 #if __is_target_os(visionos)
114 #define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
115 #define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_1
116 /* for compatibility with existing code. New code should use platform specific checks */
117 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
118 #endif
119 #endif /* __has_builtin(__is_target_os) && __is_target_os(visionos) */
120#endif /* __VISION_OS_VERSION_MIN_REQUIRED */
121
122
123//FIXME: Workaround for rdar://116062344
124#ifndef __VISION_OS_VERSION_MIN_REQUIRED
114 #if defined(__has_builtin) && __has_builtin(__is_target_os)125 #if defined(__has_builtin) && __has_builtin(__is_target_os)
115 #if __is_target_os(xros)126 #if __is_target_os(xros)
116 #define __XR_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__127 #define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
117 #define __XR_OS_VERSION_MAX_ALLOWED __XROS_1_0128 // Hardcoded these since until compiler fix for rdar://116062344 will land
129 #if defined(__VISIONOS_2_0)
130 #define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_0
131 #elif defined(__VISIONOS_1_1)
132 #define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_1_1
133 #elif defined(__VISIONOS_1_0)
134 #define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_1_0
135 #endif
118 /* for compatibility with existing code. New code should use platform specific checks */136 /* for compatibility with existing code. New code should use platform specific checks */
119 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_0137 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
120 #endif138 #endif
121 #endif /* __has_builtin(__is_target_os) && __is_target_os(xros) */139 #endif /* __has_builtin(__is_target_os) && __is_target_os(visionos) */
122#endif /* __XR_OS_VERSION_MIN_REQUIRED */140#endif /* __VISION_OS_VERSION_MIN_REQUIRED */
123141
142#ifndef __OPEN_SOURCE__
143
144#endif /* __OPEN_SOURCE__ */
124145
125#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED146#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
126 /* make sure a default max version is set */147 /* make sure a default max version is set */
...@@ -150,43 +171,42 @@...@@ -150,43 +171,42 @@
150#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))171#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
151#define __AVAILABILITY_INTERNAL_REGULAR 172#define __AVAILABILITY_INTERNAL_REGULAR
152173
153#include <AvailabilityInternalLegacy.h>
154
155#if defined(__has_feature) && defined(__has_attribute)174#if defined(__has_feature) && defined(__has_attribute)
156 #if __has_attribute(availability)175 #if __has_attribute(availability)
157 #define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x176 #define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
158 #define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
159 #define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y177 #define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y
178 #define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
160 #define __API_AVAILABLE_PLATFORM_macosx(x) macos,introduced=x179 #define __API_AVAILABLE_PLATFORM_macosx(x) macos,introduced=x
161 #define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
162 #define __API_DEPRECATED_PLATFORM_macosx(x,y) macos,introduced=x,deprecated=y180 #define __API_DEPRECATED_PLATFORM_macosx(x,y) macos,introduced=x,deprecated=y
181 #define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
163 #define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x182 #define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x
164 #define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
165 #define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y183 #define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y
184 #define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
166 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x185 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
167 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
168 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y186 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
169 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
170 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable187 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
188 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
171 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y189 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
190 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
172 #define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x191 #define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x
173 #define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
174 #define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y192 #define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y
193 #define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
175 #define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x194 #define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x
176 #define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
177 #define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y195 #define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y
196 #define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
178 197
179 198
180 199
181 #define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x200 #define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x
182 #define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
183 #define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y201 #define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y
184 #define __API_AVAILABLE_PLATFORM_xros(x) xros,introduced=x202 #define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
185 #define __API_UNAVAILABLE_PLATFORM_xros xros,unavailable203 #define __API_AVAILABLE_PLATFORM_visionos(x) visionos,introduced=x
186 #define __API_DEPRECATED_PLATFORM_xros(x,y) xros,introduced=x,deprecated=y204 #define __API_DEPRECATED_PLATFORM_visionos(x,y) visionos,introduced=x,deprecated=y
187 #define __API_AVAILABLE_PLATFORM_visionos(x) xros,introduced=x205 #define __API_UNAVAILABLE_PLATFORM_visionos visionos,unavailable
188 #define __API_UNAVAILABLE_PLATFORM_visionos xros,unavailable206 #define __API_AVAILABLE_PLATFORM_xros(x) visionos,introduced=x
189 #define __API_DEPRECATED_PLATFORM_visionos(x,y) xros,introduced=x,deprecated=y207 #define __API_DEPRECATED_PLATFORM_xros(x,y) visionos,introduced=x,deprecated=y
208 #define __API_UNAVAILABLE_PLATFORM_xros visionos,unavailable
209
190 #endif /* __has_attribute(availability) */210 #endif /* __has_attribute(availability) */
191#endif /* defined(__has_feature) && defined(__has_attribute) */211#endif /* defined(__has_feature) && defined(__has_attribute) */
192212
...@@ -218,7 +238,8 @@...@@ -218,7 +238,8 @@
218 #define __API_AVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5)238 #define __API_AVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5)
219 #define __API_AVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6)239 #define __API_AVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6)
220 #define __API_AVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6) __API_A(arg7)240 #define __API_AVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6) __API_A(arg7)
221 #define __API_AVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME241 #define __API_AVAILABLE8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6) __API_A(arg7) __API_A(arg8)
242 #define __API_AVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
222 243
223 #define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))244 #define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
224 245
...@@ -230,7 +251,8 @@...@@ -230,7 +251,8 @@
230 #define __API_AVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5)251 #define __API_AVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5)
231 #define __API_AVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6)252 #define __API_AVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6)
232 #define __API_AVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6) __API_A_BEGIN(arg7)253 #define __API_AVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6) __API_A_BEGIN(arg7)
233 #define __API_AVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME254 #define __API_AVAILABLE_BEGIN8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6) __API_A_BEGIN(arg7) __API_A_BEGIN(arg8)
255 #define __API_AVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
234256
235 257
236258
...@@ -244,7 +266,8 @@...@@ -244,7 +266,8 @@
244 #define __API_DEPRECATED_MSG5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5)266 #define __API_DEPRECATED_MSG5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5)
245 #define __API_DEPRECATED_MSG6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6)267 #define __API_DEPRECATED_MSG6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6)
246 #define __API_DEPRECATED_MSG7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6) __API_D(msg,arg7)268 #define __API_DEPRECATED_MSG7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6) __API_D(msg,arg7)
247 #define __API_DEPRECATED_MSG_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME269 #define __API_DEPRECATED_MSG8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6) __API_D(msg,arg7) __API_D(msg,arg8)
270 #define __API_DEPRECATED_MSG_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
248271
249 #define __API_D_BEGIN(msg, x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))), apply_to = __API_APPLY_TO)))272 #define __API_D_BEGIN(msg, x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))), apply_to = __API_APPLY_TO)))
250273
...@@ -256,7 +279,8 @@...@@ -256,7 +279,8 @@
256 #define __API_DEPRECATED_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5)279 #define __API_DEPRECATED_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5)
257 #define __API_DEPRECATED_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6)280 #define __API_DEPRECATED_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6)
258 #define __API_DEPRECATED_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6) __API_D_BEGIN(msg,arg7)281 #define __API_DEPRECATED_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6) __API_D_BEGIN(msg,arg7)
259 #define __API_DEPRECATED_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME282 #define __API_DEPRECATED_BEGIN8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6) __API_D_BEGIN(msg,arg7) __API_D_BEGIN(msg,arg8)
283 #define __API_DEPRECATED_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
260284
261 #if __has_feature(attribute_availability_with_replacement)285 #if __has_feature(attribute_availability_with_replacement)
262 #define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))286 #define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))
...@@ -272,7 +296,8 @@...@@ -272,7 +296,8 @@
272 #define __API_DEPRECATED_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5)296 #define __API_DEPRECATED_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5)
273 #define __API_DEPRECATED_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6)297 #define __API_DEPRECATED_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6)
274 #define __API_DEPRECATED_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6) __API_R(msg,arg7)298 #define __API_DEPRECATED_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6) __API_R(msg,arg7)
275 #define __API_DEPRECATED_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME299 #define __API_DEPRECATED_REP8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6) __API_R(msg,arg7) __API_R(msg,arg8)
300 #define __API_DEPRECATED_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
276301
277 #if __has_feature(attribute_availability_with_replacement)302 #if __has_feature(attribute_availability_with_replacement)
278 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep))), apply_to = __API_APPLY_TO))) 303 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep))), apply_to = __API_APPLY_TO)))
...@@ -280,15 +305,16 @@...@@ -280,15 +305,16 @@
280 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO))) 305 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
281 #endif306 #endif
282307
283 #define __API_DEPRECATED_BEGIN_REP0(msg,arg0) __API_R_BEGIN(msg,arg0)308 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN0(msg,arg0) __API_R_BEGIN(msg,arg0)
284 #define __API_DEPRECATED_BEGIN_REP1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)309 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)
285 #define __API_DEPRECATED_BEGIN_REP2(msg,arg0,arg1,arg2) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2)310 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN2(msg,arg0,arg1,arg2) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2)
286 #define __API_DEPRECATED_BEGIN_REP3(msg,arg0,arg1,arg2,arg3) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3)311 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN3(msg,arg0,arg1,arg2,arg3) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3)
287 #define __API_DEPRECATED_BEGIN_REP4(msg,arg0,arg1,arg2,arg3,arg4) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4)312 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN4(msg,arg0,arg1,arg2,arg3,arg4) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4)
288 #define __API_DEPRECATED_BEGIN_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5)313 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5)
289 #define __API_DEPRECATED_BEGIN_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6)314 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6)
290 #define __API_DEPRECATED_BEGIN_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)315 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)
291 #define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME316 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7) __API_R_BEGIN(msg,arg8)
317 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
292318
293 /*319 /*
294 * API Unavailability320 * API Unavailability
...@@ -309,7 +335,8 @@...@@ -309,7 +335,8 @@
309 #define __API_UNAVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5)335 #define __API_UNAVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5)
310 #define __API_UNAVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6)336 #define __API_UNAVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6)
311 #define __API_UNAVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6) __API_U(arg7)337 #define __API_UNAVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6) __API_U(arg7)
312 #define __API_UNAVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME338 #define __API_UNAVAILABLE8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6) __API_U(arg7) __API_U(arg8)
339 #define __API_UNAVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
313340
314 #define __API_U_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))341 #define __API_U_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
315342
...@@ -321,7 +348,8 @@...@@ -321,7 +348,8 @@
321 #define __API_UNAVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5)348 #define __API_UNAVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5)
322 #define __API_UNAVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6)349 #define __API_UNAVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6)
323 #define __API_UNAVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6) __API_U_BEGIN(arg7)350 #define __API_UNAVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6) __API_U_BEGIN(arg7)
324 #define __API_UNAVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME351 #define __API_UNAVAILABLE_BEGIN8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6) __API_U_BEGIN(arg7) __API_U_BEGIN(arg8)
352 #define __API_UNAVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
325353
326 #endif /* __has_attribute(availability) */354 #endif /* __has_attribute(availability) */
327#endif /* #if defined(__has_feature) && defined(__has_attribute) */355#endif /* #if defined(__has_feature) && defined(__has_attribute) */
...@@ -346,12 +374,4 @@...@@ -346,12 +374,4 @@
346 #define __swift_compiler_version_at_least(...) 1374 #define __swift_compiler_version_at_least(...) 1
347#endif375#endif
348376
349/*
350 * If __SPI_AVAILABLE has not been defined elsewhere, disable it.
351 */
352
353#ifndef __SPI_AVAILABLE
354 #define __SPI_AVAILABLE(...)
355#endif
356
357#endif /* __AVAILABILITY_INTERNAL__ */377#endif /* __AVAILABILITY_INTERNAL__ */
lib/libc/include/any-macos-any/AvailabilityInternalLegacy.h+2
...@@ -31,6 +31,8 @@...@@ -31,6 +31,8 @@
31#ifndef __AVAILABILITY_INTERNAL_LEGACY__31#ifndef __AVAILABILITY_INTERNAL_LEGACY__
32#define __AVAILABILITY_INTERNAL_LEGACY__32#define __AVAILABILITY_INTERNAL_LEGACY__
3333
34#include <AvailabilityInternal.h>
35
34#if defined(__has_builtin)36#if defined(__has_builtin)
35 #if __has_builtin(__is_target_arch)37 #if __has_builtin(__is_target_arch)
36 #if __has_builtin(__is_target_vendor)38 #if __has_builtin(__is_target_vendor)
lib/libc/include/any-macos-any/AvailabilityVersions.h+78-2
...@@ -70,13 +70,24 @@...@@ -70,13 +70,24 @@
70#define __MAC_12_3 12030070#define __MAC_12_3 120300
71#define __MAC_12_4 12040071#define __MAC_12_4 120400
72#define __MAC_12_5 12050072#define __MAC_12_5 120500
73#define __MAC_12_6 120600
74#define __MAC_12_7 120700
73#define __MAC_13_0 13000075#define __MAC_13_0 130000
74#define __MAC_13_1 13010076#define __MAC_13_1 130100
75#define __MAC_13_1 13010077#define __MAC_13_1 130100
76#define __MAC_13_2 13020078#define __MAC_13_2 130200
77#define __MAC_13_3 13030079#define __MAC_13_3 130300
78#define __MAC_13_4 13040080#define __MAC_13_4 130400
81#define __MAC_13_5 130500
82#define __MAC_13_6 130600
79#define __MAC_14_0 14000083#define __MAC_14_0 140000
84#define __MAC_14_1 140100
85#define __MAC_14_2 140200
86#define __MAC_14_3 140300
87#define __MAC_14_4 140400
88#define __MAC_14_5 140500
89#define __MAC_15_0 150000
90#define __MAC_15_1 150100
80/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */91/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
8192
82#define __IPHONE_2_0 2000093#define __IPHONE_2_0 20000
...@@ -143,13 +154,24 @@...@@ -143,13 +154,24 @@
143#define __IPHONE_15_4 150400154#define __IPHONE_15_4 150400
144#define __IPHONE_15_5 150500155#define __IPHONE_15_5 150500
145#define __IPHONE_15_6 150600156#define __IPHONE_15_6 150600
157#define __IPHONE_15_7 150700
158#define __IPHONE_15_8 150800
146#define __IPHONE_16_0 160000159#define __IPHONE_16_0 160000
147#define __IPHONE_16_1 160100160#define __IPHONE_16_1 160100
148#define __IPHONE_16_2 160200161#define __IPHONE_16_2 160200
149#define __IPHONE_16_3 160300162#define __IPHONE_16_3 160300
150#define __IPHONE_16_4 160400163#define __IPHONE_16_4 160400
151#define __IPHONE_16_5 160500164#define __IPHONE_16_5 160500
165#define __IPHONE_16_6 160600
166#define __IPHONE_16_7 160700
152#define __IPHONE_17_0 170000167#define __IPHONE_17_0 170000
168#define __IPHONE_17_1 170100
169#define __IPHONE_17_2 170200
170#define __IPHONE_17_3 170300
171#define __IPHONE_17_4 170400
172#define __IPHONE_17_5 170500
173#define __IPHONE_18_0 180000
174#define __IPHONE_18_1 180100
153/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */175/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
154176
155#define __WATCHOS_1_0 10000177#define __WATCHOS_1_0 10000
...@@ -185,13 +207,22 @@...@@ -185,13 +207,22 @@
185#define __WATCHOS_8_5 80500207#define __WATCHOS_8_5 80500
186#define __WATCHOS_8_6 80600208#define __WATCHOS_8_6 80600
187#define __WATCHOS_8_7 80700209#define __WATCHOS_8_7 80700
210#define __WATCHOS_8_8 80800
188#define __WATCHOS_9_0 90000211#define __WATCHOS_9_0 90000
189#define __WATCHOS_9_1 90100212#define __WATCHOS_9_1 90100
190#define __WATCHOS_9_2 90200213#define __WATCHOS_9_2 90200
191#define __WATCHOS_9_3 90300214#define __WATCHOS_9_3 90300
192#define __WATCHOS_9_4 90400215#define __WATCHOS_9_4 90400
193#define __WATCHOS_9_5 90500216#define __WATCHOS_9_5 90500
217#define __WATCHOS_9_6 90600
194#define __WATCHOS_10_0 100000218#define __WATCHOS_10_0 100000
219#define __WATCHOS_10_1 100100
220#define __WATCHOS_10_2 100200
221#define __WATCHOS_10_3 100300
222#define __WATCHOS_10_4 100400
223#define __WATCHOS_10_5 100500
224#define __WATCHOS_11_0 110000
225#define __WATCHOS_11_1 110100
195/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */226/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
196227
197#define __TVOS_9_0 90000228#define __TVOS_9_0 90000
...@@ -235,7 +266,15 @@...@@ -235,7 +266,15 @@
235#define __TVOS_16_3 160300266#define __TVOS_16_3 160300
236#define __TVOS_16_4 160400267#define __TVOS_16_4 160400
237#define __TVOS_16_5 160500268#define __TVOS_16_5 160500
269#define __TVOS_16_6 160600
238#define __TVOS_17_0 170000270#define __TVOS_17_0 170000
271#define __TVOS_17_1 170100
272#define __TVOS_17_2 170200
273#define __TVOS_17_3 170300
274#define __TVOS_17_4 170400
275#define __TVOS_17_5 170500
276#define __TVOS_18_0 180000
277#define __TVOS_18_1 180100
239/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */278/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
240279
241#define __BRIDGEOS_2_0 20000280#define __BRIDGEOS_2_0 20000
...@@ -258,7 +297,15 @@...@@ -258,7 +297,15 @@
258#define __BRIDGEOS_7_2 70200297#define __BRIDGEOS_7_2 70200
259#define __BRIDGEOS_7_3 70300298#define __BRIDGEOS_7_3 70300
260#define __BRIDGEOS_7_4 70400299#define __BRIDGEOS_7_4 70400
300#define __BRIDGEOS_7_6 70600
261#define __BRIDGEOS_8_0 80000301#define __BRIDGEOS_8_0 80000
302#define __BRIDGEOS_8_1 80100
303#define __BRIDGEOS_8_2 80200
304#define __BRIDGEOS_8_3 80300
305#define __BRIDGEOS_8_4 80400
306#define __BRIDGEOS_8_5 80500
307#define __BRIDGEOS_9_0 90000
308#define __BRIDGEOS_9_1 90100
262309
263310
264#define __DRIVERKIT_19_0 190000311#define __DRIVERKIT_19_0 190000
...@@ -267,13 +314,31 @@...@@ -267,13 +314,31 @@
267#define __DRIVERKIT_22_0 220000314#define __DRIVERKIT_22_0 220000
268#define __DRIVERKIT_22_4 220400315#define __DRIVERKIT_22_4 220400
269#define __DRIVERKIT_22_5 220500316#define __DRIVERKIT_22_5 220500
317#define __DRIVERKIT_22_6 220600
270#define __DRIVERKIT_23_0 230000318#define __DRIVERKIT_23_0 230000
319#define __DRIVERKIT_23_1 230100
320#define __DRIVERKIT_23_2 230200
321#define __DRIVERKIT_23_3 230300
322#define __DRIVERKIT_23_4 230400
323#define __DRIVERKIT_23_5 230500
324#define __DRIVERKIT_24_0 240000
325#define __DRIVERKIT_24_1 240100
271/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */326/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
272327
273#define __XROS_1_0 10000328#define __VISIONOS_1_0 10000
274/* __XROS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */329#define __VISIONOS_1_1 10100
330#define __VISIONOS_1_2 10200
331#define __VISIONOS_2_0 20000
332#define __VISIONOS_2_1 20100
333/* __VISIONOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
275334
276335
336
337
338#ifndef __OPEN_SOURCE__
339
340#endif /* __OPEN_SOURCE__ */
341
277/*342/*
278 * Set up standard Mac OS X versions343 * Set up standard Mac OS X versions
279 */344 */
...@@ -326,13 +391,24 @@...@@ -326,13 +391,24 @@
326#define MAC_OS_VERSION_12_3 __MAC_12_3391#define MAC_OS_VERSION_12_3 __MAC_12_3
327#define MAC_OS_VERSION_12_4 __MAC_12_4392#define MAC_OS_VERSION_12_4 __MAC_12_4
328#define MAC_OS_VERSION_12_5 __MAC_12_5393#define MAC_OS_VERSION_12_5 __MAC_12_5
394#define MAC_OS_VERSION_12_6 __MAC_12_6
395#define MAC_OS_VERSION_12_7 __MAC_12_7
329#define MAC_OS_VERSION_13_0 __MAC_13_0396#define MAC_OS_VERSION_13_0 __MAC_13_0
330#define MAC_OS_VERSION_13_1 __MAC_13_1397#define MAC_OS_VERSION_13_1 __MAC_13_1
331#define MAC_OS_VERSION_13_1 __MAC_13_1398#define MAC_OS_VERSION_13_1 __MAC_13_1
332#define MAC_OS_VERSION_13_2 __MAC_13_2399#define MAC_OS_VERSION_13_2 __MAC_13_2
333#define MAC_OS_VERSION_13_3 __MAC_13_3400#define MAC_OS_VERSION_13_3 __MAC_13_3
334#define MAC_OS_VERSION_13_4 __MAC_13_4401#define MAC_OS_VERSION_13_4 __MAC_13_4
402#define MAC_OS_VERSION_13_5 __MAC_13_5
403#define MAC_OS_VERSION_13_6 __MAC_13_6
335#define MAC_OS_VERSION_14_0 __MAC_14_0404#define MAC_OS_VERSION_14_0 __MAC_14_0
405#define MAC_OS_VERSION_14_1 __MAC_14_1
406#define MAC_OS_VERSION_14_2 __MAC_14_2
407#define MAC_OS_VERSION_14_3 __MAC_14_3
408#define MAC_OS_VERSION_14_4 __MAC_14_4
409#define MAC_OS_VERSION_14_5 __MAC_14_5
410#define MAC_OS_VERSION_15_0 __MAC_15_0
411#define MAC_OS_VERSION_15_1 __MAC_15_1
336412
337#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */413#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */
338414
lib/libc/include/any-macos-any/MacTypes.h+12-4
...@@ -37,10 +37,12 @@...@@ -37,10 +37,12 @@
37#ifndef __MACTYPES__37#ifndef __MACTYPES__
38#define __MACTYPES__38#define __MACTYPES__
3939
40#ifndef __CONDITIONALMACROS__40#if __has_include(<ConditionalMacros.h>)
41#include <ConditionalMacros.h>41#include <ConditionalMacros.h>
42#endif42#endif
4343
44#include <TargetConditionals.h>
45
44#include <stdbool.h>46#include <stdbool.h>
4547
46#include <sys/types.h>48#include <sys/types.h>
...@@ -153,7 +155,7 @@ typedef struct UnsignedWide UnsignedWide;...@@ -153,7 +155,7 @@ typedef struct UnsignedWide UnsignedWide;
153155
154#endif156#endif
155157
156#if TYPE_LONGLONG158#if TYPE_LONGLONG || 0
157/*159/*
158 Note: wide and UnsignedWide must always be structs for source code160 Note: wide and UnsignedWide must always be structs for source code
159 compatibility. On the other hand UInt64 and SInt64 can be161 compatibility. On the other hand UInt64 and SInt64 can be
...@@ -178,7 +180,7 @@ typedef struct UnsignedWide UnsignedWide;...@@ -178,7 +180,7 @@ typedef struct UnsignedWide UnsignedWide;
178180
179typedef wide SInt64;181typedef wide SInt64;
180typedef UnsignedWide UInt64;182typedef UnsignedWide UInt64;
181#endif /* TYPE_LONGLONG */183#endif
182184
183/********************************************************************************185/********************************************************************************
184186
...@@ -307,6 +309,8 @@ typedef ResType * ResTypePtr;...@@ -307,6 +309,8 @@ typedef ResType * ResTypePtr;
307 309
308*********************************************************************************/310*********************************************************************************/
309typedef unsigned char Boolean;311typedef unsigned char Boolean;
312
313#if !0
310/********************************************************************************314/********************************************************************************
311315
312 Function Pointer Types316 Function Pointer Types
...@@ -330,6 +334,8 @@ typedef ProcPtr UniversalProcPtr;...@@ -330,6 +334,8 @@ typedef ProcPtr UniversalProcPtr;
330334
331typedef ProcPtr * ProcHandle;335typedef ProcPtr * ProcHandle;
332typedef UniversalProcPtr * UniversalProcHandle;336typedef UniversalProcPtr * UniversalProcHandle;
337#endif
338
333/********************************************************************************339/********************************************************************************
334340
335 RefCon Types341 RefCon Types
...@@ -691,6 +697,8 @@ typedef UnsignedWide * UnsignedWidePtr;...@@ -691,6 +697,8 @@ typedef UnsignedWide * UnsignedWidePtr;
691typedef Float80 extended80;697typedef Float80 extended80;
692typedef Float96 extended96;698typedef Float96 extended96;
693typedef SInt8 VHSelect;699typedef SInt8 VHSelect;
700
701#if !0
694/*********************************************************************************702/*********************************************************************************
695703
696 Debugger functions704 Debugger functions
...@@ -718,7 +726,7 @@ Debugger(void) __OSX_AVAILABLE_BU...@@ -718,7 +726,7 @@ Debugger(void) __OSX_AVAILABLE_BU
718 */726 */
719extern void 727extern void
720DebugStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);728DebugStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
721729#endif
722730
723/*731/*
724 * debugstr()732 * debugstr()
lib/libc/include/any-macos-any/TargetConditionals.h+289-399
...@@ -51,49 +51,56 @@...@@ -51,49 +51,56 @@
51 * TARGET_CPU_MIPS - Compiler is generating MIPS instructions51 * TARGET_CPU_MIPS - Compiler is generating MIPS instructions
52 * TARGET_CPU_SPARC - Compiler is generating Sparc instructions52 * TARGET_CPU_SPARC - Compiler is generating Sparc instructions
53 * TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions53 * TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
54 *54 */
55 *55
56
57
58/*
56 * TARGET_OS_*59 * TARGET_OS_*
60 *
57 * These conditionals specify in which Operating System the generated code will61 * These conditionals specify in which Operating System the generated code will
58 * run. Indention is used to show which conditionals are evolutionary subclasses.62 * run. Indention is used to show which conditionals are evolutionary subclasses.
59 *63 *
60 * The MAC/WIN32/UNIX conditionals are mutually exclusive.64 * The MAC/WIN32/UNIX conditionals are mutually exclusive.
61 * The IOS/TV/WATCH conditionals are mutually exclusive.65 * The IOS/TV/WATCH/VISION conditionals are mutually exclusive.
62 *66 *
67 * TARGET_OS_WIN32 - Generated code will run on WIN32 API
68 * TARGET_OS_WINDOWS - Generated code will run on Windows
69 * TARGET_OS_UNIX - Generated code will run on some Unix (not macOS)
70 * TARGET_OS_LINUX - Generated code will run on Linux
71 * TARGET_OS_MAC - Generated code will run on a variant of macOS
72 * TARGET_OS_OSX - Generated code will run on macOS
73 * TARGET_OS_IPHONE - Generated code will run on a variant of iOS (firmware, devices, simulator)
74 * TARGET_OS_IOS - Generated code will run on iOS
75 * TARGET_OS_MACCATALYST - Generated code will run on macOS
76 * TARGET_OS_TV - Generated code will run on tvOS
77 * TARGET_OS_WATCH - Generated code will run on watchOS
78 * TARGET_OS_VISION - Generated code will run on visionOS
79 * TARGET_OS_BRIDGE - Generated code will run on bridge devices
80 * TARGET_OS_SIMULATOR - Generated code will run on an iOS, tvOS, watchOS, or visionOS simulator
81 * TARGET_OS_DRIVERKIT - Generated code will run on macOS, iOS, tvOS, watchOS, or visionOS
63 *82 *
64 * TARGET_OS_WIN32 - Generated code will run under WIN32 API83 * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
65 * TARGET_OS_WINDOWS - Generated code will run under Windows84 * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
66 * TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)85 * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
67 * TARGET_OS_LINUX - Generated code will run under Linux
68 * TARGET_OS_MAC - Generated code will run under Mac OS X variant
69 * TARGET_OS_OSX - Generated code will run under OS X devices
70 * TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
71 * TARGET_OS_IOS - Generated code will run under iOS
72 * TARGET_OS_TV - Generated code will run under Apple TV OS
73 * TARGET_OS_WATCH - Generated code will run under Apple Watch OS
74 * TARGET_OS_BRIDGE - Generated code will run under Bridge devices
75 * TARGET_OS_MACCATALYST - Generated code will run under macOS
76 * TARGET_OS_DRIVERKIT - Generated code will run under macOS, iOS, Apple TV OS, or Apple Watch OS
77 * TARGET_OS_SIMULATOR - Generated code will run under a simulator
78 *86 *
79 * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead87 * +--------------------------------------------------------------------------------------+
80 * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR88 * | TARGET_OS_MAC |
81 * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH89 * | +-----+ +------------------------------------------------------------+ +-----------+ |
82 *90 * | | | | TARGET_OS_IPHONE | | | |
83 * +---------------------------------------------------------------------------+91 * | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | |
84 * | TARGET_OS_MAC |92 * | | | | | IOS | | | | | | | | | | | | |
85 * | +-----+ +-------------------------------------------------+ +-----------+ |93 * | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | VISION | | | DRIVERKIT | |
86 * | | | | TARGET_OS_IPHONE | | | |94 * | | | | | | MACCATALYST | | | | | | | | | | | | | |
87 * | | | | +-----------------+ +----+ +-------+ +--------+ | | | |95 * | | | | | +-------------+ | | | | | | | | | | | | |
88 * | | | | | IOS | | | | | | | | | | |96 * | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | |
89 * | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | | DRIVERKIT | |97 * | +-----+ +------------------------------------------------------------+ +-----------+ |
90 * | | | | | | MACCATALYST | | | | | | | | | | | |98 * +--------------------------------------------------------------------------------------+
91 * | | | | | +-------------+ | | | | | | | | | | |99 */
92 * | | | | +-----------------+ +----+ +-------+ +--------+ | | | |
93 * | +-----+ +-------------------------------------------------+ +-----------+ |
94 * +---------------------------------------------------------------------------+
95100
101/*
96 * TARGET_RT_*102 * TARGET_RT_*
103 *
97 * These conditionals specify in which runtime the generated code will104 * These conditionals specify in which runtime the generated code will
98 * run. This is needed when the OS and CPU support more than one runtime105 * run. This is needed when the OS and CPU support more than one runtime
99 * (e.g. Mac OS X supports CFM and mach-o).106 * (e.g. Mac OS X supports CFM and mach-o).
...@@ -105,7 +112,7 @@...@@ -105,7 +112,7 @@
105 * TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used112 * TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used
106 */113 */
107 114
108 /*115/*
109 * TARGET_OS conditionals can be enabled via clang preprocessor extensions:116 * TARGET_OS conditionals can be enabled via clang preprocessor extensions:
110 *117 *
111 * __is_target_arch118 * __is_target_arch
...@@ -130,6 +137,7 @@...@@ -130,6 +137,7 @@
130 * It is disabled by default.137 * It is disabled by default.
131 */138 */
132139
140#if !defined(__has_extension) || !__has_extension(define_target_os_macros)
133#if defined(__has_builtin)141#if defined(__has_builtin)
134 #if __has_builtin(__is_target_arch)142 #if __has_builtin(__is_target_arch)
135 #if __has_builtin(__is_target_vendor)143 #if __has_builtin(__is_target_vendor)
...@@ -141,26 +149,15 @@...@@ -141,26 +149,15 @@
141 /* "-target=arm64e-apple-ios12-macabi" */149 /* "-target=arm64e-apple-ios12-macabi" */
142 #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)150 #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)
143 #define TARGET_OS_MAC 1151 #define TARGET_OS_MAC 1
144 #define TARGET_OS_OSX 0
145 #define TARGET_OS_IPHONE 1152 #define TARGET_OS_IPHONE 1
146 #define TARGET_OS_IOS 1153 #define TARGET_OS_IOS 1
147 #define TARGET_OS_WATCH 0
148
149 #define TARGET_OS_TV 0
150 #define TARGET_OS_SIMULATOR 0
151 #define TARGET_OS_EMBEDDED 0
152 #define TARGET_OS_RTKIT 0
153 #define TARGET_OS_MACCATALYST 1154 #define TARGET_OS_MACCATALYST 1
154 #define TARGET_OS_MACCATALYST 1155 #define TARGET_OS_MACCATALYST 1
155
156 #define TARGET_OS_VISION 0
157
158
159 #ifndef TARGET_OS_UIKITFORMAC156 #ifndef TARGET_OS_UIKITFORMAC
160 #define TARGET_OS_UIKITFORMAC 1157 #define TARGET_OS_UIKITFORMAC 1
161 #endif158 #endif
162 #define TARGET_OS_DRIVERKIT 0159 #define TARGET_OS_UNIX 0
163 #define DYNAMIC_TARGETS_ENABLED 1160 #define DYNAMIC_TARGETS_ENABLED 1
164 #endif 161 #endif
165162
166 /* "-target=x86_64-apple-ios12-simulator" */163 /* "-target=x86_64-apple-ios12-simulator" */
...@@ -168,131 +165,42 @@...@@ -168,131 +165,42 @@
168 /* "-target=arm64e-apple-ios12-simulator" */165 /* "-target=arm64e-apple-ios12-simulator" */
169 #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator)166 #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator)
170 #define TARGET_OS_MAC 1167 #define TARGET_OS_MAC 1
171 #define TARGET_OS_OSX 0
172 #define TARGET_OS_IPHONE 1168 #define TARGET_OS_IPHONE 1
173 #define TARGET_OS_IOS 1169 #define TARGET_OS_IOS 1
174 #define TARGET_OS_WATCH 0
175
176 #define TARGET_OS_TV 0
177 #define TARGET_OS_SIMULATOR 1170 #define TARGET_OS_SIMULATOR 1
178 #define TARGET_OS_EMBEDDED 0 171 #define TARGET_OS_UNIX 0
179 #define TARGET_OS_RTKIT 0
180 #define TARGET_OS_MACCATALYST 0
181 #define TARGET_OS_MACCATALYST 0
182
183 #define TARGET_OS_VISION 0
184
185
186 #ifndef TARGET_OS_UIKITFORMAC
187 #define TARGET_OS_UIKITFORMAC 0
188 #endif
189 #define TARGET_OS_DRIVERKIT 0
190 #define DYNAMIC_TARGETS_ENABLED 1172 #define DYNAMIC_TARGETS_ENABLED 1
191 #endif 173 #endif
192174
193175
194176
195 /* "-target=arm64e-apple-xros1.0" */177 /* "-target=arm64e-apple-xros1.0[-simulator]" */
196 #if (__is_target_arch(arm64e) || __is_target_arch(arm64)) && __is_target_vendor(apple) && __is_target_os(xros)178 #if __is_target_vendor(apple) && __is_target_os(xros)
197 #define TARGET_OS_MAC 1179 #define TARGET_OS_MAC 1
198 #define TARGET_OS_OSX 0
199 #define TARGET_OS_IPHONE 1180 #define TARGET_OS_IPHONE 1
200 #define TARGET_OS_IOS 1
201 #define TARGET_OS_WATCH 0
202
203 #define TARGET_OS_TV 0
204 #define TARGET_OS_SIMULATOR 0
205 #define TARGET_OS_EMBEDDED 1
206 #define TARGET_OS_RTKIT 0
207 #define TARGET_OS_MACCATALYST 0
208 #define TARGET_OS_MACCATALYST 0
209181
210 #define TARGET_OS_VISION 1182 #if __is_target_environment(simulator)
211 183 #define TARGET_OS_SIMULATOR 1
212 184 #else
213 #ifndef TARGET_OS_UIKITFORMAC185 #define TARGET_OS_EMBEDDED 1
214 #define TARGET_OS_UIKITFORMAC 0
215 #endif186 #endif
216 #define TARGET_OS_DRIVERKIT 0
217 #define DYNAMIC_TARGETS_ENABLED 1
218 #endif
219
220 /* "-target=arm64e-apple-xros1.0-simulator" */
221 #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(xros) && __is_target_environment(simulator)
222 #define TARGET_OS_MAC 1
223 #define TARGET_OS_OSX 0
224 #define TARGET_OS_IPHONE 1
225 #define TARGET_OS_IOS 1
226 #define TARGET_OS_WATCH 0
227
228 #define TARGET_OS_TV 0
229 #define TARGET_OS_SIMULATOR 1
230 #define TARGET_OS_EMBEDDED 0
231 #define TARGET_OS_RTKIT 0
232 #define TARGET_OS_MACCATALYST 0
233 #define TARGET_OS_MACCATALYST 0
234
235 #define TARGET_OS_VISION 1187 #define TARGET_OS_VISION 1
236 188 #define TARGET_OS_UNIX 0
237
238 #ifndef TARGET_OS_UIKITFORMAC
239 #define TARGET_OS_UIKITFORMAC 0
240 #endif
241 #define TARGET_OS_DRIVERKIT 0
242 #define DYNAMIC_TARGETS_ENABLED 1189 #define DYNAMIC_TARGETS_ENABLED 1
243 #endif190 #endif
244191
245 192
246 193 #if (__is_target_vendor(apple) && __is_target_environment(exclavecore))
247 //FIXME: Workaround for rdar://100536146
248 #if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVECORE__) && __APPLE_EXCLAVECORE__)
249 #define TARGET_OS_MAC 0
250 #define TARGET_OS_OSX 0
251 #define TARGET_OS_IPHONE 0
252 #define TARGET_OS_IOS 0
253 #define TARGET_OS_WATCH 0
254 194
255 #define TARGET_OS_TV 0195 #define TARGET_OS_UNIX 0
256 #define TARGET_OS_SIMULATOR 0
257 #define TARGET_OS_EMBEDDED 0
258 #define TARGET_OS_RTKIT 0
259 #define TARGET_OS_MACCATALYST 0
260 #define TARGET_OS_MACCATALYST 0
261
262 #define TARGET_OS_VISION 0
263
264
265 #ifndef TARGET_OS_UIKITFORMAC
266 #define TARGET_OS_UIKITFORMAC 0
267 #endif
268 #define TARGET_OS_DRIVERKIT 0
269 #define DYNAMIC_TARGETS_ENABLED 1196 #define DYNAMIC_TARGETS_ENABLED 1
270 #endif197 #endif
271198
272 199
273 200 #if (__is_target_vendor(apple) && __is_target_environment(exclavekit))
274 //FIXME: Workaround for rdar://100536146
275 #if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVEKIT__) && __APPLE_EXCLAVEKIT__)
276 #define TARGET_OS_MAC 1201 #define TARGET_OS_MAC 1
277 #define TARGET_OS_OSX 0
278 #define TARGET_OS_IPHONE 0
279 #define TARGET_OS_IOS 0
280 #define TARGET_OS_WATCH 0
281
282 #define TARGET_OS_TV 0
283 #define TARGET_OS_SIMULATOR 0
284 #define TARGET_OS_EMBEDDED 0
285 #define TARGET_OS_RTKIT 0
286 #define TARGET_OS_MACCATALYST 0
287 #define TARGET_OS_MACCATALYST 0
288
289 #define TARGET_OS_VISION 0
290
291 202
292 #ifndef TARGET_OS_UIKITFORMAC203 #define TARGET_OS_UNIX 0
293 #define TARGET_OS_UIKITFORMAC 0
294 #endif
295 #define TARGET_OS_DRIVERKIT 0
296 #define DYNAMIC_TARGETS_ENABLED 1204 #define DYNAMIC_TARGETS_ENABLED 1
297 #endif205 #endif
298206
...@@ -301,25 +209,8 @@...@@ -301,25 +209,8 @@
301 /* "-target=arm64e-apple-driverkit19.0" */209 /* "-target=arm64e-apple-driverkit19.0" */
302 #if __is_target_vendor(apple) && __is_target_os(driverkit)210 #if __is_target_vendor(apple) && __is_target_os(driverkit)
303 #define TARGET_OS_MAC 1211 #define TARGET_OS_MAC 1
304 #define TARGET_OS_OSX 0
305 #define TARGET_OS_IPHONE 0
306 #define TARGET_OS_IOS 0
307 #define TARGET_OS_WATCH 0
308
309 #define TARGET_OS_TV 0
310 #define TARGET_OS_SIMULATOR 0
311 #define TARGET_OS_EMBEDDED 0
312 #define TARGET_OS_RTKIT 0
313 #define TARGET_OS_MACCATALYST 0
314 #define TARGET_OS_MACCATALYST 0
315
316 #define TARGET_OS_VISION 0
317
318
319 #ifndef TARGET_OS_UIKITFORMAC
320 #define TARGET_OS_UIKITFORMAC 0
321 #endif
322 #define TARGET_OS_DRIVERKIT 1212 #define TARGET_OS_DRIVERKIT 1
213 #define TARGET_OS_UNIX 0
323 #define DYNAMIC_TARGETS_ENABLED 1214 #define DYNAMIC_TARGETS_ENABLED 1
324 #endif215 #endif
325216
...@@ -329,186 +220,83 @@...@@ -329,186 +220,83 @@
329 #endif /* #if __has_builtin(__is_target_arch) */220 #endif /* #if __has_builtin(__is_target_arch) */
330#endif /* #if defined(__has_builtin) */221#endif /* #if defined(__has_builtin) */
331222
332
333#ifndef DYNAMIC_TARGETS_ENABLED223#ifndef DYNAMIC_TARGETS_ENABLED
334 #define DYNAMIC_TARGETS_ENABLED 0224 #define DYNAMIC_TARGETS_ENABLED 0
335#endif /* DYNAMIC_TARGETS_ENABLED */225#endif /* DYNAMIC_TARGETS_ENABLED */
336226
337/*227/*
338 * gcc based compiler used on Mac OS X228 * gcc based compiler used on Mac OS X
339 */229 */
340#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )230#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
341 #define TARGET_OS_WIN32 0
342 #define TARGET_OS_WINDOWS 0
343 #define TARGET_OS_UNIX 0
344 #define TARGET_OS_LINUX 0
345
346 #if !DYNAMIC_TARGETS_ENABLED231 #if !DYNAMIC_TARGETS_ENABLED
347 #define TARGET_OS_MAC 1232 #define TARGET_OS_MAC 1
348 #define TARGET_OS_OSX 1233 #define TARGET_OS_OSX 1
349 #define TARGET_OS_IPHONE 0234 #define TARGET_OS_IPHONE 0
235
350 #define TARGET_OS_IOS 0236 #define TARGET_OS_IOS 0
237
351 #define TARGET_OS_WATCH 0238 #define TARGET_OS_WATCH 0
352 239
353 #define TARGET_OS_TV 0240 #define TARGET_OS_TV 0
354 #define TARGET_OS_MACCATALYST 0241 #define TARGET_OS_MACCATALYST 0
355 #define TARGET_OS_MACCATALYST 0242 #define TARGET_OS_MACCATALYST 0
356
357
358
359 #define TARGET_OS_VISION 0
360 #ifndef TARGET_OS_UIKITFORMAC243 #ifndef TARGET_OS_UIKITFORMAC
361 #define TARGET_OS_UIKITFORMAC 0244 #define TARGET_OS_UIKITFORMAC 0
362 #endif245 #endif
363 #define TARGET_OS_SIMULATOR 0246 #define TARGET_OS_SIMULATOR 0
364 #define TARGET_OS_EMBEDDED 0 247 #define TARGET_OS_EMBEDDED 0
365 #define TARGET_OS_RTKIT 0 248 #define TARGET_OS_UNIX 0
366 #define TARGET_OS_DRIVERKIT 0
367 #endif249 #endif
368
369 #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
370 #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
371250
372 #define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST))251/*
373 #if defined(__ppc__)252 * CodeWarrior compiler from Metrowerks/Motorola
374 #define TARGET_CPU_PPC 1253 */
375 #define TARGET_CPU_PPC64 0254#elif defined(__MWERKS__)
376 #define TARGET_CPU_68K 0255 #define TARGET_OS_MAC 1
377 #define TARGET_CPU_X86 0256
378 #define TARGET_CPU_X86_64 0257/*
379 #define TARGET_CPU_ARM 0258 * unknown compiler
380 #define TARGET_CPU_ARM64 0259 */
381 #define TARGET_CPU_MIPS 0260#else
382 #define TARGET_CPU_SPARC 0 261 #define TARGET_OS_MAC 1
383 #define TARGET_CPU_ALPHA 0262#endif
384 #define TARGET_RT_LITTLE_ENDIAN 0263#endif /* !defined(__has_extension) || !__has_extension(define_target_os_macros) */
385 #define TARGET_RT_BIG_ENDIAN 1264
386 #define TARGET_RT_64_BIT 0265// This has to always be defined in the header due to limitations in define_target_os_macros
387 #ifdef __MACOS_CLASSIC__266#define TARGET_OS_RTKIT 0
388 #define TARGET_RT_MAC_CFM 1267
389 #define TARGET_RT_MAC_MACHO 0268/*
390 #else269 * gcc based compiler used on Mac OS X
391 #define TARGET_RT_MAC_CFM 0270 */
392 #define TARGET_RT_MAC_MACHO 1271#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
393 #endif272 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
394 #elif defined(__ppc64__)
395 #define TARGET_CPU_PPC 0
396 #define TARGET_CPU_PPC64 1
397 #define TARGET_CPU_68K 0
398 #define TARGET_CPU_X86 0
399 #define TARGET_CPU_X86_64 0
400 #define TARGET_CPU_ARM 0
401 #define TARGET_CPU_ARM64 0
402 #define TARGET_CPU_MIPS 0
403 #define TARGET_CPU_SPARC 0
404 #define TARGET_CPU_ALPHA 0
405 #define TARGET_RT_LITTLE_ENDIAN 0
406 #define TARGET_RT_BIG_ENDIAN 1
407 #define TARGET_RT_64_BIT 1
408 #define TARGET_RT_MAC_CFM 0
409 #define TARGET_RT_MAC_MACHO 1
410 #elif defined(__i386__)
411 #define TARGET_CPU_PPC 0
412 #define TARGET_CPU_PPC64 0
413 #define TARGET_CPU_68K 0
414 #define TARGET_CPU_X86 1
415 #define TARGET_CPU_X86_64 0
416 #define TARGET_CPU_ARM 0
417 #define TARGET_CPU_ARM64 0
418 #define TARGET_CPU_MIPS 0
419 #define TARGET_CPU_SPARC 0
420 #define TARGET_CPU_ALPHA 0
421 #define TARGET_RT_MAC_CFM 0
422 #define TARGET_RT_MAC_MACHO 1
423 #define TARGET_RT_LITTLE_ENDIAN 1
424 #define TARGET_RT_BIG_ENDIAN 0
425 #define TARGET_RT_64_BIT 0
426 #elif defined(__x86_64__)
427 #define TARGET_CPU_PPC 0
428 #define TARGET_CPU_PPC64 0
429 #define TARGET_CPU_68K 0
430 #define TARGET_CPU_X86 0
431 #define TARGET_CPU_X86_64 1
432 #define TARGET_CPU_ARM 0
433 #define TARGET_CPU_ARM64 0
434 #define TARGET_CPU_MIPS 0
435 #define TARGET_CPU_SPARC 0
436 #define TARGET_CPU_ALPHA 0
437 #define TARGET_RT_MAC_CFM 0
438 #define TARGET_RT_MAC_MACHO 1
439 #define TARGET_RT_LITTLE_ENDIAN 1273 #define TARGET_RT_LITTLE_ENDIAN 1
440 #define TARGET_RT_BIG_ENDIAN 0274 #define TARGET_RT_BIG_ENDIAN 0
275 #else
276 #define TARGET_RT_LITTLE_ENDIAN 0
277 #define TARGET_RT_BIG_ENDIAN 1
278 #endif
279 #if __LP64__
441 #define TARGET_RT_64_BIT 1280 #define TARGET_RT_64_BIT 1
442 #elif defined(__arm__) 281 #else
443 #define TARGET_CPU_PPC 0
444 #define TARGET_CPU_PPC64 0
445 #define TARGET_CPU_68K 0
446 #define TARGET_CPU_X86 0
447 #define TARGET_CPU_X86_64 0
448 #define TARGET_CPU_ARM 1
449 #define TARGET_CPU_ARM64 0
450 #define TARGET_CPU_MIPS 0
451 #define TARGET_CPU_SPARC 0
452 #define TARGET_CPU_ALPHA 0
453 #define TARGET_RT_MAC_CFM 0
454 #define TARGET_RT_MAC_MACHO 1
455 #define TARGET_RT_LITTLE_ENDIAN 1
456 #define TARGET_RT_BIG_ENDIAN 0
457 #define TARGET_RT_64_BIT 0282 #define TARGET_RT_64_BIT 0
458 #elif defined(__arm64__)283 #endif
459 #define TARGET_CPU_PPC 0284 #if defined(__ppc__) && __MACOS_CLASSIC__
460 #define TARGET_CPU_PPC64 0285 #define TARGET_RT_MAC_CFM 1
461 #define TARGET_CPU_68K 0286 #define TARGET_RT_MAC_MACHO 0
462 #define TARGET_CPU_X86 0287 #else
463 #define TARGET_CPU_X86_64 0
464 #define TARGET_CPU_ARM 0
465 #define TARGET_CPU_ARM64 1
466 #define TARGET_CPU_MIPS 0
467 #define TARGET_CPU_SPARC 0
468 #define TARGET_CPU_ALPHA 0
469 #define TARGET_RT_MAC_CFM 0288 #define TARGET_RT_MAC_CFM 0
470 #define TARGET_RT_MAC_MACHO 1289 #define TARGET_RT_MAC_MACHO 1
471 #define TARGET_RT_LITTLE_ENDIAN 1
472 #define TARGET_RT_BIG_ENDIAN 0
473 #if __LP64__
474 #define TARGET_RT_64_BIT 1
475 #else
476 #define TARGET_RT_64_BIT 0
477 #endif
478 #else
479 #error unrecognized GNU C compiler
480 #endif290 #endif
481291
482
483
484/*292/*
485 * CodeWarrior compiler from Metrowerks/Motorola293 * CodeWarrior compiler from Metrowerks/Motorola
486 */294 */
487#elif defined(__MWERKS__)295#elif defined(__MWERKS__)
488 #define TARGET_OS_MAC 1
489 #define TARGET_OS_WIN32 0
490 #define TARGET_OS_WINDOWS 0
491 #define TARGET_OS_UNIX 0
492 #define TARGET_OS_LINUX 0
493 #define TARGET_OS_EMBEDDED 0
494 #if defined(__POWERPC__)296 #if defined(__POWERPC__)
495 #define TARGET_CPU_PPC 1
496 #define TARGET_CPU_PPC64 0
497 #define TARGET_CPU_68K 0
498 #define TARGET_CPU_X86 0
499 #define TARGET_CPU_MIPS 0
500 #define TARGET_CPU_SPARC 0
501 #define TARGET_CPU_ALPHA 0
502 #define TARGET_RT_LITTLE_ENDIAN 0297 #define TARGET_RT_LITTLE_ENDIAN 0
503 #define TARGET_RT_BIG_ENDIAN 1298 #define TARGET_RT_BIG_ENDIAN 1
504 #elif defined(__INTEL__)299 #elif defined(__INTEL__)
505 #define TARGET_CPU_PPC 0
506 #define TARGET_CPU_PPC64 0
507 #define TARGET_CPU_68K 0
508 #define TARGET_CPU_X86 1
509 #define TARGET_CPU_MIPS 0
510 #define TARGET_CPU_SPARC 0
511 #define TARGET_CPU_ALPHA 0
512 #define TARGET_RT_LITTLE_ENDIAN 1300 #define TARGET_RT_LITTLE_ENDIAN 1
513 #define TARGET_RT_BIG_ENDIAN 0301 #define TARGET_RT_BIG_ENDIAN 0
514 #else302 #else
...@@ -527,98 +315,6 @@...@@ -527,98 +315,6 @@
527 * unknown compiler315 * unknown compiler
528 */316 */
529#else317#else
530 #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
531 #define TARGET_CPU_PPC64 0
532 #define TARGET_CPU_68K 0
533 #define TARGET_CPU_X86 0
534 #define TARGET_CPU_X86_64 0
535 #define TARGET_CPU_ARM 0
536 #define TARGET_CPU_ARM64 0
537 #define TARGET_CPU_MIPS 0
538 #define TARGET_CPU_SPARC 0
539 #define TARGET_CPU_ALPHA 0
540 #elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64
541 #define TARGET_CPU_PPC 0
542 #define TARGET_CPU_68K 0
543 #define TARGET_CPU_X86 0
544 #define TARGET_CPU_X86_64 0
545 #define TARGET_CPU_ARM 0
546 #define TARGET_CPU_ARM64 0
547 #define TARGET_CPU_MIPS 0
548 #define TARGET_CPU_SPARC 0
549 #define TARGET_CPU_ALPHA 0
550 #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
551 #define TARGET_CPU_PPC 0
552 #define TARGET_CPU_PPC64 0
553 #define TARGET_CPU_X86_64 0
554 #define TARGET_CPU_68K 0
555 #define TARGET_CPU_ARM 0
556 #define TARGET_CPU_ARM64 0
557 #define TARGET_CPU_MIPS 0
558 #define TARGET_CPU_SPARC 0
559 #define TARGET_CPU_ALPHA 0
560 #elif defined(TARGET_CPU_X86_64) && TARGET_CPU_X86_64
561 #define TARGET_CPU_PPC 0
562 #define TARGET_CPU_PPC64 0
563 #define TARGET_CPU_X86 0
564 #define TARGET_CPU_68K 0
565 #define TARGET_CPU_ARM 0
566 #define TARGET_CPU_ARM64 0
567 #define TARGET_CPU_MIPS 0
568 #define TARGET_CPU_SPARC 0
569 #define TARGET_CPU_ALPHA 0
570 #elif defined(TARGET_CPU_ARM) && TARGET_CPU_ARM
571 #define TARGET_CPU_PPC 0
572 #define TARGET_CPU_PPC64 0
573 #define TARGET_CPU_X86 0
574 #define TARGET_CPU_X86_64 0
575 #define TARGET_CPU_68K 0
576 #define TARGET_CPU_ARM64 0
577 #define TARGET_CPU_MIPS 0
578 #define TARGET_CPU_SPARC 0
579 #define TARGET_CPU_ALPHA 0
580 #elif defined(TARGET_CPU_ARM64) && TARGET_CPU_ARM64
581 #define TARGET_CPU_PPC 0
582 #define TARGET_CPU_PPC64 0
583 #define TARGET_CPU_X86 0
584 #define TARGET_CPU_X86_64 0
585 #define TARGET_CPU_68K 0
586 #define TARGET_CPU_ARM 0
587 #define TARGET_CPU_MIPS 0
588 #define TARGET_CPU_SPARC 0
589 #define TARGET_CPU_ALPHA 0
590 #else
591 /*
592 NOTE: If your compiler errors out here then support for your compiler
593 has not yet been added to TargetConditionals.h.
594
595 TargetConditionals.h is designed to be plug-and-play. It auto detects
596 which compiler is being run and configures the TARGET_ conditionals
597 appropriately.
598
599 The short term work around is to set the TARGET_CPU_ and TARGET_OS_
600 on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
601
602 The long term solution is to add a new case to this file which
603 auto detects your compiler and sets up the TARGET_ conditionals.
604 Then submit the changes to Apple Computer.
605 */
606 #error TargetConditionals.h: unknown compiler (see comment above)
607 #define TARGET_CPU_PPC 0
608 #define TARGET_CPU_68K 0
609 #define TARGET_CPU_X86 0
610 #define TARGET_CPU_ARM 0
611 #define TARGET_CPU_ARM64 0
612 #define TARGET_CPU_MIPS 0
613 #define TARGET_CPU_SPARC 0
614 #define TARGET_CPU_ALPHA 0
615 #endif
616 #define TARGET_OS_MAC 1
617 #define TARGET_OS_WIN32 0
618 #define TARGET_OS_WINDOWS 0
619 #define TARGET_OS_UNIX 0
620 #define TARGET_OS_LINUX 0
621 #define TARGET_OS_EMBEDDED 0
622 #if TARGET_CPU_PPC || TARGET_CPU_PPC64318 #if TARGET_CPU_PPC || TARGET_CPU_PPC64
623 #define TARGET_RT_BIG_ENDIAN 1319 #define TARGET_RT_BIG_ENDIAN 1
624 #define TARGET_RT_LITTLE_ENDIAN 0320 #define TARGET_RT_LITTLE_ENDIAN 0
...@@ -638,7 +334,201 @@...@@ -638,7 +334,201 @@
638 #define TARGET_RT_MAC_MACHO 0334 #define TARGET_RT_MAC_MACHO 0
639 #define TARGET_RT_MAC_CFM 1335 #define TARGET_RT_MAC_CFM 1
640 #endif336 #endif
641
642#endif337#endif
643338
339/*
340 * __is_target_arch based defines
341 */
342#if defined(__has_builtin) && __has_builtin(__is_target_arch)
343 #if __is_target_arch(arm64) || __is_target_arch(arm64e) || __is_target_arch(arm64_32)
344 #define TARGET_CPU_ARM64 1
345 #elif __is_target_arch(arm)
346 #define TARGET_CPU_ARM 1
347 #elif __is_target_arch(x86_64)
348 #define TARGET_CPU_X86_64 1
349 #elif __is_target_arch(i386)
350 #define TARGET_CPU_X86 1
351 #else
352
353 #error unrecognized arch using compiler with __is_target_arch support
354
355 #endif
356
357/*
358 * GCC and older clang fallback
359 */
360#elif defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
361 #if defined(__ppc__)
362 #define TARGET_CPU_PPC 1
363 #elif defined(__ppc64__)
364 #define TARGET_CPU_PPC64 1
365 #elif defined(__i386__)
366 #define TARGET_CPU_X86 1
367 #elif defined(__x86_64__)
368 #define TARGET_CPU_X86_64 1
369 #elif defined(__arm__)
370 #define TARGET_CPU_ARM 1
371 #elif defined(__arm64__)
372 #define TARGET_CPU_ARM64 1
373 #else
374 #error unrecognized GNU C compiler
375 #endif
376
377/*
378 * CodeWarrior compiler from Metrowerks/Motorola
379 */
380#elif defined(__MWERKS__)
381 #if defined(__POWERPC__)
382 #define TARGET_CPU_PPC 1
383 #elif defined(__INTEL__)
384 #define TARGET_CPU_X86 1
385 #else
386 #error unknown Metrowerks CPU type
387 #endif
388
389/*
390 * unknown compiler
391 */
392#else
393 #if !defined(TARGET_CPU_PPC) && !defined(TARGET_CPU_PPC64) \
394 && !defined(TARGET_CPU_X86) && !defined(TARGET_CPU_X86_64) \
395 && !defined(TARGET_CPU_ARM) && !defined(TARGET_CPU_ARM64)
396 /*
397 TargetConditionals.h is designed to be plug-and-play. It auto detects
398 which compiler is being run and configures the TARGET_ conditionals
399 appropriately.
400
401 The short term work around is to set the TARGET_CPU_ and TARGET_OS_
402 on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
403
404 The long term solution is to add suppport for __is_target_arch and __is_target_os
405 to your compiler.
406 */
407 #error TargetConditionals.h: unknown compiler (see comment above)
408 #endif
409#endif
410
411
412
413// Make sure all TARGET_OS_* and TARGET_CPU_* values are defined
414#ifndef TARGET_OS_MAC
415 #define TARGET_OS_MAC 0
416#endif
417
418#ifndef TARGET_OS_OSX
419 #define TARGET_OS_OSX 0
420#endif
421
422#ifndef TARGET_OS_IPHONE
423 #define TARGET_OS_IPHONE 0
424#endif
425
426#ifndef TARGET_OS_IOS
427 #define TARGET_OS_IOS 0
428#endif
429
430#ifndef TARGET_OS_WATCH
431 #define TARGET_OS_WATCH 0
432#endif
433
434#ifndef TARGET_OS_TV
435 #define TARGET_OS_TV 0
436#endif
437
438#ifndef TARGET_OS_SIMULATOR
439 #define TARGET_OS_SIMULATOR 0
440#endif
441
442#ifndef TARGET_OS_EMBEDDED
443 #define TARGET_OS_EMBEDDED 0
444#endif
445
446#ifndef TARGET_OS_RTKIT
447 #define TARGET_OS_RTKIT 0
448#endif
449
450#ifndef TARGET_OS_MACCATALYST
451 #define TARGET_OS_MACCATALYST 0
452#endif
453
454#ifndef TARGET_OS_VISION
455 #define TARGET_OS_VISION 0
456#endif
457
458#ifndef TARGET_OS_UIKITFORMAC
459 #define TARGET_OS_UIKITFORMAC 0
460#endif
461
462#ifndef TARGET_OS_DRIVERKIT
463 #define TARGET_OS_DRIVERKIT 0
464#endif
465
466#ifndef TARGET_OS_WIN32
467 #define TARGET_OS_WIN32 0
468#endif
469
470#ifndef TARGET_OS_WINDOWS
471 #define TARGET_OS_WINDOWS 0
472#endif
473
474
475
476#ifndef TARGET_OS_LINUX
477 #define TARGET_OS_LINUX 0
478#endif
479
480#ifndef TARGET_CPU_PPC
481 #define TARGET_CPU_PPC 0
482#endif
483
484#ifndef TARGET_CPU_PPC64
485 #define TARGET_CPU_PPC64 0
486#endif
487
488#ifndef TARGET_CPU_68K
489 #define TARGET_CPU_68K 0
490#endif
491
492#ifndef TARGET_CPU_X86
493 #define TARGET_CPU_X86 0
494#endif
495
496#ifndef TARGET_CPU_X86_64
497 #define TARGET_CPU_X86_64 0
498#endif
499
500#ifndef TARGET_CPU_ARM
501 #define TARGET_CPU_ARM 0
502#endif
503
504#ifndef TARGET_CPU_ARM64
505 #define TARGET_CPU_ARM64 0
506#endif
507
508#ifndef TARGET_CPU_MIPS
509 #define TARGET_CPU_MIPS 0
510#endif
511
512#ifndef TARGET_CPU_SPARC
513 #define TARGET_CPU_SPARC 0
514#endif
515
516#ifndef TARGET_CPU_ALPHA
517 #define TARGET_CPU_ALPHA 0
518#endif
519
520#ifndef TARGET_ABI_USES_IOS_VALUES
521 #define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST))
522#endif
523
524#ifndef TARGET_IPHONE_SIMULATOR
525 #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
526#endif
527
528#ifndef TARGET_OS_NANO
529 #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
530#endif
531
532
533
644#endif /* __TARGETCONDITIONALS__ */534#endif /* __TARGETCONDITIONALS__ */
lib/libc/include/any-macos-any/___wctype.h created+190
...@@ -0,0 +1,190 @@
1/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*-
24 * Copyright (c)1999 Citrus Project,
25 * All rights reserved.
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 *
36 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
37 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 *
48 */
49
50/*
51 * Common header for __wctype.h and xlocale/___wctype.h
52 */
53
54#ifndef __WCTYPE_H_
55#define __WCTYPE_H_
56#define ___WCTYPE_H_
57
58#include <sys/cdefs.h>
59#include <_types.h>
60
61#include <sys/_types/_wint_t.h>
62#include <_types/_wctype_t.h>
63
64#ifndef WEOF
65#define WEOF __DARWIN_WEOF
66#endif
67
68#ifndef __DARWIN_WCTYPE_TOP_inline
69#define __DARWIN_WCTYPE_TOP_inline __header_inline
70#endif
71
72#include <ctype.h>
73
74/*
75 * Use inline functions if we are allowed to and the compiler supports them.
76 */
77#if !defined(_DONT_USE_CTYPE_INLINE_) && \
78 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
79
80__DARWIN_WCTYPE_TOP_inline int
81iswalnum(wint_t _wc)
82{
83 return (__istype(_wc, _CTYPE_A|_CTYPE_D));
84}
85
86__DARWIN_WCTYPE_TOP_inline int
87iswalpha(wint_t _wc)
88{
89 return (__istype(_wc, _CTYPE_A));
90}
91
92__DARWIN_WCTYPE_TOP_inline int
93iswcntrl(wint_t _wc)
94{
95 return (__istype(_wc, _CTYPE_C));
96}
97
98__DARWIN_WCTYPE_TOP_inline int
99iswctype(wint_t _wc, wctype_t _charclass)
100{
101 return (__istype(_wc, _charclass));
102}
103
104__DARWIN_WCTYPE_TOP_inline int
105iswdigit(wint_t _wc)
106{
107 return (__isctype(_wc, _CTYPE_D));
108}
109
110__DARWIN_WCTYPE_TOP_inline int
111iswgraph(wint_t _wc)
112{
113 return (__istype(_wc, _CTYPE_G));
114}
115
116__DARWIN_WCTYPE_TOP_inline int
117iswlower(wint_t _wc)
118{
119 return (__istype(_wc, _CTYPE_L));
120}
121
122__DARWIN_WCTYPE_TOP_inline int
123iswprint(wint_t _wc)
124{
125 return (__istype(_wc, _CTYPE_R));
126}
127
128__DARWIN_WCTYPE_TOP_inline int
129iswpunct(wint_t _wc)
130{
131 return (__istype(_wc, _CTYPE_P));
132}
133
134__DARWIN_WCTYPE_TOP_inline int
135iswspace(wint_t _wc)
136{
137 return (__istype(_wc, _CTYPE_S));
138}
139
140__DARWIN_WCTYPE_TOP_inline int
141iswupper(wint_t _wc)
142{
143 return (__istype(_wc, _CTYPE_U));
144}
145
146__DARWIN_WCTYPE_TOP_inline int
147iswxdigit(wint_t _wc)
148{
149 return (__isctype(_wc, _CTYPE_X));
150}
151
152__DARWIN_WCTYPE_TOP_inline wint_t
153towlower(wint_t _wc)
154{
155 return (__tolower(_wc));
156}
157
158__DARWIN_WCTYPE_TOP_inline wint_t
159towupper(wint_t _wc)
160{
161 return (__toupper(_wc));
162}
163
164#else /* not using inlines */
165
166__BEGIN_DECLS
167int iswalnum(wint_t);
168int iswalpha(wint_t);
169int iswcntrl(wint_t);
170int iswctype(wint_t, wctype_t);
171int iswdigit(wint_t);
172int iswgraph(wint_t);
173int iswlower(wint_t);
174int iswprint(wint_t);
175int iswpunct(wint_t);
176int iswspace(wint_t);
177int iswupper(wint_t);
178int iswxdigit(wint_t);
179wint_t towlower(wint_t);
180wint_t towupper(wint_t);
181__END_DECLS
182
183#endif /* using inlines */
184
185__BEGIN_DECLS
186wctype_t
187 wctype(const char *);
188__END_DECLS
189
190#endif /* __WCTYPE_H_ */
lib/libc/include/any-macos-any/__wctype.h+12-43
...@@ -1,25 +1,3 @@...@@ -1,25 +1,3 @@
1/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*-1/*-
24 * Copyright (c)1999 Citrus Project,2 * Copyright (c)1999 Citrus Project,
25 * All rights reserved.3 * All rights reserved.
...@@ -48,27 +26,18 @@...@@ -48,27 +26,18 @@
48 */26 */
4927
50/*28/*
51 * Common header for _wctype.h and xlocale/__wctype.h29 * Common header for _wctype.h and _wchar.h
30 *
31 * Contains everything required by wctype.h except:
32 *
33 * #include <_types/_wctrans_t.h>
34 * int iswblank(wint_t);
35 * wint_t towctrans(wint_t, wctrans_t);
36 * wctrans_t wctrans(const char *);
52 */37 */
5338
54#ifndef ___WCTYPE_H_39#include <___wctype.h>
55#define ___WCTYPE_H_
56
57#include <sys/cdefs.h>
58#include <_types.h>
59
60#include <sys/_types/_wint_t.h>
61#include <sys/_types/_wint_t.h>
62#include <_types/_wctype_t.h>
63
64#ifndef WEOF
65#define WEOF __DARWIN_WEOF
66#endif
67
68#ifndef __DARWIN_WCTYPE_TOP_inline
69#define __DARWIN_WCTYPE_TOP_inline __header_inline
70#endif
71
72#include <ctype.h>
7340
74#endif /* ___WCTYPE_H_ */41#ifdef _USE_EXTENDED_LOCALES_
42#include <xlocale/___wctype.h>
43#endif /* _USE_EXTENDED_LOCALES_ */
lib/libc/include/any-macos-any/__xlocale.h created+40
...@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef __XLOCALE_H_
25#define __XLOCALE_H_
26
27#include <sys/cdefs.h>
28#include <_mb_cur_max.h>
29
30struct _xlocale; /* forward reference */
31typedef struct _xlocale * locale_t;
32
33__BEGIN_DECLS
34int ___mb_cur_max_l(locale_t);
35__END_DECLS
36
37#undef MB_CUR_MAX_L
38#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
39
40#endif /* __XLOCALE_H_ */
lib/libc/include/any-macos-any/_abort.h created+33
...@@ -0,0 +1,33 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef __ABORT_H_
25#define __ABORT_H_
26
27#include <sys/cdefs.h>
28
29__BEGIN_DECLS
30void abort(void) __cold __dead2;
31__END_DECLS
32
33#endif /* __ABORT_H_ */
lib/libc/include/any-macos-any/_assert.h created+77
...@@ -0,0 +1,77 @@
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)assert.h 8.2 (Berkeley) 1/21/94
39 * $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $
40 */
41
42#ifndef __ASSERT_H_
43#define __ASSERT_H_
44
45#include <sys/cdefs.h>
46
47#ifndef __GNUC__
48
49#ifndef __cplusplus
50#include <_abort.h>
51#endif /* !__cplusplus */
52#include <_printf.h>
53
54#define __assert(e, file, line) \
55 ((void)printf ("%s:%d: failed assertion `%s'\n", file, line, e), abort())
56
57#else /* __GNUC__ */
58
59__BEGIN_DECLS
60void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls;
61#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
62void __eprintf(const char *, const char *, unsigned, const char *) __dead2 __cold;
63#endif
64__END_DECLS
65
66#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
67#define __assert(e, file, line) \
68 __eprintf ("%s:%d: failed assertion `%s'\n", file, line, e)
69#else
70/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
71#define __assert(e, file, line) \
72 __assert_rtn ((const char *)-1L, file, line, e)
73#endif
74
75#endif /* __GNUC__ */
76
77#endif /* __ASSERT_H_ */
lib/libc/include/any-macos-any/_ctype.h+3-5
...@@ -63,7 +63,8 @@...@@ -63,7 +63,8 @@
63 * @(#)ctype.h 8.4 (Berkeley) 1/21/9463 * @(#)ctype.h 8.4 (Berkeley) 1/21/94
64 */64 */
6565
66#ifndef __CTYPE_H_66#ifndef _CTYPE_H_
67#define _CTYPE_H_
67#define __CTYPE_H_68#define __CTYPE_H_
6869
69#include <sys/cdefs.h>70#include <sys/cdefs.h>
...@@ -118,6 +119,7 @@...@@ -118,6 +119,7 @@
118119
119#define __DARWIN_CTYPE_TOP_inline __header_inline120#define __DARWIN_CTYPE_TOP_inline __header_inline
120121
122
121/*123/*
122 * Use inline functions if we are allowed to and the compiler supports them.124 * Use inline functions if we are allowed to and the compiler supports them.
123 */125 */
...@@ -380,8 +382,4 @@ __END_DECLS...@@ -380,8 +382,4 @@ __END_DECLS
380382
381#endif /* using inlines */383#endif /* using inlines */
382384
383#ifdef _USE_EXTENDED_LOCALES_
384#include <xlocale/_ctype.h>
385#endif /* _USE_EXTENDED_LOCALES_ */
386
387#endif /* !_CTYPE_H_ */385#endif /* !_CTYPE_H_ */
lib/libc/include/any-macos-any/_inttypes.h created+293
...@@ -0,0 +1,293 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24/*
25 * <inttypes.h> -- Standard C header, defined in ISO/IEC 9899:1999
26 * (aka "C99"), section 7.8. This defines format string conversion
27 * specifiers suitable for use within arguments to fprintf and fscanf
28 * and their ilk.
29 */
30
31#if !defined(_INTTYPES_H_)
32#define _INTTYPES_H_
33
34# define __PRI_8_LENGTH_MODIFIER__ "hh"
35# define __PRI_64_LENGTH_MODIFIER__ "ll"
36# define __SCN_64_LENGTH_MODIFIER__ "ll"
37# define __PRI_MAX_LENGTH_MODIFIER__ "j"
38# define __SCN_MAX_LENGTH_MODIFIER__ "j"
39
40# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
41# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
42# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
43# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
44# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
45# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
46
47# define PRId16 "hd"
48# define PRIi16 "hi"
49# define PRIo16 "ho"
50# define PRIu16 "hu"
51# define PRIx16 "hx"
52# define PRIX16 "hX"
53
54# define PRId32 "d"
55# define PRIi32 "i"
56# define PRIo32 "o"
57# define PRIu32 "u"
58# define PRIx32 "x"
59# define PRIX32 "X"
60
61# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
62# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
63# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
64# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
65# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
66# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
67
68# define PRIdLEAST8 PRId8
69# define PRIiLEAST8 PRIi8
70# define PRIoLEAST8 PRIo8
71# define PRIuLEAST8 PRIu8
72# define PRIxLEAST8 PRIx8
73# define PRIXLEAST8 PRIX8
74
75# define PRIdLEAST16 PRId16
76# define PRIiLEAST16 PRIi16
77# define PRIoLEAST16 PRIo16
78# define PRIuLEAST16 PRIu16
79# define PRIxLEAST16 PRIx16
80# define PRIXLEAST16 PRIX16
81
82# define PRIdLEAST32 PRId32
83# define PRIiLEAST32 PRIi32
84# define PRIoLEAST32 PRIo32
85# define PRIuLEAST32 PRIu32
86# define PRIxLEAST32 PRIx32
87# define PRIXLEAST32 PRIX32
88
89# define PRIdLEAST64 PRId64
90# define PRIiLEAST64 PRIi64
91# define PRIoLEAST64 PRIo64
92# define PRIuLEAST64 PRIu64
93# define PRIxLEAST64 PRIx64
94# define PRIXLEAST64 PRIX64
95
96# define PRIdFAST8 PRId8
97# define PRIiFAST8 PRIi8
98# define PRIoFAST8 PRIo8
99# define PRIuFAST8 PRIu8
100# define PRIxFAST8 PRIx8
101# define PRIXFAST8 PRIX8
102
103# define PRIdFAST16 PRId16
104# define PRIiFAST16 PRIi16
105# define PRIoFAST16 PRIo16
106# define PRIuFAST16 PRIu16
107# define PRIxFAST16 PRIx16
108# define PRIXFAST16 PRIX16
109
110# define PRIdFAST32 PRId32
111# define PRIiFAST32 PRIi32
112# define PRIoFAST32 PRIo32
113# define PRIuFAST32 PRIu32
114# define PRIxFAST32 PRIx32
115# define PRIXFAST32 PRIX32
116
117# define PRIdFAST64 PRId64
118# define PRIiFAST64 PRIi64
119# define PRIoFAST64 PRIo64
120# define PRIuFAST64 PRIu64
121# define PRIxFAST64 PRIx64
122# define PRIXFAST64 PRIX64
123
124/* int32_t is 'int', but intptr_t is 'long'. */
125# define PRIdPTR "ld"
126# define PRIiPTR "li"
127# define PRIoPTR "lo"
128# define PRIuPTR "lu"
129# define PRIxPTR "lx"
130# define PRIXPTR "lX"
131
132# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d"
133# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i"
134# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o"
135# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u"
136# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x"
137# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X"
138
139# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d"
140# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i"
141# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o"
142# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u"
143# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x"
144
145# define SCNd16 "hd"
146# define SCNi16 "hi"
147# define SCNo16 "ho"
148# define SCNu16 "hu"
149# define SCNx16 "hx"
150
151# define SCNd32 "d"
152# define SCNi32 "i"
153# define SCNo32 "o"
154# define SCNu32 "u"
155# define SCNx32 "x"
156
157# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d"
158# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i"
159# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o"
160# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u"
161# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x"
162
163# define SCNdLEAST8 SCNd8
164# define SCNiLEAST8 SCNi8
165# define SCNoLEAST8 SCNo8
166# define SCNuLEAST8 SCNu8
167# define SCNxLEAST8 SCNx8
168
169# define SCNdLEAST16 SCNd16
170# define SCNiLEAST16 SCNi16
171# define SCNoLEAST16 SCNo16
172# define SCNuLEAST16 SCNu16
173# define SCNxLEAST16 SCNx16
174
175# define SCNdLEAST32 SCNd32
176# define SCNiLEAST32 SCNi32
177# define SCNoLEAST32 SCNo32
178# define SCNuLEAST32 SCNu32
179# define SCNxLEAST32 SCNx32
180
181# define SCNdLEAST64 SCNd64
182# define SCNiLEAST64 SCNi64
183# define SCNoLEAST64 SCNo64
184# define SCNuLEAST64 SCNu64
185# define SCNxLEAST64 SCNx64
186
187# define SCNdFAST8 SCNd8
188# define SCNiFAST8 SCNi8
189# define SCNoFAST8 SCNo8
190# define SCNuFAST8 SCNu8
191# define SCNxFAST8 SCNx8
192
193# define SCNdFAST16 SCNd16
194# define SCNiFAST16 SCNi16
195# define SCNoFAST16 SCNo16
196# define SCNuFAST16 SCNu16
197# define SCNxFAST16 SCNx16
198
199# define SCNdFAST32 SCNd32
200# define SCNiFAST32 SCNi32
201# define SCNoFAST32 SCNo32
202# define SCNuFAST32 SCNu32
203# define SCNxFAST32 SCNx32
204
205# define SCNdFAST64 SCNd64
206# define SCNiFAST64 SCNi64
207# define SCNoFAST64 SCNo64
208# define SCNuFAST64 SCNu64
209# define SCNxFAST64 SCNx64
210
211# define SCNdPTR "ld"
212# define SCNiPTR "li"
213# define SCNoPTR "lo"
214# define SCNuPTR "lu"
215# define SCNxPTR "lx"
216
217# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d"
218# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i"
219# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o"
220# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u"
221# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x"
222
223#include <sys/cdefs.h>
224#include <Availability.h>
225
226#include <_types.h>
227#include <sys/_types/_wchar_t.h>
228
229#include <stdint.h>
230
231__BEGIN_DECLS
232
233/* 7.8.2.1 */
234__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
235extern intmax_t
236imaxabs(intmax_t j);
237
238/* 7.8.2.2 */
239typedef struct {
240 intmax_t quot;
241 intmax_t rem;
242} imaxdiv_t;
243
244__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
245extern imaxdiv_t
246imaxdiv(intmax_t __numer, intmax_t __denom);
247
248/* 7.8.2.3 */
249__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
250extern intmax_t
251strtoimax(const char * __restrict __nptr,
252 char ** __restrict __endptr,
253 int __base);
254
255__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
256extern uintmax_t
257strtoumax(const char * __restrict __nptr,
258 char ** __restrict __endptr,
259 int __base);
260
261/* 7.8.2.4 */
262__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
263extern intmax_t
264wcstoimax(const wchar_t * __restrict __nptr,
265 wchar_t ** __restrict __endptr,
266 int __base);
267
268__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
269extern uintmax_t
270wcstoumax(const wchar_t * __restrict __nptr,
271 wchar_t ** __restrict __endptr,
272 int __base);
273
274/* Poison the following routines if -fshort-wchar is set */
275#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
276#pragma GCC poison wcstoimax wcstoumax
277#endif
278
279__END_DECLS
280
281/*
282 No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros;
283 in fact, you can't #undef them, because later uses of any of
284 their dependents will *not* then do the intended substitution.
285 Expansion of a #define like this one:
286
287 #define x IDENT y
288
289 uses the cpp value of IDENT at the location where x is *expanded*,
290 not where it is #defined.
291*/
292
293#endif /* !_INTTYPES_H_ */
lib/libc/include/any-macos-any/_langinfo.h created+116
...@@ -0,0 +1,116 @@
1/*-
2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $
27 */
28
29#ifndef _LANGINFO_H_
30#define _LANGINFO_H_
31
32#include <_types.h>
33#include <_types/_nl_item.h>
34
35#define CODESET 0 /* codeset name */
36#define D_T_FMT 1 /* string for formatting date and time */
37#define D_FMT 2 /* date format string */
38#define T_FMT 3 /* time format string */
39#define T_FMT_AMPM 4 /* a.m. or p.m. time formatting string */
40#define AM_STR 5 /* Ante Meridian affix */
41#define PM_STR 6 /* Post Meridian affix */
42
43/* week day names */
44#define DAY_1 7
45#define DAY_2 8
46#define DAY_3 9
47#define DAY_4 10
48#define DAY_5 11
49#define DAY_6 12
50#define DAY_7 13
51
52/* abbreviated week day names */
53#define ABDAY_1 14
54#define ABDAY_2 15
55#define ABDAY_3 16
56#define ABDAY_4 17
57#define ABDAY_5 18
58#define ABDAY_6 19
59#define ABDAY_7 20
60
61/* month names */
62#define MON_1 21
63#define MON_2 22
64#define MON_3 23
65#define MON_4 24
66#define MON_5 25
67#define MON_6 26
68#define MON_7 27
69#define MON_8 28
70#define MON_9 29
71#define MON_10 30
72#define MON_11 31
73#define MON_12 32
74
75/* abbreviated month names */
76#define ABMON_1 33
77#define ABMON_2 34
78#define ABMON_3 35
79#define ABMON_4 36
80#define ABMON_5 37
81#define ABMON_6 38
82#define ABMON_7 39
83#define ABMON_8 40
84#define ABMON_9 41
85#define ABMON_10 42
86#define ABMON_11 43
87#define ABMON_12 44
88
89#define ERA 45 /* era description segments */
90#define ERA_D_FMT 46 /* era date format string */
91#define ERA_D_T_FMT 47 /* era date and time format string */
92#define ERA_T_FMT 48 /* era time format string */
93#define ALT_DIGITS 49 /* alternative symbols for digits */
94
95#define RADIXCHAR 50 /* radix char */
96#define THOUSEP 51 /* separator for thousands */
97
98#define YESEXPR 52 /* affirmative response expression */
99#define NOEXPR 53 /* negative response expression */
100
101#if (__DARWIN_C_LEVEL > __DARWIN_C_ANSI && __DARWIN_C_LEVEL < 200112L) || __DARWIN_C_LEVEL == __DARWIN_C_FULL
102#define YESSTR 54 /* affirmative response for yes/no queries */
103#define NOSTR 55 /* negative response for yes/no queries */
104#endif
105
106#define CRNCYSTR 56 /* currency symbol */
107
108#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
109#define D_MD_ORDER 57 /* month/day order (local extension) */
110#endif
111
112__BEGIN_DECLS
113char *nl_langinfo(nl_item);
114__END_DECLS
115
116#endif /* !_LANGINFO_H_ */
lib/libc/include/any-macos-any/_mb_cur_max.h created+36
...@@ -0,0 +1,36 @@
1/*
2 * Copyright (c) 2024 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef __MB_CUR_MAX_H_
25#define __MB_CUR_MAX_H_
26
27#include <sys/cdefs.h>
28
29__BEGIN_DECLS
30int ___mb_cur_max(void);
31__END_DECLS
32
33#undef MB_CUR_MAX
34#define MB_CUR_MAX (___mb_cur_max())
35
36#endif /* __MB_CUR_MAX_H_ */
lib/libc/include/any-macos-any/_monetary.h created+41
...@@ -0,0 +1,41 @@
1/*-
2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $
27 */
28
29#ifndef _MONETARY_H_
30#define _MONETARY_H_
31
32#include <sys/cdefs.h>
33#include <_types.h>
34#include <sys/_types/_size_t.h>
35#include <sys/_types/_ssize_t.h>
36
37__BEGIN_DECLS
38ssize_t strfmon(char *, size_t, const char *, ...);
39__END_DECLS
40
41#endif /* !_MONETARY_H_ */
lib/libc/include/any-macos-any/_printf.h created+35
...@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef __PRINTF_H_
25#define __PRINTF_H_
26
27#include <sys/cdefs.h>
28
29
30__BEGIN_DECLS
31int printf(const char * __restrict, ...) __printflike(1, 2);
32__END_DECLS
33
34
35#endif /* __PRINTF_H_ */
lib/libc/include/any-macos-any/_regex.h+122-2
...@@ -90,7 +90,8 @@...@@ -90,7 +90,8 @@
90 * Common header for regex.h and xlocale/_regex.h90 * Common header for regex.h and xlocale/_regex.h
91 */91 */
9292
93#ifndef __REGEX_H_93#ifndef _REGEX_H_
94#define _REGEX_H_
94#define __REGEX_H_95#define __REGEX_H_
9596
96#include <_types.h>97#include <_types.h>
...@@ -118,4 +119,123 @@ typedef struct {...@@ -118,4 +119,123 @@ typedef struct {
118 regoff_t rm_eo; /* end of match */119 regoff_t rm_eo; /* end of match */
119} regmatch_t;120} regmatch_t;
120121
121#endif /* !__REGEX_H_ */122/*******************/
123/* regcomp() flags */
124/*******************/
125#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
126#define REG_BASIC 0000 /* Basic regular expressions (synonym for 0) */
127#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
128
129#define REG_EXTENDED 0001 /* Extended regular expressions */
130#define REG_ICASE 0002 /* Compile ignoring upper/lower case */
131#define REG_NOSUB 0004 /* Compile only reporting success/failure */
132#define REG_NEWLINE 0010 /* Compile for newline-sensitive matching */
133
134#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
135#define REG_NOSPEC 0020 /* Compile turning off all special characters */
136
137#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
138 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
139 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
140#define REG_LITERAL REG_NOSPEC
141#endif
142
143#define REG_PEND 0040 /* Use re_endp as end pointer */
144
145#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
146 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
147 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
148#define REG_MINIMAL 0100 /* Compile using minimal repetition */
149#define REG_UNGREEDY REG_MINIMAL
150#endif
151
152#define REG_DUMP 0200 /* Unused */
153
154#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
155 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
156 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
157#define REG_ENHANCED 0400 /* Additional (non-POSIX) features */
158#endif
159#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
160
161/********************/
162/* regerror() flags */
163/********************/
164#define REG_ENOSYS (-1) /* Reserved */
165#define REG_NOMATCH 1 /* regexec() function failed to match */
166#define REG_BADPAT 2 /* invalid regular expression */
167#define REG_ECOLLATE 3 /* invalid collating element */
168#define REG_ECTYPE 4 /* invalid character class */
169#define REG_EESCAPE 5 /* trailing backslash (\) */
170#define REG_ESUBREG 6 /* invalid backreference number */
171#define REG_EBRACK 7 /* brackets ([ ]) not balanced */
172#define REG_EPAREN 8 /* parentheses not balanced */
173#define REG_EBRACE 9 /* braces not balanced */
174#define REG_BADBR 10 /* invalid repetition count(s) */
175#define REG_ERANGE 11 /* invalid character range */
176#define REG_ESPACE 12 /* out of memory */
177#define REG_BADRPT 13 /* repetition-operator operand invalid */
178
179#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
180#define REG_EMPTY 14 /* Unused */
181#define REG_ASSERT 15 /* Unused */
182#define REG_INVARG 16 /* invalid argument to regex routine */
183#define REG_ILLSEQ 17 /* illegal byte sequence */
184
185#define REG_ATOI 255 /* convert name to number (!) */
186#define REG_ITOA 0400 /* convert number to name (!) */
187#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
188
189/*******************/
190/* regexec() flags */
191/*******************/
192#define REG_NOTBOL 00001 /* First character not at beginning of line */
193#define REG_NOTEOL 00002 /* Last character not at end of line */
194
195#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
196#define REG_STARTEND 00004 /* String start/end in pmatch[0] */
197#define REG_TRACE 00400 /* Unused */
198#define REG_LARGE 01000 /* Unused */
199#define REG_BACKR 02000 /* force use of backref code */
200
201#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
202 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
203 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
204#define REG_BACKTRACKING_MATCHER REG_BACKR
205#endif
206#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
207
208__BEGIN_DECLS
209int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp);
210size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold;
211/*
212 * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround,
213 * a dummy argument name is added.
214 */
215int regexec(const regex_t * __restrict, const char * __restrict, size_t,
216 regmatch_t __pmatch[ __restrict], int);
217void regfree(regex_t *);
218
219#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
220
221/* Darwin extensions */
222int regncomp(regex_t * __restrict, const char * __restrict, size_t, int)
223 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
224int regnexec(const regex_t * __restrict, const char * __restrict, size_t,
225 size_t, regmatch_t __pmatch[ __restrict], int)
226 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
227int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int)
228 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
229int regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t,
230 regmatch_t __pmatch[ __restrict], int)
231 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
232int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int)
233 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
234int regwnexec(const regex_t * __restrict, const wchar_t * __restrict,
235 size_t, size_t, regmatch_t __pmatch[ __restrict], int)
236 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
237
238#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
239__END_DECLS
240
241#endif /* !_REGEX_H_ */
lib/libc/include/any-macos-any/_static_assert.h created+33
...@@ -0,0 +1,33 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _ASSERT_H_
25#define _ASSERT_H_
26
27#ifndef __cplusplus
28#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
29#define static_assert _Static_assert
30#endif /* __STDC_VERSION__ */
31#endif /* !__cplusplus */
32
33#endif /* _ASSERT_H_ */
lib/libc/include/any-macos-any/_stdio.h+346-3
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.2 * Copyright (c) 2000, 2005, 2007, 2009, 2010, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
...@@ -62,7 +62,8 @@...@@ -62,7 +62,8 @@
62 * Common header for stdio.h and xlocale/_stdio.h62 * Common header for stdio.h and xlocale/_stdio.h
63 */63 */
6464
65#ifndef __STDIO_H_65#ifndef _STDIO_H_
66#define _STDIO_H_
66#define __STDIO_H_67#define __STDIO_H_
6768
68#include <sys/cdefs.h>69#include <sys/cdefs.h>
...@@ -77,6 +78,7 @@...@@ -77,6 +78,7 @@
77#include <sys/_types/_null.h>78#include <sys/_types/_null.h>
7879
79#include <sys/stdio.h>80#include <sys/stdio.h>
81#include <_printf.h>
8082
81typedef __darwin_off_t fpos_t;83typedef __darwin_off_t fpos_t;
8284
...@@ -156,4 +158,345 @@ typedef struct __sFILE {...@@ -156,4 +158,345 @@ typedef struct __sFILE {
156 fpos_t _offset; /* current lseek offset (see WARNING) */158 fpos_t _offset; /* current lseek offset (see WARNING) */
157} FILE;159} FILE;
158160
159#endif /* __STDIO_H_ */161#include <sys/_types/_seek_set.h>
162
163__BEGIN_DECLS
164extern FILE *__stdinp __swift_nonisolated_unsafe;
165extern FILE *__stdoutp __swift_nonisolated_unsafe;
166extern FILE *__stderrp __swift_nonisolated_unsafe;
167__END_DECLS
168
169#define __SLBF 0x0001 /* line buffered */
170#define __SNBF 0x0002 /* unbuffered */
171#define __SRD 0x0004 /* OK to read */
172#define __SWR 0x0008 /* OK to write */
173 /* RD and WR are never simultaneously asserted */
174#define __SRW 0x0010 /* open for reading & writing */
175#define __SEOF 0x0020 /* found EOF */
176#define __SERR 0x0040 /* found error */
177#define __SMBF 0x0080 /* _buf is from malloc */
178#define __SAPP 0x0100 /* fdopen()ed in append mode */
179#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
180#define __SOPT 0x0400 /* do fseek() optimisation */
181#define __SNPT 0x0800 /* do not do fseek() optimisation */
182#define __SOFF 0x1000 /* set iff _offset is in fact correct */
183#define __SMOD 0x2000 /* true => fgetln modified _p text */
184#define __SALC 0x4000 /* allocate string space dynamically */
185#define __SIGN 0x8000 /* ignore this file in _fwalk */
186
187/*
188 * The following three definitions are for ANSI C, which took them
189 * from System V, which brilliantly took internal interface macros and
190 * made them official arguments to setvbuf(), without renaming them.
191 * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
192 *
193 * Although numbered as their counterparts above, the implementation
194 * does not rely on this.
195 */
196#define _IOFBF 0 /* setvbuf should set fully buffered */
197#define _IOLBF 1 /* setvbuf should set line buffered */
198#define _IONBF 2 /* setvbuf should set unbuffered */
199
200#define BUFSIZ 1024 /* size of buffer used by setbuf */
201#define EOF (-1)
202
203 /* must be == _POSIX_STREAM_MAX <limits.h> */
204#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
205#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
206
207/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
208#ifndef _ANSI_SOURCE
209#define P_tmpdir "/var/tmp/"
210#endif
211#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
212#define TMP_MAX 308915776
213
214#define stdin __stdinp
215#define stdout __stdoutp
216#define stderr __stderrp
217
218#ifdef _DARWIN_UNLIMITED_STREAMS
219#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
220#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it."
221#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
222#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it."
223#endif
224#endif
225
226/* ANSI-C */
227
228__BEGIN_DECLS
229void clearerr(FILE *);
230int fclose(FILE *);
231int feof(FILE *);
232int ferror(FILE *);
233int fflush(FILE *);
234int fgetc(FILE *);
235int fgetpos(FILE * __restrict, fpos_t *);
236char *fgets(char * __restrict, int, FILE *);
237#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
238FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen));
239#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
240FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
241#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
242int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
243int fputc(int, FILE *);
244int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
245size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
246FILE *freopen(const char * __restrict, const char * __restrict,
247 FILE * __restrict) __DARWIN_ALIAS(freopen);
248int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
249int fseek(FILE *, long, int);
250int fsetpos(FILE *, const fpos_t *);
251long ftell(FILE *);
252size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
253int getc(FILE *);
254int getchar(void);
255
256#if !defined(_POSIX_C_SOURCE)
257__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of gets(3), it is highly recommended that you use fgets(3) instead.")
258#endif
259char *gets(char *);
260
261void perror(const char *) __cold;
262int putc(int, FILE *);
263int putchar(int);
264int puts(const char *);
265int remove(const char *);
266int rename (const char *__old, const char *__new);
267void rewind(FILE *);
268int scanf(const char * __restrict, ...) __scanflike(1, 2);
269void setbuf(FILE * __restrict, char * __restrict);
270int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
271
272__swift_unavailable("Use snprintf instead.")
273#if !defined(_POSIX_C_SOURCE)
274__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
275#endif
276int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
277
278int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
279FILE *tmpfile(void);
280
281__swift_unavailable("Use mkstemp(3) instead.")
282#if !defined(_POSIX_C_SOURCE)
283__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
284#endif
285char *tmpnam(char *);
286
287int ungetc(int, FILE *);
288int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
289int vprintf(const char * __restrict, va_list) __printflike(1, 0);
290
291__swift_unavailable("Use vsnprintf instead.")
292#if !defined(_POSIX_C_SOURCE)
293__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
294#endif
295int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
296__END_DECLS
297
298
299
300/* Additional functionality provided by:
301 * POSIX.1-1988
302 */
303
304#if __DARWIN_C_LEVEL >= 198808L
305#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
306
307#include <_ctermid.h>
308
309__BEGIN_DECLS
310
311#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
312FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
313#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
314FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
315#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
316int fileno(FILE *);
317__END_DECLS
318#endif /* __DARWIN_C_LEVEL >= 198808L */
319
320
321/* Additional functionality provided by:
322 * POSIX.2-1992 C Language Binding Option
323 */
324
325#if __DARWIN_C_LEVEL >= 199209L
326__BEGIN_DECLS
327int pclose(FILE *) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
328#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
329FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
330#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
331FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
332#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
333__END_DECLS
334#endif /* __DARWIN_C_LEVEL >= 199209L */
335
336/* Additional functionality provided by:
337 * POSIX.1c-1995,
338 * POSIX.1i-1995,
339 * and the omnibus ISO/IEC 9945-1: 1996
340 */
341
342#if __DARWIN_C_LEVEL >= 199506L
343
344/* Functions internal to the implementation. */
345__BEGIN_DECLS
346int __srget(FILE *);
347int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
348int __swbuf(int, FILE *);
349__END_DECLS
350
351/*
352 * The __sfoo macros are here so that we can
353 * define function versions in the C library.
354 */
355#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
356#if defined(__GNUC__) && defined(__STDC__)
357__header_always_inline int __sputc(int _c, FILE *_p) {
358 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
359 return (*_p->_p++ = _c);
360 else
361 return (__swbuf(_c, _p));
362}
363#else
364/*
365 * This has been tuned to generate reasonable code on the vax using pcc.
366 */
367#define __sputc(c, p) \
368 (--(p)->_w < 0 ? \
369 (p)->_w >= (p)->_lbfsize ? \
370 (*(p)->_p = (c)), *(p)->_p != '\n' ? \
371 (int)*(p)->_p++ : \
372 __swbuf('\n', p) : \
373 __swbuf((int)(c), p) : \
374 (*(p)->_p = (c), (int)*(p)->_p++))
375#endif
376
377#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
378#define __sferror(p) (((p)->_flags & __SERR) != 0)
379#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
380#define __sfileno(p) ((p)->_file)
381
382__BEGIN_DECLS
383void flockfile(FILE *);
384int ftrylockfile(FILE *);
385void funlockfile(FILE *);
386int getc_unlocked(FILE *);
387int getchar_unlocked(void);
388int putc_unlocked(int, FILE *);
389int putchar_unlocked(int);
390
391/* Removed in Issue 6 */
392#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
393int getw(FILE *);
394int putw(int, FILE *);
395#endif
396
397__swift_unavailable("Use mkstemp(3) instead.")
398#if !defined(_POSIX_C_SOURCE)
399__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")
400#endif
401char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
402__END_DECLS
403
404#ifndef lint
405#define getc_unlocked(fp) __sgetc(fp)
406#define putc_unlocked(x, fp) __sputc(x, fp)
407#endif /* lint */
408
409#define getchar_unlocked() getc_unlocked(stdin)
410#define putchar_unlocked(x) putc_unlocked(x, stdout)
411#endif /* __DARWIN_C_LEVEL >= 199506L */
412
413
414
415/* Additional functionality provided by:
416 * POSIX.1-2001
417 * ISO C99
418 */
419
420#if __DARWIN_C_LEVEL >= 200112L
421#include <sys/_types/_off_t.h>
422
423__BEGIN_DECLS
424int fseeko(FILE * __stream, off_t __offset, int __whence);
425off_t ftello(FILE * __stream);
426__END_DECLS
427#endif /* __DARWIN_C_LEVEL >= 200112L */
428
429#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
430__BEGIN_DECLS
431int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
432int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
433int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
434int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
435int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
436__END_DECLS
437#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
438
439
440
441/* Additional functionality provided by:
442 * POSIX.1-2008
443 */
444
445#if __DARWIN_C_LEVEL >= 200809L
446#include <sys/_types/_ssize_t.h>
447
448__BEGIN_DECLS
449int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
450int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
451ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
452ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
453FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
454FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
455__END_DECLS
456#endif /* __DARWIN_C_LEVEL >= 200809L */
457
458
459
460/* Darwin extensions */
461
462#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
463__BEGIN_DECLS
464extern __const int sys_nerr; /* perror(3) external variables */
465extern __const char *__const sys_errlist[];
466
467int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
468char *ctermid_r(char *);
469char *fgetln(FILE *, size_t *);
470__const char *fmtcheck(const char *, const char *) __attribute__((format_arg(2)));
471int fpurge(FILE *);
472void setbuffer(FILE *, char *, int);
473int setlinebuf(FILE *);
474int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
475
476
477/*
478 * Stdio function-access interface.
479 */
480FILE *funopen(const void *,
481 int (* _Nullable)(void *, char *, int),
482 int (* _Nullable)(void *, const char *, int),
483 fpos_t (* _Nullable)(void *, fpos_t, int),
484 int (* _Nullable)(void *));
485__END_DECLS
486#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
487#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
488
489#define feof_unlocked(p) __sfeof(p)
490#define ferror_unlocked(p) __sferror(p)
491#define clearerr_unlocked(p) __sclearerr(p)
492#define fileno_unlocked(p) __sfileno(p)
493
494#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
495
496
497#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
498/* Security checking functions. */
499#include <secure/_stdio.h>
500#endif
501
502#endif /* _STDIO_H_ */
lib/libc/include/any-macos-any/_stdlib.h created+378
...@@ -0,0 +1,378 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*-
24 * Copyright (c) 1990, 1993
25 * The Regents of the University of California. All rights reserved.
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
54 *
55 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
56 */
57
58#ifndef _STDLIB_H_
59#define _STDLIB_H_
60
61#include <Availability.h>
62#include <sys/cdefs.h>
63
64#include <_types.h>
65#if !defined(_ANSI_SOURCE)
66#include <sys/wait.h>
67#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
68#include <alloca.h>
69#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
70#endif /* !_ANSI_SOURCE */
71
72/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
73 * _GCC_SIZE_T */
74#include <sys/_types/_size_t.h>
75
76#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
77#include <sys/_types/_ct_rune_t.h>
78#include <sys/_types/_rune_t.h>
79#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
80
81#include <sys/_types/_wchar_t.h>
82
83typedef struct {
84 int quot; /* quotient */
85 int rem; /* remainder */
86} div_t;
87
88typedef struct {
89 long quot; /* quotient */
90 long rem; /* remainder */
91} ldiv_t;
92
93#if !__DARWIN_NO_LONG_LONG
94typedef struct {
95 long long quot;
96 long long rem;
97} lldiv_t;
98#endif /* !__DARWIN_NO_LONG_LONG */
99
100#include <sys/_types/_null.h>
101
102#define EXIT_FAILURE 1
103#define EXIT_SUCCESS 0
104
105#define RAND_MAX 0x7fffffff
106
107// When _USE_EXTENDED_LOCALES_ is enabled (by including xlocale.h),
108// MB_CUR_MAX is defined by xlocale.h.
109#if !defined(MB_CUR_MAX) && !defined(_USE_EXTENDED_LOCALES_)
110#if __has_feature(modules)
111// When clang modules are enabled, there can only be one definition of
112// MB_CUR_MAX, and that needs to be the same one used by xlocale.h.
113#include <_mb_cur_max.h>
114#else
115extern int __mb_cur_max;
116#define MB_CUR_MAX __mb_cur_max
117#endif /* __has_feature(modules) */
118#endif /* !MB_CUR_MAX && !_USE_EXTENDED_LOCALES_ */
119
120#include <malloc/_malloc.h>
121#include <_abort.h>
122
123__BEGIN_DECLS
124int abs(int) __pure2;
125int atexit(void (* _Nonnull)(void));
126#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
127 defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
128int at_quick_exit(void (*)(void));
129#endif
130double atof(const char *);
131int atoi(const char *);
132long atol(const char *);
133#if !__DARWIN_NO_LONG_LONG
134long long
135 atoll(const char *);
136#endif /* !__DARWIN_NO_LONG_LONG */
137void *bsearch(const void *__key, const void *__base, size_t __nel,
138 size_t __width, int (* _Nonnull __compar)(const void *, const void *));
139/* calloc is now declared in _malloc.h */
140div_t div(int, int) __pure2;
141void exit(int) __dead2;
142/* free is now declared in _malloc.h */
143char *getenv(const char *);
144long labs(long) __pure2;
145ldiv_t ldiv(long, long) __pure2;
146#if !__DARWIN_NO_LONG_LONG
147long long
148 llabs(long long);
149lldiv_t lldiv(long long, long long);
150#endif /* !__DARWIN_NO_LONG_LONG */
151/* malloc is now declared in _malloc.h */
152int mblen(const char *__s, size_t __n);
153size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
154int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
155/* posix_memalign is now declared in _malloc.h */
156void qsort(void *__base, size_t __nel, size_t __width,
157 int (* _Nonnull __compar)(const void *, const void *));
158#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
159 defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
160void quick_exit(int) __dead2;
161#endif
162int rand(void) __swift_unavailable("Use arc4random instead.");
163/* realloc is now declared in _malloc.h */
164void srand(unsigned) __swift_unavailable("Use arc4random instead.");
165double strtod(const char *, char **) __DARWIN_ALIAS(strtod);
166float strtof(const char *, char **) __DARWIN_ALIAS(strtof);
167long strtol(const char *__str, char **__endptr, int __base);
168long double
169 strtold(const char *, char **);
170#if !__DARWIN_NO_LONG_LONG
171long long
172 strtoll(const char *__str, char **__endptr, int __base);
173#endif /* !__DARWIN_NO_LONG_LONG */
174unsigned long
175 strtoul(const char *__str, char **__endptr, int __base);
176#if !__DARWIN_NO_LONG_LONG
177unsigned long long
178 strtoull(const char *__str, char **__endptr, int __base);
179#endif /* !__DARWIN_NO_LONG_LONG */
180
181__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
182__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
183__WATCHOS_PROHIBITED __TVOS_PROHIBITED
184int system(const char *) __DARWIN_ALIAS_C(system);
185
186
187size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
188int wctomb(char *, wchar_t);
189
190#ifndef _ANSI_SOURCE
191void _Exit(int) __dead2;
192long a64l(const char *);
193double drand48(void);
194char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
195double erand48(unsigned short[3]);
196char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
197char *gcvt(double, int, char *); /* LEGACY */
198int getsubopt(char **, char * const *, char **);
199int grantpt(int);
200#if __DARWIN_UNIX03
201char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
202#else /* !__DARWIN_UNIX03 */
203char *initstate(unsigned long, char *, long);
204#endif /* __DARWIN_UNIX03 */
205long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
206char *l64a(long);
207void lcong48(unsigned short[7]);
208long lrand48(void) __swift_unavailable("Use arc4random instead.");
209#if !defined(_POSIX_C_SOURCE)
210__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of mktemp(3), it is highly recommended that you use mkstemp(3) instead.")
211#endif
212char *mktemp(char *);
213int mkstemp(char *);
214long mrand48(void) __swift_unavailable("Use arc4random instead.");
215long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
216int posix_openpt(int);
217char *ptsname(int);
218
219#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
220int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
221#endif
222
223int putenv(char *) __DARWIN_ALIAS(putenv);
224long random(void) __swift_unavailable("Use arc4random instead.");
225int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
226#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
227char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
228#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
229char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
230#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
231unsigned short
232 *seed48(unsigned short[3]);
233int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
234#if __DARWIN_UNIX03
235void setkey(const char *) __DARWIN_ALIAS(setkey);
236#else /* !__DARWIN_UNIX03 */
237int setkey(const char *);
238#endif /* __DARWIN_UNIX03 */
239char *setstate(const char *);
240void srand48(long);
241#if __DARWIN_UNIX03
242void srandom(unsigned);
243#else /* !__DARWIN_UNIX03 */
244void srandom(unsigned long);
245#endif /* __DARWIN_UNIX03 */
246int unlockpt(int);
247#if __DARWIN_UNIX03
248int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
249#else /* !__DARWIN_UNIX03 */
250void unsetenv(const char *);
251#endif /* __DARWIN_UNIX03 */
252#endif /* !_ANSI_SOURCE */
253__END_DECLS
254
255#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
256#include <machine/types.h>
257#include <sys/_types/_dev_t.h>
258#include <sys/_types/_mode_t.h>
259#include <_types/_uint32_t.h>
260
261__BEGIN_DECLS
262uint32_t arc4random(void);
263void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
264 __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
265 __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
266 __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
267 __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
268void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
269void arc4random_stir(void);
270uint32_t
271 arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
272#ifdef __BLOCKS__
273int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
274
275#ifdef __BLOCKS__
276#if __has_attribute(noescape)
277#define __bsearch_noescape __attribute__((__noescape__))
278#else
279#define __bsearch_noescape
280#endif
281#endif /* __BLOCKS__ */
282void *bsearch_b(const void *__key, const void *__base, size_t __nel,
283 size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __bsearch_noescape)
284 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
285#endif /* __BLOCKS__ */
286
287 /* getcap(3) functions */
288char *cgetcap(char *, const char *, int);
289int cgetclose(void);
290int cgetent(char **, char **, const char *);
291int cgetfirst(char **, char **);
292int cgetmatch(const char *, const char *);
293int cgetnext(char **, char **);
294int cgetnum(char *, const char *, long *);
295int cgetset(const char *);
296int cgetstr(char *, const char *, char **);
297int cgetustr(char *, const char *, char **);
298
299int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
300char *devname(dev_t, mode_t);
301char *devname_r(dev_t, mode_t, char *buf, int len);
302char *getbsize(int *, long *);
303int getloadavg(double [], int);
304const char
305 *getprogname(void);
306void setprogname(const char *);
307
308#ifdef __BLOCKS__
309#if __has_attribute(noescape)
310#define __sort_noescape __attribute__((__noescape__))
311#else
312#define __sort_noescape
313#endif
314#endif /* __BLOCKS__ */
315
316int heapsort(void *__base, size_t __nel, size_t __width,
317 int (* _Nonnull __compar)(const void *, const void *));
318#ifdef __BLOCKS__
319int heapsort_b(void *__base, size_t __nel, size_t __width,
320 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
321 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
322#endif /* __BLOCKS__ */
323int mergesort(void *__base, size_t __nel, size_t __width,
324 int (* _Nonnull __compar)(const void *, const void *));
325#ifdef __BLOCKS__
326int mergesort_b(void *__base, size_t __nel, size_t __width,
327 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
328 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
329#endif /* __BLOCKS__ */
330void psort(void *__base, size_t __nel, size_t __width,
331 int (* _Nonnull __compar)(const void *, const void *))
332 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
333#ifdef __BLOCKS__
334void psort_b(void *__base, size_t __nel, size_t __width,
335 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
336 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
337#endif /* __BLOCKS__ */
338void psort_r(void *__base, size_t __nel, size_t __width, void *,
339 int (* _Nonnull __compar)(void *, const void *, const void *))
340 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
341#ifdef __BLOCKS__
342void qsort_b(void *__base, size_t __nel, size_t __width,
343 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
344 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
345#endif /* __BLOCKS__ */
346void qsort_r(void *__base, size_t __nel, size_t __width, void *,
347 int (* _Nonnull __compar)(void *, const void *, const void *));
348int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
349 unsigned __endbyte);
350int rpmatch(const char *)
351 __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
352int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
353 unsigned __endbyte);
354void sranddev(void);
355void srandomdev(void);
356/* reallocf is now declared in _malloc.h */
357long long
358 strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
359 __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
360#if !__DARWIN_NO_LONG_LONG
361long long
362 strtoq(const char *__str, char **__endptr, int __base);
363unsigned long long
364 strtouq(const char *__str, char **__endptr, int __base);
365#endif /* !__DARWIN_NO_LONG_LONG */
366extern char *suboptarg; /* getsubopt(3) external variable */
367/* valloc is now declared in _malloc.h */
368__END_DECLS
369#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
370
371__BEGIN_DECLS
372/* Poison the following routines if -fshort-wchar is set */
373#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
374#pragma GCC poison mbstowcs mbtowc wcstombs wctomb
375#endif
376__END_DECLS
377
378#endif /* _STDLIB_H_ */
lib/libc/include/any-macos-any/_string.h created+191
...@@ -0,0 +1,191 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*-
24 * Copyright (c) 1990, 1993
25 * The Regents of the University of California. All rights reserved.
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
54 *
55 * @(#)string.h 8.1 (Berkeley) 6/2/93
56 */
57
58#ifndef _STRING_H_
59#define _STRING_H_
60
61#include <_types.h>
62#include <sys/cdefs.h>
63#include <Availability.h>
64#include <sys/_types/_size_t.h>
65#include <sys/_types/_null.h>
66
67/* ANSI-C */
68
69__BEGIN_DECLS
70void *memchr(const void *__s, int __c, size_t __n);
71int memcmp(const void *__s1, const void *__s2, size_t __n);
72void *memcpy(void *__dst, const void *__src, size_t __n);
73void *memmove(void *__dst, const void *__src, size_t __len);
74void *memset(void *__b, int __c, size_t __len);
75char *strcat(char *__s1, const char *__s2);
76char *strchr(const char *__s, int __c);
77int strcmp(const char *__s1, const char *__s2);
78int strcoll(const char *__s1, const char *__s2);
79char *strcpy(char *__dst, const char *__src);
80size_t strcspn(const char *__s, const char *__charset);
81char *strerror(int __errnum) __DARWIN_ALIAS(strerror);
82size_t strlen(const char *__s);
83char *strncat(char *__s1, const char *__s2, size_t __n);
84int strncmp(const char *__s1, const char *__s2, size_t __n);
85char *strncpy(char *__dst, const char *__src, size_t __n);
86char *strpbrk(const char *__s, const char *__charset);
87char *strrchr(const char *__s, int __c);
88size_t strspn(const char *__s, const char *__charset);
89char *strstr(const char *__big, const char *__little);
90char *strtok(char *__str, const char *__sep);
91size_t strxfrm(char *__s1, const char *__s2, size_t __n);
92__END_DECLS
93
94
95
96/* Additional functionality provided by:
97 * POSIX.1c-1995,
98 * POSIX.1i-1995,
99 * and the omnibus ISO/IEC 9945-1: 1996
100 */
101
102#if __DARWIN_C_LEVEL >= 199506L
103__BEGIN_DECLS
104char *strtok_r(char *__str, const char *__sep, char **__lasts);
105__END_DECLS
106#endif /* __DARWIN_C_LEVEL >= 199506L */
107
108
109
110/* Additional functionality provided by:
111 * POSIX.1-2001
112 */
113
114#if __DARWIN_C_LEVEL >= 200112L
115__BEGIN_DECLS
116int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen);
117char *strdup(const char *__s1);
118void *memccpy(void *__dst, const void *__src, int __c, size_t __n);
119__END_DECLS
120#endif /* __DARWIN_C_LEVEL >= 200112L */
121
122
123
124/* Additional functionality provided by:
125 * POSIX.1-2008
126 */
127
128#if __DARWIN_C_LEVEL >= 200809L
129__BEGIN_DECLS
130char *stpcpy(char *__dst, const char *__src);
131char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
132char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
133size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
134char *strsignal(int __sig);
135__END_DECLS
136#endif /* __DARWIN_C_LEVEL >= 200809L */
137
138/* C11 Annex K */
139
140#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
141#include <sys/_types/_rsize_t.h>
142#include <sys/_types/_errno_t.h>
143
144__BEGIN_DECLS
145errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
146__END_DECLS
147#endif
148
149/* Darwin extensions */
150
151#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
152#include <sys/_types/_ssize_t.h>
153
154__BEGIN_DECLS
155void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
156void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
157void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
158void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
159
160char *strcasestr(const char *__big, const char *__little);
161char *strnstr(const char *__big, const char *__little, size_t __len);
162size_t strlcat(char *__dst, const char *__source, size_t __size);
163size_t strlcpy(char *__dst, const char *__source, size_t __size);
164void strmode(int __mode, char *__bp);
165char *strsep(char **__stringp, const char *__delim);
166
167/* SUS places swab() in unistd.h. It is listed here for source compatibility */
168void swab(const void * __restrict, void * __restrict, ssize_t);
169
170__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1)
171__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1)
172int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len);
173
174__OSX_AVAILABLE(11.0) __IOS_AVAILABLE(14.0)
175__TVOS_AVAILABLE(14.0) __WATCHOS_AVAILABLE(7.0)
176int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen);
177__END_DECLS
178
179/* Some functions historically defined in string.h were placed in strings.h
180 * by SUS.
181 */
182#include <_strings.h>
183#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
184
185
186#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
187/* Security checking functions. */
188#include <secure/_string.h>
189#endif
190
191#endif /* _STRING_H_ */
lib/libc/include/any-macos-any/_strings.h created+98
...@@ -0,0 +1,98 @@
1/*
2 * Copyright (c) 2000, 2007, 2010, 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*-
24 * Copyright (c) 1990, 1993
25 * The Regents of the University of California. All rights reserved.
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * 3. All advertising materials mentioning features or use of this software
36 * must display the following acknowledgement:
37 * This product includes software developed by the University of
38 * California, Berkeley and its contributors.
39 * 4. Neither the name of the University nor the names of its contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
54 *
55 * @(#)strings.h 8.1 (Berkeley) 6/2/93
56 */
57
58#ifndef __STRINGS_H_
59#define __STRINGS_H_
60
61#include <_types.h>
62
63#include <sys/cdefs.h>
64#include <Availability.h>
65#include <sys/_types/_size_t.h>
66
67__BEGIN_DECLS
68/* Removed in Issue 7 */
69#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
70int bcmp(const void *, const void *, size_t) __POSIX_C_DEPRECATED(200112L);
71void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
72void bzero(void *, size_t) __POSIX_C_DEPRECATED(200112L);
73char *index(const char *, int) __POSIX_C_DEPRECATED(200112L);
74char *rindex(const char *, int) __POSIX_C_DEPRECATED(200112L);
75#endif
76
77int ffs(int);
78int strcasecmp(const char *, const char *);
79int strncasecmp(const char *, const char *, size_t);
80__END_DECLS
81
82/* Darwin extensions */
83#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
84__BEGIN_DECLS
85int ffsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
86int ffsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
87int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
88int flsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
89int flsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
90__END_DECLS
91#endif
92
93#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
94/* Security checking functions. */
95#include <secure/_strings.h>
96#endif
97
98#endif /* __STRINGS_H_ */
lib/libc/include/any-macos-any/_time.h created+204
...@@ -0,0 +1,204 @@
1/*
2 * Copyright (c) 2023 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * Copyright (c) 1989, 1993
25 * The Regents of the University of California. All rights reserved.
26 * (c) UNIX System Laboratories, Inc.
27 * All or some portions of this file are derived from material licensed
28 * to the University of California by American Telephone and Telegraph
29 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30 * the permission of UNIX System Laboratories, Inc.
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
34 * are met:
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 * 3. All advertising materials mentioning features or use of this software
41 * must display the following acknowledgement:
42 * This product includes software developed by the University of
43 * California, Berkeley and its contributors.
44 * 4. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 *
60 * @(#)time.h 8.3 (Berkeley) 1/21/94
61 */
62
63#ifndef _TIME_H_
64#define _TIME_H_
65
66#include <_types.h>
67#include <sys/cdefs.h>
68#include <Availability.h>
69#include <sys/_types/_clock_t.h>
70#include <sys/_types/_null.h>
71#include <sys/_types/_size_t.h>
72#include <sys/_types/_time_t.h>
73#include <sys/_types/_timespec.h>
74
75struct tm {
76 int tm_sec; /* seconds after the minute [0-60] */
77 int tm_min; /* minutes after the hour [0-59] */
78 int tm_hour; /* hours since midnight [0-23] */
79 int tm_mday; /* day of the month [1-31] */
80 int tm_mon; /* months since January [0-11] */
81 int tm_year; /* years since 1900 */
82 int tm_wday; /* days since Sunday [0-6] */
83 int tm_yday; /* days since January 1 [0-365] */
84 int tm_isdst; /* Daylight Savings Time flag */
85 long tm_gmtoff; /* offset from UTC in seconds */
86 char *tm_zone; /* timezone abbreviation */
87};
88
89#if __DARWIN_UNIX03
90#define CLOCKS_PER_SEC ((clock_t)1000000) /* [XSI] */
91#else /* !__DARWIN_UNIX03 */
92#include <machine/_limits.h> /* Include file containing CLK_TCK. */
93
94#define CLOCKS_PER_SEC ((clock_t)(__DARWIN_CLK_TCK))
95#endif /* __DARWIN_UNIX03 */
96
97#ifndef _ANSI_SOURCE
98extern char *tzname[];
99#endif
100
101extern int getdate_err;
102#if __DARWIN_UNIX03
103extern long timezone __DARWIN_ALIAS(timezone);
104#endif /* __DARWIN_UNIX03 */
105extern int daylight;
106
107__BEGIN_DECLS
108char *asctime(const struct tm *);
109clock_t clock(void) __DARWIN_ALIAS(clock);
110char *ctime(const time_t *);
111double difftime(time_t, time_t);
112struct tm *getdate(const char *);
113struct tm *gmtime(const time_t *);
114struct tm *localtime(const time_t *);
115time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
116size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
117char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
118time_t time(time_t *);
119
120#ifndef _ANSI_SOURCE
121void tzset(void);
122#endif /* not ANSI */
123
124/* [TSF] Thread safe functions */
125char *asctime_r(const struct tm * __restrict, char * __restrict);
126char *ctime_r(const time_t *, char *);
127struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict);
128struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict);
129
130#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
131time_t posix2time(time_t);
132#if !__DARWIN_UNIX03
133char *timezone(int, int);
134#endif /* !__DARWIN_UNIX03 */
135void tzsetwall(void);
136time_t time2posix(time_t);
137time_t timelocal(struct tm * const);
138time_t timegm(struct tm * const);
139#endif /* neither ANSI nor POSIX */
140
141#if !defined(_ANSI_SOURCE)
142int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep);
143#endif
144
145#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0
146#if __DARWIN_C_LEVEL >= 199309L
147#if __has_feature(enumerator_attributes)
148#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
149#else
150#define __CLOCK_AVAILABILITY
151#endif
152
153typedef enum {
154_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0,
155#define CLOCK_REALTIME _CLOCK_REALTIME
156_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6,
157#define CLOCK_MONOTONIC _CLOCK_MONOTONIC
158#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
159_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4,
160#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW
161_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5,
162#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX
163_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8,
164#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW
165_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9,
166#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX
167#endif
168_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12,
169#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID
170_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16
171#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID
172} clockid_t;
173
174__CLOCK_AVAILABILITY
175int clock_getres(clockid_t __clock_id, struct timespec *__res);
176
177__CLOCK_AVAILABILITY
178int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
179
180#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
181__CLOCK_AVAILABILITY
182__uint64_t clock_gettime_nsec_np(clockid_t __clock_id);
183#endif
184
185__OSX_AVAILABLE(10.12) __IOS_PROHIBITED
186__TVOS_PROHIBITED __WATCHOS_PROHIBITED
187int clock_settime(clockid_t __clock_id, const struct timespec *__tp);
188
189#undef __CLOCK_AVAILABILITY
190#endif /* __DARWIN_C_LEVEL */
191#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */
192
193#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
194 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
195 (defined(__cplusplus) && __cplusplus >= 201703L)
196/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */
197#define TIME_UTC 1 /* time elapsed since epoch */
198__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0))
199int timespec_get(struct timespec *ts, int base);
200#endif
201
202__END_DECLS
203
204#endif /* !_TIME_H_ */
lib/libc/include/any-macos-any/_wchar.h created+227
...@@ -0,0 +1,227 @@
1/*-
2 * Copyright (c)1999 Citrus Project,
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: /repoman/r/ncvs/src/include/wchar.h,v 1.34 2003/03/13 06:29:53 tjr Exp $
27 */
28
29/*-
30 * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
31 * All rights reserved.
32 *
33 * This code is derived from software contributed to The NetBSD Foundation
34 * by Julian Coleman.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. All advertising materials mentioning features or use of this software
45 * must display the following acknowledgement:
46 * This product includes software developed by the NetBSD
47 * Foundation, Inc. and its contributors.
48 * 4. Neither the name of The NetBSD Foundation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
53 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
54 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
55 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
56 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
57 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
58 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
59 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
60 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
61 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
62 * POSSIBILITY OF SUCH DAMAGE.
63 *
64 * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
65 */
66
67#ifndef _WCHAR_H_
68#define _WCHAR_H_
69
70#include <_types.h>
71#include <sys/cdefs.h>
72#include <Availability.h>
73
74#include <sys/_types/_null.h>
75#include <sys/_types/_size_t.h>
76#include <sys/_types/_mbstate_t.h>
77#include <sys/_types/_ct_rune_t.h>
78#include <sys/_types/_rune_t.h>
79#include <sys/_types/_wchar_t.h>
80
81#ifndef WCHAR_MIN
82#define WCHAR_MIN __DARWIN_WCHAR_MIN
83#endif
84
85#ifndef WCHAR_MAX
86#define WCHAR_MAX __DARWIN_WCHAR_MAX
87#endif
88
89#include <stdarg.h>
90#include <stdio.h>
91#include <time.h>
92#include <__wctype.h>
93
94
95/* Initially added in Issue 4 */
96__BEGIN_DECLS
97wint_t btowc(int);
98wint_t fgetwc(FILE *);
99wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);
100wint_t fputwc(wchar_t, FILE *);
101int fputws(const wchar_t * __restrict, FILE * __restrict);
102int fwide(FILE *, int);
103int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
104int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
105wint_t getwc(FILE *);
106wint_t getwchar(void);
107size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
108size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
109 mbstate_t * __restrict);
110int mbsinit(const mbstate_t *);
111size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
112 mbstate_t * __restrict);
113wint_t putwc(wchar_t, FILE *);
114wint_t putwchar(wchar_t);
115int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...);
116int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
117wint_t ungetwc(wint_t, FILE *);
118int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
119 __darwin_va_list);
120int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
121 __darwin_va_list);
122int vwprintf(const wchar_t * __restrict, __darwin_va_list);
123size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
124wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
125wchar_t *wcschr(const wchar_t *, wchar_t);
126int wcscmp(const wchar_t *, const wchar_t *);
127int wcscoll(const wchar_t *, const wchar_t *);
128wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
129size_t wcscspn(const wchar_t *, const wchar_t *);
130size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
131 const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
132size_t wcslen(const wchar_t *);
133wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
134int wcsncmp(const wchar_t *, const wchar_t *, size_t);
135wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
136wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
137wchar_t *wcsrchr(const wchar_t *, wchar_t);
138size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
139 mbstate_t * __restrict);
140size_t wcsspn(const wchar_t *, const wchar_t *);
141wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
142size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
143int wctob(wint_t);
144double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
145wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
146 wchar_t ** __restrict);
147long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
148unsigned long
149 wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
150wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
151int wmemcmp(const wchar_t *, const wchar_t *, size_t);
152wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
153wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
154wchar_t *wmemset(wchar_t *, wchar_t, size_t);
155int wprintf(const wchar_t * __restrict, ...);
156int wscanf(const wchar_t * __restrict, ...);
157int wcswidth(const wchar_t *, size_t);
158int wcwidth(wchar_t);
159__END_DECLS
160
161
162
163/* Additional functionality provided by:
164 * POSIX.1-2001
165 * ISO C99
166 */
167
168#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
169__BEGIN_DECLS
170int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
171 __darwin_va_list);
172int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
173 __darwin_va_list);
174int vwscanf(const wchar_t * __restrict, __darwin_va_list);
175float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
176long double
177 wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
178#if !__DARWIN_NO_LONG_LONG
179long long
180 wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
181unsigned long long
182 wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
183#endif /* !__DARWIN_NO_LONG_LONG */
184__END_DECLS
185#endif
186
187
188
189/* Additional functionality provided by:
190 * POSIX.1-2008
191 */
192
193#if __DARWIN_C_LEVEL >= 200809L
194__BEGIN_DECLS
195size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
196 size_t, mbstate_t * __restrict);
197wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
198wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
199wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
200int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
201int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
202size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
203size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
204 size_t, mbstate_t * __restrict);
205FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
206__END_DECLS
207#endif /* __DARWIN_C_LEVEL >= 200809L */
208
209
210
211/* Darwin extensions */
212
213#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
214__BEGIN_DECLS
215wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
216size_t wcslcat(wchar_t *, const wchar_t *, size_t);
217size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
218__END_DECLS
219#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
220
221
222/* Poison the following routines if -fshort-wchar is set */
223#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
224#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf
225#endif
226
227#endif /* !_WCHAR_H_ */
lib/libc/include/any-macos-any/_wctype.h+47-85
...@@ -23,23 +23,22 @@...@@ -23,23 +23,22 @@
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.24 * SUCH DAMAGE.
25 *25 *
26 * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp
27 * $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $
28 * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
26 */29 */
2730
28/*31#ifndef _WCTYPE_H_
29 * Common header for wctype.h and wchar.h32#define _WCTYPE_H_
30 *
31 * Contains everything required by wctype.h except:
32 *
33 * #include <_types/_wctrans_t.h>
34 * int iswblank(wint_t);
35 * wint_t towctrans(wint_t, wctrans_t);
36 * wctrans_t wctrans(const char *);
37 */
3833
39#ifndef __WCTYPE_H_34#include <sys/cdefs.h>
40#define __WCTYPE_H_35#include <_types.h>
36#include <_types/_wctrans_t.h>
37
38#define __DARWIN_WCTYPE_TOP_inline __header_inline
4139
42#include <__wctype.h>40#include <__wctype.h>
41#include <ctype.h>
4342
44/*43/*
45 * Use inline functions if we are allowed to and the compiler supports them.44 * Use inline functions if we are allowed to and the compiler supports them.
...@@ -48,117 +47,80 @@...@@ -48,117 +47,80 @@
48 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))47 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
4948
50__DARWIN_WCTYPE_TOP_inline int49__DARWIN_WCTYPE_TOP_inline int
51iswalnum(wint_t _wc)50iswblank(wint_t _wc)
52{
53 return (__istype(_wc, _CTYPE_A|_CTYPE_D));
54}
55
56__DARWIN_WCTYPE_TOP_inline int
57iswalpha(wint_t _wc)
58{
59 return (__istype(_wc, _CTYPE_A));
60}
61
62__DARWIN_WCTYPE_TOP_inline int
63iswcntrl(wint_t _wc)
64{
65 return (__istype(_wc, _CTYPE_C));
66}
67
68__DARWIN_WCTYPE_TOP_inline int
69iswctype(wint_t _wc, wctype_t _charclass)
70{
71 return (__istype(_wc, _charclass));
72}
73
74__DARWIN_WCTYPE_TOP_inline int
75iswdigit(wint_t _wc)
76{51{
77 return (__isctype(_wc, _CTYPE_D));52 return (__istype(_wc, _CTYPE_B));
78}53}
7954
55#if !defined(_ANSI_SOURCE)
80__DARWIN_WCTYPE_TOP_inline int56__DARWIN_WCTYPE_TOP_inline int
81iswgraph(wint_t _wc)57iswascii(wint_t _wc)
82{58{
83 return (__istype(_wc, _CTYPE_G));59 return ((_wc & ~0x7F) == 0);
84}60}
8561
86__DARWIN_WCTYPE_TOP_inline int62__DARWIN_WCTYPE_TOP_inline int
87iswlower(wint_t _wc)63iswhexnumber(wint_t _wc)
88{64{
89 return (__istype(_wc, _CTYPE_L));65 return (__istype(_wc, _CTYPE_X));
90}66}
9167
92__DARWIN_WCTYPE_TOP_inline int68__DARWIN_WCTYPE_TOP_inline int
93iswprint(wint_t _wc)69iswideogram(wint_t _wc)
94{70{
95 return (__istype(_wc, _CTYPE_R));71 return (__istype(_wc, _CTYPE_I));
96}72}
9773
98__DARWIN_WCTYPE_TOP_inline int74__DARWIN_WCTYPE_TOP_inline int
99iswpunct(wint_t _wc)75iswnumber(wint_t _wc)
100{76{
101 return (__istype(_wc, _CTYPE_P));77 return (__istype(_wc, _CTYPE_D));
102}78}
10379
104__DARWIN_WCTYPE_TOP_inline int80__DARWIN_WCTYPE_TOP_inline int
105iswspace(wint_t _wc)81iswphonogram(wint_t _wc)
106{82{
107 return (__istype(_wc, _CTYPE_S));83 return (__istype(_wc, _CTYPE_Q));
108}84}
10985
110__DARWIN_WCTYPE_TOP_inline int86__DARWIN_WCTYPE_TOP_inline int
111iswupper(wint_t _wc)87iswrune(wint_t _wc)
112{88{
113 return (__istype(_wc, _CTYPE_U));89 return (__istype(_wc, 0xFFFFFFF0L));
114}90}
11591
116__DARWIN_WCTYPE_TOP_inline int92__DARWIN_WCTYPE_TOP_inline int
117iswxdigit(wint_t _wc)93iswspecial(wint_t _wc)
118{94{
119 return (__isctype(_wc, _CTYPE_X));95 return (__istype(_wc, _CTYPE_T));
120}
121
122__DARWIN_WCTYPE_TOP_inline wint_t
123towlower(wint_t _wc)
124{
125 return (__tolower(_wc));
126}
127
128__DARWIN_WCTYPE_TOP_inline wint_t
129towupper(wint_t _wc)
130{
131 return (__toupper(_wc));
132}96}
97#endif /* !_ANSI_SOURCE */
13398
134#else /* not using inlines */99#else /* not using inlines */
135100
136__BEGIN_DECLS101__BEGIN_DECLS
137int iswalnum(wint_t);102int iswblank(wint_t);
138int iswalpha(wint_t);103
139int iswcntrl(wint_t);104#if !defined(_ANSI_SOURCE)
140int iswctype(wint_t, wctype_t);105wint_t iswascii(wint_t);
141int iswdigit(wint_t);106wint_t iswhexnumber(wint_t);
142int iswgraph(wint_t);107wint_t iswideogram(wint_t);
143int iswlower(wint_t);108wint_t iswnumber(wint_t);
144int iswprint(wint_t);109wint_t iswphonogram(wint_t);
145int iswpunct(wint_t);110wint_t iswrune(wint_t);
146int iswspace(wint_t);111wint_t iswspecial(wint_t);
147int iswupper(wint_t);112#endif
148int iswxdigit(wint_t);
149wint_t towlower(wint_t);
150wint_t towupper(wint_t);
151__END_DECLS113__END_DECLS
152114
153#endif /* using inlines */115#endif /* using inlines */
154116
155__BEGIN_DECLS117__BEGIN_DECLS
156wctype_t118#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
157 wctype(const char *);119wint_t nextwctype(wint_t, wctype_t);
120#endif
121wint_t towctrans(wint_t, wctrans_t);
122wctrans_t
123 wctrans(const char *);
158__END_DECLS124__END_DECLS
159125
160#ifdef _USE_EXTENDED_LOCALES_126#endif /* _WCTYPE_H_ */
161#include <xlocale/__wctype.h>
162#endif /* _USE_EXTENDED_LOCALES_ */
163
164#endif /* __WCTYPE_H_ */
lib/libc/include/any-macos-any/_xlocale.h+36-7
...@@ -21,17 +21,46 @@...@@ -21,17 +21,46 @@
21 * @APPLE_LICENSE_HEADER_END@21 * @APPLE_LICENSE_HEADER_END@
22 */22 */
2323
24#ifndef __XLOCALE_H_24#ifndef _XLOCALE_H_
25#define __XLOCALE_H_25#define _XLOCALE_H_
2626
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
2828
29struct _xlocale; /* forward reference */29#ifndef _USE_EXTENDED_LOCALES_
30typedef struct _xlocale * locale_t;30#define _USE_EXTENDED_LOCALES_
31#endif /* _USE_EXTENDED_LOCALES_ */
32
33#include <_locale.h>
34#include <__xlocale.h>
35
36#define LC_ALL_MASK ( LC_COLLATE_MASK \
37 | LC_CTYPE_MASK \
38 | LC_MESSAGES_MASK \
39 | LC_MONETARY_MASK \
40 | LC_NUMERIC_MASK \
41 | LC_TIME_MASK )
42#define LC_COLLATE_MASK (1 << 0)
43#define LC_CTYPE_MASK (1 << 1)
44#define LC_MESSAGES_MASK (1 << 2)
45#define LC_MONETARY_MASK (1 << 3)
46#define LC_NUMERIC_MASK (1 << 4)
47#define LC_TIME_MASK (1 << 5)
48
49#define _LC_NUM_MASK 6
50#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
51
52#define LC_GLOBAL_LOCALE ((locale_t)-1)
53#define LC_C_LOCALE ((locale_t)NULL)
3154
32__BEGIN_DECLS55__BEGIN_DECLS
33int ___mb_cur_max(void);56extern const locale_t _c_locale;
34int ___mb_cur_max_l(locale_t);57
58locale_t duplocale(locale_t);
59int freelocale(locale_t);
60struct lconv * localeconv_l(locale_t);
61locale_t newlocale(int, __const char *, locale_t);
62__const char * querylocale(int, locale_t);
63locale_t uselocale(locale_t);
35__END_DECLS64__END_DECLS
3665
37#endif /* __XLOCALE_H_ */66#endif /* _XLOCALE_H_ */
lib/libc/include/any-macos-any/arm/_endian.h created+105
...@@ -0,0 +1,105 @@
1/*
2 * Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*
30 * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
31 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
32 *
33 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
34 *
35 * This file contains Original Code and/or Modifications of Original Code
36 * as defined in and that are subject to the Apple Public Source License
37 * Version 2.0 (the 'License'). You may not use this file except in
38 * compliance with the License. The rights granted to you under the License
39 * may not be used to create, or enable the creation or redistribution of,
40 * unlawful or unlicensed copies of an Apple operating system, or to
41 * circumvent, violate, or enable the circumvention or violation of, any
42 * terms of an Apple operating system software license agreement.
43 *
44 * Please obtain a copy of the License at
45 * http://www.opensource.apple.com/apsl/ and read it before using this file.
46 *
47 * The Original Code and all software distributed under the License are
48 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
49 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
50 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
51 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
52 * Please see the License for the specific language governing rights and
53 * limitations under the License.
54 *
55 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
56 */
57/*
58 * Copyright (c) 1987, 1991, 1993
59 * The Regents of the University of California. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 * 1. Redistributions of source code must retain the above copyright
65 * notice, this list of conditions and the following disclaimer.
66 * 2. Redistributions in binary form must reproduce the above copyright
67 * notice, this list of conditions and the following disclaimer in the
68 * documentation and/or other materials provided with the distribution.
69 * 3. All advertising materials mentioning features or use of this software
70 * must display the following acknowledgement:
71 * This product includes software developed by the University of
72 * California, Berkeley and its contributors.
73 * 4. Neither the name of the University nor the names of its contributors
74 * may be used to endorse or promote products derived from this software
75 * without specific prior written permission.
76 *
77 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
78 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
79 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
81 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
83 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
85 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87 * SUCH DAMAGE.
88 */
89
90#ifndef _ARM___ENDIAN_H_
91#define _ARM___ENDIAN_H_
92
93#if defined (__arm__) || defined (__arm64__)
94
95#include <sys/__endian.h>
96
97#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
98
99#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
100
101#define BYTE_ORDER __DARWIN_BYTE_ORDER
102
103#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
104#endif /* defined (__arm__) || defined (__arm64__) */
105#endif /* !_ARM___ENDIAN_H_ */
lib/libc/include/any-macos-any/arm/_types.h+27-4
...@@ -6,6 +6,19 @@...@@ -6,6 +6,19 @@
66
7#if defined (__arm__) || defined (__arm64__)7#if defined (__arm__) || defined (__arm64__)
88
9#if defined(__has_feature) && __has_feature(modules)
10#define USE_CLANG_TYPES 1
11#else
12#define USE_CLANG_TYPES 0
13#endif
14
15#if USE_CLANG_TYPES
16#include <sys/_types/_ptrdiff_t.h>
17#include <sys/_types/_size_t.h>
18#include <sys/_types/_va_list.h>
19#include <sys/_types/_wchar_t.h>
20#endif
21
9/*22/*
10 * This header file contains integer types. It's intended to also contain23 * This header file contains integer types. It's intended to also contain
11 * flotaing point and other arithmetic types, as needed, later.24 * flotaing point and other arithmetic types, as needed, later.
...@@ -58,7 +71,9 @@ typedef union {...@@ -58,7 +71,9 @@ typedef union {
5871
59typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */72typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
6073
61#if defined(__PTRDIFF_TYPE__)74#if USE_CLANG_TYPES
75typedef ptrdiff_t __darwin_ptrdiff_t; /* ptr1 - ptr2 */
76#elif defined(__PTRDIFF_TYPE__)
62typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */77typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
63#elif defined(__LP64__)78#elif defined(__LP64__)
64typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */79typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
...@@ -66,19 +81,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */...@@ -66,19 +81,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
66typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */81typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
67#endif /* __GNUC__ */82#endif /* __GNUC__ */
6883
69#if defined(__SIZE_TYPE__)84#if USE_CLANG_TYPES
85typedef size_t __darwin_size_t; /* sizeof() */
86#elif defined(__SIZE_TYPE__)
70typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */87typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
71#else88#else
72typedef unsigned long __darwin_size_t; /* sizeof() */89typedef unsigned long __darwin_size_t; /* sizeof() */
73#endif90#endif
7491
75#if (__GNUC__ > 2)92#if USE_CLANG_TYPES
93typedef va_list __darwin_va_list; /* va_list */
94#elif (__GNUC__ > 2)
76typedef __builtin_va_list __darwin_va_list; /* va_list */95typedef __builtin_va_list __darwin_va_list; /* va_list */
77#else96#else
78typedef void * __darwin_va_list; /* va_list */97typedef void * __darwin_va_list; /* va_list */
79#endif98#endif
8099
81#if defined(__WCHAR_TYPE__)100#if USE_CLANG_TYPES
101typedef wchar_t __darwin_wchar_t; /* wchar_t */
102#elif defined(__WCHAR_TYPE__)
82typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */103typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
83#else104#else
84typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */105typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
...@@ -97,6 +118,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */...@@ -97,6 +118,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
97typedef long __darwin_ssize_t; /* byte count or error */118typedef long __darwin_ssize_t; /* byte count or error */
98typedef long __darwin_time_t; /* time() */119typedef long __darwin_time_t; /* time() */
99120
121#undef USE_CLANG_TYPES
122
100#endif /* defined (__arm__) || defined (__arm64__) */123#endif /* defined (__arm__) || defined (__arm64__) */
101124
102#endif /* _BSD_ARM__TYPES_H_ */125#endif /* _BSD_ARM__TYPES_H_ */
lib/libc/include/any-macos-any/arm/endian.h+1-17
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
3 */3 */
4/*4/*
5 * Copyright 1995 NeXT Computer, Inc. All rights reserved.5 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
...@@ -56,24 +56,8 @@...@@ -56,24 +56,8 @@
56#define _QUAD_HIGHWORD 156#define _QUAD_HIGHWORD 1
57#define _QUAD_LOWWORD 057#define _QUAD_LOWWORD 0
5858
59/*
60 * Definitions for byte order, according to byte significance from low
61 * address to high.
62 */
63#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
64#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
65#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
66
67#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
68
69#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))59#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
7060
71#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
72#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
73#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
74
75#define BYTE_ORDER __DARWIN_BYTE_ORDER
76
77#include <sys/_endian.h>61#include <sys/_endian.h>
7862
79#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */63#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
lib/libc/include/any-macos-any/arm/limits.h+10-2
...@@ -44,6 +44,12 @@...@@ -44,6 +44,12 @@
44#include <sys/cdefs.h>44#include <sys/cdefs.h>
45#include <arm/_limits.h>45#include <arm/_limits.h>
4646
47#if defined(__has_feature) && __has_feature(modules)
48#define USE_CLANG_LIMITS 1
49#else
50#define USE_CLANG_LIMITS 0
51#endif
52
47#undef MB_LEN_MAX53#undef MB_LEN_MAX
48#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */54#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
4955
...@@ -59,7 +65,7 @@...@@ -59,7 +65,7 @@
59#include_next <limits.h>65#include_next <limits.h>
60#endif /* __has_include_next */66#endif /* __has_include_next */
6167
62#else68#elif !USE_CLANG_LIMITS
6369
64#define CHAR_BIT 8 /* number of bits in a char */70#define CHAR_BIT 8 /* number of bits in a char */
6571
...@@ -102,7 +108,7 @@...@@ -102,7 +108,7 @@
102#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */108#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
103#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */109#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
104110
105#endif /* defined(__has_include) && __has_include(<__xnu_libcxx_sentinel.h>) */111#endif /* !USE_CLANG_LIMITS */
106112
107#if !defined(_ANSI_SOURCE)113#if !defined(_ANSI_SOURCE)
108#ifdef __LP64__114#ifdef __LP64__
...@@ -123,6 +129,8 @@...@@ -123,6 +129,8 @@
123#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */129#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
124#endif /* !_ANSI_SOURCE */130#endif /* !_ANSI_SOURCE */
125131
132#undef USE_CLANG_LIMITS
133
126#endif /* defined (__arm__) || defined (__arm64__) */134#endif /* defined (__arm__) || defined (__arm64__) */
127135
128#endif /* _ARM_LIMITS_H_ */136#endif /* _ARM_LIMITS_H_ */
lib/libc/include/any-macos-any/arm/types.h+1
...@@ -91,6 +91,7 @@ typedef int32_t user_time_t;...@@ -91,6 +91,7 @@ typedef int32_t user_time_t;
91typedef int64_t user_off_t;91typedef int64_t user_off_t;
92#endif92#endif
9393
94
94#define USER_ADDR_NULL ((user_addr_t) 0)95#define USER_ADDR_NULL ((user_addr_t) 0)
95#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))96#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
9697
lib/libc/include/any-macos-any/assert.h+3-36
...@@ -50,12 +50,13 @@...@@ -50,12 +50,13 @@
50 */50 */
5151
52#undef assert52#undef assert
53#undef __assert
5453
55#ifdef NDEBUG54#ifdef NDEBUG
56#define assert(e) ((void)0)55#define assert(e) ((void)0)
57#else56#else
5857
58#include <_assert.h>
59
59#ifdef __FILE_NAME__60#ifdef __FILE_NAME__
60#define __ASSERT_FILE_NAME __FILE_NAME__61#define __ASSERT_FILE_NAME __FILE_NAME__
61#else /* __FILE_NAME__ */62#else /* __FILE_NAME__ */
...@@ -64,36 +65,11 @@...@@ -64,36 +65,11 @@
6465
65#ifndef __GNUC__66#ifndef __GNUC__
6667
67__BEGIN_DECLS
68#ifndef __cplusplus
69void abort(void) __dead2 __cold;
70#endif /* !__cplusplus */
71int printf(const char * __restrict, ...);
72__END_DECLS
73
74#define assert(e) \68#define assert(e) \
75 ((void) ((e) ? ((void)0) : __assert (#e, __ASSERT_FILE_NAME, __LINE__)))69 ((void) ((e) ? ((void)0) : __assert (#e, __ASSERT_FILE_NAME, __LINE__)))
76#define __assert(e, file, line) \
77 ((void)printf ("%s:%d: failed assertion `%s'\n", file, line, e), abort())
7870
79#else /* __GNUC__ */71#else /* __GNUC__ */
8072
81__BEGIN_DECLS
82void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls;
83#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
84void __eprintf(const char *, const char *, unsigned, const char *) __dead2 __cold;
85#endif
86__END_DECLS
87
88#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
89#define __assert(e, file, line) \
90 __eprintf ("%s:%d: failed assertion `%s'\n", file, line, e)
91#else
92/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
93#define __assert(e, file, line) \
94 __assert_rtn ((const char *)-1L, file, line, e)
95#endif
96
97#if __DARWIN_UNIX0373#if __DARWIN_UNIX03
98#define assert(e) \74#define assert(e) \
99 (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)75 (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
...@@ -105,13 +81,4 @@ __END_DECLS...@@ -105,13 +81,4 @@ __END_DECLS
105#endif /* __GNUC__ */81#endif /* __GNUC__ */
106#endif /* NDEBUG */82#endif /* NDEBUG */
10783
108#ifndef _ASSERT_H_84#include <_static_assert.h>
109#define _ASSERT_H_
110
111#ifndef __cplusplus
112#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
113#define static_assert _Static_assert
114#endif /* __STDC_VERSION__ */
115#endif /* !__cplusplus */
116
117#endif /* _ASSERT_H_ */
lib/libc/include/any-macos-any/copyfile.h+5-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2004-2021 Apple, Inc. All rights reserved.2 * Copyright (c) 2004-2023 Apple, Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 * 5 *
...@@ -79,6 +79,10 @@ typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *__uns...@@ -79,6 +79,10 @@ typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *__uns
79#define COPYFILE_STATE_DST_BSIZE 1279#define COPYFILE_STATE_DST_BSIZE 12
80#define COPYFILE_STATE_BSIZE 1380#define COPYFILE_STATE_BSIZE 13
81#define COPYFILE_STATE_FORBID_CROSS_MOUNT 1481#define COPYFILE_STATE_FORBID_CROSS_MOUNT 14
82#define COPYFILE_STATE_NOCPROTECT 15
83#define COPYFILE_STATE_PRESERVE_SUID 16
84#define COPYFILE_STATE_RECURSIVE_SRC_FTSENT 17
85#define COPYFILE_STATE_FORBID_DST_EXISTING_SYMLINKS 18
8286
8387
84#define COPYFILE_DISABLE_VAR "COPYFILE_DISABLE"88#define COPYFILE_DISABLE_VAR "COPYFILE_DISABLE"
lib/libc/include/any-macos-any/ctype.h-5
...@@ -63,13 +63,8 @@...@@ -63,13 +63,8 @@
63 * @(#)ctype.h 8.4 (Berkeley) 1/21/9463 * @(#)ctype.h 8.4 (Berkeley) 1/21/94
64 */64 */
6565
66#ifndef _CTYPE_H_
67#define _CTYPE_H_
68
69#include <_ctype.h>66#include <_ctype.h>
7067
71#ifdef _USE_EXTENDED_LOCALES_68#ifdef _USE_EXTENDED_LOCALES_
72#include <xlocale/_ctype.h>69#include <xlocale/_ctype.h>
73#endif /* _USE_EXTENDED_LOCALES_ */70#endif /* _USE_EXTENDED_LOCALES_ */
74
75#endif /* !_CTYPE_H_ */
lib/libc/include/any-macos-any/dispatch/queue.h+63-2
...@@ -99,7 +99,6 @@ DISPATCH_DECL_FACTORY_CLASS_SWIFT(dispatch_queue, DispatchQueue);...@@ -99,7 +99,6 @@ DISPATCH_DECL_FACTORY_CLASS_SWIFT(dispatch_queue, DispatchQueue);
99 * Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc.,99 * Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc.,
100 * will have no effect when used with queues of this type.100 * will have no effect when used with queues of this type.
101 */101 */
102API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
103DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue);102DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue);
104103
105/*!104/*!
...@@ -169,7 +168,6 @@ DISPATCH_DECL_SERIAL_EXECUTOR_SWIFT(dispatch_queue_serial, DispatchSerialQueue);...@@ -169,7 +168,6 @@ DISPATCH_DECL_SERIAL_EXECUTOR_SWIFT(dispatch_queue_serial, DispatchSerialQueue);
169 * dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will168 * dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will
170 * have no effect when used on the main queue.169 * have no effect when used on the main queue.
171 */170 */
172API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
173DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial);171DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial);
174172
175/*!173/*!
...@@ -1738,6 +1736,69 @@ dispatch_assert_queue_not(dispatch_queue_t queue)...@@ -1738,6 +1736,69 @@ dispatch_assert_queue_not(dispatch_queue_t queue)
1738#define dispatch_assert_queue_not_debug(q) dispatch_assert_queue_not(q)1736#define dispatch_assert_queue_not_debug(q) dispatch_assert_queue_not(q)
1739#endif1737#endif
17401738
1739/* @function dispatch_allow_send_signals
1740 *
1741 * @discussion
1742 * This function provides the calling process an ability to send signals to
1743 * it's pthread worker threads created to service incoming work to dispatch,
1744 * including those which were already created prior to this function call
1745 * and those who may be created in the future. After a call to this function
1746 * returns successfully, this ability is retained for the lifetime of the
1747 * calling process.
1748 * Regular UNIX calls still need to be used to manipulate signal mask of
1749 * each individual pthread worker thread to allow delivery of a specific
1750 * signal to that thread.
1751 *
1752 * @param preserve_signum
1753 * Dispatch and its kernel runtime subsystem manages a pool of pthread
1754 * worker threads which are reused for handling incoming work to dispatch.
1755 * The signal number specified here is used internally by this subsystem to
1756 * preserve sigmask of the pthread worker threads across their reuse.
1757 *
1758 * In other words, if a pthread worker thread unblocks delivery of
1759 * @preserve_signum using regular UNIX calls after a call to this
1760 * function using the same @preserve_signum returns successfully,
1761 * that @preserve_signum remains unblocked across that thread's
1762 * reuse until it is further modified by regular UNIX calls.
1763 * Therefore, it avoids the need to call regular UNIX calls to
1764 * unblock delivery of @preserve_signum every time that thread
1765 * is reused. The specific signal @preserve_signum can be sent
1766 * to that specific pthread worker thread using pthread_kill().
1767 *
1768 * The following code illustrates an expected usage of this API.
1769 *
1770 * <code>
1771 *
1772 * // Enable sending signals to dispatch pthread worker threads.
1773 * int ret = dispatch_allow_send_signals(sig);
1774 * // Validate ret.
1775 *
1776 * dispatch_async(q, ^{
1777 * // Unblock sig for this worker thread if not already done.
1778 * // Such a state could be saved in TSD or globally.
1779 * mask = sigmask(sig);
1780 * pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
1781 * // busy with some work. Can receive signal sig.
1782 * // If this worker thread is re-used later, it does not
1783 * // not need to call pthread_sigmask again to unblock delivery
1784 * // of signal sig.
1785 * }
1786 *
1787 * This function returns 0 upon success and -1 with an errno otherwise.
1788 * Possible error codes are as below :
1789 *
1790 * EINVAL : @preserve_signum is prohibited and is not allowed to be preserved
1791 * across the thread's reuse.
1792 * ENOTSUP : The underlying kernel does not support this functionality.
1793 *
1794 * </code>
1795 */
1796API_AVAILABLE(macos(14.4), ios(17.4), visionos(1.1))
1797API_UNAVAILABLE(tvos, watchos, driverkit)
1798DISPATCH_EXPORT
1799int
1800dispatch_allow_send_signals(int preserve_signum);
1801
1741__END_DECLS1802__END_DECLS
17421803
1743DISPATCH_ASSUME_ABI_SINGLE_END1804DISPATCH_ASSUME_ABI_SINGLE_END
lib/libc/include/any-macos-any/dispatch/workloop.h+4
...@@ -145,6 +145,10 @@ dispatch_workloop_set_autorelease_frequency(dispatch_workloop_t workloop,...@@ -145,6 +145,10 @@ dispatch_workloop_set_autorelease_frequency(dispatch_workloop_t workloop,
145 * The worker thread will be a member of the specified os_workgroup_t while executing145 * The worker thread will be a member of the specified os_workgroup_t while executing
146 * work items submitted to the workloop.146 * work items submitted to the workloop.
147 *147 *
148 * Using both dispatch_workloop_set_scheduler_priority() and
149 * dispatch_workloop_set_os_workgroup() will prefer scheduling policies
150 * from the workgroup, if they exist.
151 *
148 * @param workloop152 * @param workloop
149 * The dispatch workloop to modify.153 * The dispatch workloop to modify.
150 *154 *
lib/libc/include/any-macos-any/float.h+11
...@@ -22,6 +22,15 @@...@@ -22,6 +22,15 @@
22#ifndef __FLOAT_H22#ifndef __FLOAT_H
23#define __FLOAT_H23#define __FLOAT_H
2424
25#if !defined(__has_feature) || !__has_feature(modules)
26/* clang's float.h comes before this header in the search order. It
27 * will include this header first, undef all of these macros, and then
28 * redeclare them. That doesn't work when the two headers are in
29 * different clang modules. The only way to avoid redeclaration errors
30 * is to not declare the macros here, and let clang's float.h handle
31 * them.
32 */
33
25/* Undefine anything that we'll be redefining below. */34/* Undefine anything that we'll be redefining below. */
26#undef FLT_EVAL_METHOD35#undef FLT_EVAL_METHOD
27#undef FLT_ROUNDS36#undef FLT_ROUNDS
...@@ -137,4 +146,6 @@...@@ -137,4 +146,6 @@
137# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__146# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
138#endif147#endif
139148
149#endif /* !__has_feature(modules) */
150
140#endif /* __FLOAT_H */151#endif /* __FLOAT_H */
lib/libc/include/any-macos-any/hfs/hfs_format.h+10-5
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2015 Apple Inc. All rights reserved.2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 * 5 *
...@@ -37,7 +37,7 @@...@@ -37,7 +37,7 @@
37 *37 *
38 * This file describes the on-disk format for HFS and HFS Plus volumes.38 * This file describes the on-disk format for HFS and HFS Plus volumes.
39 *39 *
40 * Note: Starting 10.9, definition of struct HFSUniStr255 exists in hfs_unitstr.h40 * Note: Starting with MacOS 10.9, definition of struct HFSUniStr255 exists in hfs_unistr.h
41 *41 *
42 */42 */
4343
...@@ -373,10 +373,12 @@ enum {...@@ -373,10 +373,12 @@ enum {
373 kHFSFastDevCandidateMask = 0x0400,373 kHFSFastDevCandidateMask = 0x0400,
374374
375 kHFSAutoCandidateBit = 0x000b, /* this item was automatically marked as a fast-dev candidate by the kernel */375 kHFSAutoCandidateBit = 0x000b, /* this item was automatically marked as a fast-dev candidate by the kernel */
376 kHFSAutoCandidateMask = 0x0800376 kHFSAutoCandidateMask = 0x0800,
377377
378 // There are only 4 flag bits remaining: 0x1000, 0x2000, 0x4000, 0x8000378 kHFSCatExpandedTimesBit = 0x000c, /* this item has expanded timestamps */
379 kHFSCatExpandedTimesMask = 0x1000
379380
381 // There are only 3 flag bits remaining: 0x2000, 0x4000, 0x8000
380};382};
381383
382384
...@@ -600,6 +602,7 @@ enum {...@@ -600,6 +602,7 @@ enum {
600 */602 */
601 kHFSUnusedNodeFixBit = 31, /* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */603 kHFSUnusedNodeFixBit = 31, /* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */
602 kHFSContentProtectionBit = 30, /* Volume has per-file content protection */604 kHFSContentProtectionBit = 30, /* Volume has per-file content protection */
605 kHFSExpandedTimesBit = 29, /* Volume has expanded / non-MacOS native timestamps */
603606
604 /*** Keep these in sync with the bits above ! ****/607 /*** Keep these in sync with the bits above ! ****/
605 kHFSVolumeHardwareLockMask = 0x00000080,608 kHFSVolumeHardwareLockMask = 0x00000080,
...@@ -614,6 +617,7 @@ enum {...@@ -614,6 +617,7 @@ enum {
614 617
615 /* Bits 16-31 are allocated from high to low */618 /* Bits 16-31 are allocated from high to low */
616619
620 kHFSExpandedTimesMask = 0x20000000,
617 kHFSContentProtectionMask = 0x40000000,621 kHFSContentProtectionMask = 0x40000000,
618 kHFSUnusedNodeFixMask = 0x80000000,622 kHFSUnusedNodeFixMask = 0x80000000,
619 623
...@@ -621,7 +625,8 @@ enum {...@@ -621,7 +625,8 @@ enum {
621};625};
622626
623enum {627enum {
624 kHFSUnusedNodesFixDate = 0xc5ef2480 /* March 25, 2009 */628 kHFSUnusedNodesFixDate = 0xc5ef2480, /* March 25, 2009 (aka 3320784000) */
629 kHFSUnusedNodesFixExpandedDate = 0x49c97400 /* March 25, 2009 (akai 1237939200) - BSD epoch-relative */
625};630};
626631
627/* HFS Master Directory Block - 162 bytes */632/* HFS Master Directory Block - 162 bytes */
lib/libc/include/any-macos-any/i386/_endian.h created+105
...@@ -0,0 +1,105 @@
1/*
2 * Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*
30 * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
31 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
32 *
33 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
34 *
35 * This file contains Original Code and/or Modifications of Original Code
36 * as defined in and that are subject to the Apple Public Source License
37 * Version 2.0 (the 'License'). You may not use this file except in
38 * compliance with the License. The rights granted to you under the License
39 * may not be used to create, or enable the creation or redistribution of,
40 * unlawful or unlicensed copies of an Apple operating system, or to
41 * circumvent, violate, or enable the circumvention or violation of, any
42 * terms of an Apple operating system software license agreement.
43 *
44 * Please obtain a copy of the License at
45 * http://www.opensource.apple.com/apsl/ and read it before using this file.
46 *
47 * The Original Code and all software distributed under the License are
48 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
49 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
50 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
51 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
52 * Please see the License for the specific language governing rights and
53 * limitations under the License.
54 *
55 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
56 */
57/*
58 * Copyright (c) 1987, 1991, 1993
59 * The Regents of the University of California. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 * 1. Redistributions of source code must retain the above copyright
65 * notice, this list of conditions and the following disclaimer.
66 * 2. Redistributions in binary form must reproduce the above copyright
67 * notice, this list of conditions and the following disclaimer in the
68 * documentation and/or other materials provided with the distribution.
69 * 3. All advertising materials mentioning features or use of this software
70 * must display the following acknowledgement:
71 * This product includes software developed by the University of
72 * California, Berkeley and its contributors.
73 * 4. Neither the name of the University nor the names of its contributors
74 * may be used to endorse or promote products derived from this software
75 * without specific prior written permission.
76 *
77 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
78 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
79 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
81 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
83 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
85 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87 * SUCH DAMAGE.
88 */
89
90#ifndef _I386___ENDIAN_H_
91#define _I386___ENDIAN_H_
92
93#if defined (__i386__) || defined (__x86_64__)
94
95#include <sys/__endian.h>
96
97#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
98
99#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
100
101#define BYTE_ORDER __DARWIN_BYTE_ORDER
102
103#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
104#endif /* defined (__i386__) || defined (__x86_64__) */
105#endif /* !_I386___ENDIAN_H_ */
lib/libc/include/any-macos-any/i386/_types.h+27-4
...@@ -30,6 +30,19 @@...@@ -30,6 +30,19 @@
3030
31#if defined (__i386__) || defined (__x86_64__)31#if defined (__i386__) || defined (__x86_64__)
3232
33#if defined(__has_feature) && __has_feature(modules)
34#define USE_CLANG_TYPES 1
35#else
36#define USE_CLANG_TYPES 0
37#endif
38
39#if USE_CLANG_TYPES
40#include <sys/_types/_ptrdiff_t.h>
41#include <sys/_types/_size_t.h>
42#include <sys/_types/_va_list.h>
43#include <sys/_types/_wchar_t.h>
44#endif
45
33/*46/*
34 * This header file contains integer types. It's intended to also contain47 * This header file contains integer types. It's intended to also contain
35 * flotaing point and other arithmetic types, as needed, later.48 * flotaing point and other arithmetic types, as needed, later.
...@@ -82,7 +95,9 @@ typedef union {...@@ -82,7 +95,9 @@ typedef union {
8295
83typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */96typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
8497
85#if defined(__PTRDIFF_TYPE__)98#if USE_CLANG_TYPES
99typedef ptrdiff_t __darwin_ptrdiff_t; /* ptr1 - ptr2 */
100#elif defined(__PTRDIFF_TYPE__)
86typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */101typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
87#elif defined(__LP64__)102#elif defined(__LP64__)
88typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */103typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
...@@ -90,19 +105,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */...@@ -90,19 +105,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
90typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */105typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
91#endif /* __GNUC__ */106#endif /* __GNUC__ */
92107
93#if defined(__SIZE_TYPE__)108#if USE_CLANG_TYPES
109typedef size_t __darwin_size_t; /* sizeof() */
110#elif defined(__SIZE_TYPE__)
94typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */111typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
95#else112#else
96typedef unsigned long __darwin_size_t; /* sizeof() */113typedef unsigned long __darwin_size_t; /* sizeof() */
97#endif114#endif
98115
99#if (__GNUC__ > 2)116#if USE_CLANG_TYPES
117typedef va_list __darwin_va_list; /* va_list */
118#elif (__GNUC__ > 2)
100typedef __builtin_va_list __darwin_va_list; /* va_list */119typedef __builtin_va_list __darwin_va_list; /* va_list */
101#else120#else
102typedef void * __darwin_va_list; /* va_list */121typedef void * __darwin_va_list; /* va_list */
103#endif122#endif
104123
105#if defined(__WCHAR_TYPE__)124#if USE_CLANG_TYPES
125typedef wchar_t __darwin_wchar_t; /* wchar_t */
126#elif defined(__WCHAR_TYPE__)
106typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */127typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
107#else128#else
108typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */129typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
...@@ -121,6 +142,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */...@@ -121,6 +142,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
121typedef long __darwin_ssize_t; /* byte count or error */142typedef long __darwin_ssize_t; /* byte count or error */
122typedef long __darwin_time_t; /* time() */143typedef long __darwin_time_t; /* time() */
123144
145#undef USE_CLANG_TYPES
146
124#endif /* defined (__i386__) || defined (__x86_64__) */147#endif /* defined (__i386__) || defined (__x86_64__) */
125148
126#endif /* _BSD_I386__TYPES_H_ */149#endif /* _BSD_I386__TYPES_H_ */
lib/libc/include/any-macos-any/i386/endian.h+1-17
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 2000-2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -80,24 +80,8 @@...@@ -80,24 +80,8 @@
80#define _QUAD_HIGHWORD 180#define _QUAD_HIGHWORD 1
81#define _QUAD_LOWWORD 081#define _QUAD_LOWWORD 0
8282
83/*
84 * Definitions for byte order, according to byte significance from low
85 * address to high.
86 */
87#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
88#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
89#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
90
91#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
92
93#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))83#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
9484
95#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
96#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
97#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
98
99#define BYTE_ORDER __DARWIN_BYTE_ORDER
100
101#include <sys/_endian.h>85#include <sys/_endian.h>
10286
103#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */87#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
lib/libc/include/any-macos-any/i386/limits.h+10-2
...@@ -41,6 +41,12 @@...@@ -41,6 +41,12 @@
41#include <sys/cdefs.h>41#include <sys/cdefs.h>
42#include <i386/_limits.h>42#include <i386/_limits.h>
4343
44#if defined(__has_feature) && __has_feature(modules)
45#define USE_CLANG_LIMITS 1
46#else
47#define USE_CLANG_LIMITS 0
48#endif
49
44#undef MB_LEN_MAX50#undef MB_LEN_MAX
45#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */51#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
4652
...@@ -56,7 +62,7 @@...@@ -56,7 +62,7 @@
56#include_next <limits.h>62#include_next <limits.h>
57#endif /* __has_include_next */63#endif /* __has_include_next */
5864
59#else65#elif !USE_CLANG_LIMITS
6066
61#define CHAR_BIT 8 /* number of bits in a char */67#define CHAR_BIT 8 /* number of bits in a char */
6268
...@@ -99,7 +105,7 @@...@@ -99,7 +105,7 @@
99#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */105#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
100#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */106#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
101107
102#endif /* defined(__has_include) && __has_include(<__xnu_libcxx_sentinel.h>) */108#endif /* !USE_CLANG_LIMITS */
103109
104#if !defined(_ANSI_SOURCE)110#if !defined(_ANSI_SOURCE)
105#ifdef __LP64__111#ifdef __LP64__
...@@ -120,6 +126,8 @@...@@ -120,6 +126,8 @@
120#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */126#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
121#endif /* !_ANSI_SOURCE */127#endif /* !_ANSI_SOURCE */
122128
129#undef USE_CLANG_LIMITS
130
123#endif /* defined (__i386__) || defined (__x86_64__) */131#endif /* defined (__i386__) || defined (__x86_64__) */
124132
125#endif /* _I386_LIMITS_H_ */133#endif /* _I386_LIMITS_H_ */
lib/libc/include/any-macos-any/i386/types.h+2
...@@ -104,6 +104,8 @@ typedef int64_t user_long_t;...@@ -104,6 +104,8 @@ typedef int64_t user_long_t;
104typedef u_int64_t user_ulong_t;104typedef u_int64_t user_ulong_t;
105typedef int64_t user_time_t;105typedef int64_t user_time_t;
106typedef int64_t user_off_t;106typedef int64_t user_off_t;
107
108
107#define USER_ADDR_NULL ((user_addr_t) 0)109#define USER_ADDR_NULL ((user_addr_t) 0)
108#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))110#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
109111
lib/libc/include/any-macos-any/inttypes.h+2-264
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2004, 2013 Apple Inc. All rights reserved.2 * Copyright (c) 2000-2004, 2013, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 * 5 *
...@@ -28,270 +28,8 @@...@@ -28,270 +28,8 @@
28 * and their ilk.28 * and their ilk.
29 */29 */
3030
31#if !defined(_INTTYPES_H_)31#include <_inttypes.h>
32#define _INTTYPES_H_
33
34# define __PRI_8_LENGTH_MODIFIER__ "hh"
35# define __PRI_64_LENGTH_MODIFIER__ "ll"
36# define __SCN_64_LENGTH_MODIFIER__ "ll"
37# define __PRI_MAX_LENGTH_MODIFIER__ "j"
38# define __SCN_MAX_LENGTH_MODIFIER__ "j"
39
40# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
41# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
42# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
43# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
44# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
45# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
46
47# define PRId16 "hd"
48# define PRIi16 "hi"
49# define PRIo16 "ho"
50# define PRIu16 "hu"
51# define PRIx16 "hx"
52# define PRIX16 "hX"
53
54# define PRId32 "d"
55# define PRIi32 "i"
56# define PRIo32 "o"
57# define PRIu32 "u"
58# define PRIx32 "x"
59# define PRIX32 "X"
60
61# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
62# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
63# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
64# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
65# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
66# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
67
68# define PRIdLEAST8 PRId8
69# define PRIiLEAST8 PRIi8
70# define PRIoLEAST8 PRIo8
71# define PRIuLEAST8 PRIu8
72# define PRIxLEAST8 PRIx8
73# define PRIXLEAST8 PRIX8
74
75# define PRIdLEAST16 PRId16
76# define PRIiLEAST16 PRIi16
77# define PRIoLEAST16 PRIo16
78# define PRIuLEAST16 PRIu16
79# define PRIxLEAST16 PRIx16
80# define PRIXLEAST16 PRIX16
81
82# define PRIdLEAST32 PRId32
83# define PRIiLEAST32 PRIi32
84# define PRIoLEAST32 PRIo32
85# define PRIuLEAST32 PRIu32
86# define PRIxLEAST32 PRIx32
87# define PRIXLEAST32 PRIX32
88
89# define PRIdLEAST64 PRId64
90# define PRIiLEAST64 PRIi64
91# define PRIoLEAST64 PRIo64
92# define PRIuLEAST64 PRIu64
93# define PRIxLEAST64 PRIx64
94# define PRIXLEAST64 PRIX64
95
96# define PRIdFAST8 PRId8
97# define PRIiFAST8 PRIi8
98# define PRIoFAST8 PRIo8
99# define PRIuFAST8 PRIu8
100# define PRIxFAST8 PRIx8
101# define PRIXFAST8 PRIX8
102
103# define PRIdFAST16 PRId16
104# define PRIiFAST16 PRIi16
105# define PRIoFAST16 PRIo16
106# define PRIuFAST16 PRIu16
107# define PRIxFAST16 PRIx16
108# define PRIXFAST16 PRIX16
109
110# define PRIdFAST32 PRId32
111# define PRIiFAST32 PRIi32
112# define PRIoFAST32 PRIo32
113# define PRIuFAST32 PRIu32
114# define PRIxFAST32 PRIx32
115# define PRIXFAST32 PRIX32
116
117# define PRIdFAST64 PRId64
118# define PRIiFAST64 PRIi64
119# define PRIoFAST64 PRIo64
120# define PRIuFAST64 PRIu64
121# define PRIxFAST64 PRIx64
122# define PRIXFAST64 PRIX64
123
124/* int32_t is 'int', but intptr_t is 'long'. */
125# define PRIdPTR "ld"
126# define PRIiPTR "li"
127# define PRIoPTR "lo"
128# define PRIuPTR "lu"
129# define PRIxPTR "lx"
130# define PRIXPTR "lX"
131
132# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d"
133# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i"
134# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o"
135# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u"
136# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x"
137# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X"
138
139# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d"
140# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i"
141# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o"
142# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u"
143# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x"
144
145# define SCNd16 "hd"
146# define SCNi16 "hi"
147# define SCNo16 "ho"
148# define SCNu16 "hu"
149# define SCNx16 "hx"
150
151# define SCNd32 "d"
152# define SCNi32 "i"
153# define SCNo32 "o"
154# define SCNu32 "u"
155# define SCNx32 "x"
156
157# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d"
158# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i"
159# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o"
160# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u"
161# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x"
162
163# define SCNdLEAST8 SCNd8
164# define SCNiLEAST8 SCNi8
165# define SCNoLEAST8 SCNo8
166# define SCNuLEAST8 SCNu8
167# define SCNxLEAST8 SCNx8
168
169# define SCNdLEAST16 SCNd16
170# define SCNiLEAST16 SCNi16
171# define SCNoLEAST16 SCNo16
172# define SCNuLEAST16 SCNu16
173# define SCNxLEAST16 SCNx16
174
175# define SCNdLEAST32 SCNd32
176# define SCNiLEAST32 SCNi32
177# define SCNoLEAST32 SCNo32
178# define SCNuLEAST32 SCNu32
179# define SCNxLEAST32 SCNx32
180
181# define SCNdLEAST64 SCNd64
182# define SCNiLEAST64 SCNi64
183# define SCNoLEAST64 SCNo64
184# define SCNuLEAST64 SCNu64
185# define SCNxLEAST64 SCNx64
186
187# define SCNdFAST8 SCNd8
188# define SCNiFAST8 SCNi8
189# define SCNoFAST8 SCNo8
190# define SCNuFAST8 SCNu8
191# define SCNxFAST8 SCNx8
192
193# define SCNdFAST16 SCNd16
194# define SCNiFAST16 SCNi16
195# define SCNoFAST16 SCNo16
196# define SCNuFAST16 SCNu16
197# define SCNxFAST16 SCNx16
198
199# define SCNdFAST32 SCNd32
200# define SCNiFAST32 SCNi32
201# define SCNoFAST32 SCNo32
202# define SCNuFAST32 SCNu32
203# define SCNxFAST32 SCNx32
204
205# define SCNdFAST64 SCNd64
206# define SCNiFAST64 SCNi64
207# define SCNoFAST64 SCNo64
208# define SCNuFAST64 SCNu64
209# define SCNxFAST64 SCNx64
210
211# define SCNdPTR "ld"
212# define SCNiPTR "li"
213# define SCNoPTR "lo"
214# define SCNuPTR "lu"
215# define SCNxPTR "lx"
216
217# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d"
218# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i"
219# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o"
220# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u"
221# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x"
222
223#include <sys/cdefs.h>
224#include <Availability.h>
225
226#include <_types.h>
227#include <sys/_types/_wchar_t.h>
228
229#include <stdint.h>
230
231__BEGIN_DECLS
232
233/* 7.8.2.1 */
234__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
235extern intmax_t
236imaxabs(intmax_t j);
237
238/* 7.8.2.2 */
239typedef struct {
240 intmax_t quot;
241 intmax_t rem;
242} imaxdiv_t;
243
244__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
245extern imaxdiv_t
246imaxdiv(intmax_t __numer, intmax_t __denom);
247
248/* 7.8.2.3 */
249__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
250extern intmax_t
251strtoimax(const char * __restrict __nptr,
252 char ** __restrict __endptr,
253 int __base);
254
255__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
256extern uintmax_t
257strtoumax(const char * __restrict __nptr,
258 char ** __restrict __endptr,
259 int __base);
260
261/* 7.8.2.4 */
262__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
263extern intmax_t
264wcstoimax(const wchar_t * __restrict __nptr,
265 wchar_t ** __restrict __endptr,
266 int __base);
267
268__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
269extern uintmax_t
270wcstoumax(const wchar_t * __restrict __nptr,
271 wchar_t ** __restrict __endptr,
272 int __base);
273
274/* Poison the following routines if -fshort-wchar is set */
275#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
276#pragma GCC poison wcstoimax wcstoumax
277#endif
278
279__END_DECLS
28032
281#ifdef _USE_EXTENDED_LOCALES_33#ifdef _USE_EXTENDED_LOCALES_
282#include <xlocale/_inttypes.h>34#include <xlocale/_inttypes.h>
283#endif /* _USE_EXTENDED_LOCALES_ */35#endif /* _USE_EXTENDED_LOCALES_ */
284
285/*
286 No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros;
287 in fact, you can't #undef them, because later uses of any of
288 their dependents will *not* then do the intended substitution.
289 Expansion of a #define like this one:
290
291 #define x IDENT y
292
293 uses the cpp value of IDENT at the location where x is *expanded*,
294 not where it is #defined.
295*/
296
297#endif /* !_INTTYPES_H_ */
lib/libc/include/any-macos-any/langinfo.h+1-88
...@@ -26,95 +26,8 @@...@@ -26,95 +26,8 @@
26 * $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $26 * $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $
27 */27 */
2828
29#ifndef _LANGINFO_H_29#include <_langinfo.h>
30#define _LANGINFO_H_
31
32#include <_types.h>
33#include <_types/_nl_item.h>
34
35#define CODESET 0 /* codeset name */
36#define D_T_FMT 1 /* string for formatting date and time */
37#define D_FMT 2 /* date format string */
38#define T_FMT 3 /* time format string */
39#define T_FMT_AMPM 4 /* a.m. or p.m. time formatting string */
40#define AM_STR 5 /* Ante Meridian affix */
41#define PM_STR 6 /* Post Meridian affix */
42
43/* week day names */
44#define DAY_1 7
45#define DAY_2 8
46#define DAY_3 9
47#define DAY_4 10
48#define DAY_5 11
49#define DAY_6 12
50#define DAY_7 13
51
52/* abbreviated week day names */
53#define ABDAY_1 14
54#define ABDAY_2 15
55#define ABDAY_3 16
56#define ABDAY_4 17
57#define ABDAY_5 18
58#define ABDAY_6 19
59#define ABDAY_7 20
60
61/* month names */
62#define MON_1 21
63#define MON_2 22
64#define MON_3 23
65#define MON_4 24
66#define MON_5 25
67#define MON_6 26
68#define MON_7 27
69#define MON_8 28
70#define MON_9 29
71#define MON_10 30
72#define MON_11 31
73#define MON_12 32
74
75/* abbreviated month names */
76#define ABMON_1 33
77#define ABMON_2 34
78#define ABMON_3 35
79#define ABMON_4 36
80#define ABMON_5 37
81#define ABMON_6 38
82#define ABMON_7 39
83#define ABMON_8 40
84#define ABMON_9 41
85#define ABMON_10 42
86#define ABMON_11 43
87#define ABMON_12 44
88
89#define ERA 45 /* era description segments */
90#define ERA_D_FMT 46 /* era date format string */
91#define ERA_D_T_FMT 47 /* era date and time format string */
92#define ERA_T_FMT 48 /* era time format string */
93#define ALT_DIGITS 49 /* alternative symbols for digits */
94
95#define RADIXCHAR 50 /* radix char */
96#define THOUSEP 51 /* separator for thousands */
97
98#define YESEXPR 52 /* affirmative response expression */
99#define NOEXPR 53 /* negative response expression */
100
101#if (__DARWIN_C_LEVEL > __DARWIN_C_ANSI && __DARWIN_C_LEVEL < 200112L) || __DARWIN_C_LEVEL == __DARWIN_C_FULL
102#define YESSTR 54 /* affirmative response for yes/no queries */
103#define NOSTR 55 /* negative response for yes/no queries */
104#endif
105
106#define CRNCYSTR 56 /* currency symbol */
107
108#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
109#define D_MD_ORDER 57 /* month/day order (local extension) */
110#endif
111
112__BEGIN_DECLS
113char *nl_langinfo(nl_item);
114__END_DECLS
11530
116#ifdef _USE_EXTENDED_LOCALES_31#ifdef _USE_EXTENDED_LOCALES_
117#include <xlocale/_langinfo.h>32#include <xlocale/_langinfo.h>
118#endif /* _USE_EXTENDED_LOCALES_ */33#endif /* _USE_EXTENDED_LOCALES_ */
119
120#endif /* !_LANGINFO_H_ */
lib/libc/include/any-macos-any/libkern/OSAtomic.h+4
...@@ -40,6 +40,10 @@...@@ -40,6 +40,10 @@
4040
41#include <sys/cdefs.h>41#include <sys/cdefs.h>
4242
43#if __has_include(<libkern/OSAtomicPrivate.h>)
44#include <libkern/OSAtomicPrivate.h>
45#endif
46
43#include "OSAtomicDeprecated.h"47#include "OSAtomicDeprecated.h"
44#include "OSSpinLockDeprecated.h"48#include "OSSpinLockDeprecated.h"
45#include "OSAtomicQueue.h"49#include "OSAtomicQueue.h"
lib/libc/include/any-macos-any/libkern/OSAtomicDeprecated.h+1
...@@ -36,6 +36,7 @@...@@ -36,6 +36,7 @@
36 */36 */
3737
38#include <Availability.h>38#include <Availability.h>
39#include <TargetConditionals.h>
3940
40#if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED)41#if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED)
4142
lib/libc/include/any-macos-any/libkern/OSThermalNotification.h+1
...@@ -26,6 +26,7 @@...@@ -26,6 +26,7 @@
2626
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
28#include <Availability.h>28#include <Availability.h>
29#include <TargetConditionals.h>
2930
30/*31/*
31** OSThermalNotification.h32** OSThermalNotification.h
lib/libc/include/any-macos-any/libkern/_OSByteOrder.h+18-26
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 2006-2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -29,14 +29,6 @@...@@ -29,14 +29,6 @@
29#ifndef _OS__OSBYTEORDER_H29#ifndef _OS__OSBYTEORDER_H
30#define _OS__OSBYTEORDER_H30#define _OS__OSBYTEORDER_H
3131
32/*
33 * This header is normally included from <libkern/OSByteOrder.h>. However,
34 * <sys/_endian.h> also includes this in the case of little-endian
35 * architectures, so that we can map OSByteOrder routines to the hton* and ntoh*
36 * macros. This results in the asymmetry below; we only include
37 * <libkern/arch/_OSByteOrder.h> for little-endian architectures.
38 */
39
40#include <sys/_types.h>32#include <sys/_types.h>
4133
42/* Macros for swapping constant values in the preprocessing stage. */34/* Macros for swapping constant values in the preprocessing stage. */
...@@ -62,22 +54,12 @@...@@ -62,22 +54,12 @@
6254
63#if defined(__GNUC__)55#if defined(__GNUC__)
6456
65#if !defined(__DARWIN_OS_INLINE)
66# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
67# define __DARWIN_OS_INLINE static inline
68# elif defined(__MWERKS__) || defined(__cplusplus)
69# define __DARWIN_OS_INLINE static inline
70# else
71# define __DARWIN_OS_INLINE static __inline__
72# endif
73#endif
74
75#if defined(__i386__) || defined(__x86_64__)57#if defined(__i386__) || defined(__x86_64__)
76#include <libkern/i386/_OSByteOrder.h>58#include <libkern/i386/_OSByteOrder.h>
77#endif59#endif
7860
79#if defined (__arm__) || defined(__arm64__)61#if defined (__arm__) || defined(__arm64__)
80#include <libkern/arm/OSByteOrder.h>62#include <libkern/arm/_OSByteOrder.h>
81#endif63#endif
8264
8365
...@@ -94,28 +76,38 @@...@@ -94,28 +76,38 @@
9476
95#if defined(__i386__) || defined(__x86_64__)77#if defined(__i386__) || defined(__x86_64__)
9678
79#if !defined(__DARWIN_OS_INLINE)
80# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
81# define __DARWIN_OS_INLINE static inline
82# elif defined(__MWERKS__) || defined(__cplusplus)
83# define __DARWIN_OS_INLINE static inline
84# else
85# define __DARWIN_OS_INLINE static __inline__
86# endif
87#endif
88
97__DARWIN_OS_INLINE89__DARWIN_OS_INLINE
98uint16_t90__uint16_t
99_OSSwapInt16(91_OSSwapInt16(
100 uint16_t data92 __uint16_t data
101 )93 )
102{94{
103 return __DARWIN_OSSwapConstInt16(data);95 return __DARWIN_OSSwapConstInt16(data);
104}96}
10597
106__DARWIN_OS_INLINE98__DARWIN_OS_INLINE
107uint32_t99__uint32_t
108_OSSwapInt32(100_OSSwapInt32(
109 uint32_t data101 __uint32_t data
110 )102 )
111{103{
112 return __DARWIN_OSSwapConstInt32(data);104 return __DARWIN_OSSwapConstInt32(data);
113}105}
114106
115__DARWIN_OS_INLINE107__DARWIN_OS_INLINE
116uint64_t108__uint64_t
117_OSSwapInt64(109_OSSwapInt64(
118 uint64_t data110 __uint64_t data
119 )111 )
120{112{
121 return __DARWIN_OSSwapConstInt64(data);113 return __DARWIN_OSSwapConstInt64(data);
lib/libc/include/any-macos-any/libkern/arm/OSByteOrder.h+43-64
...@@ -1,64 +1,41 @@...@@ -1,64 +1,41 @@
1/*1/*
2 * Copyright (c) 1999-2007 Apple Inc. All rights reserved.2 * Copyright (c) 1999-2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
3 */27 */
428
5#ifndef _OS_OSBYTEORDERARM_H29#ifndef _OS_OSBYTEORDERARM_H
6#define _OS_OSBYTEORDERARM_H30#define _OS_OSBYTEORDERARM_H
731
32#if defined (__arm__) || defined(__arm64__)
33
8#include <stdint.h>34#include <stdint.h>
35#include <libkern/arm/_OSByteOrder.h>
36#include <sys/_types/_os_inline.h>
9#include <arm/arch.h> /* for _ARM_ARCH_6 */37#include <arm/arch.h> /* for _ARM_ARCH_6 */
1038
11/* Generic byte swapping functions. */
12
13__DARWIN_OS_INLINE
14uint16_t
15_OSSwapInt16(
16 uint16_t _data
17 )
18{
19 /* Reduces to 'rev16' with clang */
20 return (uint16_t)(_data << 8 | _data >> 8);
21}
22
23__DARWIN_OS_INLINE
24uint32_t
25_OSSwapInt32(
26 uint32_t _data
27 )
28{
29#if defined(__llvm__)
30 _data = __builtin_bswap32(_data);
31#else
32 /* This actually generates the best code */
33 _data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
34#endif
35
36 return _data;
37}
38
39__DARWIN_OS_INLINE
40uint64_t
41_OSSwapInt64(
42 uint64_t _data
43 )
44{
45#if defined(__llvm__)
46 return __builtin_bswap64(_data);
47#else
48 union {
49 uint64_t _ull;
50 uint32_t _ul[2];
51 } _u;
52
53 /* This actually generates the best code */
54 _u._ul[0] = (uint32_t)(_data >> 32);
55 _u._ul[1] = (uint32_t)(_data & 0xffffffff);
56 _u._ul[0] = _OSSwapInt32(_u._ul[0]);
57 _u._ul[1] = _OSSwapInt32(_u._ul[1]);
58 return _u._ull;
59#endif
60}
61
62/* Functions for byte reversed loads. */39/* Functions for byte reversed loads. */
6340
64struct _OSUnalignedU16 {41struct _OSUnalignedU16 {
...@@ -74,7 +51,7 @@ struct _OSUnalignedU64 {...@@ -74,7 +51,7 @@ struct _OSUnalignedU64 {
74} __attribute__((__packed__));51} __attribute__((__packed__));
7552
76#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)53#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
77__DARWIN_OS_INLINE54OS_INLINE
78uint16_t55uint16_t
79_OSReadSwapInt16(56_OSReadSwapInt16(
80 const volatile void * _base,57 const volatile void * _base,
...@@ -84,7 +61,7 @@ _OSReadSwapInt16(...@@ -84,7 +61,7 @@ _OSReadSwapInt16(
84 return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);61 return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
85}62}
86#else63#else
87__DARWIN_OS_INLINE64OS_INLINE
88uint16_t65uint16_t
89OSReadSwapInt16(66OSReadSwapInt16(
90 const volatile void * _base,67 const volatile void * _base,
...@@ -96,7 +73,7 @@ OSReadSwapInt16(...@@ -96,7 +73,7 @@ OSReadSwapInt16(
96#endif73#endif
9774
98#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)75#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
99__DARWIN_OS_INLINE76OS_INLINE
100uint32_t77uint32_t
101_OSReadSwapInt32(78_OSReadSwapInt32(
102 const volatile void * _base,79 const volatile void * _base,
...@@ -106,7 +83,7 @@ _OSReadSwapInt32(...@@ -106,7 +83,7 @@ _OSReadSwapInt32(
106 return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);83 return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
107}84}
108#else85#else
109__DARWIN_OS_INLINE86OS_INLINE
110uint32_t87uint32_t
111OSReadSwapInt32(88OSReadSwapInt32(
112 const volatile void * _base,89 const volatile void * _base,
...@@ -118,7 +95,7 @@ OSReadSwapInt32(...@@ -118,7 +95,7 @@ OSReadSwapInt32(
118#endif95#endif
11996
120#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)97#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
121__DARWIN_OS_INLINE98OS_INLINE
122uint64_t99uint64_t
123_OSReadSwapInt64(100_OSReadSwapInt64(
124 const volatile void * _base,101 const volatile void * _base,
...@@ -128,7 +105,7 @@ _OSReadSwapInt64(...@@ -128,7 +105,7 @@ _OSReadSwapInt64(
128 return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);105 return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
129}106}
130#else107#else
131__DARWIN_OS_INLINE108OS_INLINE
132uint64_t109uint64_t
133OSReadSwapInt64(110OSReadSwapInt64(
134 const volatile void * _base,111 const volatile void * _base,
...@@ -142,7 +119,7 @@ OSReadSwapInt64(...@@ -142,7 +119,7 @@ OSReadSwapInt64(
142/* Functions for byte reversed stores. */119/* Functions for byte reversed stores. */
143120
144#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)121#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
145__DARWIN_OS_INLINE122OS_INLINE
146void123void
147_OSWriteSwapInt16(124_OSWriteSwapInt16(
148 volatile void * _base,125 volatile void * _base,
...@@ -153,7 +130,7 @@ _OSWriteSwapInt16(...@@ -153,7 +130,7 @@ _OSWriteSwapInt16(
153 ((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);130 ((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
154}131}
155#else132#else
156__DARWIN_OS_INLINE133OS_INLINE
157void134void
158OSWriteSwapInt16(135OSWriteSwapInt16(
159 volatile void * _base,136 volatile void * _base,
...@@ -166,7 +143,7 @@ OSWriteSwapInt16(...@@ -166,7 +143,7 @@ OSWriteSwapInt16(
166#endif143#endif
167144
168#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)145#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
169__DARWIN_OS_INLINE146OS_INLINE
170void147void
171_OSWriteSwapInt32(148_OSWriteSwapInt32(
172 volatile void * _base,149 volatile void * _base,
...@@ -177,7 +154,7 @@ _OSWriteSwapInt32(...@@ -177,7 +154,7 @@ _OSWriteSwapInt32(
177 ((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);154 ((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
178}155}
179#else156#else
180__DARWIN_OS_INLINE157OS_INLINE
181void158void
182OSWriteSwapInt32(159OSWriteSwapInt32(
183 volatile void * _base,160 volatile void * _base,
...@@ -190,7 +167,7 @@ OSWriteSwapInt32(...@@ -190,7 +167,7 @@ OSWriteSwapInt32(
190#endif167#endif
191168
192#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)169#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
193__DARWIN_OS_INLINE170OS_INLINE
194void171void
195_OSWriteSwapInt64(172_OSWriteSwapInt64(
196 volatile void * _base,173 volatile void * _base,
...@@ -201,7 +178,7 @@ _OSWriteSwapInt64(...@@ -201,7 +178,7 @@ _OSWriteSwapInt64(
201 ((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);178 ((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
202}179}
203#else180#else
204__DARWIN_OS_INLINE181OS_INLINE
205void182void
206OSWriteSwapInt64(183OSWriteSwapInt64(
207 volatile void * _base,184 volatile void * _base,
...@@ -213,4 +190,6 @@ OSWriteSwapInt64(...@@ -213,4 +190,6 @@ OSWriteSwapInt64(
213}190}
214#endif191#endif
215192
193#endif /* defined (__arm__) || defined(__arm64__) */
194
216#endif /* ! _OS_OSBYTEORDERARM_H */195#endif /* ! _OS_OSBYTEORDERARM_H */
lib/libc/include/any-macos-any/libkern/arm/_OSByteOrder.h created+99
...@@ -0,0 +1,99 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef _OS__OSBYTEORDERARM_H
30#define _OS__OSBYTEORDERARM_H
31
32#if defined (__arm__) || defined(__arm64__)
33
34#include <sys/_types.h>
35
36#if !defined(__DARWIN_OS_INLINE)
37# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
38# define __DARWIN_OS_INLINE static inline
39# elif defined(__MWERKS__) || defined(__cplusplus)
40# define __DARWIN_OS_INLINE static inline
41# else
42# define __DARWIN_OS_INLINE static __inline__
43# endif
44#endif
45
46/* Generic byte swapping functions. */
47
48__DARWIN_OS_INLINE
49__uint16_t
50_OSSwapInt16(
51 __uint16_t _data
52 )
53{
54 /* Reduces to 'rev16' with clang */
55 return (__uint16_t)(_data << 8 | _data >> 8);
56}
57
58__DARWIN_OS_INLINE
59__uint32_t
60_OSSwapInt32(
61 __uint32_t _data
62 )
63{
64#if defined(__llvm__)
65 _data = __builtin_bswap32(_data);
66#else
67 /* This actually generates the best code */
68 _data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
69#endif
70
71 return _data;
72}
73
74__DARWIN_OS_INLINE
75__uint64_t
76_OSSwapInt64(
77 __uint64_t _data
78 )
79{
80#if defined(__llvm__)
81 return __builtin_bswap64(_data);
82#else
83 union {
84 __uint64_t _ull;
85 __uint32_t _ul[2];
86 } _u;
87
88 /* This actually generates the best code */
89 _u._ul[0] = (__uint32_t)(_data >> 32);
90 _u._ul[1] = (__uint32_t)(_data & 0xffffffff);
91 _u._ul[0] = _OSSwapInt32(_u._ul[0]);
92 _u._ul[1] = _OSSwapInt32(_u._ul[1]);
93 return _u._ull;
94#endif
95}
96
97#endif /* defined (__arm__) || defined(__arm64__) */
98
99#endif /* ! _OS__OSBYTEORDERARM_H */
lib/libc/include/any-macos-any/libkern/i386/OSByteOrder.h+5-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 1999-2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -29,6 +29,8 @@...@@ -29,6 +29,8 @@
29#ifndef _OS_OSBYTEORDERI386_H29#ifndef _OS_OSBYTEORDERI386_H
30#define _OS_OSBYTEORDERI386_H30#define _OS_OSBYTEORDERI386_H
3131
32#if defined(__i386__) || defined(__x86_64__)
33
32#include <stdint.h>34#include <stdint.h>
33#include <libkern/i386/_OSByteOrder.h>35#include <libkern/i386/_OSByteOrder.h>
34#include <sys/_types/_os_inline.h>36#include <sys/_types/_os_inline.h>
...@@ -109,4 +111,6 @@ OSWriteSwapInt64(...@@ -109,4 +111,6 @@ OSWriteSwapInt64(
109 *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);111 *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
110}112}
111113
114#endif /* defined(__i386__) || defined(__x86_64__) */
115
112#endif /* ! _OS_OSBYTEORDERI386_H */116#endif /* ! _OS_OSBYTEORDERI386_H */
lib/libc/include/any-macos-any/libkern/i386/_OSByteOrder.h+7-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2006-2012 Apple Inc. All rights reserved.2 * Copyright (c) 2006-2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -29,6 +29,10 @@...@@ -29,6 +29,10 @@
29#ifndef _OS__OSBYTEORDERI386_H29#ifndef _OS__OSBYTEORDERI386_H
30#define _OS__OSBYTEORDERI386_H30#define _OS__OSBYTEORDERI386_H
3131
32#if defined(__i386__) || defined(__x86_64__)
33
34#include <sys/_types.h>
35
32#if !defined(__DARWIN_OS_INLINE)36#if !defined(__DARWIN_OS_INLINE)
33# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L37# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34# define __DARWIN_OS_INLINE static inline38# define __DARWIN_OS_INLINE static inline
...@@ -101,4 +105,6 @@ _OSSwapInt64(...@@ -101,4 +105,6 @@ _OSSwapInt64(
101#error Unknown architecture105#error Unknown architecture
102#endif106#endif
103107
108#endif /* defined(__i386__) || defined(__x86_64__) */
109
104#endif /* ! _OS__OSBYTEORDERI386_H */110#endif /* ! _OS__OSBYTEORDERI386_H */
lib/libc/include/any-macos-any/libproc.h+4-4
...@@ -129,6 +129,10 @@ int proc_clear_dirty(pid_t pid, uint32_t flags);...@@ -129,6 +129,10 @@ int proc_clear_dirty(pid_t pid, uint32_t flags);
129129
130int proc_terminate(pid_t pid, int *sig);130int proc_terminate(pid_t pid, int *sig);
131int proc_terminate_all_rsr(int sig);131int proc_terminate_all_rsr(int sig);
132int proc_signal_with_audittoken(audit_token_t *audittoken, int sig);
133int proc_terminate_with_audittoken(audit_token_t *audittoken, int *sig);
134int proc_signal_delegate(audit_token_t instigator, audit_token_t target, int sig);
135int proc_terminate_delegate(audit_token_t instigator, audit_token_t target, int *sig);
132136
133/*137/*
134 * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,138 * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
...@@ -164,10 +168,6 @@ int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));...@@ -164,10 +168,6 @@ int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
164168
165int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);169int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);
166170
167#if __has_include(<libproc_private.h>)
168#include <libproc_private.h>
169#endif
170
171__END_DECLS171__END_DECLS
172172
173#endif /*_LIBPROC_H_ */173#endif /*_LIBPROC_H_ */
lib/libc/include/any-macos-any/mach-o/compact_unwind_encoding.h+40-40
...@@ -108,7 +108,7 @@ enum {...@@ -108,7 +108,7 @@ enum {
108// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.108// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
109// Each entry contains which register to restore.109// Each entry contains which register to restore.
110// UNWIND_X86_MODE_STACK_IMMD:110// UNWIND_X86_MODE_STACK_IMMD:
111// A "frameless" (EBP not used as frame pointer) function with a small 111// A "frameless" (EBP not used as frame pointer) function with a small
112// constant stack size. To return, a constant (encoded in the compact112// constant stack size. To return, a constant (encoded in the compact
113// unwind encoding) is added to the ESP. Then the return is done by113// unwind encoding) is added to the ESP. Then the return is done by
114// popping the stack into the pc.114// popping the stack into the pc.
...@@ -119,16 +119,16 @@ enum {...@@ -119,16 +119,16 @@ enum {
119// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION contains which registers were119// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION contains which registers were
120// saved and their order.120// saved and their order.
121// UNWIND_X86_MODE_STACK_IND:121// UNWIND_X86_MODE_STACK_IND:
122// A "frameless" (EBP not used as frame pointer) function large constant 122// A "frameless" (EBP not used as frame pointer) function large constant
123// stack size. This case is like the previous, except the stack size is too123// stack size. This case is like the previous, except the stack size is too
124// large to encode in the compact unwind encoding. Instead it requires that 124// large to encode in the compact unwind encoding. Instead it requires that
125// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact 125// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
126// encoding contains the offset to the nnnnnnnn value in the function in126// encoding contains the offset to the nnnnnnnn value in the function in
127// UNWIND_X86_FRAMELESS_STACK_SIZE. 127// UNWIND_X86_FRAMELESS_STACK_SIZE.
128// UNWIND_X86_MODE_DWARF:128// UNWIND_X86_MODE_DWARF:
129// No compact unwind encoding is available. Instead the low 24-bits of the129// No compact unwind encoding is available. Instead the low 24-bits of the
130// compact encoding is the offset of the DWARF FDE in the __eh_frame section.130// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
131// This mode is never used in object files. It is only generated by the 131// This mode is never used in object files. It is only generated by the
132// linker in final linked images which have only DWARF unwind info for a132// linker in final linked images which have only DWARF unwind info for a
133// function.133// function.
134//134//
...@@ -233,36 +233,36 @@ enum {...@@ -233,36 +233,36 @@ enum {
233// For x86_64 there are four modes for the compact unwind encoding:233// For x86_64 there are four modes for the compact unwind encoding:
234// UNWIND_X86_64_MODE_RBP_FRAME:234// UNWIND_X86_64_MODE_RBP_FRAME:
235// RBP based frame where RBP is push on stack immediately after return address,235// RBP based frame where RBP is push on stack immediately after return address,
236// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current 236// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
237// EPB value, then RBP is restored by popping off the stack, and the return 237// EPB value, then RBP is restored by popping off the stack, and the return
238// is done by popping the stack once more into the pc.238// is done by popping the stack once more into the pc.
239// All non-volatile registers that need to be restored must have been saved239// All non-volatile registers that need to be restored must have been saved
240// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8 240// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
241// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved241// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
242// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.242// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
243// Each entry contains which register to restore. 243// Each entry contains which register to restore.
244// UNWIND_X86_64_MODE_STACK_IMMD:244// UNWIND_X86_64_MODE_STACK_IMMD:
245// A "frameless" (RBP not used as frame pointer) function with a small 245// A "frameless" (RBP not used as frame pointer) function with a small
246// constant stack size. To return, a constant (encoded in the compact 246// constant stack size. To return, a constant (encoded in the compact
247// unwind encoding) is added to the RSP. Then the return is done by 247// unwind encoding) is added to the RSP. Then the return is done by
248// popping the stack into the pc.248// popping the stack into the pc.
249// All non-volatile registers that need to be restored must have been saved249// All non-volatile registers that need to be restored must have been saved
250// on the stack immediately after the return address. The stack_size/8 is250// on the stack immediately after the return address. The stack_size/8 is
251// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).251// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
252// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.252// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
253// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION contains which registers were253// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION contains which registers were
254// saved and their order. 254// saved and their order.
255// UNWIND_X86_64_MODE_STACK_IND:255// UNWIND_X86_64_MODE_STACK_IND:
256// A "frameless" (RBP not used as frame pointer) function large constant 256// A "frameless" (RBP not used as frame pointer) function large constant
257// stack size. This case is like the previous, except the stack size is too257// stack size. This case is like the previous, except the stack size is too
258// large to encode in the compact unwind encoding. Instead it requires that 258// large to encode in the compact unwind encoding. Instead it requires that
259// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact 259// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
260// encoding contains the offset to the nnnnnnnn value in the function in260// encoding contains the offset to the nnnnnnnn value in the function in
261// UNWIND_X86_64_FRAMELESS_STACK_SIZE. 261// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
262// UNWIND_X86_64_MODE_DWARF:262// UNWIND_X86_64_MODE_DWARF:
263// No compact unwind encoding is available. Instead the low 24-bits of the263// No compact unwind encoding is available. Instead the low 24-bits of the
264// compact encoding is the offset of the DWARF FDE in the __eh_frame section.264// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
265// This mode is never used in object files. It is only generated by the 265// This mode is never used in object files. It is only generated by the
266// linker in final linked images which have only DWARF unwind info for a266// linker in final linked images which have only DWARF unwind info for a
267// function.267// function.
268//268//
...@@ -307,20 +307,20 @@ enum {...@@ -307,20 +307,20 @@ enum {
307// This is a standard arm64 prolog where FP/LR are immediately pushed on the307// This is a standard arm64 prolog where FP/LR are immediately pushed on the
308// stack, then SP is copied to FP. If there are any non-volatile registers308// stack, then SP is copied to FP. If there are any non-volatile registers
309// saved, then are copied into the stack frame in pairs in a contiguous309// saved, then are copied into the stack frame in pairs in a contiguous
310// range right below the saved FP/LR pair. Any subset of the five X pairs 310// range right below the saved FP/LR pair. Any subset of the five X pairs
311// and four D pairs can be saved, but the memory layout must be in register311// and four D pairs can be saved, but the memory layout must be in register
312// number order. 312// number order.
313// UNWIND_ARM64_MODE_FRAMELESS:313// UNWIND_ARM64_MODE_FRAMELESS:
314// A "frameless" leaf function, where FP/LR are not saved. The return address 314// A "frameless" leaf function, where FP/LR are not saved. The return address
315// remains in LR throughout the function. If any non-volatile registers315// remains in LR throughout the function. If any non-volatile registers
316// are saved, they must be pushed onto the stack before any stack space is316// are saved, they must be pushed onto the stack before any stack space is
317// allocated for local variables. The stack sized (including any saved317// allocated for local variables. The stack sized (including any saved
318// non-volatile registers) divided by 16 is encoded in the bits 318// non-volatile registers) divided by 16 is encoded in the bits
319// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.319// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
320// UNWIND_ARM64_MODE_DWARF:320// UNWIND_ARM64_MODE_DWARF:
321// No compact unwind encoding is available. Instead the low 24-bits of the321// No compact unwind encoding is available. Instead the low 24-bits of the
322// compact encoding is the offset of the DWARF FDE in the __eh_frame section.322// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
323// This mode is never used in object files. It is only generated by the 323// This mode is never used in object files. It is only generated by the
324// linker in final linked images which have only DWARF unwind info for a324// linker in final linked images which have only DWARF unwind info for a
325// function.325// function.
326//326//
...@@ -393,19 +393,19 @@ enum {...@@ -393,19 +393,19 @@ enum {
393393
394//394//
395// A compiler can generated compact unwind information for a function by adding395// A compiler can generated compact unwind information for a function by adding
396// a "row" to the __LD,__compact_unwind section. This section has the 396// a "row" to the __LD,__compact_unwind section. This section has the
397// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers. 397// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
398// It is removed by the new linker, so never ends up in final executables. 398// It is removed by the new linker, so never ends up in final executables.
399// This section is a table, initially with one row per function (that needs 399// This section is a table, initially with one row per function (that needs
400// unwind info). The table columns and some conceptual entries are:400// unwind info). The table columns and some conceptual entries are:
401//401//
402// range-start pointer to start of function/range402// range-start pointer to start of function/range
403// range-length 403// range-length
404// compact-unwind-encoding 32-bit encoding 404// compact-unwind-encoding 32-bit encoding
405// personality-function or zero if no personality function405// personality-function or zero if no personality function
406// lsda or zero if no LSDA data406// lsda or zero if no LSDA data
407//407//
408// The length and encoding fields are 32-bits. The other are all pointer sized. 408// The length and encoding fields are 32-bits. The other are all pointer sized.
409//409//
410// In x86_64 assembly, these entry would look like:410// In x86_64 assembly, these entry would look like:
411//411//
...@@ -428,23 +428,23 @@ enum {...@@ -428,23 +428,23 @@ enum {
428// .quad except_tab1428// .quad except_tab1
429//429//
430//430//
431// Notes: There is no need for any labels in the the __compact_unwind section. 431// Notes: There is no need for any labels in the __compact_unwind section.
432// The use of the .set directive is to force the evaluation of the 432// The use of the .set directive is to force the evaluation of the
433// range-length at assembly time, instead of generating relocations.433// range-length at assembly time, instead of generating relocations.
434//434//
435// To support future compiler optimizations where which non-volatile registers 435// To support future compiler optimizations where which non-volatile registers
436// are saved changes within a function (e.g. delay saving non-volatiles until436// are saved changes within a function (e.g. delay saving non-volatiles until
437// necessary), there can by multiple lines in the __compact_unwind table for one437// necessary), there can by multiple lines in the __compact_unwind table for one
438// function, each with a different (non-overlapping) range and each with 438// function, each with a different (non-overlapping) range and each with
439// different compact unwind encodings that correspond to the non-volatiles 439// different compact unwind encodings that correspond to the non-volatiles
440// saved at that range of the function.440// saved at that range of the function.
441//441//
442// If a particular function is so wacky that there is no compact unwind way442// If a particular function is so wacky that there is no compact unwind way
443// to encode it, then the compiler can emit traditional DWARF unwind info. 443// to encode it, then the compiler can emit traditional DWARF unwind info.
444// The runtime will use which ever is available.444// The runtime will use which ever is available.
445//445//
446// Runtime support for compact unwind encodings are only available on 10.6 446// Runtime support for compact unwind encodings are only available on 10.6
447// and later. So, the compiler should not generate it when targeting pre-10.6. 447// and later. So, the compiler should not generate it when targeting pre-10.6.
448448
449449
450450
...@@ -458,7 +458,7 @@ enum {...@@ -458,7 +458,7 @@ enum {
458//458//
459// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.459// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
460// The header of the section contains a coarse index that maps function address460// The header of the section contains a coarse index that maps function address
461// to the page (4096 byte block) containing the unwind info for that function. 461// to the page (4096 byte block) containing the unwind info for that function.
462//462//
463463
464#define UNWIND_SECTION_VERSION 1464#define UNWIND_SECTION_VERSION 1
lib/libc/include/any-macos-any/mach-o/loader.h+37-2
...@@ -234,7 +234,12 @@ struct mach_header_64 {...@@ -234,7 +234,12 @@ struct mach_header_64 {
234 the platforms macOS, macCatalyst,234 the platforms macOS, macCatalyst,
235 iOSSimulator, tvOSSimulator and235 iOSSimulator, tvOSSimulator and
236 watchOSSimulator. */236 watchOSSimulator. */
237 237
238#define MH_IMPLICIT_PAGEZERO 0x10000000 /* main executable has no __PAGEZERO
239 segment. Instead, loader (xnu)
240 will load program high and block
241 out all memory below it. */
242
238#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit243#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit
239 is set, the dylib is part of the dyld244 is set, the dylib is part of the dyld
240 shared cache, rather than loose in245 shared cache, rather than loose in
...@@ -670,7 +675,7 @@ struct fvmlib_command {...@@ -670,7 +675,7 @@ struct fvmlib_command {
670};675};
671676
672/*677/*
673 * Dynamicly linked shared libraries are identified by two things. The678 * Dynamically linked shared libraries are identified by two things. The
674 * pathname (the name of the library as found for execution), and the679 * pathname (the name of the library as found for execution), and the
675 * compatibility version number. The pathname must match and the compatibility680 * compatibility version number. The pathname must match and the compatibility
676 * number in the user of the library must be greater than or equal to the681 * number in the user of the library must be greater than or equal to the
...@@ -699,6 +704,30 @@ struct dylib_command {...@@ -699,6 +704,30 @@ struct dylib_command {
699 struct dylib dylib; /* the library identification */704 struct dylib dylib; /* the library identification */
700};705};
701706
707
708/*
709 * An alternate encoding for: LC_LOAD_DYLIB.
710 * The flags field contains independent flags DYLIB_USE_*
711 * First supported in macOS 15, iOS 18.
712 */
713struct dylib_use_command {
714 uint32_t cmd; /* LC_LOAD_DYLIB or LC_LOAD_WEAK_DYLIB */
715 uint32_t cmdsize; /* overall size, including path */
716 uint32_t nameoff; /* == 28, dylibs's path offset */
717 uint32_t marker; /* == DYLIB_USE_MARKER */
718 uint32_t current_version; /* dylib's current version number */
719 uint32_t compat_version; /* dylib's compatibility version number */
720 uint32_t flags; /* DYLIB_USE_... flags */
721};
722#define DYLIB_USE_WEAK_LINK 0x01
723#define DYLIB_USE_REEXPORT 0x02
724#define DYLIB_USE_UPWARD 0x04
725#define DYLIB_USE_DELAYED_INIT 0x08
726
727#define DYLIB_USE_MARKER 0x1a741800
728
729
730
702/*731/*
703 * A dynamically linked shared library may be a subframework of an umbrella732 * A dynamically linked shared library may be a subframework of an umbrella
704 * framework. If so it will be linked with "-umbrella umbrella_name" where733 * framework. If so it will be linked with "-umbrella umbrella_name" where
...@@ -1287,6 +1316,8 @@ struct build_tool_version {...@@ -1287,6 +1316,8 @@ struct build_tool_version {
1287#define PLATFORM_TVOSSIMULATOR 81316#define PLATFORM_TVOSSIMULATOR 8
1288#define PLATFORM_WATCHOSSIMULATOR 91317#define PLATFORM_WATCHOSSIMULATOR 9
1289#define PLATFORM_DRIVERKIT 101318#define PLATFORM_DRIVERKIT 10
1319#define PLATFORM_VISIONOS 11
1320#define PLATFORM_VISIONOSSIMULATOR 12
12901321
1291#ifndef __OPEN_SOURCE__1322#ifndef __OPEN_SOURCE__
12921323
...@@ -1299,6 +1330,10 @@ struct build_tool_version {...@@ -1299,6 +1330,10 @@ struct build_tool_version {
12991330
1300#endif /* __OPEN_SOURCE__ */1331#endif /* __OPEN_SOURCE__ */
13011332
1333#ifndef __OPEN_SOURCE__
1334
1335#endif /* __OPEN_SOURCE__ */
1336
1302/* Known values for the tool field above. */1337/* Known values for the tool field above. */
1303#define TOOL_CLANG 11338#define TOOL_CLANG 1
1304#define TOOL_SWIFT 21339#define TOOL_SWIFT 2
lib/libc/include/any-macos-any/mach-o/nlist.h+1-1
...@@ -202,7 +202,7 @@ struct nlist_64 {...@@ -202,7 +202,7 @@ struct nlist_64 {
202/*202/*
203 * To simplify stripping of objects that use are used with the dynamic link203 * To simplify stripping of objects that use are used with the dynamic link
204 * editor, the static link editor marks the symbols defined an object that are204 * editor, the static link editor marks the symbols defined an object that are
205 * referenced by a dynamicly bound object (dynamic shared libraries, bundles).205 * referenced by a dynamically bound object (dynamic shared libraries, bundles).
206 * With this marking strip knows not to strip these symbols.206 * With this marking strip knows not to strip these symbols.
207 */207 */
208#define REFERENCED_DYNAMICALLY 0x0010208#define REFERENCED_DYNAMICALLY 0x0010
lib/libc/include/any-macos-any/mach/arm/_structs.h+42
...@@ -62,6 +62,12 @@ _STRUCT_ARM_EXCEPTION_STATE64...@@ -62,6 +62,12 @@ _STRUCT_ARM_EXCEPTION_STATE64
62 __uint32_t __esr; /* Exception syndrome */62 __uint32_t __esr; /* Exception syndrome */
63 __uint32_t __exception; /* number of arm exception taken */63 __uint32_t __exception; /* number of arm exception taken */
64};64};
65#define _STRUCT_ARM_EXCEPTION_STATE64_V2 struct __darwin_arm_exception_state64_v2
66_STRUCT_ARM_EXCEPTION_STATE64_V2
67{
68 __uint64_t __far; /* Virtual Fault Address */
69 __uint64_t __esr; /* Exception syndrome */
70};
65#else /* !__DARWIN_UNIX03 */71#else /* !__DARWIN_UNIX03 */
66#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state6472#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
67_STRUCT_ARM_EXCEPTION_STATE6473_STRUCT_ARM_EXCEPTION_STATE64
...@@ -70,6 +76,12 @@ _STRUCT_ARM_EXCEPTION_STATE64...@@ -70,6 +76,12 @@ _STRUCT_ARM_EXCEPTION_STATE64
70 __uint32_t esr; /* Exception syndrome */76 __uint32_t esr; /* Exception syndrome */
71 __uint32_t exception; /* number of arm exception taken */77 __uint32_t exception; /* number of arm exception taken */
72};78};
79#define _STRUCT_ARM_EXCEPTION_STATE64_V2 struct arm_exception_state64_v2
80_STRUCT_ARM_EXCEPTION_STATE64_V2
81{
82 __uint64_t far; /* Virtual Fault Address */
83 __uint64_t esr; /* Exception syndrome */
84};
73#endif /* __DARWIN_UNIX03 */85#endif /* __DARWIN_UNIX03 */
7486
75#if __DARWIN_UNIX0387#if __DARWIN_UNIX03
...@@ -241,6 +253,12 @@ _STRUCT_ARM_THREAD_STATE64...@@ -241,6 +253,12 @@ _STRUCT_ARM_THREAD_STATE64
241 ptrauth_key_function_pointer, 0)) : __f); \253 ptrauth_key_function_pointer, 0)) : __f); \
242 __tsp->__opaque_flags &= \254 __tsp->__opaque_flags &= \
243 ~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_PC; })255 ~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_PC; })
256/* Set pc field of arm_thread_state64_t to an already signed function pointer */
257#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
258 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
259 __typeof__(presigned_fptr) __f = (presigned_fptr); __tsp->__opaque_pc = __f; \
260 __tsp->__opaque_flags &= \
261 ~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_PC; })
244/* Return lr field of arm_thread_state64_t as a data pointer value */262/* Return lr field of arm_thread_state64_t as a data pointer value */
245#define __darwin_arm_thread_state64_get_lr(ts) \263#define __darwin_arm_thread_state64_get_lr(ts) \
246 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \264 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
...@@ -295,6 +313,12 @@ _STRUCT_ARM_THREAD_STATE64...@@ -295,6 +313,12 @@ _STRUCT_ARM_THREAD_STATE64
295 ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \313 ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
296 ptrauth_key_function_pointer, 0)) : __f); __tsp->__opaque_flags &= \314 ptrauth_key_function_pointer, 0)) : __f); __tsp->__opaque_flags &= \
297 ~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_LR; })315 ~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_LR; })
316/* Set lr field of arm_thread_state64_t to an already signed function pointer */
317#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
318 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
319 __typeof__(presigned_fptr) __f = (presigned_fptr); __tsp->__opaque_lr = __f; \
320 __tsp->__opaque_flags &= \
321 ~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_LR & ~__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR; })
298/* Return sp field of arm_thread_state64_t as a data pointer value */322/* Return sp field of arm_thread_state64_t as a data pointer value */
299#define __darwin_arm_thread_state64_get_sp(ts) \323#define __darwin_arm_thread_state64_get_sp(ts) \
300 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \324 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
...@@ -368,6 +392,9 @@ _STRUCT_ARM_THREAD_STATE64...@@ -368,6 +392,9 @@ _STRUCT_ARM_THREAD_STATE64
368/* Set pc field of arm_thread_state64_t to a function pointer */392/* Set pc field of arm_thread_state64_t to a function pointer */
369#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \393#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
370 ((ts).__opaque_pc = (fptr))394 ((ts).__opaque_pc = (fptr))
395/* Set pc field of arm_thread_state64_t to an already signed function pointer */
396#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
397 ((ts).__opaque_pc = (presigned_fptr))
371/* Return lr field of arm_thread_state64_t as a data pointer value */398/* Return lr field of arm_thread_state64_t as a data pointer value */
372#define __darwin_arm_thread_state64_get_lr(ts) \399#define __darwin_arm_thread_state64_get_lr(ts) \
373 ((uintptr_t)((ts).__opaque_lr))400 ((uintptr_t)((ts).__opaque_lr))
...@@ -377,6 +404,9 @@ _STRUCT_ARM_THREAD_STATE64...@@ -377,6 +404,9 @@ _STRUCT_ARM_THREAD_STATE64
377/* Set lr field of arm_thread_state64_t to a function pointer */404/* Set lr field of arm_thread_state64_t to a function pointer */
378#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \405#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
379 ((ts).__opaque_lr = (fptr))406 ((ts).__opaque_lr = (fptr))
407/* Set lr field of arm_thread_state64_t to a presigned function pointer */
408#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
409 ((ts).__opaque_lr = (presigned_fptr))
380/* Return sp field of arm_thread_state64_t as a data pointer value */410/* Return sp field of arm_thread_state64_t as a data pointer value */
381#define __darwin_arm_thread_state64_get_sp(ts) \411#define __darwin_arm_thread_state64_get_sp(ts) \
382 ((uintptr_t)((ts).__opaque_sp))412 ((uintptr_t)((ts).__opaque_sp))
...@@ -405,6 +435,9 @@ _STRUCT_ARM_THREAD_STATE64...@@ -405,6 +435,9 @@ _STRUCT_ARM_THREAD_STATE64
405/* Set pc field of arm_thread_state64_t to a function pointer */435/* Set pc field of arm_thread_state64_t to a function pointer */
406#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \436#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
407 ((ts).__pc = (uintptr_t)(fptr))437 ((ts).__pc = (uintptr_t)(fptr))
438/* Set pc field of arm_thread_state64_t to an already signed function pointer */
439#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
440 ((ts).__pc = (uintptr_t)(presigned_fptr))
408/* Return lr field of arm_thread_state64_t as a data pointer value */441/* Return lr field of arm_thread_state64_t as a data pointer value */
409#define __darwin_arm_thread_state64_get_lr(ts) \442#define __darwin_arm_thread_state64_get_lr(ts) \
410 ((ts).__lr)443 ((ts).__lr)
...@@ -414,6 +447,9 @@ _STRUCT_ARM_THREAD_STATE64...@@ -414,6 +447,9 @@ _STRUCT_ARM_THREAD_STATE64
414/* Set lr field of arm_thread_state64_t to a function pointer */447/* Set lr field of arm_thread_state64_t to a function pointer */
415#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \448#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
416 ((ts).__lr = (uintptr_t)(fptr))449 ((ts).__lr = (uintptr_t)(fptr))
450/* Set lr field of arm_thread_state64_t to a presigned function pointer */
451#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
452 ((ts).__lr = ((uintptr_t)presigned_fptr))
417/* Return sp field of arm_thread_state64_t as a data pointer value */453/* Return sp field of arm_thread_state64_t as a data pointer value */
418#define __darwin_arm_thread_state64_get_sp(ts) \454#define __darwin_arm_thread_state64_get_sp(ts) \
419 ((ts).__sp)455 ((ts).__sp)
...@@ -441,6 +477,9 @@ _STRUCT_ARM_THREAD_STATE64...@@ -441,6 +477,9 @@ _STRUCT_ARM_THREAD_STATE64
441/* Set pc field of arm_thread_state64_t to a function pointer */477/* Set pc field of arm_thread_state64_t to a function pointer */
442#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \478#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
443 ((ts).pc = (uintptr_t)(fptr))479 ((ts).pc = (uintptr_t)(fptr))
480/* Set pc field of arm_thread_state64_t to an already signed function pointer */
481#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
482 ((ts).pc = (uintptr_t)(presigned_fptr))
444/* Return lr field of arm_thread_state64_t as a data pointer value */483/* Return lr field of arm_thread_state64_t as a data pointer value */
445#define __darwin_arm_thread_state64_get_lr(ts) \484#define __darwin_arm_thread_state64_get_lr(ts) \
446 ((ts).lr)485 ((ts).lr)
...@@ -450,6 +489,9 @@ _STRUCT_ARM_THREAD_STATE64...@@ -450,6 +489,9 @@ _STRUCT_ARM_THREAD_STATE64
450/* Set lr field of arm_thread_state64_t to a function pointer */489/* Set lr field of arm_thread_state64_t to a function pointer */
451#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \490#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
452 ((ts).lr = (uintptr_t)(fptr))491 ((ts).lr = (uintptr_t)(fptr))
492/* Set lr field of arm_thread_state64_t to a presigned function pointer */
493#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
494 ((ts).lr = ((uintptr_t)presigned_fptr))
453/* Return sp field of arm_thread_state64_t as a data pointer value */495/* Return sp field of arm_thread_state64_t as a data pointer value */
454#define __darwin_arm_thread_state64_get_sp(ts) \496#define __darwin_arm_thread_state64_get_sp(ts) \
455 ((ts).sp)497 ((ts).sp)
lib/libc/include/any-macos-any/mach/arm/exception.h+2
...@@ -47,6 +47,7 @@...@@ -47,6 +47,7 @@
47 */47 */
4848
49#define EXC_ARM_UNDEFINED 1 /* Undefined */49#define EXC_ARM_UNDEFINED 1 /* Undefined */
50#define EXC_ARM_SME_DISALLOWED 2 /* Current thread state prohibits use of SME resources */
5051
51/*52/*
52 * EXC_ARITHMETIC53 * EXC_ARITHMETIC
...@@ -71,6 +72,7 @@...@@ -71,6 +72,7 @@
71#define EXC_ARM_SWP 0x104 /* SWP instruction */72#define EXC_ARM_SWP 0x104 /* SWP instruction */
72#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */73#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
7374
75
74/*76/*
75 * EXC_BREAKPOINT77 * EXC_BREAKPOINT
76 */78 */
lib/libc/include/any-macos-any/mach/arm/thread_status.h+14
...@@ -60,6 +60,7 @@...@@ -60,6 +60,7 @@
60#define ARM_EXCEPTION_STATE64 760#define ARM_EXCEPTION_STATE64 7
61// ARM_THREAD_STATE_LAST 8 /* legacy */61// ARM_THREAD_STATE_LAST 8 /* legacy */
62#define ARM_THREAD_STATE32 962#define ARM_THREAD_STATE32 9
63#define ARM_EXCEPTION_STATE64_V2 10
6364
6465
65/* API */66/* API */
...@@ -73,6 +74,8 @@...@@ -73,6 +74,8 @@
73#define ARM_PAGEIN_STATE 2774#define ARM_PAGEIN_STATE 27
7475
7576
77#define THREAD_STATE_FLAVORS 29 /* This must be updated to 1 more than the highest numerical state flavor */
78
76#ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID79#ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID
77#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 080#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0
78#endif81#endif
...@@ -91,6 +94,7 @@...@@ -91,6 +94,7 @@
91 (x == ARM_THREAD_STATE32) || \94 (x == ARM_THREAD_STATE32) || \
92 (x == ARM_THREAD_STATE64) || \95 (x == ARM_THREAD_STATE64) || \
93 (x == ARM_EXCEPTION_STATE64) || \96 (x == ARM_EXCEPTION_STATE64) || \
97 (x == ARM_EXCEPTION_STATE64_V2) || \
94 (x == ARM_NEON_STATE) || \98 (x == ARM_NEON_STATE) || \
95 (x == ARM_NEON_STATE64) || \99 (x == ARM_NEON_STATE64) || \
96 (x == ARM_DEBUG_STATE32) || \100 (x == ARM_DEBUG_STATE32) || \
...@@ -123,6 +127,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;...@@ -123,6 +127,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
123/* Set pc field of arm_thread_state64_t to a function pointer */127/* Set pc field of arm_thread_state64_t to a function pointer */
124#define arm_thread_state64_set_pc_fptr(ts, fptr) \128#define arm_thread_state64_set_pc_fptr(ts, fptr) \
125 __darwin_arm_thread_state64_set_pc_fptr(ts, fptr)129 __darwin_arm_thread_state64_set_pc_fptr(ts, fptr)
130/* Set pc field of arm_thread_state64_t to an already signed function pointer */
131#define arm_thread_state64_set_pc_presigned_fptr(ts, fptr) \
132 __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, fptr)
126/* Return lr field of arm_thread_state64_t as a data pointer value */133/* Return lr field of arm_thread_state64_t as a data pointer value */
127#define arm_thread_state64_get_lr(ts) \134#define arm_thread_state64_get_lr(ts) \
128 __darwin_arm_thread_state64_get_lr(ts)135 __darwin_arm_thread_state64_get_lr(ts)
...@@ -134,6 +141,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;...@@ -134,6 +141,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
134/* Set lr field of arm_thread_state64_t to a function pointer */141/* Set lr field of arm_thread_state64_t to a function pointer */
135#define arm_thread_state64_set_lr_fptr(ts, fptr) \142#define arm_thread_state64_set_lr_fptr(ts, fptr) \
136 __darwin_arm_thread_state64_set_lr_fptr(ts, fptr)143 __darwin_arm_thread_state64_set_lr_fptr(ts, fptr)
144/* Set lr field of arm_thread_state64_t to an already signed function pointer */
145#define arm_thread_state64_set_lr_presigned_fptr(ts, fptr) \
146 __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, fptr)
137/* Return sp field of arm_thread_state64_t as a data pointer value */147/* Return sp field of arm_thread_state64_t as a data pointer value */
138#define arm_thread_state64_get_sp(ts) \148#define arm_thread_state64_get_sp(ts) \
139 __darwin_arm_thread_state64_get_sp(ts)149 __darwin_arm_thread_state64_get_sp(ts)
...@@ -182,6 +192,7 @@ typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;...@@ -182,6 +192,7 @@ typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
182typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;192typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
183typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;193typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
184typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;194typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;
195typedef _STRUCT_ARM_EXCEPTION_STATE64_V2 arm_exception_state64_v2_t;
185196
186typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;197typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;
187typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;198typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;
...@@ -209,6 +220,9 @@ typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;...@@ -209,6 +220,9 @@ typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
209#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \220#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
210 (sizeof (arm_exception_state64_t)/sizeof(uint32_t)))221 (sizeof (arm_exception_state64_t)/sizeof(uint32_t)))
211222
223#define ARM_EXCEPTION_STATE64_V2_COUNT ((mach_msg_type_number_t) \
224 (sizeof (arm_exception_state64_v2_t)/sizeof(uint32_t)))
225
212#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \226#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
213 (sizeof (arm_debug_state_t)/sizeof(uint32_t)))227 (sizeof (arm_debug_state_t)/sizeof(uint32_t)))
214228
lib/libc/include/any-macos-any/mach/arm/vm_param.h+5
...@@ -87,6 +87,11 @@...@@ -87,6 +87,11 @@
87#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL87#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL
88#define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL88#define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL
8989
90/*
91 * `MACH_VM_MAX_ADDRESS` is exported to user space, but we don't want this
92 * larger value for `MACH_VM_MAX_ADDRESS` to be exposed outside the kernel.
93 */
94
90#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)95#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)
91#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW)96#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW)
9297
lib/libc/include/any-macos-any/mach/clock_types.h+21-21
...@@ -50,7 +50,7 @@...@@ -50,7 +50,7 @@
50 */50 */
51typedef int alarm_type_t; /* alarm time type */51typedef int alarm_type_t; /* alarm time type */
52typedef int sleep_type_t; /* sleep time type */52typedef int sleep_type_t; /* sleep time type */
53typedef int clock_id_t; /* clock identification type */53typedef int clock_id_t; /* clock identification type */
54typedef int clock_flavor_t; /* clock flavor type */54typedef int clock_flavor_t; /* clock flavor type */
55typedef int *clock_attr_t; /* clock attribute type */55typedef int *clock_attr_t; /* clock attribute type */
56typedef int clock_res_t; /* clock resolution type */56typedef int clock_res_t; /* clock resolution type */
...@@ -60,7 +60,7 @@ typedef int clock_res_t; /* clock resolution type */...@@ -60,7 +60,7 @@ typedef int clock_res_t; /* clock resolution type */
60 */60 */
61struct mach_timespec {61struct mach_timespec {
62 unsigned int tv_sec; /* seconds */62 unsigned int tv_sec; /* seconds */
63 clock_res_t tv_nsec; /* nanoseconds */63 clock_res_t tv_nsec; /* nanoseconds */
64};64};
65typedef struct mach_timespec mach_timespec_t;65typedef struct mach_timespec mach_timespec_t;
6666
...@@ -86,39 +86,39 @@ typedef struct mach_timespec mach_timespec_t;...@@ -86,39 +86,39 @@ typedef struct mach_timespec mach_timespec_t;
86#define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */86#define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */
87#define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */87#define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */
8888
89#define BAD_MACH_TIMESPEC(t) \89#define BAD_MACH_TIMESPEC(t) \
90 ((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)90 ((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)
9191
92/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */92/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */
93#define CMP_MACH_TIMESPEC(t1, t2) \93#define CMP_MACH_TIMESPEC(t1, t2) \
94 ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \94 ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
95 ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \95 ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
96 (t1)->tv_nsec - (t2)->tv_nsec))96 (t1)->tv_nsec - (t2)->tv_nsec))
9797
98/* t1 += t2 */98/* t1 += t2 */
99#define ADD_MACH_TIMESPEC(t1, t2) \99#define ADD_MACH_TIMESPEC(t1, t2) \
100 do { \100 do { \
101 if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \101 if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
102 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \102 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \
103 (t1)->tv_sec += 1; \103 (t1)->tv_sec += 1; \
104 } \104 } \
105 (t1)->tv_sec += (t2)->tv_sec; \105 (t1)->tv_sec += (t2)->tv_sec; \
106 } while (0)106 } while (0)
107107
108/* t1 -= t2 */108/* t1 -= t2 */
109#define SUB_MACH_TIMESPEC(t1, t2) \109#define SUB_MACH_TIMESPEC(t1, t2) \
110 do { \110 do { \
111 if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \111 if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
112 (t1)->tv_nsec += (long) NSEC_PER_SEC; \112 (t1)->tv_nsec += (long) NSEC_PER_SEC; \
113 (t1)->tv_sec -= 1; \113 (t1)->tv_sec -= 1; \
114 } \114 } \
115 (t1)->tv_sec -= (t2)->tv_sec; \115 (t1)->tv_sec -= (t2)->tv_sec; \
116 } while (0)116 } while (0)
117117
118/*118/*
119 * Alarm parameter defines.119 * Alarm parameter defines.
120 */120 */
121#define ALRMTYPE 0xff /* type (8-bit field) */121#define ALRMTYPE 0xff /* type (8-bit field) */
122#define TIME_ABSOLUTE 0x00 /* absolute time */122#define TIME_ABSOLUTE 0x00 /* absolute time */
123#define TIME_RELATIVE 0x01 /* relative time */123#define TIME_RELATIVE 0x01 /* relative time */
124124
lib/libc/include/any-macos-any/mach/error.h+3
...@@ -99,6 +99,9 @@...@@ -99,6 +99,9 @@
99#define err_ipc err_system(0x3) /* old ipc errors */99#define err_ipc err_system(0x3) /* old ipc errors */
100#define err_mach_ipc err_system(0x4) /* mach-ipc errors */100#define err_mach_ipc err_system(0x4) /* mach-ipc errors */
101#define err_dipc err_system(0x7) /* distributed ipc */101#define err_dipc err_system(0x7) /* distributed ipc */
102#define err_vm err_system(0x8) /* virtual memory */
103/* err_system(0x37) libkern */
104/* err_system(0x38) iokit */
102#define err_local err_system(0x3e) /* user defined errors */105#define err_local err_system(0x3e) /* user defined errors */
103#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */106#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
104107
lib/libc/include/any-macos-any/mach/exception_types.h+5
...@@ -126,6 +126,11 @@...@@ -126,6 +126,11 @@
126 * and thread identity.126 * and thread identity.
127 */127 */
128128
129#define EXCEPTION_STATE_IDENTITY_PROTECTED 5
130/* Send a catch_exception_raise_state_identity_protected message including protected task
131 * and thread identity plus the thread state.
132 */
133
129#define MACH_EXCEPTION_BACKTRACE_PREFERRED 0x20000000134#define MACH_EXCEPTION_BACKTRACE_PREFERRED 0x20000000
130/* Prefer sending a catch_exception_raise_backtrace message, if applicable */135/* Prefer sending a catch_exception_raise_backtrace message, if applicable */
131136
lib/libc/include/any-macos-any/mach/host_info.h+1
...@@ -184,6 +184,7 @@ typedef struct host_priority_info *host_priority_info_t;...@@ -184,6 +184,7 @@ typedef struct host_priority_info *host_priority_info_t;
184#define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */184#define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */
185185
186186
187
187struct host_load_info {188struct host_load_info {
188 integer_t avenrun[3]; /* scaled by LOAD_SCALE */189 integer_t avenrun[3]; /* scaled by LOAD_SCALE */
189 integer_t mach_factor[3]; /* scaled by LOAD_SCALE */190 integer_t mach_factor[3]; /* scaled by LOAD_SCALE */
lib/libc/include/any-macos-any/mach/host_special_ports.h+15-1
...@@ -110,8 +110,10 @@...@@ -110,8 +110,10 @@
110#define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT)110#define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT)
111#define HOST_IOCOMPRESSIONSTATS_PORT (25 + HOST_MAX_SPECIAL_KERNEL_PORT)111#define HOST_IOCOMPRESSIONSTATS_PORT (25 + HOST_MAX_SPECIAL_KERNEL_PORT)
112#define HOST_MEMORY_ERROR_PORT (26 + HOST_MAX_SPECIAL_KERNEL_PORT)112#define HOST_MEMORY_ERROR_PORT (26 + HOST_MAX_SPECIAL_KERNEL_PORT)
113#define HOST_MANAGEDAPPDISTD_PORT (27 + HOST_MAX_SPECIAL_KERNEL_PORT)
114#define HOST_DOUBLEAGENTD_PORT (28 + HOST_MAX_SPECIAL_KERNEL_PORT)
113115
114#define HOST_MAX_SPECIAL_PORT HOST_MEMORY_ERROR_PORT116#define HOST_MAX_SPECIAL_PORT HOST_DOUBLEAGENTD_PORT
115/* MAX = last since rdar://59872249 */117/* MAX = last since rdar://59872249 */
116118
117/* obsolete name */119/* obsolete name */
...@@ -288,6 +290,18 @@...@@ -288,6 +290,18 @@
288#define host_set_memory_error_port(host, port) \290#define host_set_memory_error_port(host, port) \
289 (host_set_special_port((host), HOST_MEMORY_ERROR_PORT, (port)))291 (host_set_special_port((host), HOST_MEMORY_ERROR_PORT, (port)))
290292
293#define host_get_managedappdistd_port(host, port) \
294 (host_get_special_port((host), \
295 HOST_LOCAL_NODE, HOST_MANAGEDAPPDISTD_PORT, (port)))
296#define host_set_managedappdistd_port(host, port) \
297 (host_set_special_port((host), HOST_MANAGEDAPPDISTD_PORT, (port)))
298
299#define host_get_doubleagentd_port(host, port) \
300 (host_get_special_port((host), \
301 HOST_LOCAL_NODE, HOST_DOUBLEAGENTD_PORT, (port)))
302#define host_set_doubleagentd_port(host, port) \
303 (host_set_special_port((host), HOST_DOUBLEAGENTD_PORT, (port)))
304
291/* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences.305/* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences.
292 * All lookups go through send_resource_violation()306 * All lookups go through send_resource_violation()
293 */307 */
lib/libc/include/any-macos-any/mach/i386/thread_status.h+1
...@@ -125,6 +125,7 @@...@@ -125,6 +125,7 @@
125#define x86_THREAD_FULL_STATE64 23125#define x86_THREAD_FULL_STATE64 23
126#define x86_INSTRUCTION_STATE 24126#define x86_INSTRUCTION_STATE 24
127#define x86_LAST_BRANCH_STATE 25127#define x86_LAST_BRANCH_STATE 25
128#define THREAD_STATE_FLAVORS 26 /* This must be updated to 1 more than the highest numerical state flavor */
128129
129/*130/*
130 * Largest state on this machine:131 * Largest state on this machine:
lib/libc/include/any-macos-any/mach/machine.h+12-4
...@@ -118,10 +118,11 @@ typedef integer_t cpu_threadtype_t;...@@ -118,10 +118,11 @@ typedef integer_t cpu_threadtype_t;
118#define CPU_TYPE_POWERPC ((cpu_type_t) 18)118#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
119#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)119#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
120/* skip ((cpu_type_t) 19) */120/* skip ((cpu_type_t) 19) */
121/* skip ((cpu_type_t) 20 */121/* skip ((cpu_type_t) 20) */
122/* skip ((cpu_type_t) 21 */122/* skip ((cpu_type_t) 21) */
123/* skip ((cpu_type_t) 22 */123/* skip ((cpu_type_t) 22) */
124/* skip ((cpu_type_t) 23 */124/* skip ((cpu_type_t) 23) */
125/* skip ((cpu_type_t) 24) */
125126
126/*127/*
127 * Machine subtypes (these are defined here, instead of in a machine128 * Machine subtypes (these are defined here, instead of in a machine
...@@ -349,6 +350,7 @@ typedef integer_t cpu_threadtype_t;...@@ -349,6 +350,7 @@ typedef integer_t cpu_threadtype_t;
349#define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0)350#define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0)
350#define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1)351#define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1)
351352
353
352#endif /* !__ASSEMBLER__ */354#endif /* !__ASSEMBLER__ */
353355
354/*356/*
...@@ -396,7 +398,13 @@ typedef integer_t cpu_threadtype_t;...@@ -396,7 +398,13 @@ typedef integer_t cpu_threadtype_t;
396#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3398#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
397#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d399#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d
398#define CPUFAMILY_ARM_EVEREST_SAWTOOTH 0x8765edea400#define CPUFAMILY_ARM_EVEREST_SAWTOOTH 0x8765edea
401#define CPUFAMILY_ARM_IBIZA 0xfa33415e
402#define CPUFAMILY_ARM_PALMA 0x72015832
399#define CPUFAMILY_ARM_COLL 0x2876f5b5403#define CPUFAMILY_ARM_COLL 0x2876f5b5
404#define CPUFAMILY_ARM_LOBOS 0x5f4dea93
405#define CPUFAMILY_ARM_DONAN 0x6f5129ac
406#define CPUFAMILY_ARM_TAHITI 0x75d4acb9
407#define CPUFAMILY_ARM_TUPAI 0x204526d0
400408
401/* Described in rdar://64125549 */409/* Described in rdar://64125549 */
402#define CPUSUBFAMILY_UNKNOWN 0410#define CPUSUBFAMILY_UNKNOWN 0
lib/libc/include/any-macos-any/mach/memory_object_types.h+1
...@@ -279,6 +279,7 @@ typedef struct memory_object_attr_info memory_object_attr_info_data_t;...@@ -279,6 +279,7 @@ typedef struct memory_object_attr_info memory_object_attr_info_data_t;
279 & 0xFF000000) | ((flags) & 0xFFFFFF));279 & 0xFF000000) | ((flags) & 0xFFFFFF));
280280
281/* leave room for vm_prot bits (0xFF ?) */281/* leave room for vm_prot bits (0xFF ?) */
282#define MAP_MEM_PROT_MASK 0xFF
282#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */283#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */
283#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */284#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */
284#define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */285#define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */
lib/libc/include/any-macos-any/mach/message.h+14-4
...@@ -71,8 +71,10 @@...@@ -71,8 +71,10 @@
71#ifndef _MACH_MESSAGE_H_71#ifndef _MACH_MESSAGE_H_
72#define _MACH_MESSAGE_H_72#define _MACH_MESSAGE_H_
7373
74#include <stddef.h>
74#include <stdint.h>75#include <stdint.h>
75#include <machine/limits.h>76#include <machine/limits.h>
77#include <machine/types.h> /* user_addr_t */
76#include <mach/port.h>78#include <mach/port.h>
77#include <mach/boolean.h>79#include <mach/boolean.h>
78#include <mach/kern_return.h>80#include <mach/kern_return.h>
...@@ -81,6 +83,9 @@...@@ -81,6 +83,9 @@
81#include <sys/cdefs.h>83#include <sys/cdefs.h>
82#include <sys/appleapiopts.h>84#include <sys/appleapiopts.h>
83#include <Availability.h>85#include <Availability.h>
86#if __has_feature(ptrauth_calls)
87#include <ptrauth.h>
88#endif
8489
85/*90/*
86 * The timeout mechanism uses mach_msg_timeout_t values,91 * The timeout mechanism uses mach_msg_timeout_t values,
...@@ -281,6 +286,8 @@ typedef unsigned int mach_msg_descriptor_type_t;...@@ -281,6 +286,8 @@ typedef unsigned int mach_msg_descriptor_type_t;
281286
282#define MACH_MSG_DESCRIPTOR_MAX MACH_MSG_GUARDED_PORT_DESCRIPTOR287#define MACH_MSG_DESCRIPTOR_MAX MACH_MSG_GUARDED_PORT_DESCRIPTOR
283288
289#define __ipc_desc_sign(d)
290
284#pragma pack(push, 4)291#pragma pack(push, 4)
285292
286typedef struct {293typedef struct {
...@@ -292,7 +299,6 @@ typedef struct {...@@ -292,7 +299,6 @@ typedef struct {
292299
293typedef struct {300typedef struct {
294 mach_port_t name;301 mach_port_t name;
295// Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes
296 mach_msg_size_t pad1;302 mach_msg_size_t pad1;
297 unsigned int pad2 : 16;303 unsigned int pad2 : 16;
298 mach_msg_type_name_t disposition : 8;304 mach_msg_type_name_t disposition : 8;
...@@ -319,7 +325,7 @@ typedef struct {...@@ -319,7 +325,7 @@ typedef struct {
319} mach_msg_ool_descriptor64_t;325} mach_msg_ool_descriptor64_t;
320326
321typedef struct {327typedef struct {
322 void* address;328 void *address;
323#if !defined(__LP64__)329#if !defined(__LP64__)
324 mach_msg_size_t size;330 mach_msg_size_t size;
325#endif331#endif
...@@ -351,7 +357,7 @@ typedef struct {...@@ -351,7 +357,7 @@ typedef struct {
351} mach_msg_ool_ports_descriptor64_t;357} mach_msg_ool_ports_descriptor64_t;
352358
353typedef struct {359typedef struct {
354 void* address;360 void *address;
355#if !defined(__LP64__)361#if !defined(__LP64__)
356 mach_msg_size_t count;362 mach_msg_size_t count;
357#endif363#endif
...@@ -398,7 +404,7 @@ typedef struct {...@@ -398,7 +404,7 @@ typedef struct {
398 * appropriate in LP64 mode because not all descriptors404 * appropriate in LP64 mode because not all descriptors
399 * are of the same size in that environment.405 * are of the same size in that environment.
400 */406 */
401typedef union{407typedef union {
402 mach_msg_port_descriptor_t port;408 mach_msg_port_descriptor_t port;
403 mach_msg_ool_descriptor_t out_of_line;409 mach_msg_ool_descriptor_t out_of_line;
404 mach_msg_ool_ports_descriptor_t ool_ports;410 mach_msg_ool_ports_descriptor_t ool_ports;
...@@ -667,6 +673,10 @@ typedef natural_t mach_msg_type_number_t;...@@ -667,6 +673,10 @@ typedef natural_t mach_msg_type_number_t;
667 (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \673 (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
668 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))674 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
669675
676#define MACH_MSG_TYPE_PORT_ANY_SEND_ONCE(x) \
677 (((x) == MACH_MSG_TYPE_MOVE_SEND_ONCE) || \
678 ((x) == MACH_MSG_TYPE_MAKE_SEND_ONCE))
679
670#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \680#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
671 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \681 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
672 ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))682 ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
lib/libc/include/any-macos-any/mach/port.h+21-24
...@@ -195,40 +195,37 @@ typedef natural_t mach_port_right_t;...@@ -195,40 +195,37 @@ typedef natural_t mach_port_right_t;
195#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) /* obsolete right */195#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) /* obsolete right */
196#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) /* right not implemented */196#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) /* right not implemented */
197197
198#define MACH_PORT_TYPE(right) \
199 ((mach_port_type_t)(((mach_port_type_t) 1) \
200 << ((right) + ((mach_port_right_t) 16))))
198201
199typedef natural_t mach_port_type_t;202typedef natural_t mach_port_type_t;
200typedef mach_port_type_t *mach_port_type_array_t;203typedef mach_port_type_t *mach_port_type_array_t;
201204
202#define MACH_PORT_TYPE(right) \205#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
203 ((mach_port_type_t)(((mach_port_type_t) 1) \206#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
204 << ((right) + ((mach_port_right_t) 16))))207#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
205#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)208#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
206#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)209#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
207#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)210#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
208#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)211#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */
209#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)212/* Dummy type bits that mach_port_type/mach_port_names can return. */
210#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)213#define MACH_PORT_TYPE_DNREQUEST 0x80000000
211#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */214#define MACH_PORT_TYPE_SPREQUEST 0x40000000
212215#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
213216
214/* Convenient combinations. */217/* Convenient combinations. */
215218
216#define MACH_PORT_TYPE_SEND_RECEIVE \219#define MACH_PORT_TYPE_SEND_RECEIVE \
217 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)220 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
218#define MACH_PORT_TYPE_SEND_RIGHTS \221#define MACH_PORT_TYPE_SEND_RIGHTS \
219 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)222 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
220#define MACH_PORT_TYPE_PORT_RIGHTS \223#define MACH_PORT_TYPE_PORT_RIGHTS \
221 (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)224 (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
222#define MACH_PORT_TYPE_PORT_OR_DEAD \225#define MACH_PORT_TYPE_PORT_OR_DEAD \
223 (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)226 (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
224#define MACH_PORT_TYPE_ALL_RIGHTS \227#define MACH_PORT_TYPE_ALL_RIGHTS \
225 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)228 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
226
227/* Dummy type bits that mach_port_type/mach_port_names can return. */
228
229#define MACH_PORT_TYPE_DNREQUEST 0x80000000
230#define MACH_PORT_TYPE_SPREQUEST 0x40000000
231#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
232229
233/* User-references for capabilities. */230/* User-references for capabilities. */
234231
...@@ -368,7 +365,7 @@ typedef struct mach_service_port_info * mach_service_port_info_t;...@@ -368,7 +365,7 @@ typedef struct mach_service_port_info * mach_service_port_info_t;
368#define MPO_REPLY_PORT 0x1000 /* Designate port as a reply port. */365#define MPO_REPLY_PORT 0x1000 /* Designate port as a reply port. */
369#define MPO_ENFORCE_REPLY_PORT_SEMANTICS 0x2000 /* When talking to this port, local port of mach msg needs to follow reply port semantics.*/366#define MPO_ENFORCE_REPLY_PORT_SEMANTICS 0x2000 /* When talking to this port, local port of mach msg needs to follow reply port semantics.*/
370#define MPO_PROVISIONAL_REPLY_PORT 0x4000 /* Designate port as a provisional reply port. */367#define MPO_PROVISIONAL_REPLY_PORT 0x4000 /* Designate port as a provisional reply port. */
371#define MPO_PROVISIONAL_ID_PROT_OPTOUT 0x8000 /* Opted out of EXCEPTION_IDENTITY_PROTECTED violation for now */368#define MPO_EXCEPTION_PORT 0x8000 /* Used for hardened exceptions - immovable */
372369
373370
374/*371/*
...@@ -404,6 +401,7 @@ enum mach_port_guard_exception_codes {...@@ -404,6 +401,7 @@ enum mach_port_guard_exception_codes {
404 kGUARD_EXC_INVALID_OPTIONS = 3,401 kGUARD_EXC_INVALID_OPTIONS = 3,
405 kGUARD_EXC_SET_CONTEXT = 4,402 kGUARD_EXC_SET_CONTEXT = 4,
406 kGUARD_EXC_THREAD_SET_STATE = 5,403 kGUARD_EXC_THREAD_SET_STATE = 5,
404 kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE= 6,
407 kGUARD_EXC_UNGUARDED = 1u << 3,405 kGUARD_EXC_UNGUARDED = 1u << 3,
408 kGUARD_EXC_INCORRECT_GUARD = 1u << 4,406 kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
409 kGUARD_EXC_IMMOVABLE = 1u << 5,407 kGUARD_EXC_IMMOVABLE = 1u << 5,
...@@ -427,7 +425,6 @@ enum mach_port_guard_exception_codes {...@@ -427,7 +425,6 @@ enum mach_port_guard_exception_codes {
427 kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,425 kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
428 kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,426 kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
429 kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 1u << 23,427 kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 1u << 23,
430 kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE = 1u << 24,
431};428};
432429
433#define MAX_FATAL_kGUARD_EXC_CODE (1u << 7)430#define MAX_FATAL_kGUARD_EXC_CODE (1u << 7)
lib/libc/include/any-macos-any/mach/task.h+55-4
...@@ -52,7 +52,7 @@ typedef function_table_entry *function_table_t;...@@ -52,7 +52,7 @@ typedef function_table_entry *function_table_t;
52#endif /* AUTOTEST */52#endif /* AUTOTEST */
5353
54#ifndef task_MSG_COUNT54#ifndef task_MSG_COUNT
55#define task_MSG_COUNT 6555#define task_MSG_COUNT 66
56#endif /* task_MSG_COUNT */56#endif /* task_MSG_COUNT */
5757
58#include <Availability.h>58#include <Availability.h>
...@@ -933,6 +933,23 @@ kern_return_t task_map_kcdata_object_64...@@ -933,6 +933,23 @@ kern_return_t task_map_kcdata_object_64
933 mach_vm_size_t *kcd_size933 mach_vm_size_t *kcd_size
934);934);
935935
936/* Routine task_register_hardened_exception_handler */
937#ifdef mig_external
938mig_external
939#else
940extern
941#endif /* mig_external */
942__TVOS_PROHIBITED __WATCHOS_PROHIBITED
943kern_return_t task_register_hardened_exception_handler
944(
945 task_t task,
946 uint32_t signed_pc_key,
947 exception_mask_t exceptions_allowed,
948 exception_behavior_t behaviors_allowed,
949 thread_state_flavor_t flavors_allowed,
950 mach_port_t new_exception_port
951);
952
936__END_DECLS953__END_DECLS
937954
938/********************** Caution **************************/955/********************** Caution **************************/
...@@ -1035,7 +1052,7 @@ __END_DECLS...@@ -1035,7 +1052,7 @@ __END_DECLS
1035 NDR_record_t NDR;1052 NDR_record_t NDR;
1036 task_flavor_t flavor;1053 task_flavor_t flavor;
1037 mach_msg_type_number_t task_info_inCnt;1054 mach_msg_type_number_t task_info_inCnt;
1038 integer_t task_info_in[90];1055 integer_t task_info_in[94];
1039 } __Request__task_set_info_t __attribute__((unused));1056 } __Request__task_set_info_t __attribute__((unused));
1040#ifdef __MigPackStructs1057#ifdef __MigPackStructs
1041#pragma pack(pop)1058#pragma pack(pop)
...@@ -1773,6 +1790,25 @@ __END_DECLS...@@ -1773,6 +1790,25 @@ __END_DECLS
1773#ifdef __MigPackStructs1790#ifdef __MigPackStructs
1774#pragma pack(pop)1791#pragma pack(pop)
1775#endif1792#endif
1793
1794#ifdef __MigPackStructs
1795#pragma pack(push, 4)
1796#endif
1797 typedef struct {
1798 mach_msg_header_t Head;
1799 /* start of the kernel processed data */
1800 mach_msg_body_t msgh_body;
1801 mach_msg_port_descriptor_t new_exception_port;
1802 /* end of the kernel processed data */
1803 NDR_record_t NDR;
1804 uint32_t signed_pc_key;
1805 exception_mask_t exceptions_allowed;
1806 exception_behavior_t behaviors_allowed;
1807 thread_state_flavor_t flavors_allowed;
1808 } __Request__task_register_hardened_exception_handler_t __attribute__((unused));
1809#ifdef __MigPackStructs
1810#pragma pack(pop)
1811#endif
1776#endif /* !__Request__task_subsystem__defined */1812#endif /* !__Request__task_subsystem__defined */
17771813
1778/* union of all requests */1814/* union of all requests */
...@@ -1843,6 +1879,7 @@ union __RequestUnion__task_subsystem {...@@ -1843,6 +1879,7 @@ union __RequestUnion__task_subsystem {
1843 __Request__task_set_corpse_forking_behavior_t Request_task_set_corpse_forking_behavior;1879 __Request__task_set_corpse_forking_behavior_t Request_task_set_corpse_forking_behavior;
1844 __Request__task_test_async_upcall_propagation_t Request_task_test_async_upcall_propagation;1880 __Request__task_test_async_upcall_propagation_t Request_task_test_async_upcall_propagation;
1845 __Request__task_map_kcdata_object_64_t Request_task_map_kcdata_object_64;1881 __Request__task_map_kcdata_object_64_t Request_task_map_kcdata_object_64;
1882 __Request__task_register_hardened_exception_handler_t Request_task_register_hardened_exception_handler;
1846};1883};
1847#endif /* !__RequestUnion__task_subsystem__defined */1884#endif /* !__RequestUnion__task_subsystem__defined */
1848/* typedefs for all replies */1885/* typedefs for all replies */
...@@ -1928,7 +1965,7 @@ union __RequestUnion__task_subsystem {...@@ -1928,7 +1965,7 @@ union __RequestUnion__task_subsystem {
1928 NDR_record_t NDR;1965 NDR_record_t NDR;
1929 kern_return_t RetCode;1966 kern_return_t RetCode;
1930 mach_msg_type_number_t task_info_outCnt;1967 mach_msg_type_number_t task_info_outCnt;
1931 integer_t task_info_out[90];1968 integer_t task_info_out[94];
1932 } __Reply__task_info_t __attribute__((unused));1969 } __Reply__task_info_t __attribute__((unused));
1933#ifdef __MigPackStructs1970#ifdef __MigPackStructs
1934#pragma pack(pop)1971#pragma pack(pop)
...@@ -2692,6 +2729,18 @@ union __RequestUnion__task_subsystem {...@@ -2692,6 +2729,18 @@ union __RequestUnion__task_subsystem {
2692#ifdef __MigPackStructs2729#ifdef __MigPackStructs
2693#pragma pack(pop)2730#pragma pack(pop)
2694#endif2731#endif
2732
2733#ifdef __MigPackStructs
2734#pragma pack(push, 4)
2735#endif
2736 typedef struct {
2737 mach_msg_header_t Head;
2738 NDR_record_t NDR;
2739 kern_return_t RetCode;
2740 } __Reply__task_register_hardened_exception_handler_t __attribute__((unused));
2741#ifdef __MigPackStructs
2742#pragma pack(pop)
2743#endif
2695#endif /* !__Reply__task_subsystem__defined */2744#endif /* !__Reply__task_subsystem__defined */
26962745
2697/* union of all replies */2746/* union of all replies */
...@@ -2762,6 +2811,7 @@ union __ReplyUnion__task_subsystem {...@@ -2762,6 +2811,7 @@ union __ReplyUnion__task_subsystem {
2762 __Reply__task_set_corpse_forking_behavior_t Reply_task_set_corpse_forking_behavior;2811 __Reply__task_set_corpse_forking_behavior_t Reply_task_set_corpse_forking_behavior;
2763 __Reply__task_test_async_upcall_propagation_t Reply_task_test_async_upcall_propagation;2812 __Reply__task_test_async_upcall_propagation_t Reply_task_test_async_upcall_propagation;
2764 __Reply__task_map_kcdata_object_64_t Reply_task_map_kcdata_object_64;2813 __Reply__task_map_kcdata_object_64_t Reply_task_map_kcdata_object_64;
2814 __Reply__task_register_hardened_exception_handler_t Reply_task_register_hardened_exception_handler;
2765};2815};
2766#endif /* !__RequestUnion__task_subsystem__defined */2816#endif /* !__RequestUnion__task_subsystem__defined */
27672817
...@@ -2829,7 +2879,8 @@ union __ReplyUnion__task_subsystem {...@@ -2829,7 +2879,8 @@ union __ReplyUnion__task_subsystem {
2829 { "task_test_sync_upcall", 3461 },\2879 { "task_test_sync_upcall", 3461 },\
2830 { "task_set_corpse_forking_behavior", 3462 },\2880 { "task_set_corpse_forking_behavior", 3462 },\
2831 { "task_test_async_upcall_propagation", 3463 },\2881 { "task_test_async_upcall_propagation", 3463 },\
2832 { "task_map_kcdata_object_64", 3464 }2882 { "task_map_kcdata_object_64", 3464 },\
2883 { "task_register_hardened_exception_handler", 3465 }
2833#endif2884#endif
28342885
2835#ifdef __AfterMigUserHeader2886#ifdef __AfterMigUserHeader
lib/libc/include/any-macos-any/mach/task_info.h+10-1
...@@ -403,12 +403,21 @@ struct task_vm_info {...@@ -403,12 +403,21 @@ struct task_vm_info {
403403
404 /* added for rev6 */404 /* added for rev6 */
405 int64_t ledger_swapins;405 int64_t ledger_swapins;
406
407 /* added for rev7 */
408 int64_t ledger_tag_neural_nofootprint_total;
409 int64_t ledger_tag_neural_nofootprint_peak;
406};410};
407typedef struct task_vm_info task_vm_info_data_t;411typedef struct task_vm_info task_vm_info_data_t;
408typedef struct task_vm_info *task_vm_info_t;412typedef struct task_vm_info *task_vm_info_t;
409#define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \413#define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \
410 (sizeof (task_vm_info_data_t) / sizeof (natural_t)))414 (sizeof (task_vm_info_data_t) / sizeof (natural_t)))
411#define TASK_VM_INFO_REV6_COUNT TASK_VM_INFO_COUNT415/*
416 * The capacity of task_info_t in mach_types.defs also needs to be adjusted
417 */
418#define TASK_VM_INFO_REV7_COUNT TASK_VM_INFO_COUNT
419#define TASK_VM_INFO_REV6_COUNT /* doesn't include neural total and peak */ \
420 ((mach_msg_type_number_t) (TASK_VM_INFO_REV7_COUNT - 4))
412#define TASK_VM_INFO_REV5_COUNT /* doesn't include ledger swapins */ \421#define TASK_VM_INFO_REV5_COUNT /* doesn't include ledger swapins */ \
413 ((mach_msg_type_number_t) (TASK_VM_INFO_REV6_COUNT - 2))422 ((mach_msg_type_number_t) (TASK_VM_INFO_REV6_COUNT - 2))
414#define TASK_VM_INFO_REV4_COUNT /* doesn't include decompressions */ \423#define TASK_VM_INFO_REV4_COUNT /* doesn't include decompressions */ \
lib/libc/include/any-macos-any/mach/thread_act.h+51-2
...@@ -52,7 +52,7 @@ typedef function_table_entry *function_table_t;...@@ -52,7 +52,7 @@ typedef function_table_entry *function_table_t;
52#endif /* AUTOTEST */52#endif /* AUTOTEST */
5353
54#ifndef thread_act_MSG_COUNT54#ifndef thread_act_MSG_COUNT
55#define thread_act_MSG_COUNT 3155#define thread_act_MSG_COUNT 32
56#endif /* thread_act_MSG_COUNT */56#endif /* thread_act_MSG_COUNT */
5757
58#include <Availability.h>58#include <Availability.h>
...@@ -493,6 +493,22 @@ kern_return_t thread_get_exception_ports_info...@@ -493,6 +493,22 @@ kern_return_t thread_get_exception_ports_info
493 exception_flavor_array_t old_flavors493 exception_flavor_array_t old_flavors
494);494);
495495
496/* Routine thread_adopt_exception_handler */
497#ifdef mig_external
498mig_external
499#else
500extern
501#endif /* mig_external */
502__TVOS_PROHIBITED __WATCHOS_PROHIBITED
503kern_return_t thread_adopt_exception_handler
504(
505 thread_t thread,
506 mach_port_t exc_port,
507 exception_mask_t exc_mask,
508 exception_behavior_t behavior_mask,
509 thread_state_flavor_t flavor_mask
510);
511
496__END_DECLS512__END_DECLS
497513
498/********************** Caution **************************/514/********************** Caution **************************/
...@@ -905,6 +921,24 @@ __END_DECLS...@@ -905,6 +921,24 @@ __END_DECLS
905#ifdef __MigPackStructs921#ifdef __MigPackStructs
906#pragma pack(pop)922#pragma pack(pop)
907#endif923#endif
924
925#ifdef __MigPackStructs
926#pragma pack(push, 4)
927#endif
928 typedef struct {
929 mach_msg_header_t Head;
930 /* start of the kernel processed data */
931 mach_msg_body_t msgh_body;
932 mach_msg_port_descriptor_t exc_port;
933 /* end of the kernel processed data */
934 NDR_record_t NDR;
935 exception_mask_t exc_mask;
936 exception_behavior_t behavior_mask;
937 thread_state_flavor_t flavor_mask;
938 } __Request__thread_adopt_exception_handler_t __attribute__((unused));
939#ifdef __MigPackStructs
940#pragma pack(pop)
941#endif
908#endif /* !__Request__thread_act_subsystem__defined */942#endif /* !__Request__thread_act_subsystem__defined */
909943
910/* union of all requests */944/* union of all requests */
...@@ -942,6 +976,7 @@ union __RequestUnion__thread_act_subsystem {...@@ -942,6 +976,7 @@ union __RequestUnion__thread_act_subsystem {
942 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;976 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
943 __Request__thread_convert_thread_state_t Request_thread_convert_thread_state;977 __Request__thread_convert_thread_state_t Request_thread_convert_thread_state;
944 __Request__thread_get_exception_ports_info_t Request_thread_get_exception_ports_info;978 __Request__thread_get_exception_ports_info_t Request_thread_get_exception_ports_info;
979 __Request__thread_adopt_exception_handler_t Request_thread_adopt_exception_handler;
945};980};
946#endif /* !__RequestUnion__thread_act_subsystem__defined */981#endif /* !__RequestUnion__thread_act_subsystem__defined */
947/* typedefs for all replies */982/* typedefs for all replies */
...@@ -1346,6 +1381,18 @@ union __RequestUnion__thread_act_subsystem {...@@ -1346,6 +1381,18 @@ union __RequestUnion__thread_act_subsystem {
1346#ifdef __MigPackStructs1381#ifdef __MigPackStructs
1347#pragma pack(pop)1382#pragma pack(pop)
1348#endif1383#endif
1384
1385#ifdef __MigPackStructs
1386#pragma pack(push, 4)
1387#endif
1388 typedef struct {
1389 mach_msg_header_t Head;
1390 NDR_record_t NDR;
1391 kern_return_t RetCode;
1392 } __Reply__thread_adopt_exception_handler_t __attribute__((unused));
1393#ifdef __MigPackStructs
1394#pragma pack(pop)
1395#endif
1349#endif /* !__Reply__thread_act_subsystem__defined */1396#endif /* !__Reply__thread_act_subsystem__defined */
13501397
1351/* union of all replies */1398/* union of all replies */
...@@ -1383,6 +1430,7 @@ union __ReplyUnion__thread_act_subsystem {...@@ -1383,6 +1430,7 @@ union __ReplyUnion__thread_act_subsystem {
1383 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;1430 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
1384 __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;1431 __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;
1385 __Reply__thread_get_exception_ports_info_t Reply_thread_get_exception_ports_info;1432 __Reply__thread_get_exception_ports_info_t Reply_thread_get_exception_ports_info;
1433 __Reply__thread_adopt_exception_handler_t Reply_thread_adopt_exception_handler;
1386};1434};
1387#endif /* !__RequestUnion__thread_act_subsystem__defined */1435#endif /* !__RequestUnion__thread_act_subsystem__defined */
13881436
...@@ -1417,7 +1465,8 @@ union __ReplyUnion__thread_act_subsystem {...@@ -1417,7 +1465,8 @@ union __ReplyUnion__thread_act_subsystem {
1417 { "thread_set_mach_voucher", 3626 },\1465 { "thread_set_mach_voucher", 3626 },\
1418 { "thread_swap_mach_voucher", 3627 },\1466 { "thread_swap_mach_voucher", 3627 },\
1419 { "thread_convert_thread_state", 3628 },\1467 { "thread_convert_thread_state", 3628 },\
1420 { "thread_get_exception_ports_info", 3630 }1468 { "thread_get_exception_ports_info", 3630 },\
1469 { "thread_adopt_exception_handler", 3631 }
1421#endif1470#endif
14221471
1423#ifdef __AfterMigUserHeader1472#ifdef __AfterMigUserHeader
lib/libc/include/any-macos-any/mach/vm_behavior.h+1
...@@ -75,5 +75,6 @@ typedef int vm_behavior_t;...@@ -75,5 +75,6 @@ typedef int vm_behavior_t;
75#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)75#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
76#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)76#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
77#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11)77#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11)
78#define VM_BEHAVIOR_ZERO ((vm_behavior_t) 12) /* zero pages without faulting in additional pages */
7879
79#endif /*_MACH_VM_BEHAVIOR_H_*/80#endif /*_MACH_VM_BEHAVIOR_H_*/
lib/libc/include/any-macos-any/mach/vm_region.h+1
...@@ -71,6 +71,7 @@ typedef int *vm_region_recurse_info_64_t;...@@ -71,6 +71,7 @@ typedef int *vm_region_recurse_info_64_t;
71typedef int vm_region_flavor_t;71typedef int vm_region_flavor_t;
72typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];72typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];
7373
74
74#define VM_REGION_BASIC_INFO_64 975#define VM_REGION_BASIC_INFO_64 9
75struct vm_region_basic_info_64 {76struct vm_region_basic_info_64 {
76 vm_prot_t protection;77 vm_prot_t protection;
lib/libc/include/any-macos-any/mach/vm_statistics.h+4-2
...@@ -352,10 +352,12 @@ enum virtual_memory_guard_exception_codes {...@@ -352,10 +352,12 @@ enum virtual_memory_guard_exception_codes {
352#define VM_LEDGER_TAG_UNCHANGED ((int)-1)352#define VM_LEDGER_TAG_UNCHANGED ((int)-1)
353353
354/* individual bits: */354/* individual bits: */
355#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)355#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
356#define VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG (1 << 1)356#define VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG (1 << 1)
357#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)357#define VM_LEDGER_FLAG_FROM_KERNEL (1 << 2)
358358
359#define VM_LEDGER_FLAGS_USER (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)
360#define VM_LEDGER_FLAGS_ALL (VM_LEDGER_FLAGS_USER | VM_LEDGER_FLAG_FROM_KERNEL)
359361
360#define VM_MEMORY_MALLOC 1362#define VM_MEMORY_MALLOC 1
361#define VM_MEMORY_MALLOC_SMALL 2363#define VM_MEMORY_MALLOC_SMALL 2
lib/libc/include/any-macos-any/machine/_endian.h created+42
...@@ -0,0 +1,42 @@
1/*
2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
30 */
31#ifndef _BSD_MACHINE__ENDIAN_H_
32#define _BSD_MACHINE__ENDIAN_H_
33
34#if defined (__i386__) || defined(__x86_64__)
35#include <i386/_endian.h>
36#elif defined (__arm__) || defined (__arm64__)
37#include <arm/_endian.h>
38#else
39#error architecture not supported
40#endif
41
42#endif /* _BSD_MACHINE__ENDIAN_H_ */
lib/libc/include/any-macos-any/malloc/_malloc.h+21-10
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2018 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 2018-2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
...@@ -32,29 +32,40 @@...@@ -32,29 +32,40 @@
3232
33#include <Availability.h>33#include <Availability.h>
34#include <sys/cdefs.h>34#include <sys/cdefs.h>
35#include <_types.h>35#if __has_include(<sys/_types/_size_t.h>)
36#include <sys/_types/_size_t.h>36#include <sys/_types/_size_t.h>
37#else
38#define __need_size_t
39#include <stddef.h>
40#undef __need_size_t
41#endif
42
37#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))43#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
38#include <malloc/_malloc_type.h>44#include <malloc/_malloc_type.h>
39#else45#else
40#define _MALLOC_TYPED(override, type_param_pos)46#define _MALLOC_TYPED(override, type_param_pos)
41#endif47#endif
4248
49#include <malloc/_ptrcheck.h>
50__ptrcheck_abi_assume_single()
51
43__BEGIN_DECLS52__BEGIN_DECLS
4453
45void *malloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_malloc, 1);54void * __sized_by_or_null(__size) malloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_malloc, 1);
46void *calloc(size_t __count, size_t __size) __result_use_check __alloc_size(1,2) _MALLOC_TYPED(malloc_type_calloc, 2);55void * __sized_by_or_null(__count * __size) calloc(size_t __count, size_t __size) __result_use_check __alloc_size(1,2) _MALLOC_TYPED(malloc_type_calloc, 2);
47void free(void *);56void free(void * __unsafe_indexable);
48void *realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_realloc, 2);57void * __sized_by_or_null(__size) realloc(void * __unsafe_indexable __ptr, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_realloc, 2);
58void * __sized_by_or_null(__size) reallocf(void * __unsafe_indexable __ptr, size_t __size) __result_use_check __alloc_size(2);
49#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))59#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
50void *valloc(size_t) __alloc_size(1) _MALLOC_TYPED(malloc_type_valloc, 1);60void * __sized_by_or_null(__size) valloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_valloc, 1);
51#endif /* !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */61#endif /* !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
52#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \62#if (defined(__DARWIN_C_LEVEL) && defined(__DARWIN_C_FULL) && __DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
53 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \63 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
54 (defined(__cplusplus) && __cplusplus >= 201703L)64 (defined(__cplusplus) && __cplusplus >= 201703L)
55void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);65void * __sized_by_or_null(__size) aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
56#endif66#endif
57int posix_memalign(void **__memptr, size_t __alignment, size_t __size) /*__alloc_size(3)*/ _MALLOC_TYPED(malloc_type_posix_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);67/* rdar://120689514 */
68int posix_memalign(void * __unsafe_indexable *__memptr, size_t __alignment, size_t __size) _MALLOC_TYPED(malloc_type_posix_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
5869
59__END_DECLS70__END_DECLS
6071
lib/libc/include/any-macos-any/malloc/_malloc_type.h+29-25
...@@ -24,55 +24,59 @@...@@ -24,55 +24,59 @@
24#ifndef _MALLOC_UNDERSCORE_MALLOC_TYPE_H_24#ifndef _MALLOC_UNDERSCORE_MALLOC_TYPE_H_
25#define _MALLOC_UNDERSCORE_MALLOC_TYPE_H_25#define _MALLOC_UNDERSCORE_MALLOC_TYPE_H_
2626
27/* !!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!27#include <malloc/_ptrcheck.h>
28 * Typed Memory Operations and malloc_type_* functions constitute a private,28__ptrcheck_abi_assume_single()
29 * unstable interface. Don't use it, don't depend on it.29
30 * !!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!30typedef unsigned long long malloc_type_id_t;
31 */
3231
33#if defined(__LP64__) /* MALLOC_TARGET_64BIT */32#if defined(__LP64__) /* MALLOC_TARGET_64BIT */
3433
35/* Included from <malloc/_malloc.h> so carefully manage what we include here. */34// Included from <malloc/_malloc.h> so carefully manage what we include here.
36#include <Availability.h> /* __SPI_AVAILABLE */35#include <Availability.h> /* __SPI_AVAILABLE */
37#include <sys/_types/_size_t.h> /* size_t */36#if __has_include(<sys/_types/_size_t.h>)
37#include <sys/_types/_size_t.h>
38#else
39#define __need_size_t
40#include <stddef.h>
41#undef __need_size_t
42#endif
38#include <sys/cdefs.h> /* __BEGIN_DECLS */43#include <sys/cdefs.h> /* __BEGIN_DECLS */
3944
40#define _MALLOC_TYPE_AVAILABILITY __API_UNAVAILABLE(macos, ios, tvos, watchos, visionos)45#define _MALLOC_TYPE_AVAILABILITY __API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0), visionos(1.0), driverkit(23.0))
4146
42__BEGIN_DECLS47__BEGIN_DECLS
4348
44/* <malloc/_malloc.h> */49/* <malloc/_malloc.h> */
4550
46typedef unsigned long long malloc_type_id_t;51_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_malloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
4752_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(count * size) malloc_type_calloc(size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1,2);
48_MALLOC_TYPE_AVAILABILITY void *malloc_type_malloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);53_MALLOC_TYPE_AVAILABILITY void malloc_type_free(void * __unsafe_indexable ptr, malloc_type_id_t type_id);
49_MALLOC_TYPE_AVAILABILITY void *malloc_type_calloc(size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1,2);54_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_realloc(void * __unsafe_indexable ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
50_MALLOC_TYPE_AVAILABILITY void malloc_type_free(void *ptr, malloc_type_id_t type_id);55_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_valloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
51_MALLOC_TYPE_AVAILABILITY void *malloc_type_realloc(void *ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);56_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_aligned_alloc(size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
52_MALLOC_TYPE_AVAILABILITY void *malloc_type_valloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);57/* rdar://120689514 */
53_MALLOC_TYPE_AVAILABILITY void *malloc_type_aligned_alloc(size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);58_MALLOC_TYPE_AVAILABILITY int malloc_type_posix_memalign(void * __unsafe_indexable *memptr, size_t alignment, size_t size, malloc_type_id_t type_id) /*__alloc_size(3)*/;
54_MALLOC_TYPE_AVAILABILITY int malloc_type_posix_memalign(void **memptr, size_t alignment, size_t size, malloc_type_id_t type_id) /*__alloc_size(3)*/;
5559
5660
57/* <malloc/malloc.h> */61/* <malloc/malloc.h> */
5862
59typedef struct _malloc_zone_t malloc_zone_t;63typedef struct _malloc_zone_t malloc_zone_t;
6064
61_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_malloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);65_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_zone_malloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
62_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_calloc(malloc_zone_t *zone, size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2,3);66_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(count * size) malloc_type_zone_calloc(malloc_zone_t *zone, size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2,3);
63_MALLOC_TYPE_AVAILABILITY void malloc_type_zone_free(malloc_zone_t *zone, void *ptr, malloc_type_id_t type_id);67_MALLOC_TYPE_AVAILABILITY void malloc_type_zone_free(malloc_zone_t *zone, void * __unsafe_indexable ptr, malloc_type_id_t type_id);
64_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_realloc(malloc_zone_t *zone, void *ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);68_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_zone_realloc(malloc_zone_t *zone, void * __unsafe_indexable ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);
65_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_valloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);69_MALLOC_TYPE_AVAILABILITY void *__sized_by_or_null(size) malloc_type_zone_valloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
66_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);70_MALLOC_TYPE_AVAILABILITY void *__sized_by_or_null(size) malloc_type_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);
6771
68__END_DECLS72__END_DECLS
6973
70/* Rewrite enablement */74/* Rewrite enablement */
71#if defined(__has_feature) && __has_feature(typed_memory_operations)75#if defined(__has_feature) && __has_feature(typed_memory_operations)
72#if __has_builtin(__is_target_os) && __is_target_os(ios)76#if __has_builtin(__is_target_os) && (__is_target_os(ios) || __is_target_os(driverkit) || __is_target_os(macos) || (__has_builtin(__is_target_environment) && (__is_target_environment(exclavekit) || __is_target_environment(exclavecore))))
73#define _MALLOC_TYPED(override, type_param_pos) __attribute__((typed_memory_operation(override, type_param_pos)))77#define _MALLOC_TYPED(override, type_param_pos) __attribute__((typed_memory_operation(override, type_param_pos)))
74#define _MALLOC_TYPE_ENABLED 178#define _MALLOC_TYPE_ENABLED 1
75#endif79#endif
76#endif /* defined(__has_feature) && __has_feature(typed_memory_operations) */80#endif /* defined(__has_feature) && __has_feature(typed_memory_operations) */
7781
78#endif /* MALLOC_TARGET_64BIT */82#endif /* MALLOC_TARGET_64BIT */
lib/libc/include/any-macos-any/malloc/_platform.h created+80
...@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2023 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _MALLOC_UNDERSCORE_PLATFORM_H
25#define _MALLOC_UNDERSCORE_PLATFORM_H
26
27#include <malloc/_ptrcheck.h>
28__ptrcheck_abi_assume_single()
29
30#include <stdbool.h>
31#include <stddef.h>
32#include <stdint.h>
33
34#include <sys/cdefs.h>
35#ifndef __DARWIN_EXTSN
36#define __DARWIN_EXTSN(x)
37#endif /* __DARWIN_EXTSN */
38
39#if __has_include(<mach/boolean.h>)
40#include <mach/boolean.h>
41#else
42typedef int boolean_t;
43#endif /* __has_include(<mach/boolean.h>) */
44
45#if __has_include(<mach/kern_return.h>)
46#include <mach/kern_return.h>
47#else
48typedef int kern_return_t;
49#endif /* __has_include(<mach/kern_return.h>) */
50
51#if __has_include(<mach/port.h>)
52#include <mach/port.h>
53#else
54typedef void * __single mach_port_t;
55#endif /* __has_include(<mach/port.h>) */
56
57#if __has_include(<mach/mach_types.h>)
58#include <mach/mach_types.h>
59#else
60typedef mach_port_t task_t;
61#endif /* __has_include(<mach/mach_types.h>) */
62
63#if __has_include(<mach/vm_types.h>)
64#include <mach/vm_types.h>
65#else
66typedef uint64_t mach_vm_address_t;
67typedef uint64_t mach_vm_offset_t;
68typedef uint64_t mach_vm_size_t;
69typedef uintptr_t vm_offset_t;
70typedef vm_offset_t vm_address_t;
71typedef uintptr_t vm_size_t;
72#endif /* __has_include(<mach/vm_types.h>) */
73
74#if __has_include(<malloc/_malloc_type.h>) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
75#include <malloc/_malloc_type.h>
76#else
77#define _MALLOC_TYPED(override, type_param_pos)
78#endif
79
80#endif /* _MALLOC_UNDERSCORE_PLATFORM_H */
lib/libc/include/any-macos-any/malloc/_ptrcheck.h created+43
...@@ -0,0 +1,43 @@
1/*
2 * Copyright (c) 2023 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _MALLOC_UNDERSCORE_PTRCHECK_H_
25#define _MALLOC_UNDERSCORE_PTRCHECK_H_
26
27#if __has_include(<ptrcheck.h>)
28#include <ptrcheck.h>
29#else
30#define __has_ptrcheck 0
31#define __single
32#define __unsafe_indexable
33#define __counted_by(N)
34#define __counted_by_or_null(N)
35#define __sized_by(N)
36#define __sized_by_or_null(N)
37#define __ended_by(E)
38#define __terminated_by(T)
39#define __null_terminated
40#define __ptrcheck_abi_assume_single()
41#endif
42
43#endif /* _MALLOC_UNDERSCORE_PTRCHECK_H_ */
lib/libc/include/any-macos-any/malloc/malloc.h+403-149
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 1999-2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 * 5 *
...@@ -24,15 +24,13 @@...@@ -24,15 +24,13 @@
24#ifndef _MALLOC_MALLOC_H_24#ifndef _MALLOC_MALLOC_H_
25#define _MALLOC_MALLOC_H_25#define _MALLOC_MALLOC_H_
2626
27#include <stddef.h>27#include <TargetConditionals.h>
28#include <mach/mach_types.h>28#include <malloc/_platform.h>
29#include <sys/cdefs.h>
30#include <Availability.h>29#include <Availability.h>
31#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))30#include <os/availability.h>
32#include <malloc/_malloc_type.h>31
33#else32#include <malloc/_ptrcheck.h>
34#define _MALLOC_TYPED(override, type_param_pos)33__ptrcheck_abi_assume_single()
35#endif
3634
37#if __has_feature(ptrauth_calls)35#if __has_feature(ptrauth_calls)
38#include <ptrauth.h>36#include <ptrauth.h>
...@@ -41,19 +39,19 @@...@@ -41,19 +39,19 @@
41// the zone can be copied). Process-independent because the zone structure may39// the zone can be copied). Process-independent because the zone structure may
42// be in the shared library cache.40// be in the shared library cache.
43#define MALLOC_ZONE_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \41#define MALLOC_ZONE_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
44 FALSE, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn42 0, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn
4543
46// Introspection function pointer, address- and type-diversified.44// Introspection function pointer, address- and type-diversified.
47// Process-independent because the malloc_introspection_t structure that contains45// Process-independent because the malloc_introspection_t structure that contains
48// these pointers may be in the shared library cache.46// these pointers may be in the shared library cache.
49#define MALLOC_INTROSPECT_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \47#define MALLOC_INTROSPECT_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
50 TRUE, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn48 1, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn
5149
52// Pointer to the introspection pointer table, type-diversified but not50// Pointer to the introspection pointer table, type-diversified but not
53// address-diversified (because the zone can be copied).51// address-diversified (because the zone can be copied).
54// Process-independent because the table pointer may be in the shared library cache.52// Process-independent because the table pointer may be in the shared library cache.
55#define MALLOC_INTROSPECT_TBL_PTR(ptr) __ptrauth(ptrauth_key_process_independent_data,\53#define MALLOC_INTROSPECT_TBL_PTR(ptr) __ptrauth(ptrauth_key_process_independent_data,\
56 FALSE, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr54 0, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr
5755
58#endif // __has_feature(ptrauth_calls)56#endif // __has_feature(ptrauth_calls)
5957
...@@ -66,155 +64,393 @@...@@ -66,155 +64,393 @@
66__BEGIN_DECLS64__BEGIN_DECLS
67/********* Type definitions ************/65/********* Type definitions ************/
6866
67/*
68 * Only zone implementors should depend on the layout of this structure;
69 * Regular callers should use the access functions below
70 */
69typedef struct _malloc_zone_t {71typedef struct _malloc_zone_t {
70 /* Only zone implementors should depend on the layout of this structure;72 void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */
71 Regular callers should use the access functions below */73 void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */
72 void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */74
73 void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */75 /*
74 size_t (* MALLOC_ZONE_FN_PTR(size))(struct _malloc_zone_t *zone, const void *ptr); /* returns the size of a block or 0 if not in this zone; must be fast, especially for negative answers */76 * Returns the size of a block or 0 if not in this zone; must be fast,
75 void *(* MALLOC_ZONE_FN_PTR(malloc))(struct _malloc_zone_t *zone, size_t size);77 * especially for negative answers.
76 void *(* MALLOC_ZONE_FN_PTR(calloc))(struct _malloc_zone_t *zone, size_t num_items, size_t size); /* same as malloc, but block returned is set to zero */78 */
77 void *(* MALLOC_ZONE_FN_PTR(valloc))(struct _malloc_zone_t *zone, size_t size); /* same as malloc, but block returned is set to zero and is guaranteed to be page aligned */79 size_t (* MALLOC_ZONE_FN_PTR(size))(struct _malloc_zone_t *zone,
78 void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone, void *ptr);80 const void * __unsafe_indexable ptr);
79 void *(* MALLOC_ZONE_FN_PTR(realloc))(struct _malloc_zone_t *zone, void *ptr, size_t size);81
80 void (* MALLOC_ZONE_FN_PTR(destroy))(struct _malloc_zone_t *zone); /* zone is destroyed and all memory reclaimed */82 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc))(
81 const char *zone_name;83 struct _malloc_zone_t *zone, size_t size);
8284
83 /* Optional batch callbacks; these may be NULL */85 /* Same as malloc, but block returned is set to zero */
84 unsigned (* MALLOC_ZONE_FN_PTR(batch_malloc))(struct _malloc_zone_t *zone, size_t size, void **results, unsigned num_requested); /* given a size, returns pointers capable of holding that size; returns the number of pointers allocated (maybe 0 or less than num_requested) */86 void * __sized_by_or_null(num_items * size) (* MALLOC_ZONE_FN_PTR(calloc))(
85 void (* MALLOC_ZONE_FN_PTR(batch_free))(struct _malloc_zone_t *zone, void **to_be_freed, unsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process */87 struct _malloc_zone_t *zone, size_t num_items, size_t size);
8688
87 struct malloc_introspection_t * MALLOC_INTROSPECT_TBL_PTR(introspect);89 /* Same as malloc, but block returned is guaranteed to be page-aligned */
88 unsigned version;90 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(valloc))(
89 91 struct _malloc_zone_t *zone, size_t size);
90 /* aligned memory allocation. The callback may be NULL. Present in version >= 5. */92
91 void *(* MALLOC_ZONE_FN_PTR(memalign))(struct _malloc_zone_t *zone, size_t alignment, size_t size);93 void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone,
92 94 void * __unsafe_indexable ptr);
93 /* free a pointer known to be in zone and known to have the given size. The callback may be NULL. Present in version >= 6.*/95
94 void (* MALLOC_ZONE_FN_PTR(free_definite_size))(struct _malloc_zone_t *zone, void *ptr, size_t size);96 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(realloc))(
9597 struct _malloc_zone_t *zone, void * __unsafe_indexable ptr,
96 /* Empty out caches in the face of memory pressure. The callback may be NULL. Present in version >= 8. */98 size_t size);
97 size_t (* MALLOC_ZONE_FN_PTR(pressure_relief))(struct _malloc_zone_t *zone, size_t goal);99
100 /* Zone is destroyed and all memory reclaimed */
101 void (* MALLOC_ZONE_FN_PTR(destroy))(struct _malloc_zone_t *zone);
102
103 const char * __null_terminated zone_name;
104
105 /* Optional batch callbacks; these may be NULL */
98106
99 /*107 /*
100 * Checks whether an address might belong to the zone. May be NULL. Present in version >= 10.108 * Given a size, returns pointers capable of holding that size; returns the
101 * False positives are allowed (e.g. the pointer was freed, or it's in zone space that has109 * number of pointers allocated (maybe 0 or less than num_requested)
102 * not yet been allocated. False negatives are not allowed.
103 */110 */
104 boolean_t (* MALLOC_ZONE_FN_PTR(claimed_address))(struct _malloc_zone_t *zone, void *ptr);111 unsigned (* MALLOC_ZONE_FN_PTR(batch_malloc))(struct _malloc_zone_t *zone,
112 size_t size,
113 void * __unsafe_indexable * __counted_by(num_requested) results,
114 unsigned num_requested);
115
116 /*
117 * Frees all the pointers in to_be_freed; note that to_be_freed may be
118 * overwritten during the process
119 */
120 void (* MALLOC_ZONE_FN_PTR(batch_free))(struct _malloc_zone_t *zone,
121 void * __unsafe_indexable * __counted_by(num_to_be_freed) to_be_freed,
122 unsigned num_to_be_freed);
123
124 struct malloc_introspection_t * MALLOC_INTROSPECT_TBL_PTR(introspect);
125 unsigned version;
126
127 /* Aligned memory allocation. May be NULL. Present in version >= 5. */
128 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(memalign))(
129 struct _malloc_zone_t *zone, size_t alignment, size_t size);
130
131 /*
132 * Free a pointer known to be in zone and known to have the given size.
133 * May be NULL. Present in version >= 6.
134 */
135 void (* MALLOC_ZONE_FN_PTR(free_definite_size))(struct _malloc_zone_t *zone,
136 void * __sized_by(size) ptr, size_t size);
137
138 /*
139 * Empty out caches in the face of memory pressure. May be NULL.
140 * Present in version >= 8.
141 */
142 size_t (* MALLOC_ZONE_FN_PTR(pressure_relief))(struct _malloc_zone_t *zone,
143 size_t goal);
144
145 /*
146 * Checks whether an address might belong to the zone. May be NULL. Present
147 * in version >= 10. False positives are allowed (e.g. the pointer was
148 * freed, or it's in zone space that has not yet been allocated. False
149 * negatives are not allowed.
150 */
151 boolean_t (* MALLOC_ZONE_FN_PTR(claimed_address))(
152 struct _malloc_zone_t *zone, void * __unsafe_indexable ptr);
153
154 /*
155 * For libmalloc-internal zone 0 implementations only: try to free ptr,
156 * promising to call find_zone_and_free if it turns out not to belong to us.
157 * May be present in version >= 13.
158 */
159 void (* MALLOC_ZONE_FN_PTR(try_free_default))(struct _malloc_zone_t *zone,
160 void * __unsafe_indexable ptr);
161
162 /*
163 * Memory allocation with an extensible binary flags option. Currently for
164 * libmalloc-internal zone implementations only - should be NULL otherwise.
165 * Added in version >= 15.
166 */
167 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_with_options))(
168 struct _malloc_zone_t *zone, size_t align, size_t size,
169 uint64_t options);
170
171 /*
172 * Typed Memory Operations versions of zone functions. Present in
173 * version >= 16.
174 */
175
176 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_malloc))(
177 struct _malloc_zone_t *zone, size_t size, malloc_type_id_t type_id);
105178
106 /* For zone 0 implementations: try to free ptr, promising to call find_zone_and_free179 void * __sized_by_or_null(count * size) (* MALLOC_ZONE_FN_PTR(malloc_type_calloc))(
107 * if it turns out not to belong to us */180 struct _malloc_zone_t *zone, size_t count, size_t size,
108 void (* MALLOC_ZONE_FN_PTR(try_free_default))(struct _malloc_zone_t *zone, void *ptr);181 malloc_type_id_t type_id);
182
183 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_realloc))(
184 struct _malloc_zone_t *zone, void * __unsafe_indexable ptr,
185 size_t size, malloc_type_id_t type_id);
186
187 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_memalign))(
188 struct _malloc_zone_t *zone, size_t alignment, size_t size,
189 malloc_type_id_t type_id);
190
191 /* Must be NULL for non-libmalloc zone implementations */
192 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_malloc_with_options))(
193 struct _malloc_zone_t *zone, size_t align, size_t size, uint64_t options,
194 malloc_type_id_t type_id);
109} malloc_zone_t;195} malloc_zone_t;
110196
197/*!
198 * @enum malloc_type_callsite_flags_v0_t
199 *
200 * Information about where and how malloc was called
201 *
202 * @constant MALLOC_TYPE_CALLSITE_FLAGS_V0_FIXED_SIZE
203 * Set in malloc_type_summary_v0_t if the call to malloc was called with a fixed
204 * size. Note that, at present, this bit is set in all callsites where the
205 * compiler rewrites a call to malloc
206 *
207 * @constant MALLOC_TYPE_CALLSITE_FLAGS_V0_ARRAY
208 * Set in malloc_type_summary_v0_t if the type being allocated is an array, e.g.
209 * allocated via new[] or calloc(count, size)
210 */
211typedef enum {
212 MALLOC_TYPE_CALLSITE_FLAGS_V0_NONE = 0,
213 MALLOC_TYPE_CALLSITE_FLAGS_V0_FIXED_SIZE = 1 << 0,
214 MALLOC_TYPE_CALLSITE_FLAGS_V0_ARRAY = 1 << 1,
215} malloc_type_callsite_flags_v0_t;
216
217/*!
218 * @enum malloc_type_kind_v0_t
219 *
220 * @constant MALLOC_TYPE_KIND_V0_OTHER
221 * Default allocation type, used for most calls to malloc
222 *
223 * @constant MALLOC_TYPE_KIND_V0_OBJC
224 * Marks a type allocated by libobjc
225 *
226 * @constant MALLOC_TYPE_KIND_V0_SWIFT
227 * Marks a type allocated by the Swift runtime
228 *
229 * @constant MALLOC_TYPE_KIND_V0_CXX
230 * Marks a type allocated by the C++ runtime's operator new
231 */
232typedef enum {
233 MALLOC_TYPE_KIND_V0_OTHER = 0,
234 MALLOC_TYPE_KIND_V0_OBJC = 1,
235 MALLOC_TYPE_KIND_V0_SWIFT = 2,
236 MALLOC_TYPE_KIND_V0_CXX = 3
237} malloc_type_kind_v0_t;
238
239/*!
240 * @struct malloc_type_layout_semantics_v0_t
241 *
242 * @field contains_data_pointer
243 * True if the allocated type or any of its fields is a pointer
244 * to a data type (i.e. the pointee contains no pointers)
245 *
246 * @field contains_struct_pointer
247 * True if the allocated type or any of its fields is a pointer
248 * to a struct or union
249 *
250 * @field contains_immutable_pointer
251 * True if the allocated type or any of its fields is a const pointer
252 *
253 * @field contains_anonymous_pointer
254 * True if the allocated type or any of its fields is a pointer
255 * to something other than a struct or data type
256 *
257 * @field is_reference_counted
258 * True if the allocated type is reference counted
259 *
260 * @field contains_generic_data
261 * True if the allocated type or any of its fields are not pointers
262 */
263typedef struct {
264 bool contains_data_pointer : 1;
265 bool contains_struct_pointer : 1;
266 bool contains_immutable_pointer : 1;
267 bool contains_anonymous_pointer : 1;
268 bool is_reference_counted : 1;
269 uint16_t reserved_0 : 3;
270 bool contains_generic_data : 1;
271 uint16_t reserved_1 : 7;
272} malloc_type_layout_semantics_v0_t;
273
274/*!
275 * @struct malloc_type_summary_v0_t
276 *
277 * @field version
278 * Versioning field of the type summary. Set to 0 for the current verison. New
279 * fields can be added where the reserved fields currently are without
280 * incrementing the version, as long as they are non-breaking.
281 *
282 * @field callsite_flags
283 * Details from the callsite of malloc inferred by the compiler
284 *
285 * @field type_kind
286 * Details about the runtime making the allocation
287 *
288 * @field layout_semantics
289 * Details about what kinds of data are contained in the type being allocated
290 *
291 * @discussion
292 * The reserved fields should not be read from or written to, and may be
293 * used for additional fields and information in future versions
294 */
295typedef struct {
296 uint32_t version : 4;
297 uint32_t reserved_0 : 2;
298 malloc_type_callsite_flags_v0_t callsite_flags : 4;
299 malloc_type_kind_v0_t type_kind : 2;
300 uint32_t reserved_1 : 4;
301 malloc_type_layout_semantics_v0_t layout_semantics;
302} malloc_type_summary_v0_t;
303
304/*!
305 * @union malloc_type_descriptor_v0_t
306 *
307 * @field hash
308 * Hash of the type layout of the allocated type, or if type inference failed,
309 * the hash of the callsite's file, line and column. The hash allows the
310 * allocator to disambiguate between different types with the same summary, e.g.
311 * types that have the same fields in different orders.
312 *
313 * @field summary
314 * Details of the type being allocated
315 *
316 * @field type_id
317 * opaque type used for punning
318 *
319 * @discussion
320 * Use malloc_type_descriptor_v0_t to decode the opaque malloc_type_id_t with
321 * version == 0 into a malloc_type_summary_v0_t:
322 *
323 * <code>
324 * malloc_type_descriptor_v0_t desc = (malloc_type_descriptor_v0_t){ .type_id = id };
325 * </code>
326 *
327 * See LLVM documentation for more details
328 */
329typedef union {
330 struct {
331 uint32_t hash;
332 malloc_type_summary_v0_t summary;
333 };
334 malloc_type_id_t type_id;
335} malloc_type_descriptor_v0_t;
336
111/********* Creation and destruction ************/337/********* Creation and destruction ************/
112338
113extern malloc_zone_t *malloc_default_zone(void);339extern malloc_zone_t *malloc_default_zone(void);
114 /* The initial zone */340 /* The initial zone */
115341
342#if !0 && !0
116extern malloc_zone_t *malloc_create_zone(vm_size_t start_size, unsigned flags);343extern malloc_zone_t *malloc_create_zone(vm_size_t start_size, unsigned flags);
117 /* Creates a new zone with default behavior and registers it */344 /* Creates a new zone with default behavior and registers it */
118345
119extern void malloc_destroy_zone(malloc_zone_t *zone);346extern void malloc_destroy_zone(malloc_zone_t *zone);
120 /* Destroys zone and everything it allocated */347 /* Destroys zone and everything it allocated */
348#endif
121349
122/********* Block creation and manipulation ************/350/********* Block creation and manipulation ************/
123351
124extern void *malloc_zone_malloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_malloc, 2);352extern void * __sized_by_or_null(size) malloc_zone_malloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_malloc, 2);
125 /* Allocates a new pointer of size size; zone must be non-NULL */353 /* Allocates a new pointer of size size; zone must be non-NULL */
126354
127extern void *malloc_zone_calloc(malloc_zone_t *zone, size_t num_items, size_t size) __alloc_size(2,3) _MALLOC_TYPED(malloc_type_zone_calloc, 3);355extern void * __sized_by_or_null(num_items * size) malloc_zone_calloc(malloc_zone_t *zone, size_t num_items, size_t size) __alloc_size(2,3) _MALLOC_TYPED(malloc_type_zone_calloc, 3);
128 /* Allocates a new pointer of size num_items * size; block is cleared; zone must be non-NULL */356 /* Allocates a new pointer of size num_items * size; block is cleared; zone must be non-NULL */
129357
130extern void *malloc_zone_valloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_valloc, 2);358extern void * __sized_by_or_null(size) malloc_zone_valloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_valloc, 2);
131 /* Allocates a new pointer of size size; zone must be non-NULL; Pointer is guaranteed to be page-aligned and block is cleared */359 /* Allocates a new pointer of size size; zone must be non-NULL; Pointer is guaranteed to be page-aligned and block is cleared */
132360
133extern void malloc_zone_free(malloc_zone_t *zone, void *ptr);361extern void malloc_zone_free(malloc_zone_t *zone, void * __unsafe_indexable ptr);
134 /* Frees pointer in zone; zone must be non-NULL */362 /* Frees pointer in zone; zone must be non-NULL */
135363
136extern void *malloc_zone_realloc(malloc_zone_t *zone, void *ptr, size_t size) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_realloc, 3);364extern void * __sized_by_or_null(size) malloc_zone_realloc(malloc_zone_t *zone, void * __unsafe_indexable ptr, size_t size) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_realloc, 3);
137 /* Enlarges block if necessary; zone must be non-NULL */365 /* Enlarges block if necessary; zone must be non-NULL */
138366
139extern malloc_zone_t *malloc_zone_from_ptr(const void *ptr);367extern malloc_zone_t *malloc_zone_from_ptr(const void * __unsafe_indexable ptr);
140 /* Returns the zone for a pointer, or NULL if not in any zone.368 /* Returns the zone for a pointer, or NULL if not in any zone.
141 The ptr must have been returned from a malloc or realloc call. */369 The ptr must have been returned from a malloc or realloc call. */
142370
143extern size_t malloc_size(const void *ptr);371extern size_t malloc_size(const void * __unsafe_indexable ptr);
144 /* Returns size of given ptr, including any padding inserted by the allocator */372 /* Returns size of given ptr, including any padding inserted by the allocator */
145373
146extern size_t malloc_good_size(size_t size);374extern size_t malloc_good_size(size_t size);
147 /* Returns number of bytes greater than or equal to size that can be allocated without padding */375 /* Returns number of bytes greater than or equal to size that can be allocated without padding */
148376
149extern void *malloc_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);377extern void * __sized_by_or_null(size) malloc_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) __alloc_align(2) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
150 /* 378 /*
151 * Allocates a new pointer of size size whose address is an exact multiple of alignment.379 * Allocates a new pointer of size size whose address is an exact multiple of alignment.
152 * alignment must be a power of two and at least as large as sizeof(void *).380 * alignment must be a power of two and at least as large as sizeof(void *).
153 * zone must be non-NULL.381 * zone must be non-NULL.
154 */382 */
155383
156/********* Batch methods ************/384/********* Batch methods ************/
157385
158extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t size, void **results, unsigned num_requested);386#if !0 && !0
159 /* Allocates num blocks of the same size; Returns the number truly allocated (may be 0) */387extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t size, void * __unsafe_indexable * __counted_by(num_requested) results, unsigned num_requested);
388 /* Allocates num blocks of the same size; Returns the number truly allocated (may be 0) */
160389
161extern void malloc_zone_batch_free(malloc_zone_t *zone, void **to_be_freed, unsigned num);390extern void malloc_zone_batch_free(malloc_zone_t *zone, void * __unsafe_indexable * __counted_by(num) to_be_freed, unsigned num);
162 /* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process; This function will always free even if the zone has no batch callback */391 /* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process; This function will always free even if the zone has no batch callback */
392#endif
163393
164/********* Functions for libcache ************/394/********* Functions for libcache ************/
165395
396#if !0 && !0
166extern malloc_zone_t *malloc_default_purgeable_zone(void) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);397extern malloc_zone_t *malloc_default_purgeable_zone(void) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
167 /* Returns a pointer to the default purgeable_zone. */398 /* Returns a pointer to the default purgeable_zone. */
168399
169extern void malloc_make_purgeable(void *ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);400extern void malloc_make_purgeable(void * __unsafe_indexable ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
170 /* Make an allocation from the purgeable zone purgeable if possible. */401 /* Make an allocation from the purgeable zone purgeable if possible. */
171402
172extern int malloc_make_nonpurgeable(void *ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);403extern int malloc_make_nonpurgeable(void * __unsafe_indexable ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
173 /* Makes an allocation from the purgeable zone nonpurgeable.404 /* Makes an allocation from the purgeable zone nonpurgeable.
174 * Returns zero if the contents were not purged since the last405 * Returns zero if the contents were not purged since the last
175 * call to malloc_make_purgeable, else returns non-zero. */406 * call to malloc_make_purgeable, else returns non-zero. */
407#endif
176408
177/********* Functions for zone implementors ************/409/********* Functions for zone implementors ************/
178410
411#if !0 && !0
179extern void malloc_zone_register(malloc_zone_t *zone);412extern void malloc_zone_register(malloc_zone_t *zone);
180 /* Registers a custom malloc zone; Should typically be called after a 413 /* Registers a custom malloc zone; Should typically be called after a
181 * malloc_zone_t has been filled in with custom methods by a client. See414 * malloc_zone_t has been filled in with custom methods by a client. See
182 * malloc_create_zone for creating additional malloc zones with the415 * malloc_create_zone for creating additional malloc zones with the
183 * default allocation and free behavior. */416 * default allocation and free behavior. */
184417
185extern void malloc_zone_unregister(malloc_zone_t *zone);418extern void malloc_zone_unregister(malloc_zone_t *zone);
186 /* De-registers a zone419 /* De-registers a zone
187 Should typically be called before calling the zone destruction routine */420 Should typically be called before calling the zone destruction routine */
421#endif
188422
189extern void malloc_set_zone_name(malloc_zone_t *zone, const char *name);423extern void malloc_set_zone_name(malloc_zone_t *zone, const char * __null_terminated name);
190 /* Sets the name of a zone */424 /* Sets the name of a zone */
191425
192extern const char *malloc_get_zone_name(malloc_zone_t *zone);426extern const char *malloc_get_zone_name(malloc_zone_t *zone);
193 /* Returns the name of a zone */427 /* Returns the name of a zone */
194428
429#if !0 && !0
195size_t malloc_zone_pressure_relief(malloc_zone_t *zone, size_t goal) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);430size_t malloc_zone_pressure_relief(malloc_zone_t *zone, size_t goal) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
196 /* malloc_zone_pressure_relief() advises the malloc subsystem that the process is under memory pressure and 431 /* malloc_zone_pressure_relief() advises the malloc subsystem that the process is under memory pressure and
197 * that the subsystem should make its best effort towards releasing (i.e. munmap()-ing) "goal" bytes from "zone". 432 * that the subsystem should make its best effort towards releasing (i.e. munmap()-ing) "goal" bytes from "zone".
198 * If "goal" is passed as zero, the malloc subsystem will attempt to achieve maximal pressure relief in "zone". 433 * If "goal" is passed as zero, the malloc subsystem will attempt to achieve maximal pressure relief in "zone".
199 * If "zone" is passed as NULL, all zones are examined for pressure relief opportunities. 434 * If "zone" is passed as NULL, all zones are examined for pressure relief opportunities.
200 * malloc_zone_pressure_relief() returns the number of bytes released. 435 * malloc_zone_pressure_relief() returns the number of bytes released.
201 */436 */
437#endif
202438
203typedef struct {439typedef struct {
204 vm_address_t address;440 vm_address_t address;
205 vm_size_t size;441 vm_size_t size;
206} vm_range_t;442} vm_range_t;
207443
208typedef struct malloc_statistics_t {444typedef struct malloc_statistics_t {
209 unsigned blocks_in_use;445 unsigned blocks_in_use;
210 size_t size_in_use;446 size_t size_in_use;
211 size_t max_size_in_use; /* high water mark of touched memory */447 size_t max_size_in_use; /* high water mark of touched memory */
212 size_t size_allocated; /* reserved in memory */448 size_t size_allocated; /* reserved in memory */
213} malloc_statistics_t;449} malloc_statistics_t;
214450
215typedef kern_return_t memory_reader_t(task_t remote_task, vm_address_t remote_address, vm_size_t size, void **local_memory);451typedef kern_return_t memory_reader_t(task_t remote_task, vm_address_t remote_address, vm_size_t size, void * __sized_by(size) *local_memory);
216 /* given a task, "reads" the memory at the given address and size452 /* given a task, "reads" the memory at the given address and size
217local_memory: set to a contiguous chunk of memory; validity of local_memory is assumed to be limited (until next call) */453 local_memory: set to a contiguous chunk of memory; validity of local_memory is assumed to be limited (until next call) */
218454
219#define MALLOC_PTR_IN_USE_RANGE_TYPE 1 /* for allocated pointers */455#define MALLOC_PTR_IN_USE_RANGE_TYPE 1 /* for allocated pointers */
220#define MALLOC_PTR_REGION_RANGE_TYPE 2 /* for region containing pointers */456#define MALLOC_PTR_REGION_RANGE_TYPE 2 /* for region containing pointers */
...@@ -222,102 +458,112 @@ local_memory: set to a contiguous chunk of memory; validity of local_memory is a...@@ -222,102 +458,112 @@ local_memory: set to a contiguous chunk of memory; validity of local_memory is a
222#define MALLOC_ZONE_SPECIFIC_FLAGS 0xff00 /* bits reserved for zone-specific purposes */458#define MALLOC_ZONE_SPECIFIC_FLAGS 0xff00 /* bits reserved for zone-specific purposes */
223459
224typedef void vm_range_recorder_t(task_t, void *, unsigned type, vm_range_t *, unsigned);460typedef void vm_range_recorder_t(task_t, void *, unsigned type, vm_range_t *, unsigned);
225 /* given a task and context, "records" the specified addresses */461/* given a task and context, "records" the specified addresses */
226462
227/* Print function for the print_task() operation. */463/* Print function for the print_task() operation. */
228typedef void print_task_printer_t(const char *fmt, ...) __printflike(1,2);464typedef void print_task_printer_t(const char * __null_terminated fmt, ...) __printflike(1,2);
229465
230typedef struct malloc_introspection_t {466typedef struct malloc_introspection_t {
231 kern_return_t (* MALLOC_INTROSPECT_FN_PTR(enumerator))(task_t task, void *, unsigned type_mask, vm_address_t zone_address, memory_reader_t reader, vm_range_recorder_t recorder); /* enumerates all the malloc pointers in use */467 kern_return_t (* MALLOC_INTROSPECT_FN_PTR(enumerator))(task_t task, void *, unsigned type_mask, vm_address_t zone_address, memory_reader_t reader, vm_range_recorder_t recorder); /* enumerates all the malloc pointers in use */
232 size_t (* MALLOC_INTROSPECT_FN_PTR(good_size))(malloc_zone_t *zone, size_t size);468 size_t (* MALLOC_INTROSPECT_FN_PTR(good_size))(malloc_zone_t *zone, size_t size);
233 boolean_t (* MALLOC_INTROSPECT_FN_PTR(check))(malloc_zone_t *zone); /* Consistency checker */469 boolean_t (* MALLOC_INTROSPECT_FN_PTR(check))(malloc_zone_t *zone); /* Consistency checker */
234 void (* MALLOC_INTROSPECT_FN_PTR(print))(malloc_zone_t *zone, boolean_t verbose); /* Prints zone */470 void (* MALLOC_INTROSPECT_FN_PTR(print))(malloc_zone_t *zone, boolean_t verbose); /* Prints zone */
235 void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void *address); /* Enables logging of activity */471 void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void * __unsafe_indexable address); /* Enables logging of activity */
236 void (* MALLOC_INTROSPECT_FN_PTR(force_lock))(malloc_zone_t *zone); /* Forces locking zone */472 void (* MALLOC_INTROSPECT_FN_PTR(force_lock))(malloc_zone_t *zone); /* Forces locking zone */
237 void (* MALLOC_INTROSPECT_FN_PTR(force_unlock))(malloc_zone_t *zone); /* Forces unlocking zone */473 void (* MALLOC_INTROSPECT_FN_PTR(force_unlock))(malloc_zone_t *zone); /* Forces unlocking zone */
238 void (* MALLOC_INTROSPECT_FN_PTR(statistics))(malloc_zone_t *zone, malloc_statistics_t *stats); /* Fills statistics */474 void (* MALLOC_INTROSPECT_FN_PTR(statistics))(malloc_zone_t *zone, malloc_statistics_t *stats); /* Fills statistics */
239 boolean_t (* MALLOC_INTROSPECT_FN_PTR(zone_locked))(malloc_zone_t *zone); /* Are any zone locks held */475 boolean_t (* MALLOC_INTROSPECT_FN_PTR(zone_locked))(malloc_zone_t *zone); /* Are any zone locks held */
240476
241 /* Discharge checking. Present in version >= 7. */477 /* Discharge checking. Present in version >= 7. */
242 boolean_t (* MALLOC_INTROSPECT_FN_PTR(enable_discharge_checking))(malloc_zone_t *zone);478 boolean_t (* MALLOC_INTROSPECT_FN_PTR(enable_discharge_checking))(malloc_zone_t *zone);
243 void (* MALLOC_INTROSPECT_FN_PTR(disable_discharge_checking))(malloc_zone_t *zone);479 void (* MALLOC_INTROSPECT_FN_PTR(disable_discharge_checking))(malloc_zone_t *zone);
244 void (* MALLOC_INTROSPECT_FN_PTR(discharge))(malloc_zone_t *zone, void *memory);480 void (* MALLOC_INTROSPECT_FN_PTR(discharge))(malloc_zone_t *zone, void * __unsafe_indexable memory);
245#ifdef __BLOCKS__481#ifdef __BLOCKS__
246 void (* MALLOC_INTROSPECT_FN_PTR(enumerate_discharged_pointers))(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info));482 void (* MALLOC_INTROSPECT_FN_PTR(enumerate_discharged_pointers))(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info));
247 #else483 #else
248 void *enumerate_unavailable_without_blocks; 484 void *enumerate_unavailable_without_blocks;
249#endif /* __BLOCKS__ */485#endif /* __BLOCKS__ */
250 void (* MALLOC_INTROSPECT_FN_PTR(reinit_lock))(malloc_zone_t *zone); /* Reinitialize zone locks, called only from atfork_child handler. Present in version >= 9. */486 void (* MALLOC_INTROSPECT_FN_PTR(reinit_lock))(malloc_zone_t *zone); /* Reinitialize zone locks, called only from atfork_child handler. Present in version >= 9. */
251 void (* MALLOC_INTROSPECT_FN_PTR(print_task))(task_t task, unsigned level, vm_address_t zone_address, memory_reader_t reader, print_task_printer_t printer); /* debug print for another process. Present in version >= 11. */487 void (* MALLOC_INTROSPECT_FN_PTR(print_task))(task_t task, unsigned level, vm_address_t zone_address, memory_reader_t reader, print_task_printer_t printer); /* debug print for another process. Present in version >= 11. */
252 void (* MALLOC_INTROSPECT_FN_PTR(task_statistics))(task_t task, vm_address_t zone_address, memory_reader_t reader, malloc_statistics_t *stats); /* Present in version >= 12. */488 void (* MALLOC_INTROSPECT_FN_PTR(task_statistics))(task_t task, vm_address_t zone_address, memory_reader_t reader, malloc_statistics_t *stats); /* Present in version >= 12. */
253 unsigned zone_type; /* Identifies the zone type. 0 means unknown/undefined zone type. Present in version >= 14. */489 unsigned zone_type; /* Identifies the zone type. 0 means unknown/undefined zone type. Present in version >= 14. */
254} malloc_introspection_t;490} malloc_introspection_t;
255491
256// The value of "level" when passed to print_task() that corresponds to492// The value of "level" when passed to print_task() that corresponds to
257// verbose passed to print()493// verbose passed to print()
258#define MALLOC_VERBOSE_PRINT_LEVEL 2494#define MALLOC_VERBOSE_PRINT_LEVEL 2
259495
260extern void malloc_printf(const char *format, ...);496#if !0 && !0
261 /* Convenience for logging errors and warnings;497extern void malloc_printf(const char * __null_terminated format, ...) __printflike(1,2);
262 No allocation is performed during execution of this function;498 /* Convenience for logging errors and warnings;
263 Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)499 No allocation is performed during execution of this function;
264 */500 Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)
501 */
502#endif
265503
266/********* Functions for performance tools ************/504/********* Functions for performance tools ************/
267505
268extern kern_return_t malloc_get_all_zones(task_t task, memory_reader_t reader, vm_address_t **addresses, unsigned *count);506#if !0 && !0
269 /* Fills addresses and count with the addresses of the zones in task;507extern kern_return_t malloc_get_all_zones(task_t task, memory_reader_t reader, vm_address_t * __single * __counted_by(*count) addresses, unsigned *count);
270 Note that the validity of the addresses returned correspond to the validity of the memory returned by reader */508 /* Fills addresses and count with the addresses of the zones in task;
509 Note that the validity of the addresses returned correspond to the validity reader */
510#endif
271511
272/********* Debug helpers ************/512/********* Debug helpers ************/
273513
274extern void malloc_zone_print_ptr_info(void *ptr);514extern void malloc_zone_print_ptr_info(void * __unsafe_indexable ptr);
275 /* print to stdout if this pointer is in the malloc heap, free status, and size */515 /* print to stdout if this pointer is in the malloc heap, free status, and size */
276516
277extern boolean_t malloc_zone_check(malloc_zone_t *zone);517extern boolean_t malloc_zone_check(malloc_zone_t *zone);
278 /* Checks zone is well formed; if !zone, checks all zones */518 /* Checks zone is well formed; if !zone, checks all zones */
279519
280extern void malloc_zone_print(malloc_zone_t *zone, boolean_t verbose);520extern void malloc_zone_print(malloc_zone_t *zone, boolean_t verbose);
281 /* Prints summary on zone; if !zone, prints all zones */521 /* Prints summary on zone; if !zone, prints all zones */
282522
523#if !0 && !0
283extern void malloc_zone_statistics(malloc_zone_t *zone, malloc_statistics_t *stats);524extern void malloc_zone_statistics(malloc_zone_t *zone, malloc_statistics_t *stats);
284 /* Fills statistics for zone; if !zone, sums up all zones */525 /* Fills statistics for zone; if !zone, sums up all zones */
285526
286extern void malloc_zone_log(malloc_zone_t *zone, void *address);527extern void malloc_zone_log(malloc_zone_t *zone, void * __unsafe_indexable address);
287 /* Controls logging of all activity; if !zone, for all zones;528 /* Controls logging of all activity; if !zone, for all zones;
288 If address==0 nothing is logged;529 If address==0 nothing is logged;
289 If address==-1 all activity is logged;530 If address==-1 all activity is logged;
290 Else only the activity regarding address is logged */531 Else only the activity regarding address is logged */
532#endif
291533
292struct mstats {534struct mstats {
293 size_t bytes_total;535 size_t bytes_total;
294 size_t chunks_used;536 size_t chunks_used;
295 size_t bytes_used;537 size_t bytes_used;
296 size_t chunks_free;538 size_t chunks_free;
297 size_t bytes_free;539 size_t bytes_free;
298};540};
299541
542#if !0 && !0
300extern struct mstats mstats(void);543extern struct mstats mstats(void);
301544
302extern boolean_t malloc_zone_enable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);545extern boolean_t malloc_zone_enable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
303/* Increment the discharge checking enabled counter for a zone. Returns true if the zone supports checking, false if it does not. */546 /* Increment the discharge checking enabled counter for a zone. Returns true if the zone supports checking, false if it does not. */
304547
305extern void malloc_zone_disable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);548extern void malloc_zone_disable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
306/* Decrement the discharge checking enabled counter for a zone. */549/* Decrement the discharge checking enabled counter for a zone. */
307550
308extern void malloc_zone_discharge(malloc_zone_t *zone, void *memory) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);551extern void malloc_zone_discharge(malloc_zone_t *zone, void * __unsafe_indexable memory) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
309/* Register memory that the programmer expects to be freed soon. 552 /* Register memory that the programmer expects to be freed soon.
310 zone may be NULL in which case the zone is determined using malloc_zone_from_ptr(). 553 zone may be NULL in which case the zone is determined using malloc_zone_from_ptr().
311 If discharge checking is off for the zone this function is a no-op. */554 If discharge checking is off for the zone this function is a no-op. */
312 555#endif
556
557#if !0 && !0
313#ifdef __BLOCKS__558#ifdef __BLOCKS__
314extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info)) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);559extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info)) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
315/* Calls report_discharged for each block that was registered using malloc_zone_discharge() but has not yet been freed. 560 /* Calls report_discharged for each block that was registered using malloc_zone_discharge() but has not yet been freed.
316 info is used to provide zone defined information about the memory block. 561 info is used to provide zone defined information about the memory block.
317 If zone is NULL then the enumeration covers all zones. */562 If zone is NULL then the enumeration covers all zones. */
318#else563#else
319extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);564extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
320#endif /* __BLOCKS__ */565#endif /* __BLOCKS__ */
566#endif
321567
322/********* Zone version summary ************/568/********* Zone version summary ************/
323// Version 0, but optional:569// Version 0, but optional:
...@@ -347,6 +593,14 @@ extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void...@@ -347,6 +593,14 @@ extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void
347// - malloc_zone_t::try_free_default593// - malloc_zone_t::try_free_default
348// Version 14:594// Version 14:
349// malloc_introspection_t::zone_type595// malloc_introspection_t::zone_type
596// Version 15:
597// malloc_zone_t::malloc_with_options
598// Version 16:
599// malloc_zone_t::malloc_type_malloc
600// malloc_zone_t::malloc_type_calloc
601// malloc_zone_t::malloc_type_realloc
602// malloc_zone_t::malloc_type_memalign
603// malloc_zone_t::malloc_type_malloc_with_options
350604
351// These functions are optional and calling them requires two checks:605// These functions are optional and calling them requires two checks:
352// * Check zone version to ensure zone struct is large enough to include the member.606// * Check zone version to ensure zone struct is large enough to include the member.
lib/libc/include/any-macos-any/math.h+18-3
...@@ -79,7 +79,7 @@ __BEGIN_DECLS...@@ -79,7 +79,7 @@ __BEGIN_DECLS
79#define FP_SUBNORMAL 579#define FP_SUBNORMAL 5
80#define FP_SUPERNORMAL 6 /* legacy PowerPC support; this is otherwise unused */80#define FP_SUPERNORMAL 6 /* legacy PowerPC support; this is otherwise unused */
8181
82#if defined __arm64__ || defined __ARM_VFPV4__82#if defined __arm64__ || defined __aarch64__ || defined __ARM_VFPV4__
83/* On these architectures, fma(), fmaf( ), and fmal( ) are generally about as83/* On these architectures, fma(), fmaf( ), and fmal( ) are generally about as
84 fast as (or faster than) separate multiply and add of the same operands. */84 fast as (or faster than) separate multiply and add of the same operands. */
85# define FP_FAST_FMA 185# define FP_FAST_FMA 1
...@@ -564,12 +564,12 @@ __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios,...@@ -564,12 +564,12 @@ __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios,
564 * Reentrant variants of lgamma[fl] *564 * Reentrant variants of lgamma[fl] *
565 ******************************************************************************/565 ******************************************************************************/
566566
567#ifdef _REENTRANT567#if defined(_REENTRANT) || defined(__swift__)
568/* Reentrant variants of the lgamma[fl] functions. */568/* Reentrant variants of the lgamma[fl] functions. */
569extern float lgammaf_r(float, int *) __API_AVAILABLE(macos(10.6), ios(3.1));569extern float lgammaf_r(float, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
570extern double lgamma_r(double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));570extern double lgamma_r(double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
571extern long double lgammal_r(long double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));571extern long double lgammal_r(long double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
572#endif /* _REENTRANT */572#endif /* _REENTRANT || __swift__ */
573573
574/******************************************************************************574/******************************************************************************
575 * Apple extensions to the C standard *575 * Apple extensions to the C standard *
...@@ -610,6 +610,21 @@ extern double __sinpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));...@@ -610,6 +610,21 @@ extern double __sinpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
610extern float __tanpif(float) __API_AVAILABLE(macos(10.9), ios(7.0));610extern float __tanpif(float) __API_AVAILABLE(macos(10.9), ios(7.0));
611extern double __tanpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));611extern double __tanpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
612612
613/* half precision math functions */
614extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
615extern _Float16 __hypotf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
616extern _Float16 __sqrtf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
617extern _Float16 __ceilf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
618extern _Float16 __floorf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
619extern _Float16 __rintf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
620extern _Float16 __roundf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
621extern _Float16 __truncf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
622extern _Float16 __copysignf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
623extern _Float16 __nextafterf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
624extern _Float16 __fmaxf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
625extern _Float16 __fminf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
626extern _Float16 __fmaf16(_Float16, _Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
627
613#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || \628#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || \
614 (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)629 (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)
615/* __sincos and __sincosf were introduced in OSX 10.9 and iOS 7.0. When630/* __sincos and __sincosf were introduced in OSX 10.9 and iOS 7.0. When
lib/libc/include/any-macos-any/monetary.h+1-13
...@@ -26,20 +26,8 @@...@@ -26,20 +26,8 @@
26 * $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $26 * $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $
27 */27 */
2828
29#ifndef _MONETARY_H_29#include <_monetary.h>
30#define _MONETARY_H_
31
32#include <sys/cdefs.h>
33#include <_types.h>
34#include <sys/_types/_size_t.h>
35#include <sys/_types/_ssize_t.h>
36
37__BEGIN_DECLS
38ssize_t strfmon(char *, size_t, const char *, ...);
39__END_DECLS
4030
41#ifdef _USE_EXTENDED_LOCALES_31#ifdef _USE_EXTENDED_LOCALES_
42#include <xlocale/_monetary.h>32#include <xlocale/_monetary.h>
43#endif /* _USE_EXTENDED_LOCALES_ */33#endif /* _USE_EXTENDED_LOCALES_ */
44
45#endif /* !_MONETARY_H_ */
lib/libc/include/any-macos-any/net/if.h+7
...@@ -72,6 +72,9 @@...@@ -72,6 +72,9 @@
7272
73#include <net/if_var.h>73#include <net/if_var.h>
74#include <net/net_kev.h>74#include <net/net_kev.h>
75#if __has_ptrcheck
76#include <netinet/in.h>
77#endif
75#include <sys/types.h>78#include <sys/types.h>
76#include <sys/socket.h>79#include <sys/socket.h>
7780
...@@ -139,6 +142,7 @@ struct if_clonereq {...@@ -139,6 +142,7 @@ struct if_clonereq {
139#define IFCAP_SW_TIMESTAMP 0x01000 /* Time stamping in software */142#define IFCAP_SW_TIMESTAMP 0x01000 /* Time stamping in software */
140#define IFCAP_CSUM_PARTIAL 0x02000 /* can offload partial checksum */143#define IFCAP_CSUM_PARTIAL 0x02000 /* can offload partial checksum */
141#define IFCAP_CSUM_ZERO_INVERT 0x04000 /* can invert 0 to -0 (0xffff) */144#define IFCAP_CSUM_ZERO_INVERT 0x04000 /* can invert 0 to -0 (0xffff) */
145#define IFCAP_LRO_NUM_SEG 0x08000 /* NIC & driver can set the num of segments a LRO-packet is built of */
142146
143#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)147#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
144#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)148#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)
...@@ -315,6 +319,7 @@ struct ifreq {...@@ -315,6 +319,7 @@ struct ifreq {
315 u_int32_t ifru_route_refcnt;319 u_int32_t ifru_route_refcnt;
316 int ifru_cap[2];320 int ifru_cap[2];
317 u_int32_t ifru_functional_type;321 u_int32_t ifru_functional_type;
322 u_int32_t ifru_peer_egress_functional_type;
318#define IFRTYPE_FUNCTIONAL_UNKNOWN 0323#define IFRTYPE_FUNCTIONAL_UNKNOWN 0
319#define IFRTYPE_FUNCTIONAL_LOOPBACK 1324#define IFRTYPE_FUNCTIONAL_LOOPBACK 1
320#define IFRTYPE_FUNCTIONAL_WIRED 2325#define IFRTYPE_FUNCTIONAL_WIRED 2
...@@ -325,6 +330,8 @@ struct ifreq {...@@ -325,6 +330,8 @@ struct ifreq {
325#define IFRTYPE_FUNCTIONAL_COMPANIONLINK 7330#define IFRTYPE_FUNCTIONAL_COMPANIONLINK 7
326#define IFRTYPE_FUNCTIONAL_MANAGEMENT 8331#define IFRTYPE_FUNCTIONAL_MANAGEMENT 8
327#define IFRTYPE_FUNCTIONAL_LAST 8332#define IFRTYPE_FUNCTIONAL_LAST 8
333 u_int8_t ifru_is_directlink;
334 u_int8_t ifru_is_vpn;
328 } ifr_ifru;335 } ifr_ifru;
329#define ifr_addr ifr_ifru.ifru_addr /* address */336#define ifr_addr ifr_ifru.ifru_addr /* address */
330#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */337#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
lib/libc/include/any-macos-any/net/if_dl.h+3-8
...@@ -65,6 +65,7 @@...@@ -65,6 +65,7 @@
65#define _NET_IF_DL_H_65#define _NET_IF_DL_H_
66#include <sys/appleapiopts.h>66#include <sys/appleapiopts.h>
6767
68#include <sys/_types.h> /* __offsetof() */
68#include <sys/types.h>69#include <sys/types.h>
6970
7071
...@@ -89,12 +90,6 @@...@@ -89,12 +90,6 @@
89/*90/*
90 * Structure of a Link-Level sockaddr:91 * Structure of a Link-Level sockaddr:
91 */92 */
92#if __has_ptrcheck
93#define DLIL_SDLDATACOUNT __counted_by(sdl_len - 8)
94#else
95#define DLIL_SDLDATACOUNT 12
96#endif
97
98struct sockaddr_dl {93struct sockaddr_dl {
99 u_char sdl_len; /* Total length of sockaddr */94 u_char sdl_len; /* Total length of sockaddr */
100 u_char sdl_family; /* AF_LINK */95 u_char sdl_family; /* AF_LINK */
...@@ -103,7 +98,7 @@ struct sockaddr_dl {...@@ -103,7 +98,7 @@ struct sockaddr_dl {
103 u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */98 u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
104 u_char sdl_alen; /* link level address length */99 u_char sdl_alen; /* link level address length */
105 u_char sdl_slen; /* link layer selector length */100 u_char sdl_slen; /* link layer selector length */
106 char sdl_data[DLIL_SDLDATACOUNT];101 char sdl_data[12];
107 /* minimum work area, can be larger;102 /* minimum work area, can be larger;
108 * contains both if name and ll address */103 * contains both if name and ll address */
109#ifndef __APPLE__104#ifndef __APPLE__
...@@ -113,7 +108,7 @@ struct sockaddr_dl {...@@ -113,7 +108,7 @@ struct sockaddr_dl {
113#endif108#endif
114};109};
115110
116#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))111#define LLADDR(s) ((caddr_t)(s) + __offsetof(struct sockaddr_dl, sdl_data) + (s)->sdl_nlen)
117112
118113
119114
lib/libc/include/any-macos-any/net/route.h+13-12
...@@ -83,8 +83,7 @@ struct rt_metrics {...@@ -83,8 +83,7 @@ struct rt_metrics {
83 u_int32_t rmx_rtt; /* estimated round trip time */83 u_int32_t rmx_rtt; /* estimated round trip time */
84 u_int32_t rmx_rttvar; /* estimated rtt variance */84 u_int32_t rmx_rttvar; /* estimated rtt variance */
85 u_int32_t rmx_pksent; /* packets sent using this route */85 u_int32_t rmx_pksent; /* packets sent using this route */
86 u_int32_t rmx_state; /* route state */86 u_int32_t rmx_filler[4]; /* will be used for TCP's peer-MSS cache */
87 u_int32_t rmx_filler[3]; /* will be used for TCP's peer-MSS cache */
88};87};
8988
90/*89/*
...@@ -102,9 +101,7 @@ struct rt_metrics {...@@ -102,9 +101,7 @@ struct rt_metrics {
102#define RTF_DELCLONE 0x80 /* delete cloned route */101#define RTF_DELCLONE 0x80 /* delete cloned route */
103#define RTF_CLONING 0x100 /* generate new routes on use */102#define RTF_CLONING 0x100 /* generate new routes on use */
104#define RTF_XRESOLVE 0x200 /* external daemon resolves name */103#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
105#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward104#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
106 * compatibility */
107#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */
108#define RTF_STATIC 0x800 /* manually added */105#define RTF_STATIC 0x800 /* manually added */
109#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */106#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
110#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */107#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */
...@@ -129,12 +126,6 @@ struct rt_metrics {...@@ -129,12 +126,6 @@ struct rt_metrics {
129 /* 0x80000000 unassigned */126 /* 0x80000000 unassigned */
130127
131#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */128#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
132#define RTF_BITS \
133 "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \
134 "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \
135 "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \
136 "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \
137 "\33IFREF\34PROXY\35ROUTER\37GLOBAL"
138129
139#define IS_DIRECT_HOSTROUTE(rt) \130#define IS_DIRECT_HOSTROUTE(rt) \
140 (((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST)131 (((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST)
...@@ -143,10 +134,16 @@ struct rt_metrics {...@@ -143,10 +134,16 @@ struct rt_metrics {
143 (((rt)->rt_flags & (RTF_CLONING | RTF_PRCLONING | RTF_HOST | RTF_LLINFO |\134 (((rt)->rt_flags & (RTF_CLONING | RTF_PRCLONING | RTF_HOST | RTF_LLINFO |\
144 RTF_WASCLONED | RTF_GATEWAY)) ==\135 RTF_WASCLONED | RTF_GATEWAY)) ==\
145 (RTF_HOST | RTF_LLINFO | RTF_WASCLONED))136 (RTF_HOST | RTF_LLINFO | RTF_WASCLONED))
137
138#define IS_LOCALNET_ROUTE(rt) \
139 (!((rt)->rt_flags & RTF_LOCAL) && \
140 ((((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST) || \
141 ((rt)->rt_flags & (RTF_MULTICAST | RTF_BROADCAST))))
142
146/*143/*
147 * Routing statistics.144 * Routing statistics.
148 */145 */
149struct rtstat {146struct rtstat {
150 short rts_badredirect; /* bogus redirect calls */147 short rts_badredirect; /* bogus redirect calls */
151 short rts_dynamic; /* routes created by redirects */148 short rts_dynamic; /* routes created by redirects */
152 short rts_newgateway; /* routes modified by redirects */149 short rts_newgateway; /* routes modified by redirects */
...@@ -188,6 +185,10 @@ struct rt_msghdr2 {...@@ -188,6 +185,10 @@ struct rt_msghdr2 {
188 struct rt_metrics rtm_rmx; /* metrics themselves */185 struct rt_metrics rtm_rmx; /* metrics themselves */
189};186};
190187
188struct rt_msghdr_prelude {
189 u_short rtm_msglen; /* to skip over non-understood messages */
190};
191
191#define RTM_VERSION 5 /* Up the ante and ignore older versions */192#define RTM_VERSION 5 /* Up the ante and ignore older versions */
192193
193/*194/*
lib/libc/include/any-macos-any/objc/NSObjCRuntime.h+1
...@@ -6,6 +6,7 @@...@@ -6,6 +6,7 @@
6#define _OBJC_NSOBJCRUNTIME_H_6#define _OBJC_NSOBJCRUNTIME_H_
77
8#include <TargetConditionals.h>8#include <TargetConditionals.h>
9#include <limits.h>
9#include <objc/objc.h>10#include <objc/objc.h>
1011
11#if __LP64__ || NS_BUILD_32_LIKE_6412#if __LP64__ || NS_BUILD_32_LIKE_64
lib/libc/include/any-macos-any/objc/objc-api.h+6
...@@ -301,4 +301,10 @@...@@ -301,4 +301,10 @@
301# endif301# endif
302#endif302#endif
303303
304#if __has_attribute(not_tail_called)
305# define OBJC_NOT_TAIL_CALLED __attribute__((not_tail_called))
306#else
307# define OBJC_NOT_TAIL_CALLED
308#endif
309
304#endif310#endif
lib/libc/include/any-macos-any/objc/objc.h+7
...@@ -46,6 +46,13 @@ struct objc_object {...@@ -46,6 +46,13 @@ struct objc_object {
46typedef struct objc_object *id;46typedef struct objc_object *id;
47#endif47#endif
4848
49/// An opaque type that represents an Objective-C protocol.
50#ifdef __OBJC__
51@class Protocol;
52#else
53typedef struct objc_object Protocol;
54#endif
55
49/// An opaque type that represents a method selector.56/// An opaque type that represents a method selector.
50typedef struct objc_selector *SEL;57typedef struct objc_selector *SEL;
5158
lib/libc/include/any-macos-any/objc/runtime.h+4-35
...@@ -54,12 +54,6 @@ typedef struct objc_property *objc_property_t;...@@ -54,12 +54,6 @@ typedef struct objc_property *objc_property_t;
5454
55#endif55#endif
5656
57#ifdef __OBJC__
58@class Protocol;
59#else
60typedef struct objc_object Protocol;
61#endif
62
63/// Defines a method57/// Defines a method
64struct objc_method_description {58struct objc_method_description {
65 SEL _Nullable name; /**< The name of the method */59 SEL _Nullable name; /**< The name of the method */
...@@ -367,6 +361,7 @@ objc_copyClassList(unsigned int * _Nullable outCount)...@@ -367,6 +361,7 @@ objc_copyClassList(unsigned int * _Nullable outCount)
367 *361 *
368 */362 */
369#define OBJC_DYNAMIC_CLASSES ((const void *)-1)363#define OBJC_DYNAMIC_CLASSES ((const void *)-1)
364#ifdef __BLOCKS__
370OBJC_EXPORT void365OBJC_EXPORT void
371objc_enumerateClasses(const void * _Nullable image,366objc_enumerateClasses(const void * _Nullable image,
372 const char * _Nullable namePrefix,367 const char * _Nullable namePrefix,
...@@ -375,7 +370,9 @@ objc_enumerateClasses(const void * _Nullable image,...@@ -375,7 +370,9 @@ objc_enumerateClasses(const void * _Nullable image,
375 void (^ _Nonnull block)(Class _Nonnull aClass, BOOL * _Nonnull stop)370 void (^ _Nonnull block)(Class _Nonnull aClass, BOOL * _Nonnull stop)
376 OBJC_NOESCAPE)371 OBJC_NOESCAPE)
377 OBJC_AVAILABLE(13.0, 16.0, 16.0, 9.0, 7.0)372 OBJC_AVAILABLE(13.0, 16.0, 16.0, 9.0, 7.0)
378 OBJC_REFINED_FOR_SWIFT;373 OBJC_REFINED_FOR_SWIFT
374 OBJC_NOT_TAIL_CALLED;
375#endif
379376
380/* Working with Classes */377/* Working with Classes */
381378
...@@ -1480,34 +1477,6 @@ objc_copyClassNamesForImage(const char * _Nonnull image,...@@ -1480,34 +1477,6 @@ objc_copyClassNamesForImage(const char * _Nonnull image,
14801477
1481/* Working with Selectors */1478/* Working with Selectors */
14821479
1483/**
1484 * Returns the name of the method specified by a given selector.
1485 *
1486 * @param sel A pointer of type \c SEL. Pass the selector whose name you wish to determine.
1487 *
1488 * @return A C string indicating the name of the selector.
1489 */
1490OBJC_EXPORT const char * _Nonnull
1491sel_getName(SEL _Nonnull sel)
1492 OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
1493
1494
1495/**
1496 * Registers a method with the Objective-C runtime system, maps the method
1497 * name to a selector, and returns the selector value.
1498 *
1499 * @param str A pointer to a C string. Pass the name of the method you wish to register.
1500 *
1501 * @return A pointer of type SEL specifying the selector for the named method.
1502 *
1503 * @note You must register a method name with the Objective-C runtime system to obtain the
1504 * method’s selector before you can add the method to a class definition. If the method name
1505 * has already been registered, this function simply returns the selector.
1506 */
1507OBJC_EXPORT SEL _Nonnull
1508sel_registerName(const char * _Nonnull str)
1509 OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
1510
1511/** 1480/**
1512 * Returns a Boolean value that indicates whether two selectors are equal.1481 * Returns a Boolean value that indicates whether two selectors are equal.
1513 * 1482 *
lib/libc/include/any-macos-any/os/availability.h+26-10
...@@ -65,11 +65,19 @@...@@ -65,11 +65,19 @@
65#define API_TO_BE_DEPRECATED_DRIVERKIT 10000065#define API_TO_BE_DEPRECATED_DRIVERKIT 100000
66#endif66#endif
6767
68#ifndef API_TO_BE_DEPRECATED_XROS68#ifndef API_TO_BE_DEPRECATEDC_VISIONOS
69#define API_TO_BE_DEPRECATED_XROS 10000069#define API_TO_BE_DEPRECATED_VISIONOS 100000
70#endif70#endif
7171
72#ifndef __OPEN_SOURCE__
73
74#endif /* __OPEN_SOURCE__ */
75
72#include <AvailabilityInternal.h>76#include <AvailabilityInternal.h>
77#include <AvailabilityInternalLegacy.h>
78#if __has_include(<AvailabilityInternalPrivate.h>)
79 #include <AvailabilityInternalPrivate.h>
80#endif
7381
7482
7583
...@@ -90,8 +98,8 @@...@@ -90,8 +98,8 @@
90 * API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))98 * API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
91 */99 */
92100
93 #define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)101 #define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE8,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
94 #define API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)102 #define API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN8,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
95 #define API_AVAILABLE_END _Pragma("clang attribute pop")103 #define API_AVAILABLE_END _Pragma("clang attribute pop")
96104
97 /*105 /*
...@@ -111,13 +119,13 @@...@@ -111,13 +119,13 @@
111 * API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))119 * API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
112 */120 */
113 121
114 #define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)122 #define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
115 #define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)123 #define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
116124
117 #define API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)125 #define API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN8,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
118 #define API_DEPRECATED_END _Pragma("clang attribute pop")126 #define API_DEPRECATED_END _Pragma("clang attribute pop")
119127
120 #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)128 #define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN8,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
121 #define API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")129 #define API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
122130
123 /*131 /*
...@@ -129,9 +137,9 @@...@@ -129,9 +137,9 @@
129 * API_UNAVAILABLE(watchos, tvos)137 * API_UNAVAILABLE(watchos, tvos)
130 */138 */
131139
132 #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)140 #define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE8,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
133141
134 #define API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)142 #define API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN8,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
135 #define API_UNAVAILABLE_END _Pragma("clang attribute pop")143 #define API_UNAVAILABLE_END _Pragma("clang attribute pop")
136 #endif /* __has_attribute(availability) */144 #endif /* __has_attribute(availability) */
137#endif /* #if defined(__has_feature) && defined(__has_attribute) */145#endif /* #if defined(__has_feature) && defined(__has_attribute) */
...@@ -200,6 +208,14 @@...@@ -200,6 +208,14 @@
200 #define SPI_AVAILABLE(...)208 #define SPI_AVAILABLE(...)
201#endif209#endif
202210
211#ifndef SPI_AVAILABLE_BEGIN
212 #define SPI_AVAILABLE_BEGIN(...)
213#endif
214
215#ifndef SPI_AVAILABLE_END
216 #define SPI_AVAILABLE_END(...)
217#endif
218
203#ifndef SPI_DEPRECATED219#ifndef SPI_DEPRECATED
204 #define SPI_DEPRECATED(...)220 #define SPI_DEPRECATED(...)
205#endif221#endif
lib/libc/include/any-macos-any/os/base.h+4
...@@ -246,8 +246,12 @@...@@ -246,8 +246,12 @@
246#if __has_attribute(__swift_attr__)246#if __has_attribute(__swift_attr__)
247#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg) \247#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg) \
248 __attribute__((__swift_attr__("@_unavailableFromAsync(message: \"" msg "\")")))248 __attribute__((__swift_attr__("@_unavailableFromAsync(message: \"" msg "\")")))
249#define OS_SWIFT_NONISOLATED __attribute__((__swift_attr__("nonisolated")))
250#define OS_SWIFT_NONISOLATED_UNSAFE __attribute__((__swift_attr__("nonisolated(unsafe)")))
249#else251#else
250#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg)252#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg)
253#define OS_SWIFT_NONISOLATED
254#define OS_SWIFT_NONISOLATED_UNSAFE
251#endif255#endif
252256
253#if __has_attribute(swift_private)257#if __has_attribute(swift_private)
lib/libc/include/any-macos-any/os/lock.h+41
...@@ -195,6 +195,47 @@ OS_UNFAIR_LOCK_AVAILABILITY...@@ -195,6 +195,47 @@ OS_UNFAIR_LOCK_AVAILABILITY
195OS_EXPORT OS_NOTHROW OS_NONNULL_ALL195OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
196void os_unfair_lock_assert_not_owner(const os_unfair_lock *lock);196void os_unfair_lock_assert_not_owner(const os_unfair_lock *lock);
197197
198/*!
199 * @typedef os_unfair_lock_flags_t
200 *
201 * @const OS_UNFAIR_LOCK_FLAG_ADAPTIVE_SPIN
202 * This flag allows the caller of os_unfair_lock_lock_with_flags API to spin
203 * temporarily before blocking, particularly useful when the holder of the
204 * lock is on core. This should only be used for locks where the protected
205 * critical section is always extremely short.
206 */
207OS_REFINED_FOR_SWIFT
208OS_OPTIONS(os_unfair_lock_flags, uint32_t,
209 OS_UNFAIR_LOCK_FLAG_NONE
210 __API_AVAILABLE(macos(15.0), ios(18.0),
211 tvos(18.0), watchos(11.0), visionos(2.0))
212 OS_SWIFT_UNAVAILABLE("Use OSAllocatedUnfairLock APIs that do not require flags.")
213 = 0x00000000,
214 OS_UNFAIR_LOCK_FLAG_ADAPTIVE_SPIN
215 __API_AVAILABLE(macos(15.0), ios(18.0),
216 tvos(18.0), watchos(11.0), visionos(2.0))
217 OS_SWIFT_UNAVAILABLE("Use OSAllocatedUnfairLockFlags.AdaptiveSpin")
218 = 0x00040000,
219);
220
221/*!
222 * @function os_unfair_lock_lock_with_flags
223 *
224 * @abstract
225 * Locks an os_unfair_lock.
226 *
227 * @param lock
228 * Pointer to an os_unfair_lock.
229 *
230 * @param flags
231 * Flags to alter the behavior of the lock. See os_unfair_lock_flags_t.
232 */
233__API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0))
234OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
235OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock for async-safe scoped locking")
236void os_unfair_lock_lock_with_flags(os_unfair_lock_t lock,
237 os_unfair_lock_flags_t flags);
238
198__END_DECLS239__END_DECLS
199240
200OS_ASSUME_NONNULL_END241OS_ASSUME_NONNULL_END
lib/libc/include/any-macos-any/pthread.h+6-6
...@@ -587,8 +587,8 @@ __API_AVAILABLE(macos(11.0))...@@ -587,8 +587,8 @@ __API_AVAILABLE(macos(11.0))
587__API_UNAVAILABLE(ios, tvos, watchos, driverkit)587__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
588void pthread_jit_write_protect_np(int enabled);588void pthread_jit_write_protect_np(int enabled);
589589
590__API_AVAILABLE(macos(11.0))590__API_AVAILABLE(macos(11.0), ios(17.4))
591__API_UNAVAILABLE(ios, tvos, watchos, driverkit)591__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
592int pthread_jit_write_protect_supported_np(void);592int pthread_jit_write_protect_supported_np(void);
593593
594/*!594/*!
...@@ -691,8 +691,8 @@ typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx);...@@ -691,8 +691,8 @@ typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx);
691 * abort(3), the latter being encumbered by various conformance requirements) or691 * abort(3), the latter being encumbered by various conformance requirements) or
692 * return a result indicating failure.692 * return a result indicating failure.
693 */693 */
694__API_AVAILABLE(macos(11.4))694__API_AVAILABLE(macos(11.4), ios(17.4))
695__API_UNAVAILABLE(ios, tvos, watchos, driverkit)695__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
696__SWIFT_UNAVAILABLE_MSG("This interface cannot be safely used from Swift")696__SWIFT_UNAVAILABLE_MSG("This interface cannot be safely used from Swift")
697int pthread_jit_write_with_callback_np(697int pthread_jit_write_with_callback_np(
698 pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx);698 pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx);
...@@ -722,8 +722,8 @@ int pthread_jit_write_with_callback_np(...@@ -722,8 +722,8 @@ int pthread_jit_write_with_callback_np(
722 * this function, as this allows the runtime to automatically freeze the set of722 * this function, as this allows the runtime to automatically freeze the set of
723 * allowed callbacks early in process initialization.723 * allowed callbacks early in process initialization.
724 */724 */
725__API_AVAILABLE(macos(12.1))725__API_AVAILABLE(macos(12.1), ios(17.4))
726__API_UNAVAILABLE(ios, tvos, watchos, driverkit)726__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
727void pthread_jit_write_freeze_callbacks_np(void);727void pthread_jit_write_freeze_callbacks_np(void);
728728
729/*!729/*!
lib/libc/include/any-macos-any/regex.h-124
...@@ -86,132 +86,8 @@...@@ -86,132 +86,8 @@
86 * @(#)regex.h 8.2 (Berkeley) 1/3/9486 * @(#)regex.h 8.2 (Berkeley) 1/3/94
87 */87 */
8888
89#ifndef _REGEX_H_
90#define _REGEX_H_
91
92#include <_regex.h>89#include <_regex.h>
9390
94/*******************/
95/* regcomp() flags */
96/*******************/
97#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
98#define REG_BASIC 0000 /* Basic regular expressions (synonym for 0) */
99#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
100
101#define REG_EXTENDED 0001 /* Extended regular expressions */
102#define REG_ICASE 0002 /* Compile ignoring upper/lower case */
103#define REG_NOSUB 0004 /* Compile only reporting success/failure */
104#define REG_NEWLINE 0010 /* Compile for newline-sensitive matching */
105
106#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
107#define REG_NOSPEC 0020 /* Compile turning off all special characters */
108
109#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
110 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
111 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
112#define REG_LITERAL REG_NOSPEC
113#endif
114
115#define REG_PEND 0040 /* Use re_endp as end pointer */
116
117#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
118 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
119 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
120#define REG_MINIMAL 0100 /* Compile using minimal repetition */
121#define REG_UNGREEDY REG_MINIMAL
122#endif
123
124#define REG_DUMP 0200 /* Unused */
125
126#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
127 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
128 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
129#define REG_ENHANCED 0400 /* Additional (non-POSIX) features */
130#endif
131#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
132
133/********************/
134/* regerror() flags */
135/********************/
136#define REG_ENOSYS (-1) /* Reserved */
137#define REG_NOMATCH 1 /* regexec() function failed to match */
138#define REG_BADPAT 2 /* invalid regular expression */
139#define REG_ECOLLATE 3 /* invalid collating element */
140#define REG_ECTYPE 4 /* invalid character class */
141#define REG_EESCAPE 5 /* trailing backslash (\) */
142#define REG_ESUBREG 6 /* invalid backreference number */
143#define REG_EBRACK 7 /* brackets ([ ]) not balanced */
144#define REG_EPAREN 8 /* parentheses not balanced */
145#define REG_EBRACE 9 /* braces not balanced */
146#define REG_BADBR 10 /* invalid repetition count(s) */
147#define REG_ERANGE 11 /* invalid character range */
148#define REG_ESPACE 12 /* out of memory */
149#define REG_BADRPT 13 /* repetition-operator operand invalid */
150
151#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
152#define REG_EMPTY 14 /* Unused */
153#define REG_ASSERT 15 /* Unused */
154#define REG_INVARG 16 /* invalid argument to regex routine */
155#define REG_ILLSEQ 17 /* illegal byte sequence */
156
157#define REG_ATOI 255 /* convert name to number (!) */
158#define REG_ITOA 0400 /* convert number to name (!) */
159#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
160
161/*******************/
162/* regexec() flags */
163/*******************/
164#define REG_NOTBOL 00001 /* First character not at beginning of line */
165#define REG_NOTEOL 00002 /* Last character not at end of line */
166
167#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
168#define REG_STARTEND 00004 /* String start/end in pmatch[0] */
169#define REG_TRACE 00400 /* Unused */
170#define REG_LARGE 01000 /* Unused */
171#define REG_BACKR 02000 /* force use of backref code */
172
173#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
174 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
175 || defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
176#define REG_BACKTRACKING_MATCHER REG_BACKR
177#endif
178#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
179
180__BEGIN_DECLS
181int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp);
182size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold;
183/*
184 * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround,
185 * a dummy argument name is added.
186 */
187int regexec(const regex_t * __restrict, const char * __restrict, size_t,
188 regmatch_t __pmatch[ __restrict], int);
189void regfree(regex_t *);
190
191#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
192
193/* Darwin extensions */
194int regncomp(regex_t * __restrict, const char * __restrict, size_t, int)
195 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
196int regnexec(const regex_t * __restrict, const char * __restrict, size_t,
197 size_t, regmatch_t __pmatch[ __restrict], int)
198 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
199int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int)
200 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
201int regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t,
202 regmatch_t __pmatch[ __restrict], int)
203 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
204int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int)
205 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
206int regwnexec(const regex_t * __restrict, const wchar_t * __restrict,
207 size_t, size_t, regmatch_t __pmatch[ __restrict], int)
208 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
209
210#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
211__END_DECLS
212
213#ifdef _USE_EXTENDED_LOCALES_91#ifdef _USE_EXTENDED_LOCALES_
214#include <xlocale/_regex.h>92#include <xlocale/_regex.h>
215#endif /* _USE_EXTENDED_LOCALES_ */93#endif /* _USE_EXTENDED_LOCALES_ */
216
217#endif /* !_REGEX_H_ */
lib/libc/include/any-macos-any/runetype.h+1-1
...@@ -80,7 +80,7 @@ typedef struct {...@@ -80,7 +80,7 @@ typedef struct {
8080
81 __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);81 __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);
82 int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);82 int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
83 __darwin_rune_t __invalid_rune;83 __darwin_rune_t __invalid_rune; /* Deprecated */
8484
85 __uint32_t __runetype[_CACHED_RUNES];85 __uint32_t __runetype[_CACHED_RUNES];
86 __darwin_rune_t __maplower[_CACHED_RUNES];86 __darwin_rune_t __maplower[_CACHED_RUNES];
lib/libc/include/any-macos-any/secure/_common.h+2
...@@ -24,6 +24,8 @@...@@ -24,6 +24,8 @@
24#ifndef _SECURE__COMMON_H_24#ifndef _SECURE__COMMON_H_
25#define _SECURE__COMMON_H_25#define _SECURE__COMMON_H_
2626
27#include <_types.h>
28
27#undef _USE_FORTIFY_LEVEL29#undef _USE_FORTIFY_LEVEL
28#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 030#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
29# if _FORTIFY_SOURCE > 131# if _FORTIFY_SOURCE > 1
lib/libc/include/any-macos-any/secure/_stdio.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2007, 2010 Apple Inc. All rights reserved.2 * Copyright (c) 2007, 2010, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
lib/libc/include/any-macos-any/secure/_string.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2007,2017 Apple Inc. All rights reserved.2 * Copyright (c) 2007,2017,2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
lib/libc/include/any-macos-any/secure/_strings.h+2-2
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.2 * Copyright (c) 2017, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
...@@ -21,7 +21,7 @@...@@ -21,7 +21,7 @@
21 * @APPLE_LICENSE_HEADER_END@21 * @APPLE_LICENSE_HEADER_END@
22 */22 */
2323
24#ifndef _STRINGS_H_24#ifndef __STRINGS_H_
25# error "Never use <secure/_strings.h> directly; include <strings.h> instead."25# error "Never use <secure/_strings.h> directly; include <strings.h> instead."
26#endif26#endif
2727
lib/libc/include/any-macos-any/simd/base.h+14-5
...@@ -32,6 +32,7 @@...@@ -32,6 +32,7 @@
32# endif32# endif
3333
34# if SIMD_COMPILER_HAS_REQUIRED_FEATURES34# if SIMD_COMPILER_HAS_REQUIRED_FEATURES
35# define SIMD_CURRENT_LIBRARY_VERSION 6
35# if __has_include(<TargetConditionals.h>) && __has_include(<Availability.h>)36# if __has_include(<TargetConditionals.h>) && __has_include(<Availability.h>)
36# include <TargetConditionals.h>37# include <TargetConditionals.h>
37# include <Availability.h>38# include <Availability.h>
...@@ -43,19 +44,27 @@...@@ -43,19 +44,27 @@
43 * do not work; these functions are simply unavailable when targeting older44 * do not work; these functions are simply unavailable when targeting older
44 * versions of the library. */45 * versions of the library. */
45# if TARGET_OS_RTKIT46# if TARGET_OS_RTKIT
46# define SIMD_LIBRARY_VERSION 547# define SIMD_LIBRARY_VERSION SIMD_CURRENT_LIBRARY_VERSION
48# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_15_0 || \
49 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_18_0 || \
50 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_11_0 || \
51 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_18_0 || \
52 __XR_OS_VERSION_MIN_REQUIRED >= __XROS_2_0 || \
53 __BRIDGE_OS_VERSION_MIN_REQUIRED >= __BRIDGEOS_9_0 || \
54 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_24_0
55# define SIMD_LIBRARY_VERSION 6
47# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_13_0 || \56# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_13_0 || \
48 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_16_0 || \57 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_16_0 || \
49 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_9_0 || \58 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_9_0 || \
50 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_16_0 || \59 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_16_0 || \
51 __BRIDGE_OS_VERSION_MIN_REQUIRED >= 70000 || \60 __BRIDGE_OS_VERSION_MIN_REQUIRED >= __BRIDGEOS_7_0 || \
52 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_22_061 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_22_0
53# define SIMD_LIBRARY_VERSION 562# define SIMD_LIBRARY_VERSION 5
54# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_12_0 || \63# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_12_0 || \
55 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_15_0 || \64 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_15_0 || \
56 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_8_0 || \65 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_8_0 || \
57 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_15_0 || \66 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_15_0 || \
58 __BRIDGE_OS_VERSION_MIN_REQUIRED >= 60000 || \67 __BRIDGE_OS_VERSION_MIN_REQUIRED >= __BRIDGEOS_6_0 || \
59 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_21_068 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_21_0
60# define SIMD_LIBRARY_VERSION 469# define SIMD_LIBRARY_VERSION 4
61# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 || \70# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 || \
...@@ -76,14 +85,14 @@...@@ -76,14 +85,14 @@
76# define SIMD_LIBRARY_VERSION 085# define SIMD_LIBRARY_VERSION 0
77# endif86# endif
78# else /* !__has_include(<TargetContidionals.h>) && __has_include(<Availability.h>) */87# else /* !__has_include(<TargetContidionals.h>) && __has_include(<Availability.h>) */
79# define SIMD_LIBRARY_VERSION 588# define SIMD_LIBRARY_VERSION SIMD_CURRENT_LIBRARY_VERSION
80# define __API_AVAILABLE(...) /* Nothing */89# define __API_AVAILABLE(...) /* Nothing */
81# endif90# endif
8291
83/* The simd types interoperate with the native simd intrinsic types for each92/* The simd types interoperate with the native simd intrinsic types for each
84 * architecture; the headers that define those types and operations are93 * architecture; the headers that define those types and operations are
85 * automatically included with simd.h */94 * automatically included with simd.h */
86# if defined __ARM_NEON__95# if defined __ARM_NEON
87# include <arm_neon.h>96# include <arm_neon.h>
88# elif defined __i386__ || defined __x86_64__97# elif defined __i386__ || defined __x86_64__
89# include <immintrin.h>98# include <immintrin.h>
lib/libc/include/any-macos-any/simd/common.h+1135-67
...@@ -158,6 +158,18 @@ static inline SIMD_CFUNC simd_short16 simd_abs(simd_short16 x);...@@ -158,6 +158,18 @@ static inline SIMD_CFUNC simd_short16 simd_abs(simd_short16 x);
158/*! @abstract The elementwise absolute value of x. */158/*! @abstract The elementwise absolute value of x. */
159static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x);159static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x);
160/*! @abstract The elementwise absolute value of x. */160/*! @abstract The elementwise absolute value of x. */
161static inline SIMD_CFUNC simd_half2 simd_abs(simd_half2 x);
162/*! @abstract The elementwise absolute value of x. */
163static inline SIMD_CFUNC simd_half3 simd_abs(simd_half3 x);
164/*! @abstract The elementwise absolute value of x. */
165static inline SIMD_CFUNC simd_half4 simd_abs(simd_half4 x);
166/*! @abstract The elementwise absolute value of x. */
167static inline SIMD_CFUNC simd_half8 simd_abs(simd_half8 x);
168/*! @abstract The elementwise absolute value of x. */
169static inline SIMD_CFUNC simd_half16 simd_abs(simd_half16 x);
170/*! @abstract The elementwise absolute value of x. */
171static inline SIMD_CFUNC simd_half32 simd_abs(simd_half32 x);
172/*! @abstract The elementwise absolute value of x. */
161static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x);173static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x);
162/*! @abstract The elementwise absolute value of x. */174/*! @abstract The elementwise absolute value of x. */
163static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x);175static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x);
...@@ -250,6 +262,20 @@ static inline SIMD_CFUNC simd_ushort16 simd_max(simd_ushort16 x, simd_ushort16 y...@@ -250,6 +262,20 @@ static inline SIMD_CFUNC simd_ushort16 simd_max(simd_ushort16 x, simd_ushort16 y
250/*! @abstract The elementwise maximum of x and y. */262/*! @abstract The elementwise maximum of x and y. */
251static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y);263static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y);
252/*! @abstract The elementwise maximum of x and y. */264/*! @abstract The elementwise maximum of x and y. */
265static inline SIMD_CFUNC _Float16 simd_max(_Float16 x, _Float16 y);
266/*! @abstract The elementwise maximum of x and y. */
267static inline SIMD_CFUNC simd_half2 simd_max(simd_half2 x, simd_half2 y);
268/*! @abstract The elementwise maximum of x and y. */
269static inline SIMD_CFUNC simd_half3 simd_max(simd_half3 x, simd_half3 y);
270/*! @abstract The elementwise maximum of x and y. */
271static inline SIMD_CFUNC simd_half4 simd_max(simd_half4 x, simd_half4 y);
272/*! @abstract The elementwise maximum of x and y. */
273static inline SIMD_CFUNC simd_half8 simd_max(simd_half8 x, simd_half8 y);
274/*! @abstract The elementwise maximum of x and y. */
275static inline SIMD_CFUNC simd_half16 simd_max(simd_half16 x, simd_half16 y);
276/*! @abstract The elementwise maximum of x and y. */
277static inline SIMD_CFUNC simd_half32 simd_max(simd_half32 x, simd_half32 y);
278/*! @abstract The elementwise maximum of x and y. */
253static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y);279static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y);
254/*! @abstract The elementwise maximum of x and y. */280/*! @abstract The elementwise maximum of x and y. */
255static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y);281static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y);
...@@ -364,6 +390,20 @@ static inline SIMD_CFUNC simd_ushort16 simd_min(simd_ushort16 x, simd_ushort16 y...@@ -364,6 +390,20 @@ static inline SIMD_CFUNC simd_ushort16 simd_min(simd_ushort16 x, simd_ushort16 y
364/*! @abstract The elementwise minimum of x and y. */390/*! @abstract The elementwise minimum of x and y. */
365static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y);391static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y);
366/*! @abstract The elementwise minimum of x and y. */392/*! @abstract The elementwise minimum of x and y. */
393static inline SIMD_CFUNC _Float16 simd_min(_Float16 x, _Float16 y);
394/*! @abstract The elementwise minimum of x and y. */
395static inline SIMD_CFUNC simd_half2 simd_min(simd_half2 x, simd_half2 y);
396/*! @abstract The elementwise minimum of x and y. */
397static inline SIMD_CFUNC simd_half3 simd_min(simd_half3 x, simd_half3 y);
398/*! @abstract The elementwise minimum of x and y. */
399static inline SIMD_CFUNC simd_half4 simd_min(simd_half4 x, simd_half4 y);
400/*! @abstract The elementwise minimum of x and y. */
401static inline SIMD_CFUNC simd_half8 simd_min(simd_half8 x, simd_half8 y);
402/*! @abstract The elementwise minimum of x and y. */
403static inline SIMD_CFUNC simd_half16 simd_min(simd_half16 x, simd_half16 y);
404/*! @abstract The elementwise minimum of x and y. */
405static inline SIMD_CFUNC simd_half32 simd_min(simd_half32 x, simd_half32 y);
406/*! @abstract The elementwise minimum of x and y. */
367static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y);407static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y);
368/*! @abstract The elementwise minimum of x and y. */408/*! @abstract The elementwise minimum of x and y. */
369static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y);409static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y);
...@@ -530,6 +570,34 @@ static inline SIMD_CFUNC simd_ushort16 simd_clamp(simd_ushort16 x, simd_ushort16...@@ -530,6 +570,34 @@ static inline SIMD_CFUNC simd_ushort16 simd_clamp(simd_ushort16 x, simd_ushort16
530 * @discussion Note that if you want to clamp all lanes to the same range,570 * @discussion Note that if you want to clamp all lanes to the same range,
531 * you can use a scalar value for min and max. */571 * you can use a scalar value for min and max. */
532static inline SIMD_CFUNC simd_ushort32 simd_clamp(simd_ushort32 x, simd_ushort32 min, simd_ushort32 max);572static inline SIMD_CFUNC simd_ushort32 simd_clamp(simd_ushort32 x, simd_ushort32 min, simd_ushort32 max);
573/*! @abstract x clamped to the range [min, max].
574 * @discussion Note that if you want to clamp all lanes to the same range,
575 * you can use a scalar value for min and max. */
576static inline SIMD_CFUNC _Float16 simd_clamp(_Float16 x, _Float16 min, _Float16 max);
577/*! @abstract x clamped to the range [min, max].
578 * @discussion Note that if you want to clamp all lanes to the same range,
579 * you can use a scalar value for min and max. */
580static inline SIMD_CFUNC simd_half2 simd_clamp(simd_half2 x, simd_half2 min, simd_half2 max);
581/*! @abstract x clamped to the range [min, max].
582 * @discussion Note that if you want to clamp all lanes to the same range,
583 * you can use a scalar value for min and max. */
584static inline SIMD_CFUNC simd_half3 simd_clamp(simd_half3 x, simd_half3 min, simd_half3 max);
585/*! @abstract x clamped to the range [min, max].
586 * @discussion Note that if you want to clamp all lanes to the same range,
587 * you can use a scalar value for min and max. */
588static inline SIMD_CFUNC simd_half4 simd_clamp(simd_half4 x, simd_half4 min, simd_half4 max);
589/*! @abstract x clamped to the range [min, max].
590 * @discussion Note that if you want to clamp all lanes to the same range,
591 * you can use a scalar value for min and max. */
592static inline SIMD_CFUNC simd_half8 simd_clamp(simd_half8 x, simd_half8 min, simd_half8 max);
593/*! @abstract x clamped to the range [min, max].
594 * @discussion Note that if you want to clamp all lanes to the same range,
595 * you can use a scalar value for min and max. */
596static inline SIMD_CFUNC simd_half16 simd_clamp(simd_half16 x, simd_half16 min, simd_half16 max);
597/*! @abstract x clamped to the range [min, max].
598 * @discussion Note that if you want to clamp all lanes to the same range,
599 * you can use a scalar value for min and max. */
600static inline SIMD_CFUNC simd_half32 simd_clamp(simd_half32 x, simd_half32 min, simd_half32 max);
533/*! @abstract x clamped to the range [min, max].601/*! @abstract x clamped to the range [min, max].
534 * @discussion Note that if you want to clamp all lanes to the same range,602 * @discussion Note that if you want to clamp all lanes to the same range,
535 * you can use a scalar value for min and max. */603 * you can use a scalar value for min and max. */
...@@ -650,6 +718,20 @@ static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 mi...@@ -650,6 +718,20 @@ static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 mi
650 * @discussion Deprecated. Use simd_clamp(x,min,max) instead. */718 * @discussion Deprecated. Use simd_clamp(x,min,max) instead. */
651#define vector_clamp simd_clamp719#define vector_clamp simd_clamp
652 720
721/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
722static inline SIMD_CFUNC _Float16 simd_sign(_Float16 x);
723/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
724static inline SIMD_CFUNC simd_half2 simd_sign(simd_half2 x);
725/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
726static inline SIMD_CFUNC simd_half3 simd_sign(simd_half3 x);
727/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
728static inline SIMD_CFUNC simd_half4 simd_sign(simd_half4 x);
729/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
730static inline SIMD_CFUNC simd_half8 simd_sign(simd_half8 x);
731/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
732static inline SIMD_CFUNC simd_half16 simd_sign(simd_half16 x);
733/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
734static inline SIMD_CFUNC simd_half32 simd_sign(simd_half32 x);
653/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */735/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
654static inline SIMD_CFUNC float simd_sign(float x);736static inline SIMD_CFUNC float simd_sign(float x);
655/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */737/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
...@@ -676,6 +758,27 @@ static inline SIMD_CFUNC simd_double8 simd_sign(simd_double8 x);...@@ -676,6 +758,27 @@ static inline SIMD_CFUNC simd_double8 simd_sign(simd_double8 x);
676 * @discussion Deprecated. Use simd_sign(x) instead. */758 * @discussion Deprecated. Use simd_sign(x) instead. */
677#define vector_sign simd_sign759#define vector_sign simd_sign
678760
761/*! @abstract Linearly interpolates between x and y, taking the value x when
762 * t=0 and y when t=1 */
763static inline SIMD_CFUNC _Float16 simd_mix(_Float16 x, _Float16 y, _Float16 t);
764/*! @abstract Linearly interpolates between x and y, taking the value x when
765 * t=0 and y when t=1 */
766static inline SIMD_CFUNC simd_half2 simd_mix(simd_half2 x, simd_half2 y, simd_half2 t);
767/*! @abstract Linearly interpolates between x and y, taking the value x when
768 * t=0 and y when t=1 */
769static inline SIMD_CFUNC simd_half3 simd_mix(simd_half3 x, simd_half3 y, simd_half3 t);
770/*! @abstract Linearly interpolates between x and y, taking the value x when
771 * t=0 and y when t=1 */
772static inline SIMD_CFUNC simd_half4 simd_mix(simd_half4 x, simd_half4 y, simd_half4 t);
773/*! @abstract Linearly interpolates between x and y, taking the value x when
774 * t=0 and y when t=1 */
775static inline SIMD_CFUNC simd_half8 simd_mix(simd_half8 x, simd_half8 y, simd_half8 t);
776/*! @abstract Linearly interpolates between x and y, taking the value x when
777 * t=0 and y when t=1 */
778static inline SIMD_CFUNC simd_half16 simd_mix(simd_half16 x, simd_half16 y, simd_half16 t);
779/*! @abstract Linearly interpolates between x and y, taking the value x when
780 * t=0 and y when t=1 */
781static inline SIMD_CFUNC simd_half32 simd_mix(simd_half32 x, simd_half32 y, simd_half32 t);
679/*! @abstract Linearly interpolates between x and y, taking the value x when782/*! @abstract Linearly interpolates between x and y, taking the value x when
680 * t=0 and y when t=1 */783 * t=0 and y when t=1 */
681static inline SIMD_CFUNC float simd_mix(float x, float y, float t);784static inline SIMD_CFUNC float simd_mix(float x, float y, float t);
...@@ -715,6 +818,41 @@ static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, s...@@ -715,6 +818,41 @@ static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, s
715#define vector_mix simd_mix818#define vector_mix simd_mix
716#define simd_lerp simd_mix819#define simd_lerp simd_mix
717820
821/*! @abstract A good approximation to 1/x.
822 * @discussion If x is very close to the limits of representation, the
823 * result may overflow or underflow; otherwise this function is accurate to
824 * a few units in the last place (ULPs). */
825static inline SIMD_CFUNC _Float16 simd_precise_recip(_Float16 x);
826/*! @abstract A good approximation to 1/x.
827 * @discussion If x is very close to the limits of representation, the
828 * result may overflow or underflow; otherwise this function is accurate to
829 * a few units in the last place (ULPs). */
830static inline SIMD_CFUNC simd_half2 simd_precise_recip(simd_half2 x);
831/*! @abstract A good approximation to 1/x.
832 * @discussion If x is very close to the limits of representation, the
833 * result may overflow or underflow; otherwise this function is accurate to
834 * a few units in the last place (ULPs). */
835static inline SIMD_CFUNC simd_half3 simd_precise_recip(simd_half3 x);
836/*! @abstract A good approximation to 1/x.
837 * @discussion If x is very close to the limits of representation, the
838 * result may overflow or underflow; otherwise this function is accurate to
839 * a few units in the last place (ULPs). */
840static inline SIMD_CFUNC simd_half4 simd_precise_recip(simd_half4 x);
841/*! @abstract A good approximation to 1/x.
842 * @discussion If x is very close to the limits of representation, the
843 * result may overflow or underflow; otherwise this function is accurate to
844 * a few units in the last place (ULPs). */
845static inline SIMD_CFUNC simd_half8 simd_precise_recip(simd_half8 x);
846/*! @abstract A good approximation to 1/x.
847 * @discussion If x is very close to the limits of representation, the
848 * result may overflow or underflow; otherwise this function is accurate to
849 * a few units in the last place (ULPs). */
850static inline SIMD_CFUNC simd_half16 simd_precise_recip(simd_half16 x);
851/*! @abstract A good approximation to 1/x.
852 * @discussion If x is very close to the limits of representation, the
853 * result may overflow or underflow; otherwise this function is accurate to
854 * a few units in the last place (ULPs). */
855static inline SIMD_CFUNC simd_half32 simd_precise_recip(simd_half32 x);
718/*! @abstract A good approximation to 1/x.856/*! @abstract A good approximation to 1/x.
719 * @discussion If x is very close to the limits of representation, the857 * @discussion If x is very close to the limits of representation, the
720 * result may overflow or underflow; otherwise this function is accurate to858 * result may overflow or underflow; otherwise this function is accurate to
...@@ -774,6 +912,41 @@ static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x);...@@ -774,6 +912,41 @@ static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x);
774 * @discussion Deprecated. Use simd_precise_recip(x) instead. */912 * @discussion Deprecated. Use simd_precise_recip(x) instead. */
775#define vector_precise_recip simd_precise_recip913#define vector_precise_recip simd_precise_recip
776914
915/*! @abstract A fast approximation to 1/x.
916 * @discussion If x is very close to the limits of representation, the
917 * result may overflow or underflow; otherwise this function is accurate to
918 * at least 11 bits for float and 22 bits for double. */
919static inline SIMD_CFUNC _Float16 simd_fast_recip(_Float16 x);
920/*! @abstract A fast approximation to 1/x.
921 * @discussion If x is very close to the limits of representation, the
922 * result may overflow or underflow; otherwise this function is accurate to
923 * at least 11 bits for float and 22 bits for double. */
924static inline SIMD_CFUNC simd_half2 simd_fast_recip(simd_half2 x);
925/*! @abstract A fast approximation to 1/x.
926 * @discussion If x is very close to the limits of representation, the
927 * result may overflow or underflow; otherwise this function is accurate to
928 * at least 11 bits for float and 22 bits for double. */
929static inline SIMD_CFUNC simd_half3 simd_fast_recip(simd_half3 x);
930/*! @abstract A fast approximation to 1/x.
931 * @discussion If x is very close to the limits of representation, the
932 * result may overflow or underflow; otherwise this function is accurate to
933 * at least 11 bits for float and 22 bits for double. */
934static inline SIMD_CFUNC simd_half4 simd_fast_recip(simd_half4 x);
935/*! @abstract A fast approximation to 1/x.
936 * @discussion If x is very close to the limits of representation, the
937 * result may overflow or underflow; otherwise this function is accurate to
938 * at least 11 bits for float and 22 bits for double. */
939static inline SIMD_CFUNC simd_half8 simd_fast_recip(simd_half8 x);
940/*! @abstract A fast approximation to 1/x.
941 * @discussion If x is very close to the limits of representation, the
942 * result may overflow or underflow; otherwise this function is accurate to
943 * at least 11 bits for float and 22 bits for double. */
944static inline SIMD_CFUNC simd_half16 simd_fast_recip(simd_half16 x);
945/*! @abstract A fast approximation to 1/x.
946 * @discussion If x is very close to the limits of representation, the
947 * result may overflow or underflow; otherwise this function is accurate to
948 * at least 11 bits for float and 22 bits for double. */
949static inline SIMD_CFUNC simd_half32 simd_fast_recip(simd_half32 x);
777/*! @abstract A fast approximation to 1/x.950/*! @abstract A fast approximation to 1/x.
778 * @discussion If x is very close to the limits of representation, the951 * @discussion If x is very close to the limits of representation, the
779 * result may overflow or underflow; otherwise this function is accurate to952 * result may overflow or underflow; otherwise this function is accurate to
...@@ -833,6 +1006,48 @@ static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x);...@@ -833,6 +1006,48 @@ static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x);
833 * @discussion Deprecated. Use simd_fast_recip(x) instead. */1006 * @discussion Deprecated. Use simd_fast_recip(x) instead. */
834#define vector_fast_recip simd_fast_recip1007#define vector_fast_recip simd_fast_recip
8351008
1009/*! @abstract An approximation to 1/x.
1010 * @discussion If x is very close to the limits of representation, the
1011 * result may overflow or underflow. This function maps to
1012 * simd_fast_recip(x) if -ffast-math is specified, and to
1013 * simd_precise_recip(x) otherwise. */
1014static inline SIMD_CFUNC _Float16 simd_recip(_Float16 x);
1015/*! @abstract An approximation to 1/x.
1016 * @discussion If x is very close to the limits of representation, the
1017 * result may overflow or underflow. This function maps to
1018 * simd_fast_recip(x) if -ffast-math is specified, and to
1019 * simd_precise_recip(x) otherwise. */
1020static inline SIMD_CFUNC simd_half2 simd_recip(simd_half2 x);
1021/*! @abstract An approximation to 1/x.
1022 * @discussion If x is very close to the limits of representation, the
1023 * result may overflow or underflow. This function maps to
1024 * simd_fast_recip(x) if -ffast-math is specified, and to
1025 * simd_precise_recip(x) otherwise. */
1026static inline SIMD_CFUNC simd_half3 simd_recip(simd_half3 x);
1027/*! @abstract An approximation to 1/x.
1028 * @discussion If x is very close to the limits of representation, the
1029 * result may overflow or underflow. This function maps to
1030 * simd_fast_recip(x) if -ffast-math is specified, and to
1031 * simd_precise_recip(x) otherwise. */
1032static inline SIMD_CFUNC simd_half4 simd_recip(simd_half4 x);
1033/*! @abstract An approximation to 1/x.
1034 * @discussion If x is very close to the limits of representation, the
1035 * result may overflow or underflow. This function maps to
1036 * simd_fast_recip(x) if -ffast-math is specified, and to
1037 * simd_precise_recip(x) otherwise. */
1038static inline SIMD_CFUNC simd_half8 simd_recip(simd_half8 x);
1039/*! @abstract An approximation to 1/x.
1040 * @discussion If x is very close to the limits of representation, the
1041 * result may overflow or underflow. This function maps to
1042 * simd_fast_recip(x) if -ffast-math is specified, and to
1043 * simd_precise_recip(x) otherwise. */
1044static inline SIMD_CFUNC simd_half16 simd_recip(simd_half16 x);
1045/*! @abstract An approximation to 1/x.
1046 * @discussion If x is very close to the limits of representation, the
1047 * result may overflow or underflow. This function maps to
1048 * simd_fast_recip(x) if -ffast-math is specified, and to
1049 * simd_precise_recip(x) otherwise. */
1050static inline SIMD_CFUNC simd_half32 simd_recip(simd_half32 x);
836/*! @abstract An approximation to 1/x.1051/*! @abstract An approximation to 1/x.
837 * @discussion If x is very close to the limits of representation, the1052 * @discussion If x is very close to the limits of representation, the
838 * result may overflow or underflow. This function maps to1053 * result may overflow or underflow. This function maps to
...@@ -903,6 +1118,34 @@ static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x);...@@ -903,6 +1118,34 @@ static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x);
903 * @discussion Deprecated. Use simd_recip(x) instead. */1118 * @discussion Deprecated. Use simd_recip(x) instead. */
904#define vector_recip simd_recip1119#define vector_recip simd_recip
9051120
1121/*! @abstract A good approximation to 1/sqrt(x).
1122 * @discussion This function is accurate to a few units in the last place
1123 * (ULPs). */
1124static inline SIMD_CFUNC _Float16 simd_precise_rsqrt(_Float16 x);
1125/*! @abstract A good approximation to 1/sqrt(x).
1126 * @discussion This function is accurate to a few units in the last place
1127 * (ULPs). */
1128static inline SIMD_CFUNC simd_half2 simd_precise_rsqrt(simd_half2 x);
1129/*! @abstract A good approximation to 1/sqrt(x).
1130 * @discussion This function is accurate to a few units in the last place
1131 * (ULPs). */
1132static inline SIMD_CFUNC simd_half3 simd_precise_rsqrt(simd_half3 x);
1133/*! @abstract A good approximation to 1/sqrt(x).
1134 * @discussion This function is accurate to a few units in the last place
1135 * (ULPs). */
1136static inline SIMD_CFUNC simd_half4 simd_precise_rsqrt(simd_half4 x);
1137/*! @abstract A good approximation to 1/sqrt(x).
1138 * @discussion This function is accurate to a few units in the last place
1139 * (ULPs). */
1140static inline SIMD_CFUNC simd_half8 simd_precise_rsqrt(simd_half8 x);
1141/*! @abstract A good approximation to 1/sqrt(x).
1142 * @discussion This function is accurate to a few units in the last place
1143 * (ULPs). */
1144static inline SIMD_CFUNC simd_half16 simd_precise_rsqrt(simd_half16 x);
1145/*! @abstract A good approximation to 1/sqrt(x).
1146 * @discussion This function is accurate to a few units in the last place
1147 * (ULPs). */
1148static inline SIMD_CFUNC simd_half32 simd_precise_rsqrt(simd_half32 x);
906/*! @abstract A good approximation to 1/sqrt(x).1149/*! @abstract A good approximation to 1/sqrt(x).
907 * @discussion This function is accurate to a few units in the last place1150 * @discussion This function is accurate to a few units in the last place
908 * (ULPs). */1151 * (ULPs). */
...@@ -951,6 +1194,34 @@ static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x);...@@ -951,6 +1194,34 @@ static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x);
951 * @discussion Deprecated. Use simd_precise_rsqrt(x) instead. */1194 * @discussion Deprecated. Use simd_precise_rsqrt(x) instead. */
952#define vector_precise_rsqrt simd_precise_rsqrt1195#define vector_precise_rsqrt simd_precise_rsqrt
9531196
1197/*! @abstract A fast approximation to 1/sqrt(x).
1198 * @discussion This function is accurate to at least 11 bits for float and
1199 * 22 bits for double. */
1200static inline SIMD_CFUNC _Float16 simd_fast_rsqrt(_Float16 x);
1201/*! @abstract A fast approximation to 1/sqrt(x).
1202 * @discussion This function is accurate to at least 11 bits for float and
1203 * 22 bits for double. */
1204static inline SIMD_CFUNC simd_half2 simd_fast_rsqrt(simd_half2 x);
1205/*! @abstract A fast approximation to 1/sqrt(x).
1206 * @discussion This function is accurate to at least 11 bits for float and
1207 * 22 bits for double. */
1208static inline SIMD_CFUNC simd_half3 simd_fast_rsqrt(simd_half3 x);
1209/*! @abstract A fast approximation to 1/sqrt(x).
1210 * @discussion This function is accurate to at least 11 bits for float and
1211 * 22 bits for double. */
1212static inline SIMD_CFUNC simd_half4 simd_fast_rsqrt(simd_half4 x);
1213/*! @abstract A fast approximation to 1/sqrt(x).
1214 * @discussion This function is accurate to at least 11 bits for float and
1215 * 22 bits for double. */
1216static inline SIMD_CFUNC simd_half8 simd_fast_rsqrt(simd_half8 x);
1217/*! @abstract A fast approximation to 1/sqrt(x).
1218 * @discussion This function is accurate to at least 11 bits for float and
1219 * 22 bits for double. */
1220static inline SIMD_CFUNC simd_half16 simd_fast_rsqrt(simd_half16 x);
1221/*! @abstract A fast approximation to 1/sqrt(x).
1222 * @discussion This function is accurate to at least 11 bits for float and
1223 * 22 bits for double. */
1224static inline SIMD_CFUNC simd_half32 simd_fast_rsqrt(simd_half32 x);
954/*! @abstract A fast approximation to 1/sqrt(x).1225/*! @abstract A fast approximation to 1/sqrt(x).
955 * @discussion This function is accurate to at least 11 bits for float and1226 * @discussion This function is accurate to at least 11 bits for float and
956 * 22 bits for double. */1227 * 22 bits for double. */
...@@ -999,6 +1270,34 @@ static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x);...@@ -999,6 +1270,34 @@ static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x);
999 * @discussion Deprecated. Use simd_fast_rsqrt(x) instead. */1270 * @discussion Deprecated. Use simd_fast_rsqrt(x) instead. */
1000#define vector_fast_rsqrt simd_fast_rsqrt1271#define vector_fast_rsqrt simd_fast_rsqrt
10011272
1273/*! @abstract An approximation to 1/sqrt(x).
1274 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1275 * specified, and to simd_precise_recip(x) otherwise. */
1276static inline SIMD_CFUNC _Float16 simd_rsqrt(_Float16 x);
1277/*! @abstract An approximation to 1/sqrt(x).
1278 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1279 * specified, and to simd_precise_recip(x) otherwise. */
1280static inline SIMD_CFUNC simd_half2 simd_rsqrt(simd_half2 x);
1281/*! @abstract An approximation to 1/sqrt(x).
1282 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1283 * specified, and to simd_precise_recip(x) otherwise. */
1284static inline SIMD_CFUNC simd_half3 simd_rsqrt(simd_half3 x);
1285/*! @abstract An approximation to 1/sqrt(x).
1286 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1287 * specified, and to simd_precise_recip(x) otherwise. */
1288static inline SIMD_CFUNC simd_half4 simd_rsqrt(simd_half4 x);
1289/*! @abstract An approximation to 1/sqrt(x).
1290 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1291 * specified, and to simd_precise_recip(x) otherwise. */
1292static inline SIMD_CFUNC simd_half8 simd_rsqrt(simd_half8 x);
1293/*! @abstract An approximation to 1/sqrt(x).
1294 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1295 * specified, and to simd_precise_recip(x) otherwise. */
1296static inline SIMD_CFUNC simd_half16 simd_rsqrt(simd_half16 x);
1297/*! @abstract An approximation to 1/sqrt(x).
1298 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1299 * specified, and to simd_precise_recip(x) otherwise. */
1300static inline SIMD_CFUNC simd_half32 simd_rsqrt(simd_half32 x);
1002/*! @abstract An approximation to 1/sqrt(x).1301/*! @abstract An approximation to 1/sqrt(x).
1003 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is1302 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
1004 * specified, and to simd_precise_recip(x) otherwise. */1303 * specified, and to simd_precise_recip(x) otherwise. */
...@@ -1047,6 +1346,34 @@ static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x);...@@ -1047,6 +1346,34 @@ static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x);
1047 * @discussion Deprecated. Use simd_rsqrt(x) instead. */1346 * @discussion Deprecated. Use simd_rsqrt(x) instead. */
1048#define vector_rsqrt simd_rsqrt1347#define vector_rsqrt simd_rsqrt
10491348
1349/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1350 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1351 * positive and finite, then the two values are exactly equal. */
1352static inline SIMD_CFUNC _Float16 simd_fract(_Float16 x);
1353/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1354 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1355 * positive and finite, then the two values are exactly equal. */
1356static inline SIMD_CFUNC simd_half2 simd_fract(simd_half2 x);
1357/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1358 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1359 * positive and finite, then the two values are exactly equal. */
1360static inline SIMD_CFUNC simd_half3 simd_fract(simd_half3 x);
1361/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1362 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1363 * positive and finite, then the two values are exactly equal. */
1364static inline SIMD_CFUNC simd_half4 simd_fract(simd_half4 x);
1365/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1366 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1367 * positive and finite, then the two values are exactly equal. */
1368static inline SIMD_CFUNC simd_half8 simd_fract(simd_half8 x);
1369/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1370 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1371 * positive and finite, then the two values are exactly equal. */
1372static inline SIMD_CFUNC simd_half16 simd_fract(simd_half16 x);
1373/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1374 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1375 * positive and finite, then the two values are exactly equal. */
1376static inline SIMD_CFUNC simd_half32 simd_fract(simd_half32 x);
1050/*! @abstract The "fractional part" of x, lying in the range [0, 1).1377/*! @abstract The "fractional part" of x, lying in the range [0, 1).
1051 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is1378 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
1052 * positive and finite, then the two values are exactly equal. */1379 * positive and finite, then the two values are exactly equal. */
...@@ -1095,6 +1422,34 @@ static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x);...@@ -1095,6 +1422,34 @@ static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x);
1095 * @discussion Deprecated. Use simd_fract(x) instead. */1422 * @discussion Deprecated. Use simd_fract(x) instead. */
1096#define vector_fract simd_fract1423#define vector_fract simd_fract
10971424
1425/*! @abstract 0 if x < edge, and 1 otherwise.
1426 * @discussion Use a scalar value for edge if you want to apply the same
1427 * threshold to all lanes. */
1428static inline SIMD_CFUNC _Float16 simd_step(_Float16 edge, _Float16 x);
1429/*! @abstract 0 if x < edge, and 1 otherwise.
1430 * @discussion Use a scalar value for edge if you want to apply the same
1431 * threshold to all lanes. */
1432static inline SIMD_CFUNC simd_half2 simd_step(simd_half2 edge, simd_half2 x);
1433/*! @abstract 0 if x < edge, and 1 otherwise.
1434 * @discussion Use a scalar value for edge if you want to apply the same
1435 * threshold to all lanes. */
1436static inline SIMD_CFUNC simd_half3 simd_step(simd_half3 edge, simd_half3 x);
1437/*! @abstract 0 if x < edge, and 1 otherwise.
1438 * @discussion Use a scalar value for edge if you want to apply the same
1439 * threshold to all lanes. */
1440static inline SIMD_CFUNC simd_half4 simd_step(simd_half4 edge, simd_half4 x);
1441/*! @abstract 0 if x < edge, and 1 otherwise.
1442 * @discussion Use a scalar value for edge if you want to apply the same
1443 * threshold to all lanes. */
1444static inline SIMD_CFUNC simd_half8 simd_step(simd_half8 edge, simd_half8 x);
1445/*! @abstract 0 if x < edge, and 1 otherwise.
1446 * @discussion Use a scalar value for edge if you want to apply the same
1447 * threshold to all lanes. */
1448static inline SIMD_CFUNC simd_half16 simd_step(simd_half16 edge, simd_half16 x);
1449/*! @abstract 0 if x < edge, and 1 otherwise.
1450 * @discussion Use a scalar value for edge if you want to apply the same
1451 * threshold to all lanes. */
1452static inline SIMD_CFUNC simd_half32 simd_step(simd_half32 edge, simd_half32 x);
1098/*! @abstract 0 if x < edge, and 1 otherwise.1453/*! @abstract 0 if x < edge, and 1 otherwise.
1099 * @discussion Use a scalar value for edge if you want to apply the same1454 * @discussion Use a scalar value for edge if you want to apply the same
1100 * threshold to all lanes. */1455 * threshold to all lanes. */
...@@ -1143,6 +1498,34 @@ static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8...@@ -1143,6 +1498,34 @@ static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8
1143 * @discussion Deprecated. Use simd_step(edge, x) instead. */1498 * @discussion Deprecated. Use simd_step(edge, x) instead. */
1144#define vector_step simd_step1499#define vector_step simd_step
11451500
1501/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1502 * @discussion You can use a scalar value for edge0 and edge1 if you want
1503 * to clamp all lanes at the same points. */
1504static inline SIMD_CFUNC _Float16 simd_smoothstep(_Float16 edge0, _Float16 edge1, _Float16 x);
1505/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1506 * @discussion You can use a scalar value for edge0 and edge1 if you want
1507 * to clamp all lanes at the same points. */
1508static inline SIMD_CFUNC simd_half2 simd_smoothstep(simd_half2 edge0, simd_half2 edge1, simd_half2 x);
1509/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1510 * @discussion You can use a scalar value for edge0 and edge1 if you want
1511 * to clamp all lanes at the same points. */
1512static inline SIMD_CFUNC simd_half3 simd_smoothstep(simd_half3 edge0, simd_half3 edge1, simd_half3 x);
1513/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1514 * @discussion You can use a scalar value for edge0 and edge1 if you want
1515 * to clamp all lanes at the same points. */
1516static inline SIMD_CFUNC simd_half4 simd_smoothstep(simd_half4 edge0, simd_half4 edge1, simd_half4 x);
1517/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1518 * @discussion You can use a scalar value for edge0 and edge1 if you want
1519 * to clamp all lanes at the same points. */
1520static inline SIMD_CFUNC simd_half8 simd_smoothstep(simd_half8 edge0, simd_half8 edge1, simd_half8 x);
1521/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1522 * @discussion You can use a scalar value for edge0 and edge1 if you want
1523 * to clamp all lanes at the same points. */
1524static inline SIMD_CFUNC simd_half16 simd_smoothstep(simd_half16 edge0, simd_half16 edge1, simd_half16 x);
1525/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1526 * @discussion You can use a scalar value for edge0 and edge1 if you want
1527 * to clamp all lanes at the same points. */
1528static inline SIMD_CFUNC simd_half32 simd_smoothstep(simd_half32 edge0, simd_half32 edge1, simd_half32 x);
1146/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge11529/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
1147 * @discussion You can use a scalar value for edge0 and edge1 if you want1530 * @discussion You can use a scalar value for edge0 and edge1 if you want
1148 * to clamp all lanes at the same points. */1531 * to clamp all lanes at the same points. */
...@@ -1295,6 +1678,30 @@ static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort16 x);...@@ -1295,6 +1678,30 @@ static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort16 x);
1295 * @discussion This computation may overflow; especial for 8-bit types you1678 * @discussion This computation may overflow; especial for 8-bit types you
1296 * may need to convert to a wider type before reducing. */1679 * may need to convert to a wider type before reducing. */
1297static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x);1680static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x);
1681/*! @abstract Sum of elements in x.
1682 * @discussion This computation may overflow; especial for 8-bit types you
1683 * may need to convert to a wider type before reducing. */
1684static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half2 x);
1685/*! @abstract Sum of elements in x.
1686 * @discussion This computation may overflow; especial for 8-bit types you
1687 * may need to convert to a wider type before reducing. */
1688static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half3 x);
1689/*! @abstract Sum of elements in x.
1690 * @discussion This computation may overflow; especial for 8-bit types you
1691 * may need to convert to a wider type before reducing. */
1692static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half4 x);
1693/*! @abstract Sum of elements in x.
1694 * @discussion This computation may overflow; especial for 8-bit types you
1695 * may need to convert to a wider type before reducing. */
1696static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half8 x);
1697/*! @abstract Sum of elements in x.
1698 * @discussion This computation may overflow; especial for 8-bit types you
1699 * may need to convert to a wider type before reducing. */
1700static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half16 x);
1701/*! @abstract Sum of elements in x.
1702 * @discussion This computation may overflow; especial for 8-bit types you
1703 * may need to convert to a wider type before reducing. */
1704static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half32 x);
1298/*! @abstract Sum of elements in x.1705/*! @abstract Sum of elements in x.
1299 * @discussion This computation may overflow; especial for 8-bit types you1706 * @discussion This computation may overflow; especial for 8-bit types you
1300 * may need to convert to a wider type before reducing. */1707 * may need to convert to a wider type before reducing. */
...@@ -1460,6 +1867,18 @@ static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort16 x);...@@ -1460,6 +1867,18 @@ static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort16 x);
1460/*! @abstract Minimum of elements in x. */1867/*! @abstract Minimum of elements in x. */
1461static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x);1868static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x);
1462/*! @abstract Minimum of elements in x. */1869/*! @abstract Minimum of elements in x. */
1870static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half2 x);
1871/*! @abstract Minimum of elements in x. */
1872static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half3 x);
1873/*! @abstract Minimum of elements in x. */
1874static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half4 x);
1875/*! @abstract Minimum of elements in x. */
1876static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half8 x);
1877/*! @abstract Minimum of elements in x. */
1878static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half16 x);
1879/*! @abstract Minimum of elements in x. */
1880static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half32 x);
1881/*! @abstract Minimum of elements in x. */
1463static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x);1882static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x);
1464/*! @abstract Minimum of elements in x. */1883/*! @abstract Minimum of elements in x. */
1465static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x);1884static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x);
...@@ -1570,6 +1989,18 @@ static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort16 x);...@@ -1570,6 +1989,18 @@ static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort16 x);
1570/*! @abstract Maximum of elements in x. */1989/*! @abstract Maximum of elements in x. */
1571static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x);1990static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x);
1572/*! @abstract Maximum of elements in x. */1991/*! @abstract Maximum of elements in x. */
1992static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half2 x);
1993/*! @abstract Maximum of elements in x. */
1994static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half3 x);
1995/*! @abstract Maximum of elements in x. */
1996static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half4 x);
1997/*! @abstract Maximum of elements in x. */
1998static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half8 x);
1999/*! @abstract Maximum of elements in x. */
2000static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half16 x);
2001/*! @abstract Maximum of elements in x. */
2002static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half32 x);
2003/*! @abstract Maximum of elements in x. */
1573static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x);2004static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x);
1574/*! @abstract Maximum of elements in x. */2005/*! @abstract Maximum of elements in x. */
1575static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x);2006static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x);
...@@ -1757,6 +2188,36 @@ static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort16 x, simd_ushort16 y)...@@ -1757,6 +2188,36 @@ static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort16 x, simd_ushort16 y)
1757static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort32 x, simd_ushort32 y) {2188static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort32 x, simd_ushort32 y) {
1758 return simd_all(x == y);2189 return simd_all(x == y);
1759}2190}
2191/*! @abstract True if and only if each lane of x is equal to the
2192 * corresponding lane of y. */
2193static inline SIMD_CFUNC simd_bool simd_equal(simd_half2 x, simd_half2 y) {
2194 return simd_all(x == y);
2195}
2196/*! @abstract True if and only if each lane of x is equal to the
2197 * corresponding lane of y. */
2198static inline SIMD_CFUNC simd_bool simd_equal(simd_half3 x, simd_half3 y) {
2199 return simd_all(x == y);
2200}
2201/*! @abstract True if and only if each lane of x is equal to the
2202 * corresponding lane of y. */
2203static inline SIMD_CFUNC simd_bool simd_equal(simd_half4 x, simd_half4 y) {
2204 return simd_all(x == y);
2205}
2206/*! @abstract True if and only if each lane of x is equal to the
2207 * corresponding lane of y. */
2208static inline SIMD_CFUNC simd_bool simd_equal(simd_half8 x, simd_half8 y) {
2209 return simd_all(x == y);
2210}
2211/*! @abstract True if and only if each lane of x is equal to the
2212 * corresponding lane of y. */
2213static inline SIMD_CFUNC simd_bool simd_equal(simd_half16 x, simd_half16 y) {
2214 return simd_all(x == y);
2215}
2216/*! @abstract True if and only if each lane of x is equal to the
2217 * corresponding lane of y. */
2218static inline SIMD_CFUNC simd_bool simd_equal(simd_half32 x, simd_half32 y) {
2219 return simd_all(x == y);
2220}
1760/*! @abstract True if and only if each lane of x is equal to the2221/*! @abstract True if and only if each lane of x is equal to the
1761 * corresponding lane of y. */2222 * corresponding lane of y. */
1762static inline SIMD_CFUNC simd_bool simd_equal(simd_int2 x, simd_int2 y) {2223static inline SIMD_CFUNC simd_bool simd_equal(simd_int2 x, simd_int2 y) {
...@@ -1969,7 +2430,7 @@ static inline SIMD_CFUNC simd_char4 simd_abs(simd_char4 x) {...@@ -1969,7 +2430,7 @@ static inline SIMD_CFUNC simd_char4 simd_abs(simd_char4 x) {
1969}2430}
19702431
1971static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x) {2432static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x) {
1972#if defined __arm__ || defined __arm64__2433#if defined __arm__ || defined __arm64__ || defined __aarch64__
1973 return vabs_s8(x);2434 return vabs_s8(x);
1974#else2435#else
1975 return simd_make_char8(simd_abs(simd_make_char16_undef(x)));2436 return simd_make_char8(simd_abs(simd_make_char16_undef(x)));
...@@ -1977,7 +2438,7 @@ static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x) {...@@ -1977,7 +2438,7 @@ static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x) {
1977}2438}
19782439
1979static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x) {2440static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x) {
1980#if defined __arm__ || defined __arm64__2441#if defined __arm__ || defined __arm64__ || defined __aarch64__
1981 return vabsq_s8(x);2442 return vabsq_s8(x);
1982#elif defined __SSE4_1__2443#elif defined __SSE4_1__
1983 return (simd_char16) _mm_abs_epi8((__m128i)x);2444 return (simd_char16) _mm_abs_epi8((__m128i)x);
...@@ -2011,7 +2472,7 @@ static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x) {...@@ -2011,7 +2472,7 @@ static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x) {
2011}2472}
20122473
2013static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x) {2474static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x) {
2014#if defined __arm__ || defined __arm64__2475#if defined __arm__ || defined __arm64__ || defined __aarch64__
2015 return vabs_s16(x);2476 return vabs_s16(x);
2016#else2477#else
2017 return simd_make_short4(simd_abs(simd_make_short8_undef(x)));2478 return simd_make_short4(simd_abs(simd_make_short8_undef(x)));
...@@ -2019,7 +2480,7 @@ static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x) {...@@ -2019,7 +2480,7 @@ static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x) {
2019}2480}
20202481
2021static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x) {2482static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x) {
2022#if defined __arm__ || defined __arm64__2483#if defined __arm__ || defined __arm64__ || defined __aarch64__
2023 return vabsq_s16(x);2484 return vabsq_s16(x);
2024#elif defined __SSE4_1__2485#elif defined __SSE4_1__
2025 return (simd_short8) _mm_abs_epi16((__m128i)x);2486 return (simd_short8) _mm_abs_epi16((__m128i)x);
...@@ -2044,8 +2505,32 @@ static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x) {...@@ -2044,8 +2505,32 @@ static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x) {
2044#endif2505#endif
2045}2506}
20462507
2508static inline SIMD_CFUNC simd_half2 simd_abs(simd_half2 x) {
2509 return __tg_fabs(x);
2510}
2511
2512static inline SIMD_CFUNC simd_half3 simd_abs(simd_half3 x) {
2513 return __tg_fabs(x);
2514}
2515
2516static inline SIMD_CFUNC simd_half4 simd_abs(simd_half4 x) {
2517 return __tg_fabs(x);
2518}
2519
2520static inline SIMD_CFUNC simd_half8 simd_abs(simd_half8 x) {
2521 return __tg_fabs(x);
2522}
2523
2524static inline SIMD_CFUNC simd_half16 simd_abs(simd_half16 x) {
2525 return __tg_fabs(x);
2526}
2527
2528static inline SIMD_CFUNC simd_half32 simd_abs(simd_half32 x) {
2529 return __tg_fabs(x);
2530}
2531
2047static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x) {2532static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x) {
2048#if defined __arm__ || defined __arm64__2533#if defined __arm__ || defined __arm64__ || defined __aarch64__
2049 return vabs_s32(x);2534 return vabs_s32(x);
2050#else2535#else
2051 return simd_make_int2(simd_abs(simd_make_int4_undef(x)));2536 return simd_make_int2(simd_abs(simd_make_int4_undef(x)));
...@@ -2057,7 +2542,7 @@ static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x) {...@@ -2057,7 +2542,7 @@ static inline SIMD_CFUNC simd_int3 simd_abs(simd_int3 x) {
2057}2542}
20582543
2059static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x) {2544static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x) {
2060#if defined __arm__ || defined __arm64__2545#if defined __arm__ || defined __arm64__ || defined __aarch64__
2061 return vabsq_s32(x);2546 return vabsq_s32(x);
2062#elif defined __SSE4_1__2547#elif defined __SSE4_1__
2063 return (simd_int4) _mm_abs_epi32((__m128i)x);2548 return (simd_int4) _mm_abs_epi32((__m128i)x);
...@@ -2103,7 +2588,7 @@ static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x) {...@@ -2103,7 +2588,7 @@ static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x) {
2103}2588}
21042589
2105static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x) {2590static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x) {
2106#if defined __arm64__2591#if defined __arm64__ || defined __aarch64__
2107 return vabsq_s64(x);2592 return vabsq_s64(x);
2108#elif defined __AVX512VL__2593#elif defined __AVX512VL__
2109 return (simd_long2) _mm_abs_epi64((__m128i)x);2594 return (simd_long2) _mm_abs_epi64((__m128i)x);
...@@ -2161,7 +2646,7 @@ static inline SIMD_CFUNC simd_char4 simd_min(simd_char4 x, simd_char4 y) {...@@ -2161,7 +2646,7 @@ static inline SIMD_CFUNC simd_char4 simd_min(simd_char4 x, simd_char4 y) {
2161}2646}
21622647
2163static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y) {2648static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y) {
2164#if defined __arm__ || defined __arm64__2649#if defined __arm__ || defined __arm64__ || defined __aarch64__
2165 return vmin_s8(x, y);2650 return vmin_s8(x, y);
2166#else2651#else
2167 return simd_make_char8(simd_min(simd_make_char16_undef(x), simd_make_char16_undef(y)));2652 return simd_make_char8(simd_min(simd_make_char16_undef(x), simd_make_char16_undef(y)));
...@@ -2170,7 +2655,7 @@ static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y) {...@@ -2170,7 +2655,7 @@ static inline SIMD_CFUNC simd_char8 simd_min(simd_char8 x, simd_char8 y) {
2170}2655}
21712656
2172static inline SIMD_CFUNC simd_char16 simd_min(simd_char16 x, simd_char16 y) {2657static inline SIMD_CFUNC simd_char16 simd_min(simd_char16 x, simd_char16 y) {
2173#if defined __arm__ || defined __arm64__2658#if defined __arm__ || defined __arm64__ || defined __aarch64__
2174 return vminq_s8(x, y);2659 return vminq_s8(x, y);
2175#elif defined __SSE4_1__2660#elif defined __SSE4_1__
2176 return (simd_char16) _mm_min_epi8((__m128i)x, (__m128i)y);2661 return (simd_char16) _mm_min_epi8((__m128i)x, (__m128i)y);
...@@ -2208,7 +2693,7 @@ static inline SIMD_CFUNC simd_uchar4 simd_min(simd_uchar4 x, simd_uchar4 y) {...@@ -2208,7 +2693,7 @@ static inline SIMD_CFUNC simd_uchar4 simd_min(simd_uchar4 x, simd_uchar4 y) {
2208}2693}
22092694
2210static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y) {2695static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y) {
2211#if defined __arm__ || defined __arm64__2696#if defined __arm__ || defined __arm64__ || defined __aarch64__
2212 return vmin_u8(x, y);2697 return vmin_u8(x, y);
2213#else2698#else
2214 return simd_make_uchar8(simd_min(simd_make_uchar16_undef(x), simd_make_uchar16_undef(y)));2699 return simd_make_uchar8(simd_min(simd_make_uchar16_undef(x), simd_make_uchar16_undef(y)));
...@@ -2217,7 +2702,7 @@ static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y) {...@@ -2217,7 +2702,7 @@ static inline SIMD_CFUNC simd_uchar8 simd_min(simd_uchar8 x, simd_uchar8 y) {
2217}2702}
22182703
2219static inline SIMD_CFUNC simd_uchar16 simd_min(simd_uchar16 x, simd_uchar16 y) {2704static inline SIMD_CFUNC simd_uchar16 simd_min(simd_uchar16 x, simd_uchar16 y) {
2220#if defined __arm__ || defined __arm64__2705#if defined __arm__ || defined __arm64__ || defined __aarch64__
2221 return vminq_u8(x, y);2706 return vminq_u8(x, y);
2222#elif defined __SSE4_1__2707#elif defined __SSE4_1__
2223 return (simd_uchar16) _mm_min_epu8((__m128i)x, (__m128i)y);2708 return (simd_uchar16) _mm_min_epu8((__m128i)x, (__m128i)y);
...@@ -2251,7 +2736,7 @@ static inline SIMD_CFUNC simd_short3 simd_min(simd_short3 x, simd_short3 y) {...@@ -2251,7 +2736,7 @@ static inline SIMD_CFUNC simd_short3 simd_min(simd_short3 x, simd_short3 y) {
2251}2736}
22522737
2253static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y) {2738static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y) {
2254#if defined __arm__ || defined __arm64__2739#if defined __arm__ || defined __arm64__ || defined __aarch64__
2255 return vmin_s16(x, y);2740 return vmin_s16(x, y);
2256#else2741#else
2257 return simd_make_short4(simd_min(simd_make_short8_undef(x), simd_make_short8_undef(y)));2742 return simd_make_short4(simd_min(simd_make_short8_undef(x), simd_make_short8_undef(y)));
...@@ -2260,7 +2745,7 @@ static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y) {...@@ -2260,7 +2745,7 @@ static inline SIMD_CFUNC simd_short4 simd_min(simd_short4 x, simd_short4 y) {
2260}2745}
22612746
2262static inline SIMD_CFUNC simd_short8 simd_min(simd_short8 x, simd_short8 y) {2747static inline SIMD_CFUNC simd_short8 simd_min(simd_short8 x, simd_short8 y) {
2263#if defined __arm__ || defined __arm64__2748#if defined __arm__ || defined __arm64__ || defined __aarch64__
2264 return vminq_s16(x, y);2749 return vminq_s16(x, y);
2265#elif defined __SSE4_1__2750#elif defined __SSE4_1__
2266 return (simd_short8) _mm_min_epi16((__m128i)x, (__m128i)y);2751 return (simd_short8) _mm_min_epi16((__m128i)x, (__m128i)y);
...@@ -2294,7 +2779,7 @@ static inline SIMD_CFUNC simd_ushort3 simd_min(simd_ushort3 x, simd_ushort3 y) {...@@ -2294,7 +2779,7 @@ static inline SIMD_CFUNC simd_ushort3 simd_min(simd_ushort3 x, simd_ushort3 y) {
2294}2779}
22952780
2296static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y) {2781static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y) {
2297#if defined __arm__ || defined __arm64__2782#if defined __arm__ || defined __arm64__ || defined __aarch64__
2298 return vmin_u16(x, y);2783 return vmin_u16(x, y);
2299#else2784#else
2300 return simd_make_ushort4(simd_min(simd_make_ushort8_undef(x), simd_make_ushort8_undef(y)));2785 return simd_make_ushort4(simd_min(simd_make_ushort8_undef(x), simd_make_ushort8_undef(y)));
...@@ -2303,7 +2788,7 @@ static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y) {...@@ -2303,7 +2788,7 @@ static inline SIMD_CFUNC simd_ushort4 simd_min(simd_ushort4 x, simd_ushort4 y) {
2303}2788}
23042789
2305static inline SIMD_CFUNC simd_ushort8 simd_min(simd_ushort8 x, simd_ushort8 y) {2790static inline SIMD_CFUNC simd_ushort8 simd_min(simd_ushort8 x, simd_ushort8 y) {
2306#if defined __arm__ || defined __arm64__2791#if defined __arm__ || defined __arm64__ || defined __aarch64__
2307 return vminq_u16(x, y);2792 return vminq_u16(x, y);
2308#elif defined __SSE4_1__2793#elif defined __SSE4_1__
2309 return (simd_ushort8) _mm_min_epu16((__m128i)x, (__m128i)y);2794 return (simd_ushort8) _mm_min_epu16((__m128i)x, (__m128i)y);
...@@ -2328,8 +2813,36 @@ static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y...@@ -2328,8 +2813,36 @@ static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y
2328#endif2813#endif
2329}2814}
23302815
2816static inline SIMD_CFUNC _Float16 simd_min(_Float16 x, _Float16 y) {
2817 return __fminf16(x,y);
2818}
2819
2820static inline SIMD_CFUNC simd_half2 simd_min(simd_half2 x, simd_half2 y) {
2821 return __tg_fmin(x,y);
2822}
2823
2824static inline SIMD_CFUNC simd_half3 simd_min(simd_half3 x, simd_half3 y) {
2825 return __tg_fmin(x,y);
2826}
2827
2828static inline SIMD_CFUNC simd_half4 simd_min(simd_half4 x, simd_half4 y) {
2829 return __tg_fmin(x,y);
2830}
2831
2832static inline SIMD_CFUNC simd_half8 simd_min(simd_half8 x, simd_half8 y) {
2833 return __tg_fmin(x,y);
2834}
2835
2836static inline SIMD_CFUNC simd_half16 simd_min(simd_half16 x, simd_half16 y) {
2837 return __tg_fmin(x,y);
2838}
2839
2840static inline SIMD_CFUNC simd_half32 simd_min(simd_half32 x, simd_half32 y) {
2841 return __tg_fmin(x,y);
2842}
2843
2331static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y) {2844static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y) {
2332#if defined __arm__ || defined __arm64__2845#if defined __arm__ || defined __arm64__ || defined __aarch64__
2333 return vmin_s32(x, y);2846 return vmin_s32(x, y);
2334#else2847#else
2335 return simd_make_int2(simd_min(simd_make_int4_undef(x), simd_make_int4_undef(y)));2848 return simd_make_int2(simd_min(simd_make_int4_undef(x), simd_make_int4_undef(y)));
...@@ -2342,7 +2855,7 @@ static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y) {...@@ -2342,7 +2855,7 @@ static inline SIMD_CFUNC simd_int3 simd_min(simd_int3 x, simd_int3 y) {
2342}2855}
23432856
2344static inline SIMD_CFUNC simd_int4 simd_min(simd_int4 x, simd_int4 y) {2857static inline SIMD_CFUNC simd_int4 simd_min(simd_int4 x, simd_int4 y) {
2345#if defined __arm__ || defined __arm64__2858#if defined __arm__ || defined __arm64__ || defined __aarch64__
2346 return vminq_s32(x, y);2859 return vminq_s32(x, y);
2347#elif defined __SSE4_1__2860#elif defined __SSE4_1__
2348 return (simd_int4) _mm_min_epi32((__m128i)x, (__m128i)y);2861 return (simd_int4) _mm_min_epi32((__m128i)x, (__m128i)y);
...@@ -2368,7 +2881,7 @@ static inline SIMD_CFUNC simd_int16 simd_min(simd_int16 x, simd_int16 y) {...@@ -2368,7 +2881,7 @@ static inline SIMD_CFUNC simd_int16 simd_min(simd_int16 x, simd_int16 y) {
2368}2881}
23692882
2370static inline SIMD_CFUNC simd_uint2 simd_min(simd_uint2 x, simd_uint2 y) {2883static inline SIMD_CFUNC simd_uint2 simd_min(simd_uint2 x, simd_uint2 y) {
2371#if defined __arm__ || defined __arm64__2884#if defined __arm__ || defined __arm64__ || defined __aarch64__
2372 return vmin_u32(x, y);2885 return vmin_u32(x, y);
2373#else2886#else
2374 return simd_make_uint2(simd_min(simd_make_uint4_undef(x), simd_make_uint4_undef(y)));2887 return simd_make_uint2(simd_min(simd_make_uint4_undef(x), simd_make_uint4_undef(y)));
...@@ -2381,7 +2894,7 @@ static inline SIMD_CFUNC simd_uint3 simd_min(simd_uint3 x, simd_uint3 y) {...@@ -2381,7 +2894,7 @@ static inline SIMD_CFUNC simd_uint3 simd_min(simd_uint3 x, simd_uint3 y) {
2381}2894}
23822895
2383static inline SIMD_CFUNC simd_uint4 simd_min(simd_uint4 x, simd_uint4 y) {2896static inline SIMD_CFUNC simd_uint4 simd_min(simd_uint4 x, simd_uint4 y) {
2384#if defined __arm__ || defined __arm64__2897#if defined __arm__ || defined __arm64__ || defined __aarch64__
2385 return vminq_u32(x, y);2898 return vminq_u32(x, y);
2386#elif defined __SSE4_1__2899#elif defined __SSE4_1__
2387 return (simd_uint4) _mm_min_epu32((__m128i)x, (__m128i)y);2900 return (simd_uint4) _mm_min_epu32((__m128i)x, (__m128i)y);
...@@ -2519,7 +3032,7 @@ static inline SIMD_CFUNC simd_char4 simd_max(simd_char4 x, simd_char4 y) {...@@ -2519,7 +3032,7 @@ static inline SIMD_CFUNC simd_char4 simd_max(simd_char4 x, simd_char4 y) {
2519}3032}
25203033
2521static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y) {3034static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y) {
2522#if defined __arm__ || defined __arm64__3035#if defined __arm__ || defined __arm64__ || defined __aarch64__
2523 return vmax_s8(x, y);3036 return vmax_s8(x, y);
2524#else3037#else
2525 return simd_make_char8(simd_max(simd_make_char16_undef(x), simd_make_char16_undef(y)));3038 return simd_make_char8(simd_max(simd_make_char16_undef(x), simd_make_char16_undef(y)));
...@@ -2528,7 +3041,7 @@ static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y) {...@@ -2528,7 +3041,7 @@ static inline SIMD_CFUNC simd_char8 simd_max(simd_char8 x, simd_char8 y) {
2528}3041}
25293042
2530static inline SIMD_CFUNC simd_char16 simd_max(simd_char16 x, simd_char16 y) {3043static inline SIMD_CFUNC simd_char16 simd_max(simd_char16 x, simd_char16 y) {
2531#if defined __arm__ || defined __arm64__3044#if defined __arm__ || defined __arm64__ || defined __aarch64__
2532 return vmaxq_s8(x, y);3045 return vmaxq_s8(x, y);
2533#elif defined __SSE4_1__3046#elif defined __SSE4_1__
2534 return (simd_char16) _mm_max_epi8((__m128i)x, (__m128i)y);3047 return (simd_char16) _mm_max_epi8((__m128i)x, (__m128i)y);
...@@ -2566,7 +3079,7 @@ static inline SIMD_CFUNC simd_uchar4 simd_max(simd_uchar4 x, simd_uchar4 y) {...@@ -2566,7 +3079,7 @@ static inline SIMD_CFUNC simd_uchar4 simd_max(simd_uchar4 x, simd_uchar4 y) {
2566}3079}
25673080
2568static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y) {3081static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y) {
2569#if defined __arm__ || defined __arm64__3082#if defined __arm__ || defined __arm64__ || defined __aarch64__
2570 return vmax_u8(x, y);3083 return vmax_u8(x, y);
2571#else3084#else
2572 return simd_make_uchar8(simd_max(simd_make_uchar16_undef(x), simd_make_uchar16_undef(y)));3085 return simd_make_uchar8(simd_max(simd_make_uchar16_undef(x), simd_make_uchar16_undef(y)));
...@@ -2575,7 +3088,7 @@ static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y) {...@@ -2575,7 +3088,7 @@ static inline SIMD_CFUNC simd_uchar8 simd_max(simd_uchar8 x, simd_uchar8 y) {
2575}3088}
25763089
2577static inline SIMD_CFUNC simd_uchar16 simd_max(simd_uchar16 x, simd_uchar16 y) {3090static inline SIMD_CFUNC simd_uchar16 simd_max(simd_uchar16 x, simd_uchar16 y) {
2578#if defined __arm__ || defined __arm64__3091#if defined __arm__ || defined __arm64__ || defined __aarch64__
2579 return vmaxq_u8(x, y);3092 return vmaxq_u8(x, y);
2580#elif defined __SSE4_1__3093#elif defined __SSE4_1__
2581 return (simd_uchar16) _mm_max_epu8((__m128i)x, (__m128i)y);3094 return (simd_uchar16) _mm_max_epu8((__m128i)x, (__m128i)y);
...@@ -2609,7 +3122,7 @@ static inline SIMD_CFUNC simd_short3 simd_max(simd_short3 x, simd_short3 y) {...@@ -2609,7 +3122,7 @@ static inline SIMD_CFUNC simd_short3 simd_max(simd_short3 x, simd_short3 y) {
2609}3122}
26103123
2611static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y) {3124static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y) {
2612#if defined __arm__ || defined __arm64__3125#if defined __arm__ || defined __arm64__ || defined __aarch64__
2613 return vmax_s16(x, y);3126 return vmax_s16(x, y);
2614#else3127#else
2615 return simd_make_short4(simd_max(simd_make_short8_undef(x), simd_make_short8_undef(y)));3128 return simd_make_short4(simd_max(simd_make_short8_undef(x), simd_make_short8_undef(y)));
...@@ -2618,7 +3131,7 @@ static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y) {...@@ -2618,7 +3131,7 @@ static inline SIMD_CFUNC simd_short4 simd_max(simd_short4 x, simd_short4 y) {
2618}3131}
26193132
2620static inline SIMD_CFUNC simd_short8 simd_max(simd_short8 x, simd_short8 y) {3133static inline SIMD_CFUNC simd_short8 simd_max(simd_short8 x, simd_short8 y) {
2621#if defined __arm__ || defined __arm64__3134#if defined __arm__ || defined __arm64__ || defined __aarch64__
2622 return vmaxq_s16(x, y);3135 return vmaxq_s16(x, y);
2623#elif defined __SSE4_1__3136#elif defined __SSE4_1__
2624 return (simd_short8) _mm_max_epi16((__m128i)x, (__m128i)y);3137 return (simd_short8) _mm_max_epi16((__m128i)x, (__m128i)y);
...@@ -2652,7 +3165,7 @@ static inline SIMD_CFUNC simd_ushort3 simd_max(simd_ushort3 x, simd_ushort3 y) {...@@ -2652,7 +3165,7 @@ static inline SIMD_CFUNC simd_ushort3 simd_max(simd_ushort3 x, simd_ushort3 y) {
2652}3165}
26533166
2654static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y) {3167static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y) {
2655#if defined __arm__ || defined __arm64__3168#if defined __arm__ || defined __arm64__ || defined __aarch64__
2656 return vmax_u16(x, y);3169 return vmax_u16(x, y);
2657#else3170#else
2658 return simd_make_ushort4(simd_max(simd_make_ushort8_undef(x), simd_make_ushort8_undef(y)));3171 return simd_make_ushort4(simd_max(simd_make_ushort8_undef(x), simd_make_ushort8_undef(y)));
...@@ -2661,7 +3174,7 @@ static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y) {...@@ -2661,7 +3174,7 @@ static inline SIMD_CFUNC simd_ushort4 simd_max(simd_ushort4 x, simd_ushort4 y) {
2661}3174}
26623175
2663static inline SIMD_CFUNC simd_ushort8 simd_max(simd_ushort8 x, simd_ushort8 y) {3176static inline SIMD_CFUNC simd_ushort8 simd_max(simd_ushort8 x, simd_ushort8 y) {
2664#if defined __arm__ || defined __arm64__3177#if defined __arm__ || defined __arm64__ || defined __aarch64__
2665 return vmaxq_u16(x, y);3178 return vmaxq_u16(x, y);
2666#elif defined __SSE4_1__3179#elif defined __SSE4_1__
2667 return (simd_ushort8) _mm_max_epu16((__m128i)x, (__m128i)y);3180 return (simd_ushort8) _mm_max_epu16((__m128i)x, (__m128i)y);
...@@ -2686,8 +3199,36 @@ static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y...@@ -2686,8 +3199,36 @@ static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y
2686#endif3199#endif
2687}3200}
26883201
3202static inline SIMD_CFUNC _Float16 simd_max(_Float16 x, _Float16 y) {
3203 return __fmaxf16(x,y);
3204}
3205
3206static inline SIMD_CFUNC simd_half2 simd_max(simd_half2 x, simd_half2 y) {
3207 return __tg_fmax(x,y);
3208}
3209
3210static inline SIMD_CFUNC simd_half3 simd_max(simd_half3 x, simd_half3 y) {
3211 return __tg_fmax(x,y);
3212}
3213
3214static inline SIMD_CFUNC simd_half4 simd_max(simd_half4 x, simd_half4 y) {
3215 return __tg_fmax(x,y);
3216}
3217
3218static inline SIMD_CFUNC simd_half8 simd_max(simd_half8 x, simd_half8 y) {
3219 return __tg_fmax(x,y);
3220}
3221
3222static inline SIMD_CFUNC simd_half16 simd_max(simd_half16 x, simd_half16 y) {
3223 return __tg_fmax(x,y);
3224}
3225
3226static inline SIMD_CFUNC simd_half32 simd_max(simd_half32 x, simd_half32 y) {
3227 return __tg_fmax(x,y);
3228}
3229
2689static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y) {3230static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y) {
2690#if defined __arm__ || defined __arm64__3231#if defined __arm__ || defined __arm64__ || defined __aarch64__
2691 return vmax_s32(x, y);3232 return vmax_s32(x, y);
2692#else3233#else
2693 return simd_make_int2(simd_max(simd_make_int4_undef(x), simd_make_int4_undef(y)));3234 return simd_make_int2(simd_max(simd_make_int4_undef(x), simd_make_int4_undef(y)));
...@@ -2700,7 +3241,7 @@ static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y) {...@@ -2700,7 +3241,7 @@ static inline SIMD_CFUNC simd_int3 simd_max(simd_int3 x, simd_int3 y) {
2700}3241}
27013242
2702static inline SIMD_CFUNC simd_int4 simd_max(simd_int4 x, simd_int4 y) {3243static inline SIMD_CFUNC simd_int4 simd_max(simd_int4 x, simd_int4 y) {
2703#if defined __arm__ || defined __arm64__3244#if defined __arm__ || defined __arm64__ || defined __aarch64__
2704 return vmaxq_s32(x, y);3245 return vmaxq_s32(x, y);
2705#elif defined __SSE4_1__3246#elif defined __SSE4_1__
2706 return (simd_int4) _mm_max_epi32((__m128i)x, (__m128i)y);3247 return (simd_int4) _mm_max_epi32((__m128i)x, (__m128i)y);
...@@ -2726,7 +3267,7 @@ static inline SIMD_CFUNC simd_int16 simd_max(simd_int16 x, simd_int16 y) {...@@ -2726,7 +3267,7 @@ static inline SIMD_CFUNC simd_int16 simd_max(simd_int16 x, simd_int16 y) {
2726}3267}
27273268
2728static inline SIMD_CFUNC simd_uint2 simd_max(simd_uint2 x, simd_uint2 y) {3269static inline SIMD_CFUNC simd_uint2 simd_max(simd_uint2 x, simd_uint2 y) {
2729#if defined __arm__ || defined __arm64__3270#if defined __arm__ || defined __arm64__ || defined __aarch64__
2730 return vmax_u32(x, y);3271 return vmax_u32(x, y);
2731#else3272#else
2732 return simd_make_uint2(simd_max(simd_make_uint4_undef(x), simd_make_uint4_undef(y)));3273 return simd_make_uint2(simd_max(simd_make_uint4_undef(x), simd_make_uint4_undef(y)));
...@@ -2739,7 +3280,7 @@ static inline SIMD_CFUNC simd_uint3 simd_max(simd_uint3 x, simd_uint3 y) {...@@ -2739,7 +3280,7 @@ static inline SIMD_CFUNC simd_uint3 simd_max(simd_uint3 x, simd_uint3 y) {
2739}3280}
27403281
2741static inline SIMD_CFUNC simd_uint4 simd_max(simd_uint4 x, simd_uint4 y) {3282static inline SIMD_CFUNC simd_uint4 simd_max(simd_uint4 x, simd_uint4 y) {
2742#if defined __arm__ || defined __arm64__3283#if defined __arm__ || defined __arm64__ || defined __aarch64__
2743 return vmaxq_u32(x, y);3284 return vmaxq_u32(x, y);
2744#elif defined __SSE4_1__3285#elif defined __SSE4_1__
2745 return (simd_uint4) _mm_max_epu32((__m128i)x, (__m128i)y);3286 return (simd_uint4) _mm_max_epu32((__m128i)x, (__m128i)y);
...@@ -2968,6 +3509,34 @@ static inline SIMD_CFUNC simd_ushort32 simd_clamp(simd_ushort32 x, simd_ushort32...@@ -2968,6 +3509,34 @@ static inline SIMD_CFUNC simd_ushort32 simd_clamp(simd_ushort32 x, simd_ushort32
2968 return simd_min(simd_max(x, min), max);3509 return simd_min(simd_max(x, min), max);
2969}3510}
29703511
3512static inline SIMD_CFUNC _Float16 simd_clamp(_Float16 x, _Float16 min, _Float16 max) {
3513 return simd_min(simd_max(x, min), max);
3514}
3515
3516static inline SIMD_CFUNC simd_half2 simd_clamp(simd_half2 x, simd_half2 min, simd_half2 max) {
3517 return simd_min(simd_max(x, min), max);
3518}
3519
3520static inline SIMD_CFUNC simd_half3 simd_clamp(simd_half3 x, simd_half3 min, simd_half3 max) {
3521 return simd_min(simd_max(x, min), max);
3522}
3523
3524static inline SIMD_CFUNC simd_half4 simd_clamp(simd_half4 x, simd_half4 min, simd_half4 max) {
3525 return simd_min(simd_max(x, min), max);
3526}
3527
3528static inline SIMD_CFUNC simd_half8 simd_clamp(simd_half8 x, simd_half8 min, simd_half8 max) {
3529 return simd_min(simd_max(x, min), max);
3530}
3531
3532static inline SIMD_CFUNC simd_half16 simd_clamp(simd_half16 x, simd_half16 min, simd_half16 max) {
3533 return simd_min(simd_max(x, min), max);
3534}
3535
3536static inline SIMD_CFUNC simd_half32 simd_clamp(simd_half32 x, simd_half32 min, simd_half32 max) {
3537 return simd_min(simd_max(x, min), max);
3538}
3539
2971static inline SIMD_CFUNC simd_int2 simd_clamp(simd_int2 x, simd_int2 min, simd_int2 max) {3540static inline SIMD_CFUNC simd_int2 simd_clamp(simd_int2 x, simd_int2 min, simd_int2 max) {
2972 return simd_min(simd_max(x, min), max);3541 return simd_min(simd_max(x, min), max);
2973}3542}
...@@ -3084,9 +3653,37 @@ static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 mi...@@ -3084,9 +3653,37 @@ static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 mi
3084 return simd_min(simd_max(x, min), max);3653 return simd_min(simd_max(x, min), max);
3085}3654}
30863655
3087 3656
3657static inline SIMD_CFUNC _Float16 simd_sign(_Float16 x) {
3658 return (x == 0 | x != x) ? 0 : __copysignf16(1,x);
3659}
3660
3661static inline SIMD_CFUNC simd_half2 simd_sign(simd_half2 x) {
3662 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3663}
3664
3665static inline SIMD_CFUNC simd_half3 simd_sign(simd_half3 x) {
3666 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3667}
3668
3669static inline SIMD_CFUNC simd_half4 simd_sign(simd_half4 x) {
3670 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3671}
3672
3673static inline SIMD_CFUNC simd_half8 simd_sign(simd_half8 x) {
3674 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3675}
3676
3677static inline SIMD_CFUNC simd_half16 simd_sign(simd_half16 x) {
3678 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3679}
3680
3681static inline SIMD_CFUNC simd_half32 simd_sign(simd_half32 x) {
3682 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3683}
3684
3088static inline SIMD_CFUNC float simd_sign(float x) {3685static inline SIMD_CFUNC float simd_sign(float x) {
3089 return (x == 0 | x != x) ? 0 : copysign(1,x);3686 return (x == 0 | x != x) ? 0 : copysignf(1,x);
3090}3687}
30913688
3092static inline SIMD_CFUNC simd_float2 simd_sign(simd_float2 x) {3689static inline SIMD_CFUNC simd_float2 simd_sign(simd_float2 x) {
...@@ -3129,6 +3726,34 @@ static inline SIMD_CFUNC simd_double8 simd_sign(simd_double8 x) {...@@ -3129,6 +3726,34 @@ static inline SIMD_CFUNC simd_double8 simd_sign(simd_double8 x) {
3129 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);3726 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
3130}3727}
31313728
3729static inline SIMD_CFUNC _Float16 simd_mix(_Float16 x, _Float16 y, _Float16 t) {
3730 return x + t*(y - x);
3731}
3732
3733static inline SIMD_CFUNC simd_half2 simd_mix(simd_half2 x, simd_half2 y, simd_half2 t) {
3734 return x + t*(y - x);
3735}
3736
3737static inline SIMD_CFUNC simd_half3 simd_mix(simd_half3 x, simd_half3 y, simd_half3 t) {
3738 return x + t*(y - x);
3739}
3740
3741static inline SIMD_CFUNC simd_half4 simd_mix(simd_half4 x, simd_half4 y, simd_half4 t) {
3742 return x + t*(y - x);
3743}
3744
3745static inline SIMD_CFUNC simd_half8 simd_mix(simd_half8 x, simd_half8 y, simd_half8 t) {
3746 return x + t*(y - x);
3747}
3748
3749static inline SIMD_CFUNC simd_half16 simd_mix(simd_half16 x, simd_half16 y, simd_half16 t) {
3750 return x + t*(y - x);
3751}
3752
3753static inline SIMD_CFUNC simd_half32 simd_mix(simd_half32 x, simd_half32 y, simd_half32 t) {
3754 return x + t*(y - x);
3755}
3756
3132static inline SIMD_CFUNC float simd_mix(float x, float y, float t) {3757static inline SIMD_CFUNC float simd_mix(float x, float y, float t) {
3133 return x + t*(y - x);3758 return x + t*(y - x);
3134}3759}
...@@ -3168,11 +3793,67 @@ static inline SIMD_CFUNC simd_double3 simd_mix(simd_double3 x, simd_double3 y, s...@@ -3168,11 +3793,67 @@ static inline SIMD_CFUNC simd_double3 simd_mix(simd_double3 x, simd_double3 y, s
3168static inline SIMD_CFUNC simd_double4 simd_mix(simd_double4 x, simd_double4 y, simd_double4 t) {3793static inline SIMD_CFUNC simd_double4 simd_mix(simd_double4 x, simd_double4 y, simd_double4 t) {
3169 return x + t*(y - x);3794 return x + t*(y - x);
3170}3795}
3171 3796
3172static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t) {3797static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t) {
3173 return x + t*(y - x);3798 return x + t*(y - x);
3799}
3800
3801static inline SIMD_CFUNC _Float16 simd_recip(_Float16 x) {
3802#if __FAST_MATH__
3803 return simd_fast_recip(x);
3804#else
3805 return simd_precise_recip(x);
3806#endif
3807}
3808
3809static inline SIMD_CFUNC simd_half2 simd_recip(simd_half2 x) {
3810#if __FAST_MATH__
3811 return simd_fast_recip(x);
3812#else
3813 return simd_precise_recip(x);
3814#endif
3815}
3816
3817static inline SIMD_CFUNC simd_half3 simd_recip(simd_half3 x) {
3818#if __FAST_MATH__
3819 return simd_fast_recip(x);
3820#else
3821 return simd_precise_recip(x);
3822#endif
3823}
3824
3825static inline SIMD_CFUNC simd_half4 simd_recip(simd_half4 x) {
3826#if __FAST_MATH__
3827 return simd_fast_recip(x);
3828#else
3829 return simd_precise_recip(x);
3830#endif
3831}
3832
3833static inline SIMD_CFUNC simd_half8 simd_recip(simd_half8 x) {
3834#if __FAST_MATH__
3835 return simd_fast_recip(x);
3836#else
3837 return simd_precise_recip(x);
3838#endif
3839}
3840
3841static inline SIMD_CFUNC simd_half16 simd_recip(simd_half16 x) {
3842#if __FAST_MATH__
3843 return simd_fast_recip(x);
3844#else
3845 return simd_precise_recip(x);
3846#endif
3847}
3848
3849static inline SIMD_CFUNC simd_half32 simd_recip(simd_half32 x) {
3850#if __FAST_MATH__
3851 return simd_fast_recip(x);
3852#else
3853 return simd_precise_recip(x);
3854#endif
3174}3855}
3175 3856
3176static inline SIMD_CFUNC float simd_recip(float x) {3857static inline SIMD_CFUNC float simd_recip(float x) {
3177#if __FAST_MATH__3858#if __FAST_MATH__
3178 return simd_fast_recip(x);3859 return simd_fast_recip(x);
...@@ -3261,13 +3942,55 @@ static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x) {...@@ -3261,13 +3942,55 @@ static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x) {
3261#endif3942#endif
3262}3943}
32633944
3945static inline SIMD_CFUNC _Float16 simd_fast_recip(_Float16 x) {
3946#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3947 return simd_fast_recip(simd_make_half4_undef(x)).x;
3948#else
3949 return simd_precise_recip(x);
3950#endif
3951}
3952
3953static inline SIMD_CFUNC simd_half2 simd_fast_recip(simd_half2 x) {
3954 return simd_fast_recip(simd_make_half4_undef(x)).lo;
3955}
3956
3957static inline SIMD_CFUNC simd_half3 simd_fast_recip(simd_half3 x) {
3958 return simd_make_half3(simd_fast_recip(simd_make_half4_undef(x)));
3959}
3960
3961static inline SIMD_CFUNC simd_half4 simd_fast_recip(simd_half4 x) {
3962#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3963 simd_half4 r = vrecpe_f16(x);
3964 return r * vrecps_f16(x, r);
3965#else
3966 return simd_precise_recip(x);
3967#endif
3968}
3969
3970static inline SIMD_CFUNC simd_half8 simd_fast_recip(simd_half8 x) {
3971#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3972 simd_half8 r = vrecpeq_f16(x);
3973 return r * vrecpsq_f16(x, r);
3974#else
3975 return simd_precise_recip(x);
3976#endif
3977}
3978
3979static inline SIMD_CFUNC simd_half16 simd_fast_recip(simd_half16 x) {
3980 return simd_make_half16(simd_fast_recip(x.lo), simd_fast_recip(x.hi));
3981}
3982
3983static inline SIMD_CFUNC simd_half32 simd_fast_recip(simd_half32 x) {
3984 return simd_make_half32(simd_fast_recip(x.lo), simd_fast_recip(x.hi));
3985}
3986
3264static inline SIMD_CFUNC float simd_fast_recip(float x) {3987static inline SIMD_CFUNC float simd_fast_recip(float x) {
3265#if defined __AVX512VL__3988#if defined __AVX512VL__
3266 simd_float4 x4 = simd_make_float4(x);3989 simd_float4 x4 = simd_make_float4(x);
3267 return ((simd_float4)_mm_rcp14_ss(x4, x4)).x;3990 return ((simd_float4)_mm_rcp14_ss(x4, x4)).x;
3268#elif defined __SSE__3991#elif defined __SSE__
3269 return ((simd_float4)_mm_rcp_ss(simd_make_float4(x))).x;3992 return ((simd_float4)_mm_rcp_ss(simd_make_float4(x))).x;
3270#elif defined __ARM_NEON__3993#elif defined __ARM_NEON
3271 return simd_fast_recip(simd_make_float2_undef(x)).x;3994 return simd_fast_recip(simd_make_float2_undef(x)).x;
3272#else3995#else
3273 return simd_precise_recip(x);3996 return simd_precise_recip(x);
...@@ -3277,7 +4000,7 @@ static inline SIMD_CFUNC float simd_fast_recip(float x) {...@@ -3277,7 +4000,7 @@ static inline SIMD_CFUNC float simd_fast_recip(float x) {
3277static inline SIMD_CFUNC simd_float2 simd_fast_recip(simd_float2 x) {4000static inline SIMD_CFUNC simd_float2 simd_fast_recip(simd_float2 x) {
3278#if defined __SSE__4001#if defined __SSE__
3279 return simd_make_float2(simd_fast_recip(simd_make_float4_undef(x)));4002 return simd_make_float2(simd_fast_recip(simd_make_float4_undef(x)));
3280#elif defined __ARM_NEON__4003#elif defined __ARM_NEON
3281 simd_float2 r = vrecpe_f32(x);4004 simd_float2 r = vrecpe_f32(x);
3282 return r * vrecps_f32(x, r);4005 return r * vrecps_f32(x, r);
3283#else4006#else
...@@ -3294,7 +4017,7 @@ static inline SIMD_CFUNC simd_float4 simd_fast_recip(simd_float4 x) {...@@ -3294,7 +4017,7 @@ static inline SIMD_CFUNC simd_float4 simd_fast_recip(simd_float4 x) {
3294 return _mm_rcp14_ps(x);4017 return _mm_rcp14_ps(x);
3295#elif defined __SSE__4018#elif defined __SSE__
3296 return _mm_rcp_ps(x);4019 return _mm_rcp_ps(x);
3297#elif defined __ARM_NEON__4020#elif defined __ARM_NEON
3298 simd_float4 r = vrecpeq_f32(x);4021 simd_float4 r = vrecpeq_f32(x);
3299 return r * vrecpsq_f32(x, r);4022 return r * vrecpsq_f32(x, r);
3300#else4023#else
...@@ -3340,11 +4063,53 @@ static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x) {...@@ -3340,11 +4063,53 @@ static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x) {
3340 return simd_precise_recip(x);4063 return simd_precise_recip(x);
3341}4064}
33424065
4066static inline SIMD_CFUNC _Float16 simd_precise_recip(_Float16 x) {
4067#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4068 return simd_precise_recip(simd_make_half4_undef(x)).x;
4069#else
4070 return 1/x;
4071#endif
4072}
4073
4074static inline SIMD_CFUNC simd_half2 simd_precise_recip(simd_half2 x) {
4075 return simd_precise_recip(simd_make_half4_undef(x)).lo;
4076}
4077
4078static inline SIMD_CFUNC simd_half3 simd_precise_recip(simd_half3 x) {
4079 return simd_make_half3(simd_precise_recip(simd_make_half4_undef(x)));
4080}
4081
4082static inline SIMD_CFUNC simd_half4 simd_precise_recip(simd_half4 x) {
4083#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4084 simd_half4 r = simd_fast_recip(x);
4085 return r*vrecps_f16(x, r);
4086#else
4087 return 1/x;
4088#endif
4089}
4090
4091static inline SIMD_CFUNC simd_half8 simd_precise_recip(simd_half8 x) {
4092#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4093 simd_half8 r = simd_fast_recip(x);
4094 return r*vrecpsq_f16(x, r);
4095#else
4096 return 1/x;
4097#endif
4098}
4099
4100static inline SIMD_CFUNC simd_half16 simd_precise_recip(simd_half16 x) {
4101 return simd_make_half16(simd_precise_recip(x.lo), simd_precise_recip(x.hi));
4102}
4103
4104static inline SIMD_CFUNC simd_half32 simd_precise_recip(simd_half32 x) {
4105 return simd_make_half32(simd_precise_recip(x.lo), simd_precise_recip(x.hi));
4106}
4107
3343static inline SIMD_CFUNC float simd_precise_recip(float x) {4108static inline SIMD_CFUNC float simd_precise_recip(float x) {
3344#if defined __SSE__4109#if defined __SSE__
3345 float r = simd_fast_recip(x);4110 float r = simd_fast_recip(x);
3346 return r*(2 - (x == 0 ? -INFINITY : x)*r);4111 return r*(2 - (x == 0 ? -INFINITY : x)*r);
3347#elif defined __ARM_NEON__4112#elif defined __ARM_NEON
3348 return simd_precise_recip(simd_make_float2_undef(x)).x;4113 return simd_precise_recip(simd_make_float2_undef(x)).x;
3349#else4114#else
3350 return 1/x;4115 return 1/x;
...@@ -3354,7 +4119,7 @@ static inline SIMD_CFUNC float simd_precise_recip(float x) {...@@ -3354,7 +4119,7 @@ static inline SIMD_CFUNC float simd_precise_recip(float x) {
3354static inline SIMD_CFUNC simd_float2 simd_precise_recip(simd_float2 x) {4119static inline SIMD_CFUNC simd_float2 simd_precise_recip(simd_float2 x) {
3355#if defined __SSE__4120#if defined __SSE__
3356 return simd_make_float2(simd_precise_recip(simd_make_float4_undef(x)));4121 return simd_make_float2(simd_precise_recip(simd_make_float4_undef(x)));
3357#elif defined __ARM_NEON__4122#elif defined __ARM_NEON
3358 simd_float2 r = simd_fast_recip(x);4123 simd_float2 r = simd_fast_recip(x);
3359 return r*vrecps_f32(x, r);4124 return r*vrecps_f32(x, r);
3360#else4125#else
...@@ -3370,7 +4135,7 @@ static inline SIMD_CFUNC simd_float4 simd_precise_recip(simd_float4 x) {...@@ -3370,7 +4135,7 @@ static inline SIMD_CFUNC simd_float4 simd_precise_recip(simd_float4 x) {
3370#if defined __SSE__4135#if defined __SSE__
3371 simd_float4 r = simd_fast_recip(x);4136 simd_float4 r = simd_fast_recip(x);
3372 return r*(2 - simd_bitselect(x, -INFINITY, x == 0)*r);4137 return r*(2 - simd_bitselect(x, -INFINITY, x == 0)*r);
3373#elif defined __ARM_NEON__4138#elif defined __ARM_NEON
3374 simd_float4 r = simd_fast_recip(x);4139 simd_float4 r = simd_fast_recip(x);
3375 return r*vrecpsq_f32(x, r);4140 return r*vrecpsq_f32(x, r);
3376#else4141#else
...@@ -3416,6 +4181,62 @@ static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x) {...@@ -3416,6 +4181,62 @@ static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x) {
3416 return 1/x;4181 return 1/x;
3417}4182}
34184183
4184static inline SIMD_CFUNC _Float16 simd_rsqrt(_Float16 x) {
4185#if __FAST_MATH__
4186 return simd_fast_rsqrt(x);
4187#else
4188 return simd_precise_rsqrt(x);
4189#endif
4190}
4191
4192static inline SIMD_CFUNC simd_half2 simd_rsqrt(simd_half2 x) {
4193#if __FAST_MATH__
4194 return simd_fast_rsqrt(x);
4195#else
4196 return simd_precise_rsqrt(x);
4197#endif
4198}
4199
4200static inline SIMD_CFUNC simd_half3 simd_rsqrt(simd_half3 x) {
4201#if __FAST_MATH__
4202 return simd_fast_rsqrt(x);
4203#else
4204 return simd_precise_rsqrt(x);
4205#endif
4206}
4207
4208static inline SIMD_CFUNC simd_half4 simd_rsqrt(simd_half4 x) {
4209#if __FAST_MATH__
4210 return simd_fast_rsqrt(x);
4211#else
4212 return simd_precise_rsqrt(x);
4213#endif
4214}
4215
4216static inline SIMD_CFUNC simd_half8 simd_rsqrt(simd_half8 x) {
4217#if __FAST_MATH__
4218 return simd_fast_rsqrt(x);
4219#else
4220 return simd_precise_rsqrt(x);
4221#endif
4222}
4223
4224static inline SIMD_CFUNC simd_half16 simd_rsqrt(simd_half16 x) {
4225#if __FAST_MATH__
4226 return simd_fast_rsqrt(x);
4227#else
4228 return simd_precise_rsqrt(x);
4229#endif
4230}
4231
4232static inline SIMD_CFUNC simd_half32 simd_rsqrt(simd_half32 x) {
4233#if __FAST_MATH__
4234 return simd_fast_rsqrt(x);
4235#else
4236 return simd_precise_rsqrt(x);
4237#endif
4238}
4239
3419static inline SIMD_CFUNC float simd_rsqrt(float x) {4240static inline SIMD_CFUNC float simd_rsqrt(float x) {
3420#if __FAST_MATH__4241#if __FAST_MATH__
3421 return simd_fast_rsqrt(x);4242 return simd_fast_rsqrt(x);
...@@ -3504,13 +4325,55 @@ static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x) {...@@ -3504,13 +4325,55 @@ static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x) {
3504#endif4325#endif
3505}4326}
3506 4327
4328static inline SIMD_CFUNC _Float16 simd_fast_rsqrt(_Float16 x) {
4329#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4330 return simd_fast_rsqrt(simd_make_half4_undef(x)).x;
4331#else
4332 return simd_precise_rsqrt(x);
4333#endif
4334}
4335
4336static inline SIMD_CFUNC simd_half2 simd_fast_rsqrt(simd_half2 x) {
4337 return simd_fast_rsqrt(simd_make_half4_undef(x)).lo;
4338}
4339
4340static inline SIMD_CFUNC simd_half3 simd_fast_rsqrt(simd_half3 x) {
4341 return simd_make_half3(simd_fast_rsqrt(simd_make_half4_undef(x)));
4342}
4343
4344static inline SIMD_CFUNC simd_half4 simd_fast_rsqrt(simd_half4 x) {
4345#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4346 simd_half4 r = vrsqrte_f16(x);
4347 return r * vrsqrts_f16(x, r*r);
4348#else
4349 return simd_precise_rsqrt(x);
4350#endif
4351}
4352
4353static inline SIMD_CFUNC simd_half8 simd_fast_rsqrt(simd_half8 x) {
4354#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4355 simd_half8 r = vrsqrteq_f16(x);
4356 return r * vrsqrtsq_f16(x, r*r);
4357#else
4358 return simd_precise_rsqrt(x);
4359#endif
4360}
4361
4362static inline SIMD_CFUNC simd_half16 simd_fast_rsqrt(simd_half16 x) {
4363 return simd_make_half16(simd_fast_rsqrt(x.lo), simd_fast_rsqrt(x.hi));
4364}
4365
4366static inline SIMD_CFUNC simd_half32 simd_fast_rsqrt(simd_half32 x) {
4367 return simd_make_half32(simd_fast_rsqrt(x.lo), simd_fast_rsqrt(x.hi));
4368}
4369
3507static inline SIMD_CFUNC float simd_fast_rsqrt(float x) {4370static inline SIMD_CFUNC float simd_fast_rsqrt(float x) {
3508#if defined __AVX512VL__4371#if defined __AVX512VL__
3509 simd_float4 x4 = simd_make_float4(x);4372 simd_float4 x4 = simd_make_float4(x);
3510 return ((simd_float4)_mm_rsqrt14_ss(x4, x4)).x;4373 return ((simd_float4)_mm_rsqrt14_ss(x4, x4)).x;
3511#elif defined __SSE__4374#elif defined __SSE__
3512 return ((simd_float4)_mm_rsqrt_ss(simd_make_float4(x))).x;4375 return ((simd_float4)_mm_rsqrt_ss(simd_make_float4(x))).x;
3513#elif defined __ARM_NEON__4376#elif defined __ARM_NEON
3514 return simd_fast_rsqrt(simd_make_float2_undef(x)).x;4377 return simd_fast_rsqrt(simd_make_float2_undef(x)).x;
3515#else4378#else
3516 return simd_precise_rsqrt(x);4379 return simd_precise_rsqrt(x);
...@@ -3520,7 +4383,7 @@ static inline SIMD_CFUNC float simd_fast_rsqrt(float x) {...@@ -3520,7 +4383,7 @@ static inline SIMD_CFUNC float simd_fast_rsqrt(float x) {
3520static inline SIMD_CFUNC simd_float2 simd_fast_rsqrt(simd_float2 x) {4383static inline SIMD_CFUNC simd_float2 simd_fast_rsqrt(simd_float2 x) {
3521#if defined __SSE__4384#if defined __SSE__
3522 return simd_make_float2(simd_fast_rsqrt(simd_make_float4_undef(x)));4385 return simd_make_float2(simd_fast_rsqrt(simd_make_float4_undef(x)));
3523#elif defined __ARM_NEON__4386#elif defined __ARM_NEON
3524 simd_float2 r = vrsqrte_f32(x);4387 simd_float2 r = vrsqrte_f32(x);
3525 return r * vrsqrts_f32(x, r*r);4388 return r * vrsqrts_f32(x, r*r);
3526#else4389#else
...@@ -3537,7 +4400,7 @@ static inline SIMD_CFUNC simd_float4 simd_fast_rsqrt(simd_float4 x) {...@@ -3537,7 +4400,7 @@ static inline SIMD_CFUNC simd_float4 simd_fast_rsqrt(simd_float4 x) {
3537 return _mm_rsqrt14_ps(x);4400 return _mm_rsqrt14_ps(x);
3538#elif defined __SSE__4401#elif defined __SSE__
3539 return _mm_rsqrt_ps(x);4402 return _mm_rsqrt_ps(x);
3540#elif defined __ARM_NEON__4403#elif defined __ARM_NEON
3541 simd_float4 r = vrsqrteq_f32(x);4404 simd_float4 r = vrsqrteq_f32(x);
3542 return r * vrsqrtsq_f32(x, r*r);4405 return r * vrsqrtsq_f32(x, r*r);
3543#else4406#else
...@@ -3583,21 +4446,63 @@ static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x) {...@@ -3583,21 +4446,63 @@ static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x) {
3583 return simd_precise_rsqrt(x);4446 return simd_precise_rsqrt(x);
3584}4447}
35854448
4449static inline SIMD_CFUNC _Float16 simd_precise_rsqrt(_Float16 x) {
4450#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4451 return simd_precise_rsqrt(simd_make_half4_undef(x)).x;
4452#else
4453 return 1/__sqrtf16(x);
4454#endif
4455}
4456
4457static inline SIMD_CFUNC simd_half2 simd_precise_rsqrt(simd_half2 x) {
4458 return simd_precise_rsqrt(simd_make_half4_undef(x)).lo;
4459}
4460
4461static inline SIMD_CFUNC simd_half3 simd_precise_rsqrt(simd_half3 x) {
4462 return simd_make_half3(simd_precise_rsqrt(simd_make_half4_undef(x)));
4463}
4464
4465static inline SIMD_CFUNC simd_half4 simd_precise_rsqrt(simd_half4 x) {
4466#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4467 simd_half4 r = simd_fast_rsqrt(x);
4468 return r*vrsqrts_f16(x, r*r);
4469#else
4470 return 1/__tg_sqrt(x);
4471#endif
4472}
4473
4474static inline SIMD_CFUNC simd_half8 simd_precise_rsqrt(simd_half8 x) {
4475#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
4476 simd_half8 r = simd_fast_rsqrt(x);
4477 return r*vrsqrtsq_f16(x, r*r);
4478#else
4479 return 1/__tg_sqrt(x);
4480#endif
4481}
4482
4483static inline SIMD_CFUNC simd_half16 simd_precise_rsqrt(simd_half16 x) {
4484 return simd_make_half16(simd_precise_rsqrt(x.lo), simd_precise_rsqrt(x.hi));
4485}
4486
4487static inline SIMD_CFUNC simd_half32 simd_precise_rsqrt(simd_half32 x) {
4488 return simd_make_half32(simd_precise_rsqrt(x.lo), simd_precise_rsqrt(x.hi));
4489}
4490
3586static inline SIMD_CFUNC float simd_precise_rsqrt(float x) {4491static inline SIMD_CFUNC float simd_precise_rsqrt(float x) {
3587#if defined __SSE__4492#if defined __SSE__
3588 float r = simd_fast_rsqrt(x);4493 float r = simd_fast_rsqrt(x);
3589 return r*(1.5f - 0.5f*(r == INFINITY ? -INFINITY : x)*r*r);4494 return r*(1.5f - 0.5f*(r == INFINITY ? -INFINITY : x)*r*r);
3590#elif defined __ARM_NEON__4495#elif defined __ARM_NEON
3591 return simd_precise_rsqrt(simd_make_float2_undef(x)).x;4496 return simd_precise_rsqrt(simd_make_float2_undef(x)).x;
3592#else4497#else
3593 return 1/sqrt(x);4498 return 1/sqrtf(x);
3594#endif4499#endif
3595}4500}
3596 4501
3597static inline SIMD_CFUNC simd_float2 simd_precise_rsqrt(simd_float2 x) {4502static inline SIMD_CFUNC simd_float2 simd_precise_rsqrt(simd_float2 x) {
3598#if defined __SSE__4503#if defined __SSE__
3599 return simd_make_float2(simd_precise_rsqrt(simd_make_float4_undef(x)));4504 return simd_make_float2(simd_precise_rsqrt(simd_make_float4_undef(x)));
3600#elif defined __ARM_NEON__4505#elif defined __ARM_NEON
3601 simd_float2 r = simd_fast_rsqrt(x);4506 simd_float2 r = simd_fast_rsqrt(x);
3602 return r*vrsqrts_f32(x, r*r);4507 return r*vrsqrts_f32(x, r*r);
3603#else4508#else
...@@ -3613,7 +4518,7 @@ static inline SIMD_CFUNC simd_float4 simd_precise_rsqrt(simd_float4 x) {...@@ -3613,7 +4518,7 @@ static inline SIMD_CFUNC simd_float4 simd_precise_rsqrt(simd_float4 x) {
3613#if defined __SSE__4518#if defined __SSE__
3614 simd_float4 r = simd_fast_rsqrt(x);4519 simd_float4 r = simd_fast_rsqrt(x);
3615 return r*(1.5 - 0.5*simd_bitselect(x, -INFINITY, r == INFINITY)*r*r);4520 return r*(1.5 - 0.5*simd_bitselect(x, -INFINITY, r == INFINITY)*r*r);
3616#elif defined __ARM_NEON__4521#elif defined __ARM_NEON
3617 simd_float4 r = simd_fast_rsqrt(x);4522 simd_float4 r = simd_fast_rsqrt(x);
3618 return r*vrsqrtsq_f32(x, r*r);4523 return r*vrsqrtsq_f32(x, r*r);
3619#else4524#else
...@@ -3659,8 +4564,36 @@ static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x) {...@@ -3659,8 +4564,36 @@ static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x) {
3659 return 1/__tg_sqrt(x);4564 return 1/__tg_sqrt(x);
3660}4565}
3661 4566
4567static inline SIMD_CFUNC _Float16 simd_fract(_Float16 x) {
4568 return __fminf16(x - __floorf16(x), 0x1.ffcp-1f16);
4569}
4570
4571static inline SIMD_CFUNC simd_half2 simd_fract(simd_half2 x) {
4572 return __tg_fmin(x - __tg_floor(x), 0x1.ffcp-1f16);
4573}
4574
4575static inline SIMD_CFUNC simd_half3 simd_fract(simd_half3 x) {
4576 return __tg_fmin(x - __tg_floor(x), 0x1.ffcp-1f16);
4577}
4578
4579static inline SIMD_CFUNC simd_half4 simd_fract(simd_half4 x) {
4580 return __tg_fmin(x - __tg_floor(x), 0x1.ffcp-1f16);
4581}
4582
4583static inline SIMD_CFUNC simd_half8 simd_fract(simd_half8 x) {
4584 return __tg_fmin(x - __tg_floor(x), 0x1.ffcp-1f16);
4585}
4586
4587static inline SIMD_CFUNC simd_half16 simd_fract(simd_half16 x) {
4588 return __tg_fmin(x - __tg_floor(x), 0x1.ffcp-1f16);
4589}
4590
4591static inline SIMD_CFUNC simd_half32 simd_fract(simd_half32 x) {
4592 return __tg_fmin(x - __tg_floor(x), 0x1.ffcp-1f16);
4593}
4594
3662static inline SIMD_CFUNC float simd_fract(float x) {4595static inline SIMD_CFUNC float simd_fract(float x) {
3663 return fmin(x - floor(x), 0x1.fffffep-1f);4596 return fminf(x - floorf(x), 0x1.fffffep-1f);
3664}4597}
36654598
3666static inline SIMD_CFUNC simd_float2 simd_fract(simd_float2 x) {4599static inline SIMD_CFUNC simd_float2 simd_fract(simd_float2 x) {
...@@ -3703,6 +4636,34 @@ static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x) {...@@ -3703,6 +4636,34 @@ static inline SIMD_CFUNC simd_double8 simd_fract(simd_double8 x) {
3703 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);4636 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);
3704}4637}
37054638
4639static inline SIMD_CFUNC _Float16 simd_step(_Float16 edge, _Float16 x) {
4640 return !(x < edge);
4641}
4642
4643static inline SIMD_CFUNC simd_half2 simd_step(simd_half2 edge, simd_half2 x) {
4644 return simd_bitselect((simd_half2)1, 0, x < edge);
4645}
4646
4647static inline SIMD_CFUNC simd_half3 simd_step(simd_half3 edge, simd_half3 x) {
4648 return simd_bitselect((simd_half3)1, 0, x < edge);
4649}
4650
4651static inline SIMD_CFUNC simd_half4 simd_step(simd_half4 edge, simd_half4 x) {
4652 return simd_bitselect((simd_half4)1, 0, x < edge);
4653}
4654
4655static inline SIMD_CFUNC simd_half8 simd_step(simd_half8 edge, simd_half8 x) {
4656 return simd_bitselect((simd_half8)1, 0, x < edge);
4657}
4658
4659static inline SIMD_CFUNC simd_half16 simd_step(simd_half16 edge, simd_half16 x) {
4660 return simd_bitselect((simd_half16)1, 0, x < edge);
4661}
4662
4663static inline SIMD_CFUNC simd_half32 simd_step(simd_half32 edge, simd_half32 x) {
4664 return simd_bitselect((simd_half32)1, 0, x < edge);
4665}
4666
3706static inline SIMD_CFUNC float simd_step(float edge, float x) {4667static inline SIMD_CFUNC float simd_step(float edge, float x) {
3707 return !(x < edge);4668 return !(x < edge);
3708}4669}
...@@ -3747,6 +4708,41 @@ static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8...@@ -3747,6 +4708,41 @@ static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8
3747 return simd_bitselect((simd_double8)1, 0, x < edge);4708 return simd_bitselect((simd_double8)1, 0, x < edge);
3748}4709}
37494710
4711static inline SIMD_CFUNC _Float16 simd_smoothstep(_Float16 edge0, _Float16 edge1, _Float16 x) {
4712 _Float16 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4713 return t*t*(3 - 2*t);
4714}
4715
4716static inline SIMD_CFUNC simd_half2 simd_smoothstep(simd_half2 edge0, simd_half2 edge1, simd_half2 x) {
4717 simd_half2 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4718 return t*t*(3 - 2*t);
4719}
4720
4721static inline SIMD_CFUNC simd_half3 simd_smoothstep(simd_half3 edge0, simd_half3 edge1, simd_half3 x) {
4722 simd_half3 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4723 return t*t*(3 - 2*t);
4724}
4725
4726static inline SIMD_CFUNC simd_half4 simd_smoothstep(simd_half4 edge0, simd_half4 edge1, simd_half4 x) {
4727 simd_half4 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4728 return t*t*(3 - 2*t);
4729}
4730
4731static inline SIMD_CFUNC simd_half8 simd_smoothstep(simd_half8 edge0, simd_half8 edge1, simd_half8 x) {
4732 simd_half8 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4733 return t*t*(3 - 2*t);
4734}
4735
4736static inline SIMD_CFUNC simd_half16 simd_smoothstep(simd_half16 edge0, simd_half16 edge1, simd_half16 x) {
4737 simd_half16 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4738 return t*t*(3 - 2*t);
4739}
4740
4741static inline SIMD_CFUNC simd_half32 simd_smoothstep(simd_half32 edge0, simd_half32 edge1, simd_half32 x) {
4742 simd_half32 t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
4743 return t*t*(3 - 2*t);
4744}
4745
3750static inline SIMD_CFUNC float simd_smoothstep(float edge0, float edge1, float x) {4746static inline SIMD_CFUNC float simd_smoothstep(float edge0, float edge1, float x) {
3751 float t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);4747 float t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
3752 return t*t*(3 - 2*t);4748 return t*t*(3 - 2*t);
...@@ -3906,6 +4902,30 @@ static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x) {...@@ -3906,6 +4902,30 @@ static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x) {
3906 return simd_reduce_add(x.lo + x.hi);4902 return simd_reduce_add(x.lo + x.hi);
3907}4903}
39084904
4905static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half2 x) {
4906 return x.x + x.y;
4907}
4908
4909static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half3 x) {
4910 return x.x + x.y + x.z;
4911}
4912
4913static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half4 x) {
4914 return simd_reduce_add(x.lo + x.hi);
4915}
4916
4917static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half8 x) {
4918 return simd_reduce_add(x.lo + x.hi);
4919}
4920
4921static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half16 x) {
4922 return simd_reduce_add(x.lo + x.hi);
4923}
4924
4925static inline SIMD_CFUNC _Float16 simd_reduce_add(simd_half32 x) {
4926 return simd_reduce_add(x.lo + x.hi);
4927}
4928
3909static inline SIMD_CFUNC int simd_reduce_add(simd_int2 x) {4929static inline SIMD_CFUNC int simd_reduce_add(simd_int2 x) {
3910 return x.x + x.y;4930 return x.x + x.y;
3911}4931}
...@@ -4032,7 +5052,7 @@ static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x) {...@@ -4032,7 +5052,7 @@ static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x) {
4032}5052}
40335053
4034static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x) {5054static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x) {
4035#if defined __arm64__5055#if defined __arm64__ || defined __aarch64__
4036 return vminvq_s8(x);5056 return vminvq_s8(x);
4037#else5057#else
4038 return simd_reduce_min(simd_min(x.lo, x.hi));5058 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4065,7 +5085,7 @@ static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar8 x) {...@@ -4065,7 +5085,7 @@ static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar8 x) {
4065}5085}
40665086
4067static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x) {5087static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x) {
4068#if defined __arm64__5088#if defined __arm64__ || defined __aarch64__
4069 return vminvq_u8(x);5089 return vminvq_u8(x);
4070#else5090#else
4071 return simd_reduce_min(simd_min(x.lo, x.hi));5091 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4094,7 +5114,7 @@ static inline SIMD_CFUNC short simd_reduce_min(simd_short4 x) {...@@ -4094,7 +5114,7 @@ static inline SIMD_CFUNC short simd_reduce_min(simd_short4 x) {
4094}5114}
40955115
4096static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x) {5116static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x) {
4097#if defined __arm64__5117#if defined __arm64__ || defined __aarch64__
4098 return vminvq_s16(x);5118 return vminvq_s16(x);
4099#else5119#else
4100 return simd_reduce_min(simd_min(x.lo, x.hi));5120 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4123,7 +5143,7 @@ static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort4 x) {...@@ -4123,7 +5143,7 @@ static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort4 x) {
4123}5143}
41245144
4125static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x) {5145static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x) {
4126#if defined __arm64__5146#if defined __arm64__ || defined __aarch64__
4127 return vminvq_u16(x);5147 return vminvq_u16(x);
4128#else5148#else
4129 return simd_reduce_min(simd_min(x.lo, x.hi));5149 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4148,7 +5168,7 @@ static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x) {...@@ -4148,7 +5168,7 @@ static inline SIMD_CFUNC int simd_reduce_min(simd_int3 x) {
4148}5168}
41495169
4150static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x) {5170static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x) {
4151#if defined __arm64__5171#if defined __arm64__ || defined __aarch64__
4152 return vminvq_s32(x);5172 return vminvq_s32(x);
4153#else5173#else
4154 return simd_reduce_min(simd_min(x.lo, x.hi));5174 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4173,7 +5193,7 @@ static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint3 x) {...@@ -4173,7 +5193,7 @@ static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint3 x) {
4173}5193}
41745194
4175static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x) {5195static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x) {
4176#if defined __arm64__5196#if defined __arm64__ || defined __aarch64__
4177 return vminvq_u32(x);5197 return vminvq_u32(x);
4178#else5198#else
4179 return simd_reduce_min(simd_min(x.lo, x.hi));5199 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4222,6 +5242,30 @@ static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong8 x) {...@@ -4222,6 +5242,30 @@ static inline SIMD_CFUNC simd_ulong1 simd_reduce_min(simd_ulong8 x) {
4222 return simd_reduce_min(simd_min(x.lo, x.hi));5242 return simd_reduce_min(simd_min(x.lo, x.hi));
4223}5243}
42245244
5245static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half2 x) {
5246 return __fminf16(x.x, x.y);
5247}
5248
5249static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half3 x) {
5250 return __fminf16(__fminf16(x.x, x.z), x.y);
5251}
5252
5253static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half4 x) {
5254 return simd_reduce_min(simd_min(x.lo, x.hi));
5255}
5256
5257static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half8 x) {
5258 return simd_reduce_min(simd_min(x.lo, x.hi));
5259}
5260
5261static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half16 x) {
5262 return simd_reduce_min(simd_min(x.lo, x.hi));
5263}
5264
5265static inline SIMD_CFUNC _Float16 simd_reduce_min(simd_half32 x) {
5266 return simd_reduce_min(simd_min(x.lo, x.hi));
5267}
5268
4225static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x) {5269static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x) {
4226 return fmin(x.x, x.y);5270 return fmin(x.x, x.y);
4227}5271}
...@@ -4231,7 +5275,7 @@ static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x) {...@@ -4231,7 +5275,7 @@ static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x) {
4231}5275}
42325276
4233static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x) {5277static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x) {
4234#if defined __arm64__5278#if defined __arm64__ || defined __aarch64__
4235 return vminvq_f32(x);5279 return vminvq_f32(x);
4236#else5280#else
4237 return simd_reduce_min(simd_min(x.lo, x.hi));5281 return simd_reduce_min(simd_min(x.lo, x.hi));
...@@ -4247,7 +5291,7 @@ static inline SIMD_CFUNC float simd_reduce_min(simd_float16 x) {...@@ -4247,7 +5291,7 @@ static inline SIMD_CFUNC float simd_reduce_min(simd_float16 x) {
4247}5291}
42485292
4249static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x) {5293static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x) {
4250#if defined __arm64__5294#if defined __arm64__ || defined __aarch64__
4251 return vminvq_f64(x);5295 return vminvq_f64(x);
4252#else5296#else
4253 return fmin(x.x, x.y);5297 return fmin(x.x, x.y);
...@@ -4284,7 +5328,7 @@ static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x) {...@@ -4284,7 +5328,7 @@ static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x) {
4284}5328}
42855329
4286static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x) {5330static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x) {
4287#if defined __arm64__5331#if defined __arm64__ || defined __aarch64__
4288 return vmaxvq_s8(x);5332 return vmaxvq_s8(x);
4289#else5333#else
4290 return simd_reduce_max(simd_max(x.lo, x.hi));5334 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4317,7 +5361,7 @@ static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar8 x) {...@@ -4317,7 +5361,7 @@ static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar8 x) {
4317}5361}
43185362
4319static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x) {5363static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x) {
4320#if defined __arm64__5364#if defined __arm64__ || defined __aarch64__
4321 return vmaxvq_u8(x);5365 return vmaxvq_u8(x);
4322#else5366#else
4323 return simd_reduce_max(simd_max(x.lo, x.hi));5367 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4346,7 +5390,7 @@ static inline SIMD_CFUNC short simd_reduce_max(simd_short4 x) {...@@ -4346,7 +5390,7 @@ static inline SIMD_CFUNC short simd_reduce_max(simd_short4 x) {
4346}5390}
43475391
4348static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x) {5392static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x) {
4349#if defined __arm64__5393#if defined __arm64__ || defined __aarch64__
4350 return vmaxvq_s16(x);5394 return vmaxvq_s16(x);
4351#else5395#else
4352 return simd_reduce_max(simd_max(x.lo, x.hi));5396 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4375,7 +5419,7 @@ static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort4 x) {...@@ -4375,7 +5419,7 @@ static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort4 x) {
4375}5419}
43765420
4377static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x) {5421static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x) {
4378#if defined __arm64__5422#if defined __arm64__ || defined __aarch64__
4379 return vmaxvq_u16(x);5423 return vmaxvq_u16(x);
4380#else5424#else
4381 return simd_reduce_max(simd_max(x.lo, x.hi));5425 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4400,7 +5444,7 @@ static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x) {...@@ -4400,7 +5444,7 @@ static inline SIMD_CFUNC int simd_reduce_max(simd_int3 x) {
4400}5444}
44015445
4402static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x) {5446static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x) {
4403#if defined __arm64__5447#if defined __arm64__ || defined __aarch64__
4404 return vmaxvq_s32(x);5448 return vmaxvq_s32(x);
4405#else5449#else
4406 return simd_reduce_max(simd_max(x.lo, x.hi));5450 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4425,7 +5469,7 @@ static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint3 x) {...@@ -4425,7 +5469,7 @@ static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint3 x) {
4425}5469}
44265470
4427static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x) {5471static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x) {
4428#if defined __arm64__5472#if defined __arm64__ || defined __aarch64__
4429 return vmaxvq_u32(x);5473 return vmaxvq_u32(x);
4430#else5474#else
4431 return simd_reduce_max(simd_max(x.lo, x.hi));5475 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4474,6 +5518,30 @@ static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong8 x) {...@@ -4474,6 +5518,30 @@ static inline SIMD_CFUNC simd_ulong1 simd_reduce_max(simd_ulong8 x) {
4474 return simd_reduce_max(simd_max(x.lo, x.hi));5518 return simd_reduce_max(simd_max(x.lo, x.hi));
4475}5519}
44765520
5521static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half2 x) {
5522 return __fmaxf16(x.x, x.y);
5523}
5524
5525static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half3 x) {
5526 return __fmaxf16(__fmaxf16(x.x, x.z), x.y);
5527}
5528
5529static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half4 x) {
5530 return simd_reduce_max(simd_max(x.lo, x.hi));
5531}
5532
5533static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half8 x) {
5534 return simd_reduce_max(simd_max(x.lo, x.hi));
5535}
5536
5537static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half16 x) {
5538 return simd_reduce_max(simd_max(x.lo, x.hi));
5539}
5540
5541static inline SIMD_CFUNC _Float16 simd_reduce_max(simd_half32 x) {
5542 return simd_reduce_max(simd_max(x.lo, x.hi));
5543}
5544
4477static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x) {5545static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x) {
4478 return fmax(x.x, x.y);5546 return fmax(x.x, x.y);
4479}5547}
...@@ -4483,7 +5551,7 @@ static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x) {...@@ -4483,7 +5551,7 @@ static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x) {
4483}5551}
44845552
4485static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x) {5553static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x) {
4486#if defined __arm64__5554#if defined __arm64__ || defined __aarch64__
4487 return vmaxvq_f32(x);5555 return vmaxvq_f32(x);
4488#else5556#else
4489 return simd_reduce_max(simd_max(x.lo, x.hi));5557 return simd_reduce_max(simd_max(x.lo, x.hi));
...@@ -4499,7 +5567,7 @@ static inline SIMD_CFUNC float simd_reduce_max(simd_float16 x) {...@@ -4499,7 +5567,7 @@ static inline SIMD_CFUNC float simd_reduce_max(simd_float16 x) {
4499}5567}
45005568
4501static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x) {5569static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x) {
4502#if defined __arm64__5570#if defined __arm64__ || defined __aarch64__
4503 return vmaxvq_f64(x);5571 return vmaxvq_f64(x);
4504#else5572#else
4505 return fmax(x.x, x.y);5573 return fmax(x.x, x.y);
lib/libc/include/any-macos-any/simd/conversion.h+452-12
...@@ -18,6 +18,13 @@...@@ -18,6 +18,13 @@
18 * are guaranteed to wrap modulo 2^N (where N is the number of bits in an18 * are guaranteed to wrap modulo 2^N (where N is the number of bits in an
19 * element of the result type).19 * element of the result type).
20 *20 *
21 * In C++ the conversion functions are templated in the simd:: namespace.
22 *
23 * C++ Function Equivalent C Function
24 * -------------------------------------------------------------------
25 * simd::convert<ScalarType>(x) simd_ScalarType(x)
26 * simd::convert_sat<ScalarType>(x) simd_ScalarType_sat(x)
27 *
21 * For integer vector types, saturating conversions are also available:28 * For integer vector types, saturating conversions are also available:
22 *29 *
23 * simd_char_sat(x) simd_uchar_sat(x)30 * simd_char_sat(x) simd_uchar_sat(x)
...@@ -28,12 +35,14 @@...@@ -28,12 +35,14 @@
28 * These conversions clamp x to the representable range of the result type35 * These conversions clamp x to the representable range of the result type
29 * before converting.36 * before converting.
30 *37 *
31 * In C++ the conversion functions are templated in the simd:: namespace.38 * As well as round to nearest even conversions for same-width data types:
32 *39 *
33 * C++ Function Equivalent C Function40 * simd_short_rte(simd_half<N> x) simd_ushort_rte(simd_half<N> x)
34 * -------------------------------------------------------------------41 * simd_int_rte(simd_float<N> x) simd_uint_rte(simd_float<N> x)
35 * simd::convert<ScalarType>(x) simd_ScalarType(x)42 * simd_long_rte(simd_double<N> x) simd_ulong_rte(simd_double<N> x)
36 * simd::convert_sat<ScalarType>(x) simd_ScalarType_sat(x)43 *
44 * Unlike most vector operations in <simd/>, there are no abbreviated C++
45 * names for these functions in the simd:: namespace.
37 */46 */
3847
39#ifndef __SIMD_CONVERSION_HEADER__48#ifndef __SIMD_CONVERSION_HEADER__
...@@ -73,6 +82,12 @@ static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x);...@@ -73,6 +82,12 @@ static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x);
73static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x);82static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x);
74static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x);83static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x);
75static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x);84static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x);
85static simd_char2 SIMD_CFUNC simd_char(simd_half2 __x);
86static simd_char3 SIMD_CFUNC simd_char(simd_half3 __x);
87static simd_char4 SIMD_CFUNC simd_char(simd_half4 __x);
88static simd_char8 SIMD_CFUNC simd_char(simd_half8 __x);
89static simd_char16 SIMD_CFUNC simd_char(simd_half16 __x);
90static simd_char32 SIMD_CFUNC simd_char(simd_half32 __x);
76static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x);91static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x);
77static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x);92static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x);
78static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x);93static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x);
...@@ -112,6 +127,12 @@ static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x);...@@ -112,6 +127,12 @@ static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x);
112static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x);127static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x);
113static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x);128static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x);
114static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x);129static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x);
130static simd_char2 SIMD_CFUNC simd_char_sat(simd_half2 __x);
131static simd_char3 SIMD_CFUNC simd_char_sat(simd_half3 __x);
132static simd_char4 SIMD_CFUNC simd_char_sat(simd_half4 __x);
133static simd_char8 SIMD_CFUNC simd_char_sat(simd_half8 __x);
134static simd_char16 SIMD_CFUNC simd_char_sat(simd_half16 __x);
135static simd_char32 SIMD_CFUNC simd_char_sat(simd_half32 __x);
115static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x);136static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x);
116static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x);137static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x);
117static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x);138static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x);
...@@ -178,6 +199,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x);...@@ -178,6 +199,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x);
178static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x);199static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x);
179static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x);200static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x);
180static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x);201static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x);
202static simd_uchar2 SIMD_CFUNC simd_uchar(simd_half2 __x);
203static simd_uchar3 SIMD_CFUNC simd_uchar(simd_half3 __x);
204static simd_uchar4 SIMD_CFUNC simd_uchar(simd_half4 __x);
205static simd_uchar8 SIMD_CFUNC simd_uchar(simd_half8 __x);
206static simd_uchar16 SIMD_CFUNC simd_uchar(simd_half16 __x);
207static simd_uchar32 SIMD_CFUNC simd_uchar(simd_half32 __x);
181static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x);208static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x);
182static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x);209static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x);
183static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x);210static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x);
...@@ -217,6 +244,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x);...@@ -217,6 +244,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x);
217static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x);244static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x);
218static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x);245static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x);
219static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x);246static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x);
247static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_half2 __x);
248static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_half3 __x);
249static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_half4 __x);
250static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_half8 __x);
251static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_half16 __x);
252static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_half32 __x);
220static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x);253static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x);
221static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x);254static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x);
222static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x);255static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x);
...@@ -283,6 +316,12 @@ static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x);...@@ -283,6 +316,12 @@ static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x);
283static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x);316static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x);
284static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x);317static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x);
285static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x);318static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x);
319static simd_short2 SIMD_CFUNC simd_short(simd_half2 __x);
320static simd_short3 SIMD_CFUNC simd_short(simd_half3 __x);
321static simd_short4 SIMD_CFUNC simd_short(simd_half4 __x);
322static simd_short8 SIMD_CFUNC simd_short(simd_half8 __x);
323static simd_short16 SIMD_CFUNC simd_short(simd_half16 __x);
324static simd_short32 SIMD_CFUNC simd_short(simd_half32 __x);
286static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x);325static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x);
287static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x);326static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x);
288static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x);327static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x);
...@@ -322,6 +361,12 @@ static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x);...@@ -322,6 +361,12 @@ static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x);
322static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x);361static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x);
323static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x);362static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x);
324static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x);363static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x);
364static simd_short2 SIMD_CFUNC simd_short_sat(simd_half2 __x);
365static simd_short3 SIMD_CFUNC simd_short_sat(simd_half3 __x);
366static simd_short4 SIMD_CFUNC simd_short_sat(simd_half4 __x);
367static simd_short8 SIMD_CFUNC simd_short_sat(simd_half8 __x);
368static simd_short16 SIMD_CFUNC simd_short_sat(simd_half16 __x);
369static simd_short32 SIMD_CFUNC simd_short_sat(simd_half32 __x);
325static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x);370static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x);
326static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x);371static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x);
327static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x);372static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x);
...@@ -361,6 +406,12 @@ static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x);...@@ -361,6 +406,12 @@ static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x);
361static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x);406static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x);
362static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x);407static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x);
363static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x);408static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x);
409static simd_short2 SIMD_CFUNC simd_short_rte(simd_half2 __x);
410static simd_short3 SIMD_CFUNC simd_short_rte(simd_half3 __x);
411static simd_short4 SIMD_CFUNC simd_short_rte(simd_half4 __x);
412static simd_short8 SIMD_CFUNC simd_short_rte(simd_half8 __x);
413static simd_short16 SIMD_CFUNC simd_short_rte(simd_half16 __x);
414static simd_short32 SIMD_CFUNC simd_short_rte(simd_half32 __x);
364#define vector_short simd_short415#define vector_short simd_short
365#define vector_short_sat simd_short_sat416#define vector_short_sat simd_short_sat
366417
...@@ -388,6 +439,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x);...@@ -388,6 +439,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x);
388static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x);439static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x);
389static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x);440static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x);
390static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x);441static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x);
442static simd_ushort2 SIMD_CFUNC simd_ushort(simd_half2 __x);
443static simd_ushort3 SIMD_CFUNC simd_ushort(simd_half3 __x);
444static simd_ushort4 SIMD_CFUNC simd_ushort(simd_half4 __x);
445static simd_ushort8 SIMD_CFUNC simd_ushort(simd_half8 __x);
446static simd_ushort16 SIMD_CFUNC simd_ushort(simd_half16 __x);
447static simd_ushort32 SIMD_CFUNC simd_ushort(simd_half32 __x);
391static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x);448static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x);
392static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x);449static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x);
393static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x);450static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x);
...@@ -427,6 +484,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x);...@@ -427,6 +484,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x);
427static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x);484static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x);
428static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x);485static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x);
429static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x);486static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x);
487static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_half2 __x);
488static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_half3 __x);
489static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_half4 __x);
490static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_half8 __x);
491static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_half16 __x);
492static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_half32 __x);
430static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x);493static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x);
431static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x);494static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x);
432static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x);495static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x);
...@@ -466,9 +529,68 @@ static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x);...@@ -466,9 +529,68 @@ static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x);
466static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x);529static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x);
467static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x);530static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x);
468static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x);531static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x);
532static simd_ushort2 SIMD_CFUNC simd_ushort_rte(simd_half2 __x);
533static simd_ushort3 SIMD_CFUNC simd_ushort_rte(simd_half3 __x);
534static simd_ushort4 SIMD_CFUNC simd_ushort_rte(simd_half4 __x);
535static simd_ushort8 SIMD_CFUNC simd_ushort_rte(simd_half8 __x);
536static simd_ushort16 SIMD_CFUNC simd_ushort_rte(simd_half16 __x);
537static simd_ushort32 SIMD_CFUNC simd_ushort_rte(simd_half32 __x);
469#define vector_ushort simd_ushort538#define vector_ushort simd_ushort
470#define vector_ushort_sat simd_ushort_sat539#define vector_ushort_sat simd_ushort_sat
471540
541static simd_half2 SIMD_CFUNC simd_half(simd_char2 __x);
542static simd_half3 SIMD_CFUNC simd_half(simd_char3 __x);
543static simd_half4 SIMD_CFUNC simd_half(simd_char4 __x);
544static simd_half8 SIMD_CFUNC simd_half(simd_char8 __x);
545static simd_half16 SIMD_CFUNC simd_half(simd_char16 __x);
546static simd_half2 SIMD_CFUNC simd_half(simd_uchar2 __x);
547static simd_half3 SIMD_CFUNC simd_half(simd_uchar3 __x);
548static simd_half4 SIMD_CFUNC simd_half(simd_uchar4 __x);
549static simd_half8 SIMD_CFUNC simd_half(simd_uchar8 __x);
550static simd_half16 SIMD_CFUNC simd_half(simd_uchar16 __x);
551static simd_half2 SIMD_CFUNC simd_half(simd_short2 __x);
552static simd_half3 SIMD_CFUNC simd_half(simd_short3 __x);
553static simd_half4 SIMD_CFUNC simd_half(simd_short4 __x);
554static simd_half8 SIMD_CFUNC simd_half(simd_short8 __x);
555static simd_half16 SIMD_CFUNC simd_half(simd_short16 __x);
556static simd_half2 SIMD_CFUNC simd_half(simd_ushort2 __x);
557static simd_half3 SIMD_CFUNC simd_half(simd_ushort3 __x);
558static simd_half4 SIMD_CFUNC simd_half(simd_ushort4 __x);
559static simd_half8 SIMD_CFUNC simd_half(simd_ushort8 __x);
560static simd_half16 SIMD_CFUNC simd_half(simd_ushort16 __x);
561static simd_half2 SIMD_CFUNC simd_half(simd_half2 __x);
562static simd_half3 SIMD_CFUNC simd_half(simd_half3 __x);
563static simd_half4 SIMD_CFUNC simd_half(simd_half4 __x);
564static simd_half8 SIMD_CFUNC simd_half(simd_half8 __x);
565static simd_half16 SIMD_CFUNC simd_half(simd_half16 __x);
566static simd_half2 SIMD_CFUNC simd_half(simd_int2 __x);
567static simd_half3 SIMD_CFUNC simd_half(simd_int3 __x);
568static simd_half4 SIMD_CFUNC simd_half(simd_int4 __x);
569static simd_half8 SIMD_CFUNC simd_half(simd_int8 __x);
570static simd_half16 SIMD_CFUNC simd_half(simd_int16 __x);
571static simd_half2 SIMD_CFUNC simd_half(simd_uint2 __x);
572static simd_half3 SIMD_CFUNC simd_half(simd_uint3 __x);
573static simd_half4 SIMD_CFUNC simd_half(simd_uint4 __x);
574static simd_half8 SIMD_CFUNC simd_half(simd_uint8 __x);
575static simd_half16 SIMD_CFUNC simd_half(simd_uint16 __x);
576static simd_half2 SIMD_CFUNC simd_half(simd_float2 __x);
577static simd_half3 SIMD_CFUNC simd_half(simd_float3 __x);
578static simd_half4 SIMD_CFUNC simd_half(simd_float4 __x);
579static simd_half8 SIMD_CFUNC simd_half(simd_float8 __x);
580static simd_half16 SIMD_CFUNC simd_half(simd_float16 __x);
581static simd_half2 SIMD_CFUNC simd_half(simd_long2 __x);
582static simd_half3 SIMD_CFUNC simd_half(simd_long3 __x);
583static simd_half4 SIMD_CFUNC simd_half(simd_long4 __x);
584static simd_half8 SIMD_CFUNC simd_half(simd_long8 __x);
585static simd_half2 SIMD_CFUNC simd_half(simd_ulong2 __x);
586static simd_half3 SIMD_CFUNC simd_half(simd_ulong3 __x);
587static simd_half4 SIMD_CFUNC simd_half(simd_ulong4 __x);
588static simd_half8 SIMD_CFUNC simd_half(simd_ulong8 __x);
589static simd_half2 SIMD_CFUNC simd_half(simd_double2 __x);
590static simd_half3 SIMD_CFUNC simd_half(simd_double3 __x);
591static simd_half4 SIMD_CFUNC simd_half(simd_double4 __x);
592static simd_half8 SIMD_CFUNC simd_half(simd_double8 __x);
593
472static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x);594static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x);
473static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x);595static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x);
474static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x);596static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x);
...@@ -489,6 +611,11 @@ static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x);...@@ -489,6 +611,11 @@ static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x);
489static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x);611static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x);
490static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x);612static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x);
491static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x);613static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x);
614static simd_int2 SIMD_CFUNC simd_int(simd_half2 __x);
615static simd_int3 SIMD_CFUNC simd_int(simd_half3 __x);
616static simd_int4 SIMD_CFUNC simd_int(simd_half4 __x);
617static simd_int8 SIMD_CFUNC simd_int(simd_half8 __x);
618static simd_int16 SIMD_CFUNC simd_int(simd_half16 __x);
492static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x);619static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x);
493static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x);620static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x);
494static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x);621static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x);
...@@ -526,6 +653,11 @@ static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x);...@@ -526,6 +653,11 @@ static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x);
526static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x);653static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x);
527static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x);654static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x);
528static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x);655static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x);
656static simd_int2 SIMD_CFUNC simd_int_sat(simd_half2 __x);
657static simd_int3 SIMD_CFUNC simd_int_sat(simd_half3 __x);
658static simd_int4 SIMD_CFUNC simd_int_sat(simd_half4 __x);
659static simd_int8 SIMD_CFUNC simd_int_sat(simd_half8 __x);
660static simd_int16 SIMD_CFUNC simd_int_sat(simd_half16 __x);
529static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x);661static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x);
530static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x);662static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x);
531static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x);663static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x);
...@@ -591,6 +723,11 @@ static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x);...@@ -591,6 +723,11 @@ static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x);
591static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x);723static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x);
592static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x);724static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x);
593static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x);725static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x);
726static simd_uint2 SIMD_CFUNC simd_uint(simd_half2 __x);
727static simd_uint3 SIMD_CFUNC simd_uint(simd_half3 __x);
728static simd_uint4 SIMD_CFUNC simd_uint(simd_half4 __x);
729static simd_uint8 SIMD_CFUNC simd_uint(simd_half8 __x);
730static simd_uint16 SIMD_CFUNC simd_uint(simd_half16 __x);
594static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x);731static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x);
595static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x);732static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x);
596static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x);733static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x);
...@@ -628,6 +765,11 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x);...@@ -628,6 +765,11 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x);
628static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x);765static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x);
629static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x);766static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x);
630static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x);767static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x);
768static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_half2 __x);
769static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_half3 __x);
770static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_half4 __x);
771static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_half8 __x);
772static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_half16 __x);
631static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x);773static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x);
632static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x);774static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x);
633static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x);775static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x);
...@@ -665,6 +807,11 @@ static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x);...@@ -665,6 +807,11 @@ static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x);
665static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x);807static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x);
666static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x);808static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x);
667static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x);809static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x);
810static simd_uint2 SIMD_CFUNC simd_uint_rte(simd_float2 __x);
811static simd_uint3 SIMD_CFUNC simd_uint_rte(simd_float3 __x);
812static simd_uint4 SIMD_CFUNC simd_uint_rte(simd_float4 __x);
813static simd_uint8 SIMD_CFUNC simd_uint_rte(simd_float8 __x);
814static simd_uint16 SIMD_CFUNC simd_uint_rte(simd_float16 __x);
668#define vector_uint simd_uint815#define vector_uint simd_uint
669#define vector_uint_sat simd_uint_sat816#define vector_uint_sat simd_uint_sat
670817
...@@ -688,6 +835,11 @@ static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x);...@@ -688,6 +835,11 @@ static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x);
688static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x);835static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x);
689static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x);836static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x);
690static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x);837static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x);
838static simd_float2 SIMD_CFUNC simd_float(simd_half2 __x);
839static simd_float3 SIMD_CFUNC simd_float(simd_half3 __x);
840static simd_float4 SIMD_CFUNC simd_float(simd_half4 __x);
841static simd_float8 SIMD_CFUNC simd_float(simd_half8 __x);
842static simd_float16 SIMD_CFUNC simd_float(simd_half16 __x);
691static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x);843static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x);
692static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x);844static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x);
693static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x);845static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x);
...@@ -733,6 +885,10 @@ static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x);...@@ -733,6 +885,10 @@ static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x);
733static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x);885static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x);
734static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x);886static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x);
735static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x);887static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x);
888static simd_long2 SIMD_CFUNC simd_long(simd_half2 __x);
889static simd_long3 SIMD_CFUNC simd_long(simd_half3 __x);
890static simd_long4 SIMD_CFUNC simd_long(simd_half4 __x);
891static simd_long8 SIMD_CFUNC simd_long(simd_half8 __x);
736static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x);892static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x);
737static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x);893static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x);
738static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x);894static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x);
...@@ -765,6 +921,10 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x);...@@ -765,6 +921,10 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x);
765static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x);921static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x);
766static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x);922static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x);
767static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x);923static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x);
924static simd_long2 SIMD_CFUNC simd_long_sat(simd_half2 __x);
925static simd_long3 SIMD_CFUNC simd_long_sat(simd_half3 __x);
926static simd_long4 SIMD_CFUNC simd_long_sat(simd_half4 __x);
927static simd_long8 SIMD_CFUNC simd_long_sat(simd_half8 __x);
768static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x);928static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x);
769static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x);929static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x);
770static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x);930static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x);
...@@ -820,6 +980,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x);...@@ -820,6 +980,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x);
820static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x);980static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x);
821static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x);981static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x);
822static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x);982static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x);
983static simd_ulong2 SIMD_CFUNC simd_ulong(simd_half2 __x);
984static simd_ulong3 SIMD_CFUNC simd_ulong(simd_half3 __x);
985static simd_ulong4 SIMD_CFUNC simd_ulong(simd_half4 __x);
986static simd_ulong8 SIMD_CFUNC simd_ulong(simd_half8 __x);
823static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x);987static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x);
824static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x);988static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x);
825static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x);989static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x);
...@@ -852,6 +1016,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x);...@@ -852,6 +1016,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x);
852static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x);1016static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x);
853static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x);1017static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x);
854static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x);1018static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x);
1019static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_half2 __x);
1020static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_half3 __x);
1021static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_half4 __x);
1022static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_half8 __x);
855static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x);1023static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x);
856static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x);1024static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x);
857static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x);1025static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x);
...@@ -884,6 +1052,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x);...@@ -884,6 +1052,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x);
884static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x);1052static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x);
885static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x);1053static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x);
886static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x);1054static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x);
1055static simd_ulong2 SIMD_CFUNC simd_ulong_rte(simd_double2 __x);
1056static simd_ulong3 SIMD_CFUNC simd_ulong_rte(simd_double3 __x);
1057static simd_ulong4 SIMD_CFUNC simd_ulong_rte(simd_double4 __x);
1058static simd_ulong8 SIMD_CFUNC simd_ulong_rte(simd_double8 __x);
887#define vector_ulong simd_ulong1059#define vector_ulong simd_ulong
888#define vector_ulong_sat simd_ulong_sat1060#define vector_ulong_sat simd_ulong_sat
8891061
...@@ -903,6 +1075,10 @@ static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x);...@@ -903,6 +1075,10 @@ static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x);
903static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x);1075static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x);
904static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x);1076static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x);
905static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x);1077static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x);
1078static simd_double2 SIMD_CFUNC simd_double(simd_half2 __x);
1079static simd_double3 SIMD_CFUNC simd_double(simd_half3 __x);
1080static simd_double4 SIMD_CFUNC simd_double(simd_half4 __x);
1081static simd_double8 SIMD_CFUNC simd_double(simd_half8 __x);
906static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x);1082static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x);
907static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x);1083static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x);
908static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x);1084static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x);
...@@ -933,6 +1109,7 @@ static simd_char2 SIMD_CFUNC vector2(char __x, char __y) {...@@ -933,6 +1109,7 @@ static simd_char2 SIMD_CFUNC vector2(char __x, char __y) {
933static simd_uchar2 SIMD_CFUNC vector2(unsigned char __x, unsigned char __y) { return ( simd_uchar2){__x, __y}; }1109static simd_uchar2 SIMD_CFUNC vector2(unsigned char __x, unsigned char __y) { return ( simd_uchar2){__x, __y}; }
934static simd_short2 SIMD_CFUNC vector2(short __x, short __y) { return ( simd_short2){__x, __y}; }1110static simd_short2 SIMD_CFUNC vector2(short __x, short __y) { return ( simd_short2){__x, __y}; }
935static simd_ushort2 SIMD_CFUNC vector2(unsigned short __x, unsigned short __y) { return (simd_ushort2){__x, __y}; }1111static simd_ushort2 SIMD_CFUNC vector2(unsigned short __x, unsigned short __y) { return (simd_ushort2){__x, __y}; }
1112static simd_half2 SIMD_CFUNC vector2(_Float16 __x, _Float16 __y) { return ( simd_half2){__x, __y}; }
936static simd_int2 SIMD_CFUNC vector2(int __x, int __y) { return ( simd_int2){__x, __y}; }1113static simd_int2 SIMD_CFUNC vector2(int __x, int __y) { return ( simd_int2){__x, __y}; }
937static simd_uint2 SIMD_CFUNC vector2(unsigned int __x, unsigned int __y) { return ( simd_uint2){__x, __y}; }1114static simd_uint2 SIMD_CFUNC vector2(unsigned int __x, unsigned int __y) { return ( simd_uint2){__x, __y}; }
938static simd_float2 SIMD_CFUNC vector2(float __x, float __y) { return ( simd_float2){__x, __y}; }1115static simd_float2 SIMD_CFUNC vector2(float __x, float __y) { return ( simd_float2){__x, __y}; }
...@@ -944,6 +1121,7 @@ static simd_char3 SIMD_CFUNC vector3(char __x, char __y, c...@@ -944,6 +1121,7 @@ static simd_char3 SIMD_CFUNC vector3(char __x, char __y, c
944static simd_uchar3 SIMD_CFUNC vector3(unsigned char __x, unsigned char __y, unsigned char __z) { return ( simd_uchar3){__x, __y, __z}; }1121static simd_uchar3 SIMD_CFUNC vector3(unsigned char __x, unsigned char __y, unsigned char __z) { return ( simd_uchar3){__x, __y, __z}; }
945static simd_short3 SIMD_CFUNC vector3(short __x, short __y, short __z) { return ( simd_short3){__x, __y, __z}; }1122static simd_short3 SIMD_CFUNC vector3(short __x, short __y, short __z) { return ( simd_short3){__x, __y, __z}; }
946static simd_ushort3 SIMD_CFUNC vector3(unsigned short __x, unsigned short __y, unsigned short __z) { return (simd_ushort3){__x, __y, __z}; }1123static simd_ushort3 SIMD_CFUNC vector3(unsigned short __x, unsigned short __y, unsigned short __z) { return (simd_ushort3){__x, __y, __z}; }
1124static simd_half3 SIMD_CFUNC vector3(_Float16 __x, _Float16 __y, _Float16 __z) { return ( simd_half3){__x, __y, __z}; }
947static simd_int3 SIMD_CFUNC vector3(int __x, int __y, int __z) { return ( simd_int3){__x, __y, __z}; }1125static simd_int3 SIMD_CFUNC vector3(int __x, int __y, int __z) { return ( simd_int3){__x, __y, __z}; }
948static simd_uint3 SIMD_CFUNC vector3(unsigned int __x, unsigned int __y, unsigned int __z) { return ( simd_uint3){__x, __y, __z}; }1126static simd_uint3 SIMD_CFUNC vector3(unsigned int __x, unsigned int __y, unsigned int __z) { return ( simd_uint3){__x, __y, __z}; }
949static simd_float3 SIMD_CFUNC vector3(float __x, float __y, float __z) { return ( simd_float3){__x, __y, __z}; }1127static simd_float3 SIMD_CFUNC vector3(float __x, float __y, float __z) { return ( simd_float3){__x, __y, __z}; }
...@@ -955,6 +1133,7 @@ static simd_char3 SIMD_CFUNC vector3(simd_char2 __xy, char __z) {...@@ -955,6 +1133,7 @@ static simd_char3 SIMD_CFUNC vector3(simd_char2 __xy, char __z) {
955static simd_uchar3 SIMD_CFUNC vector3(simd_uchar2 __xy, unsigned char __z) { simd_uchar3 __r; __r.xy = __xy; __r.z = __z; return __r; }1133static simd_uchar3 SIMD_CFUNC vector3(simd_uchar2 __xy, unsigned char __z) { simd_uchar3 __r; __r.xy = __xy; __r.z = __z; return __r; }
956static simd_short3 SIMD_CFUNC vector3(simd_short2 __xy, short __z) { simd_short3 __r; __r.xy = __xy; __r.z = __z; return __r; }1134static simd_short3 SIMD_CFUNC vector3(simd_short2 __xy, short __z) { simd_short3 __r; __r.xy = __xy; __r.z = __z; return __r; }
957static simd_ushort3 SIMD_CFUNC vector3(simd_ushort2 __xy, unsigned short __z) { simd_ushort3 __r; __r.xy = __xy; __r.z = __z; return __r; }1135static simd_ushort3 SIMD_CFUNC vector3(simd_ushort2 __xy, unsigned short __z) { simd_ushort3 __r; __r.xy = __xy; __r.z = __z; return __r; }
1136static simd_half3 SIMD_CFUNC vector3(simd_half2 __xy, _Float16 __z) { simd_half3 __r; __r.xy = __xy; __r.z = __z; return __r; }
958static simd_int3 SIMD_CFUNC vector3(simd_int2 __xy, int __z) { simd_int3 __r; __r.xy = __xy; __r.z = __z; return __r; }1137static simd_int3 SIMD_CFUNC vector3(simd_int2 __xy, int __z) { simd_int3 __r; __r.xy = __xy; __r.z = __z; return __r; }
959static simd_uint3 SIMD_CFUNC vector3(simd_uint2 __xy, unsigned int __z) { simd_uint3 __r; __r.xy = __xy; __r.z = __z; return __r; }1138static simd_uint3 SIMD_CFUNC vector3(simd_uint2 __xy, unsigned int __z) { simd_uint3 __r; __r.xy = __xy; __r.z = __z; return __r; }
960static simd_float3 SIMD_CFUNC vector3(simd_float2 __xy, float __z) { simd_float3 __r; __r.xy = __xy; __r.z = __z; return __r; }1139static simd_float3 SIMD_CFUNC vector3(simd_float2 __xy, float __z) { simd_float3 __r; __r.xy = __xy; __r.z = __z; return __r; }
...@@ -966,6 +1145,7 @@ static simd_char4 SIMD_CFUNC vector4(char __x, char __y, c...@@ -966,6 +1145,7 @@ static simd_char4 SIMD_CFUNC vector4(char __x, char __y, c
966static simd_uchar4 SIMD_CFUNC vector4(unsigned char __x, unsigned char __y, unsigned char __z, unsigned char __w) { return ( simd_uchar4){__x, __y, __z, __w}; }1145static simd_uchar4 SIMD_CFUNC vector4(unsigned char __x, unsigned char __y, unsigned char __z, unsigned char __w) { return ( simd_uchar4){__x, __y, __z, __w}; }
967static simd_short4 SIMD_CFUNC vector4(short __x, short __y, short __z, short __w) { return ( simd_short4){__x, __y, __z, __w}; }1146static simd_short4 SIMD_CFUNC vector4(short __x, short __y, short __z, short __w) { return ( simd_short4){__x, __y, __z, __w}; }
968static simd_ushort4 SIMD_CFUNC vector4(unsigned short __x, unsigned short __y, unsigned short __z, unsigned short __w) { return (simd_ushort4){__x, __y, __z, __w}; }1147static simd_ushort4 SIMD_CFUNC vector4(unsigned short __x, unsigned short __y, unsigned short __z, unsigned short __w) { return (simd_ushort4){__x, __y, __z, __w}; }
1148static simd_half4 SIMD_CFUNC vector4(_Float16 __x, _Float16 __y, _Float16 __z, _Float16 __w) { return ( simd_half4){__x, __y, __z, __w}; }
969static simd_int4 SIMD_CFUNC vector4(int __x, int __y, int __z, int __w) { return ( simd_int4){__x, __y, __z, __w}; }1149static simd_int4 SIMD_CFUNC vector4(int __x, int __y, int __z, int __w) { return ( simd_int4){__x, __y, __z, __w}; }
970static simd_uint4 SIMD_CFUNC vector4(unsigned int __x, unsigned int __y, unsigned int __z, unsigned int __w) { return ( simd_uint4){__x, __y, __z, __w}; }1150static simd_uint4 SIMD_CFUNC vector4(unsigned int __x, unsigned int __y, unsigned int __z, unsigned int __w) { return ( simd_uint4){__x, __y, __z, __w}; }
971static simd_float4 SIMD_CFUNC vector4(float __x, float __y, float __z, float __w) { return ( simd_float4){__x, __y, __z, __w}; }1151static simd_float4 SIMD_CFUNC vector4(float __x, float __y, float __z, float __w) { return ( simd_float4){__x, __y, __z, __w}; }
...@@ -977,6 +1157,7 @@ static simd_char4 SIMD_CFUNC vector4(simd_char2 __xy, simd_char2 __zw) { s...@@ -977,6 +1157,7 @@ static simd_char4 SIMD_CFUNC vector4(simd_char2 __xy, simd_char2 __zw) { s
977static simd_uchar4 SIMD_CFUNC vector4(simd_uchar2 __xy, simd_uchar2 __zw) { simd_uchar4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }1157static simd_uchar4 SIMD_CFUNC vector4(simd_uchar2 __xy, simd_uchar2 __zw) { simd_uchar4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
978static simd_short4 SIMD_CFUNC vector4(simd_short2 __xy, simd_short2 __zw) { simd_short4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }1158static simd_short4 SIMD_CFUNC vector4(simd_short2 __xy, simd_short2 __zw) { simd_short4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
979static simd_ushort4 SIMD_CFUNC vector4(simd_ushort2 __xy, simd_ushort2 __zw) { simd_ushort4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }1159static simd_ushort4 SIMD_CFUNC vector4(simd_ushort2 __xy, simd_ushort2 __zw) { simd_ushort4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
1160static simd_half4 SIMD_CFUNC vector4(simd_half2 __xy, simd_half2 __zw) { simd_half4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
980static simd_int4 SIMD_CFUNC vector4(simd_int2 __xy, simd_int2 __zw) { simd_int4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }1161static simd_int4 SIMD_CFUNC vector4(simd_int2 __xy, simd_int2 __zw) { simd_int4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
981static simd_uint4 SIMD_CFUNC vector4(simd_uint2 __xy, simd_uint2 __zw) { simd_uint4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }1162static simd_uint4 SIMD_CFUNC vector4(simd_uint2 __xy, simd_uint2 __zw) { simd_uint4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
982static simd_float4 SIMD_CFUNC vector4(simd_float2 __xy, simd_float2 __zw) { simd_float4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }1163static simd_float4 SIMD_CFUNC vector4(simd_float2 __xy, simd_float2 __zw) { simd_float4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
...@@ -988,6 +1169,7 @@ static simd_char4 SIMD_CFUNC vector4(simd_char3 __xyz, char __w) {...@@ -988,6 +1169,7 @@ static simd_char4 SIMD_CFUNC vector4(simd_char3 __xyz, char __w) {
988static simd_uchar4 SIMD_CFUNC vector4(simd_uchar3 __xyz, unsigned char __w) { simd_uchar4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }1169static simd_uchar4 SIMD_CFUNC vector4(simd_uchar3 __xyz, unsigned char __w) { simd_uchar4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
989static simd_short4 SIMD_CFUNC vector4(simd_short3 __xyz, short __w) { simd_short4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }1170static simd_short4 SIMD_CFUNC vector4(simd_short3 __xyz, short __w) { simd_short4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
990static simd_ushort4 SIMD_CFUNC vector4(simd_ushort3 __xyz, unsigned short __w) { simd_ushort4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }1171static simd_ushort4 SIMD_CFUNC vector4(simd_ushort3 __xyz, unsigned short __w) { simd_ushort4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
1172static simd_half4 SIMD_CFUNC vector4(simd_half3 __xyz, _Float16 __w) { simd_half4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
991static simd_int4 SIMD_CFUNC vector4(simd_int3 __xyz, int __w) { simd_int4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }1173static simd_int4 SIMD_CFUNC vector4(simd_int3 __xyz, int __w) { simd_int4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
992static simd_uint4 SIMD_CFUNC vector4(simd_uint3 __xyz, unsigned int __w) { simd_uint4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }1174static simd_uint4 SIMD_CFUNC vector4(simd_uint3 __xyz, unsigned int __w) { simd_uint4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
993static simd_float4 SIMD_CFUNC vector4(simd_float3 __xyz, float __w) { simd_float4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }1175static simd_float4 SIMD_CFUNC vector4(simd_float3 __xyz, float __w) { simd_float4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
...@@ -999,6 +1181,7 @@ static simd_char8 SIMD_CFUNC vector8(simd_char4 __lo, simd_char4 __hi) { s...@@ -999,6 +1181,7 @@ static simd_char8 SIMD_CFUNC vector8(simd_char4 __lo, simd_char4 __hi) { s
999static simd_uchar8 SIMD_CFUNC vector8(simd_uchar4 __lo, simd_uchar4 __hi) { simd_uchar8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1181static simd_uchar8 SIMD_CFUNC vector8(simd_uchar4 __lo, simd_uchar4 __hi) { simd_uchar8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1000static simd_short8 SIMD_CFUNC vector8(simd_short4 __lo, simd_short4 __hi) { simd_short8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1182static simd_short8 SIMD_CFUNC vector8(simd_short4 __lo, simd_short4 __hi) { simd_short8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1001static simd_ushort8 SIMD_CFUNC vector8(simd_ushort4 __lo, simd_ushort4 __hi) { simd_ushort8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1183static simd_ushort8 SIMD_CFUNC vector8(simd_ushort4 __lo, simd_ushort4 __hi) { simd_ushort8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1184static simd_half8 SIMD_CFUNC vector8(simd_half4 __lo, simd_half4 __hi) { simd_half8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1002static simd_int8 SIMD_CFUNC vector8(simd_int4 __lo, simd_int4 __hi) { simd_int8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1185static simd_int8 SIMD_CFUNC vector8(simd_int4 __lo, simd_int4 __hi) { simd_int8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1003static simd_uint8 SIMD_CFUNC vector8(simd_uint4 __lo, simd_uint4 __hi) { simd_uint8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1186static simd_uint8 SIMD_CFUNC vector8(simd_uint4 __lo, simd_uint4 __hi) { simd_uint8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1004static simd_float8 SIMD_CFUNC vector8(simd_float4 __lo, simd_float4 __hi) { simd_float8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1187static simd_float8 SIMD_CFUNC vector8(simd_float4 __lo, simd_float4 __hi) { simd_float8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
...@@ -1010,6 +1193,7 @@ static simd_char16 SIMD_CFUNC vector16(simd_char8 __lo, simd_char8 __hi) {...@@ -1010,6 +1193,7 @@ static simd_char16 SIMD_CFUNC vector16(simd_char8 __lo, simd_char8 __hi) {
1010static simd_uchar16 SIMD_CFUNC vector16(simd_uchar8 __lo, simd_uchar8 __hi) { simd_uchar16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1193static simd_uchar16 SIMD_CFUNC vector16(simd_uchar8 __lo, simd_uchar8 __hi) { simd_uchar16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1011static simd_short16 SIMD_CFUNC vector16(simd_short8 __lo, simd_short8 __hi) { simd_short16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1194static simd_short16 SIMD_CFUNC vector16(simd_short8 __lo, simd_short8 __hi) { simd_short16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1012static simd_ushort16 SIMD_CFUNC vector16(simd_ushort8 __lo, simd_ushort8 __hi) { simd_ushort16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1195static simd_ushort16 SIMD_CFUNC vector16(simd_ushort8 __lo, simd_ushort8 __hi) { simd_ushort16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1196static simd_half16 SIMD_CFUNC vector16(simd_half8 __lo, simd_half8 __hi) { simd_half16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1013static simd_int16 SIMD_CFUNC vector16(simd_int8 __lo, simd_int8 __hi) { simd_int16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1197static simd_int16 SIMD_CFUNC vector16(simd_int8 __lo, simd_int8 __hi) { simd_int16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1014static simd_uint16 SIMD_CFUNC vector16(simd_uint8 __lo, simd_uint8 __hi) { simd_uint16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1198static simd_uint16 SIMD_CFUNC vector16(simd_uint8 __lo, simd_uint8 __hi) { simd_uint16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1015static simd_float16 SIMD_CFUNC vector16(simd_float8 __lo, simd_float8 __hi) { simd_float16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1199static simd_float16 SIMD_CFUNC vector16(simd_float8 __lo, simd_float8 __hi) { simd_float16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
...@@ -1018,6 +1202,7 @@ static simd_char32 SIMD_CFUNC vector32(simd_char16 __lo, simd_char16 __hi)...@@ -1018,6 +1202,7 @@ static simd_char32 SIMD_CFUNC vector32(simd_char16 __lo, simd_char16 __hi)
1018static simd_uchar32 SIMD_CFUNC vector32(simd_uchar16 __lo, simd_uchar16 __hi) { simd_uchar32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1202static simd_uchar32 SIMD_CFUNC vector32(simd_uchar16 __lo, simd_uchar16 __hi) { simd_uchar32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1019static simd_short32 SIMD_CFUNC vector32(simd_short16 __lo, simd_short16 __hi) { simd_short32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1203static simd_short32 SIMD_CFUNC vector32(simd_short16 __lo, simd_short16 __hi) { simd_short32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1020static simd_ushort32 SIMD_CFUNC vector32(simd_ushort16 __lo, simd_ushort16 __hi) { simd_ushort32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }1204static simd_ushort32 SIMD_CFUNC vector32(simd_ushort16 __lo, simd_ushort16 __hi) { simd_ushort32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
1205static simd_half32 SIMD_CFUNC vector32(simd_half16 __lo, simd_half16 __hi) { simd_half32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10211206
1022#pragma mark - Implementation1207#pragma mark - Implementation
10231208
...@@ -1045,6 +1230,12 @@ static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x) { return simd_char(si...@@ -1045,6 +1230,12 @@ static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x) { return simd_char(si
1045static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x) { return simd_char(simd_short(__x)); }1230static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x) { return simd_char(simd_short(__x)); }
1046static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x) { return simd_char(simd_short(__x)); }1231static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x) { return simd_char(simd_short(__x)); }
1047static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x) { return simd_char(simd_short(__x)); }1232static simd_char32 SIMD_CFUNC simd_char(simd_ushort32 __x) { return simd_char(simd_short(__x)); }
1233static simd_char2 SIMD_CFUNC simd_char(simd_half2 __x) { return simd_char(simd_short(__x)); }
1234static simd_char3 SIMD_CFUNC simd_char(simd_half3 __x) { return simd_char(simd_short(__x)); }
1235static simd_char4 SIMD_CFUNC simd_char(simd_half4 __x) { return simd_char(simd_short(__x)); }
1236static simd_char8 SIMD_CFUNC simd_char(simd_half8 __x) { return simd_char(simd_short(__x)); }
1237static simd_char16 SIMD_CFUNC simd_char(simd_half16 __x) { return simd_char(simd_short(__x)); }
1238static simd_char32 SIMD_CFUNC simd_char(simd_half32 __x) { return simd_char(simd_short(__x)); }
1048static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x) { return simd_char(simd_short(__x)); }1239static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x) { return simd_char(simd_short(__x)); }
1049static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x) { return simd_char(simd_short(__x)); }1240static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x) { return simd_char(simd_short(__x)); }
1050static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x) { return simd_char(simd_short(__x)); }1241static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x) { return simd_char(simd_short(__x)); }
...@@ -1085,6 +1276,12 @@ static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x) { return simd_cha...@@ -1085,6 +1276,12 @@ static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x) { return simd_cha
1085static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }1276static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1086static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }1277static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1087static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }1278static simd_char32 SIMD_CFUNC simd_char_sat(simd_short32 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1279static simd_char2 SIMD_CFUNC simd_char_sat(simd_half2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1280static simd_char3 SIMD_CFUNC simd_char_sat(simd_half3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1281static simd_char4 SIMD_CFUNC simd_char_sat(simd_half4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1282static simd_char8 SIMD_CFUNC simd_char_sat(simd_half8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1283static simd_char16 SIMD_CFUNC simd_char_sat(simd_half16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1284static simd_char32 SIMD_CFUNC simd_char_sat(simd_half32 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1088static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }1285static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1089static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }1286static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
1090static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }1287static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
...@@ -1150,6 +1347,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x) { return simd_uchar...@@ -1150,6 +1347,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x) { return simd_uchar
1150static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x) { return simd_uchar(simd_char(__x)); }1347static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x) { return simd_uchar(simd_char(__x)); }
1151static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x) { return simd_uchar(simd_char(__x)); }1348static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x) { return simd_uchar(simd_char(__x)); }
1152static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x) { return simd_uchar(simd_char(__x)); }1349static simd_uchar32 SIMD_CFUNC simd_uchar(simd_ushort32 __x) { return simd_uchar(simd_char(__x)); }
1350static simd_uchar2 SIMD_CFUNC simd_uchar(simd_half2 __x) { return simd_uchar(simd_char(__x)); }
1351static simd_uchar3 SIMD_CFUNC simd_uchar(simd_half3 __x) { return simd_uchar(simd_char(__x)); }
1352static simd_uchar4 SIMD_CFUNC simd_uchar(simd_half4 __x) { return simd_uchar(simd_char(__x)); }
1353static simd_uchar8 SIMD_CFUNC simd_uchar(simd_half8 __x) { return simd_uchar(simd_char(__x)); }
1354static simd_uchar16 SIMD_CFUNC simd_uchar(simd_half16 __x) { return simd_uchar(simd_char(__x)); }
1355static simd_uchar32 SIMD_CFUNC simd_uchar(simd_half32 __x) { return simd_uchar(simd_char(__x)); }
1153static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x) { return simd_uchar(simd_char(__x)); }1356static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x) { return simd_uchar(simd_char(__x)); }
1154static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x) { return simd_uchar(simd_char(__x)); }1357static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x) { return simd_uchar(simd_char(__x)); }
1155static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x) { return simd_uchar(simd_char(__x)); }1358static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x) { return simd_uchar(simd_char(__x)); }
...@@ -1190,6 +1393,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x) { return simd_u...@@ -1190,6 +1393,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x) { return simd_u
1190static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }1393static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1191static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }1394static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1192static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }1395static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_short32 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1396static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_half2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1397static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_half3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1398static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_half4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1399static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_half8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1400static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_half16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1401static simd_uchar32 SIMD_CFUNC simd_uchar_sat(simd_half32 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1193static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }1402static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1194static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }1403static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
1195static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }1404static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
...@@ -1255,6 +1464,12 @@ static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x) { return (simd_shor...@@ -1255,6 +1464,12 @@ static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x) { return (simd_shor
1255static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x) { return (simd_short8)__x; }1464static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x) { return (simd_short8)__x; }
1256static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x) { return (simd_short16)__x; }1465static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x) { return (simd_short16)__x; }
1257static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x) { return (simd_short32)__x; }1466static simd_short32 SIMD_CFUNC simd_short(simd_ushort32 __x) { return (simd_short32)__x; }
1467static simd_short2 SIMD_CFUNC simd_short(simd_half2 __x) { return __builtin_convertvector(__x, simd_short2); }
1468static simd_short3 SIMD_CFUNC simd_short(simd_half3 __x) { return __builtin_convertvector(__x, simd_short3); }
1469static simd_short4 SIMD_CFUNC simd_short(simd_half4 __x) { return __builtin_convertvector(__x, simd_short4); }
1470static simd_short8 SIMD_CFUNC simd_short(simd_half8 __x) { return __builtin_convertvector(__x, simd_short8); }
1471static simd_short16 SIMD_CFUNC simd_short(simd_half16 __x) { return __builtin_convertvector(__x, simd_short16); }
1472static simd_short32 SIMD_CFUNC simd_short(simd_half32 __x) { return __builtin_convertvector(__x, simd_short32); }
1258static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x) { return __builtin_convertvector(__x & 0xffff, simd_short2); }1473static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x) { return __builtin_convertvector(__x & 0xffff, simd_short2); }
1259static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x) { return __builtin_convertvector(__x & 0xffff, simd_short3); }1474static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x) { return __builtin_convertvector(__x & 0xffff, simd_short3); }
1260static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x) { return __builtin_convertvector(__x & 0xffff, simd_short4); }1475static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x) { return __builtin_convertvector(__x & 0xffff, simd_short4); }
...@@ -1295,6 +1510,12 @@ static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x) { return __x; }...@@ -1295,6 +1510,12 @@ static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x) { return __x; }
1295static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x) { return __x; }1510static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x) { return __x; }
1296static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x) { return __x; }1511static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x) { return __x; }
1297static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x) { return __x; }1512static simd_short32 SIMD_CFUNC simd_short_sat(simd_short32 __x) { return __x; }
1513static simd_short2 SIMD_CFUNC simd_short_sat(simd_half2 __x) { return simd_bitselect(simd_short(simd_max(__x,-0x1.0p15f16)), 0x7fff, __x >= 0x1.0p15f16); }
1514static simd_short3 SIMD_CFUNC simd_short_sat(simd_half3 __x) { return simd_bitselect(simd_short(simd_max(__x,-0x1.0p15f16)), 0x7fff, __x >= 0x1.0p15f16); }
1515static simd_short4 SIMD_CFUNC simd_short_sat(simd_half4 __x) { return simd_bitselect(simd_short(simd_max(__x,-0x1.0p15f16)), 0x7fff, __x >= 0x1.0p15f16); }
1516static simd_short8 SIMD_CFUNC simd_short_sat(simd_half8 __x) { return simd_bitselect(simd_short(simd_max(__x,-0x1.0p15f16)), 0x7fff, __x >= 0x1.0p15f16); }
1517static simd_short16 SIMD_CFUNC simd_short_sat(simd_half16 __x) { return simd_bitselect(simd_short(simd_max(__x,-0x1.0p15f16)), 0x7fff, __x >= 0x1.0p15f16); }
1518static simd_short32 SIMD_CFUNC simd_short_sat(simd_half32 __x) { return simd_bitselect(simd_short(simd_max(__x,-0x1.0p15f16)), 0x7fff, __x >= 0x1.0p15f16); }
1298static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }1519static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1299static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }1520static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
1300static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }1521static simd_short4 SIMD_CFUNC simd_short_sat(simd_int4 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
...@@ -1334,7 +1555,26 @@ static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x) { return simd_s...@@ -1334,7 +1555,26 @@ static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x) { return simd_s
1334static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x) { return simd_short(simd_min(__x,0x7fff)); }1555static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x) { return simd_short(simd_min(__x,0x7fff)); }
1335static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x) { return simd_short(simd_min(__x,0x7fff)); }1556static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x) { return simd_short(simd_min(__x,0x7fff)); }
1336static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x) { return simd_short(simd_min(__x,0x7fff)); }1557static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x) { return simd_short(simd_min(__x,0x7fff)); }
1337 1558static simd_short2 SIMD_CFUNC simd_short_rte(simd_half2 __x) { return simd_make_short2(simd_short_rte(simd_make_half4_undef(__x))); }
1559static simd_short3 SIMD_CFUNC simd_short_rte(simd_half3 __x) { return simd_make_short3(simd_short_rte(simd_make_half4_undef(__x))); }
1560static simd_short4 SIMD_CFUNC simd_short_rte(simd_half4 __x) {
1561#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
1562 return vcvtn_s16_f16(__x);
1563#else
1564 return simd_make_short4(simd_short_rte(simd_make_half8_undef(__x)));
1565#endif
1566}
1567static simd_short8 SIMD_CFUNC simd_short_rte(simd_half8 __x) {
1568#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
1569 return vcvtnq_s16_f16(__x);
1570#else
1571 simd_half8 magic = __tg_copysign(0x1.0p10f16, __x);
1572 simd_short8 x_is_small = __tg_fabs(__x) < 0x1.0p10f16;
1573 return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fff), simd_short8);
1574#endif
1575}
1576static simd_short16 SIMD_CFUNC simd_short_rte(simd_half16 __x) { return simd_make_short16(simd_short_rte(__x.lo), simd_short_rte(__x.hi)); }
1577static simd_short32 SIMD_CFUNC simd_short_rte(simd_half32 __x) { return simd_make_short32(simd_short_rte(__x.lo), simd_short_rte(__x.hi)); }
13381578
1339static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x) { return simd_ushort(simd_short(__x)); }1579static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x) { return simd_ushort(simd_short(__x)); }
1340static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x) { return simd_ushort(simd_short(__x)); }1580static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x) { return simd_ushort(simd_short(__x)); }
...@@ -1360,6 +1600,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x) { return __x; }...@@ -1360,6 +1600,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x) { return __x; }
1360static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x) { return __x; }1600static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x) { return __x; }
1361static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x) { return __x; }1601static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x) { return __x; }
1362static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x) { return __x; }1602static simd_ushort32 SIMD_CFUNC simd_ushort(simd_ushort32 __x) { return __x; }
1603static simd_ushort2 SIMD_CFUNC simd_ushort(simd_half2 __x) { return __builtin_convertvector(__x, simd_ushort2); }
1604static simd_ushort3 SIMD_CFUNC simd_ushort(simd_half3 __x) { return __builtin_convertvector(__x, simd_ushort3); }
1605static simd_ushort4 SIMD_CFUNC simd_ushort(simd_half4 __x) { return __builtin_convertvector(__x, simd_ushort4); }
1606static simd_ushort8 SIMD_CFUNC simd_ushort(simd_half8 __x) { return __builtin_convertvector(__x, simd_ushort8); }
1607static simd_ushort16 SIMD_CFUNC simd_ushort(simd_half16 __x) { return __builtin_convertvector(__x, simd_ushort16); }
1608static simd_ushort32 SIMD_CFUNC simd_ushort(simd_half32 __x) { return __builtin_convertvector(__x, simd_ushort32); }
1363static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x) { return simd_ushort(simd_short(__x)); }1609static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x) { return simd_ushort(simd_short(__x)); }
1364static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x) { return simd_ushort(simd_short(__x)); }1610static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x) { return simd_ushort(simd_short(__x)); }
1365static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x) { return simd_ushort(simd_short(__x)); }1611static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x) { return simd_ushort(simd_short(__x)); }
...@@ -1400,6 +1646,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x) { return simd...@@ -1400,6 +1646,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x) { return simd
1400static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x) { return simd_ushort(simd_max(__x, 0)); }1646static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x) { return simd_ushort(simd_max(__x, 0)); }
1401static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x) { return simd_ushort(simd_max(__x, 0)); }1647static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x) { return simd_ushort(simd_max(__x, 0)); }
1402static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x) { return simd_ushort(simd_max(__x, 0)); }1648static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_short32 __x) { return simd_ushort(simd_max(__x, 0)); }
1649static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_half2 __x) { return simd_bitselect(simd_ushort(simd_max(__x,0)), 0xffff, __x > 0x1.ffcp15f16); }
1650static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_half3 __x) { return simd_bitselect(simd_ushort(simd_max(__x,0)), 0xffff, __x > 0x1.ffcp15f16); }
1651static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_half4 __x) { return simd_bitselect(simd_ushort(simd_max(__x,0)), 0xffff, __x > 0x1.ffcp15f16); }
1652static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_half8 __x) { return simd_bitselect(simd_ushort(simd_max(__x,0)), 0xffff, __x > 0x1.ffcp15f16); }
1653static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_half16 __x) { return simd_bitselect(simd_ushort(simd_max(__x,0)), 0xffff, __x > 0x1.ffcp15f16); }
1654static simd_ushort32 SIMD_CFUNC simd_ushort_sat(simd_half32 __x) { return simd_bitselect(simd_ushort(simd_max(__x,0)), 0xffff, __x > 0x1.ffcp15f16); }
1403static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }1655static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1404static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }1656static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
1405static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }1657static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_int4 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
...@@ -1439,7 +1691,78 @@ static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x) { return simd...@@ -1439,7 +1691,78 @@ static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x) { return simd
1439static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x) { return simd_ushort(simd_min(__x, 0xffff)); }1691static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1440static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x) { return simd_ushort(simd_min(__x, 0xffff)); }1692static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1441static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x) { return simd_ushort(simd_min(__x, 0xffff)); }1693static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
1442 1694static simd_ushort2 SIMD_CFUNC simd_ushort_rte(simd_half2 __x) { return simd_make_ushort2(simd_ushort_rte(simd_make_half4_undef(__x))); }
1695static simd_ushort3 SIMD_CFUNC simd_ushort_rte(simd_half3 __x) { return simd_make_ushort3(simd_ushort_rte(simd_make_half4_undef(__x))); }
1696static simd_ushort4 SIMD_CFUNC simd_ushort_rte(simd_half4 __x) {
1697#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
1698 return vcvtn_u16_f16(__x);
1699#else
1700 return simd_make_ushort4(simd_ushort_rte(simd_make_half8_undef(__x)));
1701#endif
1702}
1703static simd_ushort8 SIMD_CFUNC simd_ushort_rte(simd_half8 __x) {
1704#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
1705 return vcvtnq_u16_f16(__x);
1706#else
1707 simd_short8 __big = __x >= 0x1.0p15f16;
1708 return simd_ushort(simd_short(__x - simd_bitselect((simd_half8) 0,0x1.0p15f16,__big))) + simd_bitselect((simd_ushort8) 0,0x8000,__big);
1709#endif
1710}
1711static simd_ushort16 SIMD_CFUNC simd_ushort_rte(simd_half16 __x) { return simd_make_ushort16(simd_ushort_rte(__x.lo), simd_ushort_rte(__x.hi)); }
1712static simd_ushort32 SIMD_CFUNC simd_ushort_rte(simd_half32 __x) { return simd_make_ushort32(simd_ushort_rte(__x.lo), simd_ushort_rte(__x.hi)); }
1713
1714static simd_half2 SIMD_CFUNC simd_half(simd_char2 __x) { return (simd_half2)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1715static simd_half3 SIMD_CFUNC simd_half(simd_char3 __x) { return (simd_half3)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1716static simd_half4 SIMD_CFUNC simd_half(simd_char4 __x) { return (simd_half4)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1717static simd_half8 SIMD_CFUNC simd_half(simd_char8 __x) { return (simd_half8)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1718static simd_half16 SIMD_CFUNC simd_half(simd_char16 __x) { return (simd_half16)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1719static simd_half2 SIMD_CFUNC simd_half(simd_uchar2 __x) { return (simd_half2)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1720static simd_half3 SIMD_CFUNC simd_half(simd_uchar3 __x) { return (simd_half3)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1721static simd_half4 SIMD_CFUNC simd_half(simd_uchar4 __x) { return (simd_half4)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1722static simd_half8 SIMD_CFUNC simd_half(simd_uchar8 __x) { return (simd_half8)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1723static simd_half16 SIMD_CFUNC simd_half(simd_uchar16 __x) { return (simd_half16)(simd_short(__x) + 0x6600) - 0x1.8p10f16; }
1724static simd_half2 SIMD_CFUNC simd_half(simd_short2 __x) { return __builtin_convertvector(__x,simd_half2); }
1725static simd_half3 SIMD_CFUNC simd_half(simd_short3 __x) { return __builtin_convertvector(__x,simd_half3); }
1726static simd_half4 SIMD_CFUNC simd_half(simd_short4 __x) { return __builtin_convertvector(__x,simd_half4); }
1727static simd_half8 SIMD_CFUNC simd_half(simd_short8 __x) { return __builtin_convertvector(__x,simd_half8); }
1728static simd_half16 SIMD_CFUNC simd_half(simd_short16 __x) { return __builtin_convertvector(__x,simd_half16); }
1729static simd_half2 SIMD_CFUNC simd_half(simd_ushort2 __x) { return __builtin_convertvector(__x,simd_half2); }
1730static simd_half3 SIMD_CFUNC simd_half(simd_ushort3 __x) { return __builtin_convertvector(__x,simd_half3); }
1731static simd_half4 SIMD_CFUNC simd_half(simd_ushort4 __x) { return __builtin_convertvector(__x,simd_half4); }
1732static simd_half8 SIMD_CFUNC simd_half(simd_ushort8 __x) { return __builtin_convertvector(__x,simd_half8); }
1733static simd_half16 SIMD_CFUNC simd_half(simd_ushort16 __x) { return __builtin_convertvector(__x,simd_half16); }
1734static simd_half2 SIMD_CFUNC simd_half(simd_half2 __x) { return __x; }
1735static simd_half3 SIMD_CFUNC simd_half(simd_half3 __x) { return __x; }
1736static simd_half4 SIMD_CFUNC simd_half(simd_half4 __x) { return __x; }
1737static simd_half8 SIMD_CFUNC simd_half(simd_half8 __x) { return __x; }
1738static simd_half16 SIMD_CFUNC simd_half(simd_half16 __x) { return __x; }
1739static simd_half2 SIMD_CFUNC simd_half(simd_int2 __x) { return __builtin_convertvector(__x,simd_half2); }
1740static simd_half3 SIMD_CFUNC simd_half(simd_int3 __x) { return __builtin_convertvector(__x,simd_half3); }
1741static simd_half4 SIMD_CFUNC simd_half(simd_int4 __x) { return __builtin_convertvector(__x,simd_half4); }
1742static simd_half8 SIMD_CFUNC simd_half(simd_int8 __x) { return __builtin_convertvector(__x,simd_half8); }
1743static simd_half16 SIMD_CFUNC simd_half(simd_int16 __x) { return __builtin_convertvector(__x,simd_half16); }
1744static simd_half2 SIMD_CFUNC simd_half(simd_uint2 __x) { return __builtin_convertvector(__x,simd_half2); }
1745static simd_half3 SIMD_CFUNC simd_half(simd_uint3 __x) { return __builtin_convertvector(__x,simd_half3); }
1746static simd_half4 SIMD_CFUNC simd_half(simd_uint4 __x) { return __builtin_convertvector(__x,simd_half4); }
1747static simd_half8 SIMD_CFUNC simd_half(simd_uint8 __x) { return __builtin_convertvector(__x,simd_half8); }
1748static simd_half16 SIMD_CFUNC simd_half(simd_uint16 __x) { return __builtin_convertvector(__x,simd_half16); }
1749static simd_half2 SIMD_CFUNC simd_half(simd_float2 __x) { return __builtin_convertvector(__x,simd_half2); }
1750static simd_half3 SIMD_CFUNC simd_half(simd_float3 __x) { return __builtin_convertvector(__x,simd_half3); }
1751static simd_half4 SIMD_CFUNC simd_half(simd_float4 __x) { return __builtin_convertvector(__x,simd_half4); }
1752static simd_half8 SIMD_CFUNC simd_half(simd_float8 __x) { return __builtin_convertvector(__x,simd_half8); }
1753static simd_half16 SIMD_CFUNC simd_half(simd_float16 __x) { return __builtin_convertvector(__x,simd_half16); }
1754static simd_half2 SIMD_CFUNC simd_half(simd_long2 __x) { return __builtin_convertvector(__x,simd_half2); }
1755static simd_half3 SIMD_CFUNC simd_half(simd_long3 __x) { return __builtin_convertvector(__x,simd_half3); }
1756static simd_half4 SIMD_CFUNC simd_half(simd_long4 __x) { return __builtin_convertvector(__x,simd_half4); }
1757static simd_half8 SIMD_CFUNC simd_half(simd_long8 __x) { return __builtin_convertvector(__x,simd_half8); }
1758static simd_half2 SIMD_CFUNC simd_half(simd_ulong2 __x) { return __builtin_convertvector(__x,simd_half2); }
1759static simd_half3 SIMD_CFUNC simd_half(simd_ulong3 __x) { return __builtin_convertvector(__x,simd_half3); }
1760static simd_half4 SIMD_CFUNC simd_half(simd_ulong4 __x) { return __builtin_convertvector(__x,simd_half4); }
1761static simd_half8 SIMD_CFUNC simd_half(simd_ulong8 __x) { return __builtin_convertvector(__x,simd_half8); }
1762static simd_half2 SIMD_CFUNC simd_half(simd_double2 __x) { return __builtin_convertvector(__x,simd_half2); }
1763static simd_half3 SIMD_CFUNC simd_half(simd_double3 __x) { return __builtin_convertvector(__x,simd_half3); }
1764static simd_half4 SIMD_CFUNC simd_half(simd_double4 __x) { return __builtin_convertvector(__x,simd_half4); }
1765static simd_half8 SIMD_CFUNC simd_half(simd_double8 __x) { return __builtin_convertvector(__x,simd_half8); }
14431766
1444static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x) { return __builtin_convertvector(__x, simd_int2); }1767static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x) { return __builtin_convertvector(__x, simd_int2); }
1445static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x) { return __builtin_convertvector(__x, simd_int3); }1768static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x) { return __builtin_convertvector(__x, simd_int3); }
...@@ -1461,6 +1784,11 @@ static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x) { return __builtin_conv...@@ -1461,6 +1784,11 @@ static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x) { return __builtin_conv
1461static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x) { return __builtin_convertvector(__x, simd_int4); }1784static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x) { return __builtin_convertvector(__x, simd_int4); }
1462static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x) { return __builtin_convertvector(__x, simd_int8); }1785static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x) { return __builtin_convertvector(__x, simd_int8); }
1463static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x) { return __builtin_convertvector(__x, simd_int16); }1786static simd_int16 SIMD_CFUNC simd_int(simd_ushort16 __x) { return __builtin_convertvector(__x, simd_int16); }
1787static simd_int2 SIMD_CFUNC simd_int(simd_half2 __x) { return __builtin_convertvector(__x, simd_int2); }
1788static simd_int3 SIMD_CFUNC simd_int(simd_half3 __x) { return __builtin_convertvector(__x, simd_int3); }
1789static simd_int4 SIMD_CFUNC simd_int(simd_half4 __x) { return __builtin_convertvector(__x, simd_int4); }
1790static simd_int8 SIMD_CFUNC simd_int(simd_half8 __x) { return __builtin_convertvector(__x, simd_int8); }
1791static simd_int16 SIMD_CFUNC simd_int(simd_half16 __x) { return __builtin_convertvector(__x, simd_int16); }
1464static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x) { return __x; }1792static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x) { return __x; }
1465static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x) { return __x; }1793static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x) { return __x; }
1466static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x) { return __x; }1794static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x) { return __x; }
...@@ -1499,6 +1827,11 @@ static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x) { return simd_int(_...@@ -1499,6 +1827,11 @@ static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x) { return simd_int(_
1499static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x) { return simd_int(__x); }1827static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x) { return simd_int(__x); }
1500static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x) { return simd_int(__x); }1828static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x) { return simd_int(__x); }
1501static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x) { return simd_int(__x); }1829static simd_int16 SIMD_CFUNC simd_int_sat(simd_short16 __x) { return simd_int(__x); }
1830static simd_int2 SIMD_CFUNC simd_int_sat(simd_half2 __x) { return simd_int(__x); }
1831static simd_int3 SIMD_CFUNC simd_int_sat(simd_half3 __x) { return simd_int(__x); }
1832static simd_int4 SIMD_CFUNC simd_int_sat(simd_half4 __x) { return simd_int(__x); }
1833static simd_int8 SIMD_CFUNC simd_int_sat(simd_half8 __x) { return simd_int(__x); }
1834static simd_int16 SIMD_CFUNC simd_int_sat(simd_half16 __x) { return simd_int(__x); }
1502static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x) { return __x; }1835static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x) { return __x; }
1503static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x) { return __x; }1836static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x) { return __x; }
1504static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x) { return __x; }1837static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x) { return __x; }
...@@ -1538,7 +1871,7 @@ static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x) { return simd_int(s...@@ -1538,7 +1871,7 @@ static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x) { return simd_int(s
1538static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x) { return simd_int(simd_min(__x,0x7fffffff)); }1871static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
1539 1872
1540static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x) {1873static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x) {
1541#if defined __arm64__1874#if defined __arm64__ || defined __aarch64__
1542 return vcvtn_s32_f32(__x);1875 return vcvtn_s32_f32(__x);
1543#else1876#else
1544 return simd_make_int2(simd_int_rte(simd_make_float4_undef(__x)));1877 return simd_make_int2(simd_int_rte(simd_make_float4_undef(__x)));
...@@ -1552,7 +1885,7 @@ static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x) {...@@ -1552,7 +1885,7 @@ static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x) {
1552static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x) {1885static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x) {
1553#if defined __SSE2__1886#if defined __SSE2__
1554 return _mm_cvtps_epi32(__x);1887 return _mm_cvtps_epi32(__x);
1555#elif defined __arm64__1888#elif defined __arm64__ || defined __aarch64__
1556 return vcvtnq_s32_f32(__x);1889 return vcvtnq_s32_f32(__x);
1557#else1890#else
1558 simd_float4 magic = __tg_copysign(0x1.0p23, __x);1891 simd_float4 magic = __tg_copysign(0x1.0p23, __x);
...@@ -1571,7 +1904,7 @@ static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x) {...@@ -1571,7 +1904,7 @@ static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x) {
15711904
1572static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x) {1905static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x) {
1573#if defined __AVX512F__1906#if defined __AVX512F__
1574 return _mm512_cvt_roundps_epi32(__x, _MM_FROUND_RINT);1907 return _mm512_cvtps_epi32(__x);
1575#else1908#else
1576 return simd_make_int16(simd_int_rte(__x.lo), simd_int_rte(__x.hi));1909 return simd_make_int16(simd_int_rte(__x.lo), simd_int_rte(__x.hi));
1577#endif1910#endif
...@@ -1597,6 +1930,11 @@ static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x) { return simd_uint(si...@@ -1597,6 +1930,11 @@ static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x) { return simd_uint(si
1597static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x) { return simd_uint(simd_int(__x)); }1930static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x) { return simd_uint(simd_int(__x)); }
1598static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x) { return simd_uint(simd_int(__x)); }1931static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x) { return simd_uint(simd_int(__x)); }
1599static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x) { return simd_uint(simd_int(__x)); }1932static simd_uint16 SIMD_CFUNC simd_uint(simd_ushort16 __x) { return simd_uint(simd_int(__x)); }
1933static simd_uint2 SIMD_CFUNC simd_uint(simd_half2 __x) { return simd_uint(simd_int(__x)); }
1934static simd_uint3 SIMD_CFUNC simd_uint(simd_half3 __x) { return simd_uint(simd_int(__x)); }
1935static simd_uint4 SIMD_CFUNC simd_uint(simd_half4 __x) { return simd_uint(simd_int(__x)); }
1936static simd_uint8 SIMD_CFUNC simd_uint(simd_half8 __x) { return simd_uint(simd_int(__x)); }
1937static simd_uint16 SIMD_CFUNC simd_uint(simd_half16 __x) { return simd_uint(simd_int(__x)); }
1600static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x) { return (simd_uint2)__x; }1938static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x) { return (simd_uint2)__x; }
1601static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x) { return (simd_uint3)__x; }1939static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x) { return (simd_uint3)__x; }
1602static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x) { return (simd_uint4)__x; }1940static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x) { return (simd_uint4)__x; }
...@@ -1635,6 +1973,11 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x) { return simd_uin...@@ -1635,6 +1973,11 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x) { return simd_uin
1635static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x) { return simd_uint(simd_max(__x,0)); }1973static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x) { return simd_uint(simd_max(__x,0)); }
1636static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x) { return simd_uint(simd_max(__x,0)); }1974static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x) { return simd_uint(simd_max(__x,0)); }
1637static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x) { return simd_uint(simd_max(__x,0)); }1975static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_short16 __x) { return simd_uint(simd_max(__x,0)); }
1976static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_half2 __x) { return simd_uint(simd_max(__x,0)); }
1977static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_half3 __x) { return simd_uint(simd_max(__x,0)); }
1978static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_half4 __x) { return simd_uint(simd_max(__x,0)); }
1979static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_half8 __x) { return simd_uint(simd_max(__x,0)); }
1980static simd_uint16 SIMD_CFUNC simd_uint_sat(simd_half16 __x) { return simd_uint(simd_max(__x,0)); }
1638static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x) { return simd_uint(simd_max(__x,0)); }1981static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x) { return simd_uint(simd_max(__x,0)); }
1639static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x) { return simd_uint(simd_max(__x,0)); }1982static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x) { return simd_uint(simd_max(__x,0)); }
1640static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x) { return simd_uint(simd_max(__x,0)); }1983static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_int4 __x) { return simd_uint(simd_max(__x,0)); }
...@@ -1673,6 +2016,45 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x) { return simd_uin...@@ -1673,6 +2016,45 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x) { return simd_uin
1673static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }2016static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1674static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }2017static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
1675 2018
2019static simd_uint2 SIMD_CFUNC simd_uint_rte(simd_float2 __x) {
2020#if defined __arm64__
2021 return vcvtn_u32_f32(__x);
2022#else
2023 return simd_make_uint2(simd_uint_rte(simd_make_float4_undef(__x)));
2024#endif
2025}
2026
2027static simd_uint3 SIMD_CFUNC simd_uint_rte(simd_float3 __x) {
2028 return simd_make_uint3(simd_uint_rte(simd_make_float4_undef(__x)));
2029}
2030
2031static simd_uint4 SIMD_CFUNC simd_uint_rte(simd_float4 __x) {
2032#if defined __AVX512F__
2033 return _mm_cvtps_epu32(__x);
2034#elif defined __arm64__
2035 return vcvtnq_u32_f32(__x);
2036#else
2037 simd_float4 magic = __tg_copysign(0x1.0p23, __x);
2038 simd_int4 x_is_small = __tg_fabs(__x) < 0x1.0p23;
2039 return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fffffff), simd_uint4);
2040#endif
2041}
2042
2043static simd_uint8 SIMD_CFUNC simd_uint_rte(simd_float8 __x) {
2044#if defined __AVX512F__
2045 return _mm256_cvtps_epu32(__x);
2046#else
2047 return simd_make_uint8(simd_uint_rte(__x.lo), simd_uint_rte(__x.hi));
2048#endif
2049}
2050
2051static simd_uint16 SIMD_CFUNC simd_uint_rte(simd_float16 __x) {
2052#if defined __AVX512F__
2053 return _mm512_cvtps_epu32(__x);
2054#else
2055 return simd_make_uint16(simd_uint_rte(__x.lo), simd_uint_rte(__x.hi));
2056#endif
2057}
16762058
1677static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }2059static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1678static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }2060static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
...@@ -1694,6 +2076,11 @@ static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x) { return (simd_floa...@@ -1694,6 +2076,11 @@ static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x) { return (simd_floa
1694static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }2076static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1695static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }2077static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
1696static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }2078static simd_float16 SIMD_CFUNC simd_float(simd_ushort16 __x) { return (simd_float16)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
2079static simd_float2 SIMD_CFUNC simd_float(simd_half2 __x) { return __builtin_convertvector(__x,simd_float2); }
2080static simd_float3 SIMD_CFUNC simd_float(simd_half3 __x) { return __builtin_convertvector(__x,simd_float3); }
2081static simd_float4 SIMD_CFUNC simd_float(simd_half4 __x) { return __builtin_convertvector(__x,simd_float4); }
2082static simd_float8 SIMD_CFUNC simd_float(simd_half8 __x) { return __builtin_convertvector(__x,simd_float8); }
2083static simd_float16 SIMD_CFUNC simd_float(simd_half16 __x) { return __builtin_convertvector(__x,simd_float16); }
1697static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x) { return __builtin_convertvector(__x,simd_float2); }2084static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x) { return __builtin_convertvector(__x,simd_float2); }
1698static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x) { return __builtin_convertvector(__x,simd_float3); }2085static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x) { return __builtin_convertvector(__x,simd_float3); }
1699static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x) { return __builtin_convertvector(__x,simd_float4); }2086static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x) { return __builtin_convertvector(__x,simd_float4); }
...@@ -1739,6 +2126,10 @@ static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x) { return __builtin_co...@@ -1739,6 +2126,10 @@ static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x) { return __builtin_co
1739static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x) { return __builtin_convertvector(__x,simd_long3); }2126static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x) { return __builtin_convertvector(__x,simd_long3); }
1740static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x) { return __builtin_convertvector(__x,simd_long4); }2127static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x) { return __builtin_convertvector(__x,simd_long4); }
1741static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x) { return __builtin_convertvector(__x,simd_long8); }2128static simd_long8 SIMD_CFUNC simd_long(simd_ushort8 __x) { return __builtin_convertvector(__x,simd_long8); }
2129static simd_long2 SIMD_CFUNC simd_long(simd_half2 __x) { return __builtin_convertvector(__x,simd_long2); }
2130static simd_long3 SIMD_CFUNC simd_long(simd_half3 __x) { return __builtin_convertvector(__x,simd_long3); }
2131static simd_long4 SIMD_CFUNC simd_long(simd_half4 __x) { return __builtin_convertvector(__x,simd_long4); }
2132static simd_long8 SIMD_CFUNC simd_long(simd_half8 __x) { return __builtin_convertvector(__x,simd_long8); }
1742static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x) { return __builtin_convertvector(__x,simd_long2); }2133static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x) { return __builtin_convertvector(__x,simd_long2); }
1743static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x) { return __builtin_convertvector(__x,simd_long3); }2134static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x) { return __builtin_convertvector(__x,simd_long3); }
1744static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x) { return __builtin_convertvector(__x,simd_long4); }2135static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x) { return __builtin_convertvector(__x,simd_long4); }
...@@ -1772,6 +2163,10 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x) { return simd_lon...@@ -1772,6 +2163,10 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x) { return simd_lon
1772static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x) { return simd_long(__x); }2163static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x) { return simd_long(__x); }
1773static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x) { return simd_long(__x); }2164static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x) { return simd_long(__x); }
1774static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x) { return simd_long(__x); }2165static simd_long8 SIMD_CFUNC simd_long_sat(simd_short8 __x) { return simd_long(__x); }
2166static simd_long2 SIMD_CFUNC simd_long_sat(simd_half2 __x) { return simd_long(__x); }
2167static simd_long3 SIMD_CFUNC simd_long_sat(simd_half3 __x) { return simd_long(__x); }
2168static simd_long4 SIMD_CFUNC simd_long_sat(simd_half4 __x) { return simd_long(__x); }
2169static simd_long8 SIMD_CFUNC simd_long_sat(simd_half8 __x) { return simd_long(__x); }
1775static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x) { return simd_long(__x); }2170static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x) { return simd_long(__x); }
1776static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x) { return simd_long(__x); }2171static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x) { return simd_long(__x); }
1777static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x) { return simd_long(__x); }2172static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x) { return simd_long(__x); }
...@@ -1808,7 +2203,7 @@ static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x) { return simd_lon...@@ -1808,7 +2203,7 @@ static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x) { return simd_lon
1808static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x) {2203static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x) {
1809#if defined __AVX512F__2204#if defined __AVX512F__
1810 return _mm_cvtpd_epi64(__x);2205 return _mm_cvtpd_epi64(__x);
1811#elif defined __arm64__2206#elif defined __arm64__ || defined __aarch64__
1812 return vcvtnq_s64_f64(__x);2207 return vcvtnq_s64_f64(__x);
1813#else2208#else
1814 simd_double2 magic = __tg_copysign(0x1.0p52, __x);2209 simd_double2 magic = __tg_copysign(0x1.0p52, __x);
...@@ -1831,7 +2226,7 @@ static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x) {...@@ -1831,7 +2226,7 @@ static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x) {
18312226
1832static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x) {2227static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x) {
1833#if defined __AVX512F__2228#if defined __AVX512F__
1834 return _mm512_cvt_roundpd_epi64(__x, _MM_FROUND_RINT);2229 return _mm512_cvtpd_epi64(__x);
1835#else2230#else
1836 return simd_make_long8(simd_long_rte(__x.lo), simd_long_rte(__x.hi));2231 return simd_make_long8(simd_long_rte(__x.lo), simd_long_rte(__x.hi));
1837#endif2232#endif
...@@ -1854,6 +2249,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x) { return simd_ulong...@@ -1854,6 +2249,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x) { return simd_ulong
1854static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x) { return simd_ulong(simd_long(__x)); }2249static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x) { return simd_ulong(simd_long(__x)); }
1855static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x) { return simd_ulong(simd_long(__x)); }2250static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x) { return simd_ulong(simd_long(__x)); }
1856static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x) { return simd_ulong(simd_long(__x)); }2251static simd_ulong8 SIMD_CFUNC simd_ulong(simd_ushort8 __x) { return simd_ulong(simd_long(__x)); }
2252static simd_ulong2 SIMD_CFUNC simd_ulong(simd_half2 __x) { return simd_ulong(simd_long(__x)); }
2253static simd_ulong3 SIMD_CFUNC simd_ulong(simd_half3 __x) { return simd_ulong(simd_long(__x)); }
2254static simd_ulong4 SIMD_CFUNC simd_ulong(simd_half4 __x) { return simd_ulong(simd_long(__x)); }
2255static simd_ulong8 SIMD_CFUNC simd_ulong(simd_half8 __x) { return simd_ulong(simd_long(__x)); }
1857static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x) { return simd_ulong(simd_long(__x)); }2256static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x) { return simd_ulong(simd_long(__x)); }
1858static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x) { return simd_ulong(simd_long(__x)); }2257static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x) { return simd_ulong(simd_long(__x)); }
1859static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x) { return simd_ulong(simd_long(__x)); }2258static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x) { return simd_ulong(simd_long(__x)); }
...@@ -1887,6 +2286,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x) { return simd_u...@@ -1887,6 +2286,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x) { return simd_u
1887static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x) { return simd_ulong(simd_max(__x,0)); }2286static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x) { return simd_ulong(simd_max(__x,0)); }
1888static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x) { return simd_ulong(simd_max(__x,0)); }2287static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x) { return simd_ulong(simd_max(__x,0)); }
1889static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x) { return simd_ulong(simd_max(__x,0)); }2288static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_short8 __x) { return simd_ulong(simd_max(__x,0)); }
2289static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_half2 __x) { return simd_ulong(simd_max(__x,0)); }
2290static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_half3 __x) { return simd_ulong(simd_max(__x,0)); }
2291static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_half4 __x) { return simd_ulong(simd_max(__x,0)); }
2292static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_half8 __x) { return simd_ulong(simd_max(__x,0)); }
1890static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x) { return simd_ulong(simd_max(__x,0)); }2293static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x) { return simd_ulong(simd_max(__x,0)); }
1891static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x) { return simd_ulong(simd_max(__x,0)); }2294static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x) { return simd_ulong(simd_max(__x,0)); }
1892static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x) { return simd_ulong(simd_max(__x,0)); }2295static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_int4 __x) { return simd_ulong(simd_max(__x,0)); }
...@@ -1920,6 +2323,37 @@ static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x) { return __x; }...@@ -1920,6 +2323,37 @@ static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x) { return __x; }
1920static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x) { return __x; }2323static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x) { return __x; }
1921static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x) { return __x; }2324static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x) { return __x; }
1922 2325
2326static simd_ulong2 SIMD_CFUNC simd_ulong_rte(simd_double2 __x) {
2327#if defined __AVX512F__
2328 return _mm_cvtpd_epu64(__x);
2329#elif defined __arm64__
2330 return vcvtnq_u64_f64(__x);
2331#else
2332 simd_double2 magic = __tg_copysign(0x1.0p52, __x);
2333 simd_long2 x_is_small = __tg_fabs(__x) < 0x1.0p52;
2334 return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fffffffffffffff), simd_ulong2);
2335#endif
2336}
2337
2338static simd_ulong3 SIMD_CFUNC simd_ulong_rte(simd_double3 __x) {
2339 return simd_make_ulong3(simd_ulong_rte(simd_make_double4_undef(__x)));
2340}
2341
2342static simd_ulong4 SIMD_CFUNC simd_ulong_rte(simd_double4 __x) {
2343#if defined __AVX512F__
2344 return _mm256_cvtpd_epu64(__x);
2345#else
2346 return simd_make_ulong4(simd_ulong_rte(__x.lo), simd_ulong_rte(__x.hi));
2347#endif
2348}
2349
2350static simd_ulong8 SIMD_CFUNC simd_ulong_rte(simd_double8 __x) {
2351#if defined __AVX512F__
2352 return _mm512_cvtpd_epu64(__x);
2353#else
2354 return simd_make_ulong8(simd_ulong_rte(__x.lo), simd_ulong_rte(__x.hi));
2355#endif
2356}
19232357
1924static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x) { return simd_double(simd_int(__x)); }2358static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x) { return simd_double(simd_int(__x)); }
1925static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x) { return simd_double(simd_int(__x)); }2359static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x) { return simd_double(simd_int(__x)); }
...@@ -1937,6 +2371,10 @@ static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x) { return simd_dou...@@ -1937,6 +2371,10 @@ static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x) { return simd_dou
1937static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x) { return simd_double(simd_int(__x)); }2371static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x) { return simd_double(simd_int(__x)); }
1938static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x) { return simd_double(simd_int(__x)); }2372static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x) { return simd_double(simd_int(__x)); }
1939static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x) { return simd_double(simd_int(__x)); }2373static simd_double8 SIMD_CFUNC simd_double(simd_ushort8 __x) { return simd_double(simd_int(__x)); }
2374static simd_double2 SIMD_CFUNC simd_double(simd_half2 __x) { return __builtin_convertvector(__x, simd_double2); }
2375static simd_double3 SIMD_CFUNC simd_double(simd_half3 __x) { return __builtin_convertvector(__x, simd_double3); }
2376static simd_double4 SIMD_CFUNC simd_double(simd_half4 __x) { return __builtin_convertvector(__x, simd_double4); }
2377static simd_double8 SIMD_CFUNC simd_double(simd_half8 __x) { return __builtin_convertvector(__x, simd_double8); }
1940static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x) { return __builtin_convertvector(__x, simd_double2); }2378static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x) { return __builtin_convertvector(__x, simd_double2); }
1941static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x) { return __builtin_convertvector(__x, simd_double3); }2379static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x) { return __builtin_convertvector(__x, simd_double3); }
1942static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x) { return __builtin_convertvector(__x, simd_double4); }2380static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x) { return __builtin_convertvector(__x, simd_double4); }
...@@ -1991,6 +2429,8 @@ static constexpr Vector_t<ScalarType, traits<typeN>::count> convert(typeN vector...@@ -1991,6 +2429,8 @@ static constexpr Vector_t<ScalarType, traits<typeN>::count> convert(typeN vector
1991 return simd_long(vector);2429 return simd_long(vector);
1992 else if constexpr (std::is_same<ScalarType, ulong1>::value)2430 else if constexpr (std::is_same<ScalarType, ulong1>::value)
1993 return simd_ulong(vector);2431 return simd_ulong(vector);
2432 else if constexpr (std::is_same<ScalarType, half1>::value)
2433 return simd_half(vector);
1994 else if constexpr (std::is_same<ScalarType, float1>::value)2434 else if constexpr (std::is_same<ScalarType, float1>::value)
1995 return simd_float(vector);2435 return simd_float(vector);
1996 else if constexpr (std::is_same<ScalarType, double1>::value)2436 else if constexpr (std::is_same<ScalarType, double1>::value)
lib/libc/include/any-macos-any/simd/extern.h+16
...@@ -34,6 +34,16 @@ extern double _simd_orient_pd3(const double *);...@@ -34,6 +34,16 @@ extern double _simd_orient_pd3(const double *);
34extern double _simd_insphere_pd3(const double *);34extern double _simd_insphere_pd3(const double *);
35#endif /* SIMD_LIBRARY_VERSION */35#endif /* SIMD_LIBRARY_VERSION */
3636
37#if SIMD_LIBRARY_VERSION >= 6
38extern _Float16 _simd_orient_vh2(simd_half2, simd_half2);
39extern _Float16 _simd_orient_ph2(simd_half2, simd_half2, simd_half2);
40extern _Float16 _simd_incircle_ph2(simd_half2, simd_half2, simd_half2, simd_half2);
41
42extern _Float16 _simd_orient_vh3(simd_half3, simd_half3, simd_half3);
43extern _Float16 _simd_orient_ph3(simd_half3, simd_half3, simd_half3, simd_half3);
44extern _Float16 _simd_insphere_ph3(simd_half3, simd_half3, simd_half3, simd_half3, simd_half3);
45#endif /* SIMD_LIBRARY_VERSION */
46
37#pragma mark - matrix47#pragma mark - matrix
38extern simd_float2x2 __invert_f2(simd_float2x2);48extern simd_float2x2 __invert_f2(simd_float2x2);
39extern simd_double2x2 __invert_d2(simd_double2x2);49extern simd_double2x2 __invert_d2(simd_double2x2);
...@@ -42,6 +52,12 @@ extern simd_double3x3 __invert_d3(simd_double3x3);...@@ -42,6 +52,12 @@ extern simd_double3x3 __invert_d3(simd_double3x3);
42extern simd_float4x4 __invert_f4(simd_float4x4);52extern simd_float4x4 __invert_f4(simd_float4x4);
43extern simd_double4x4 __invert_d4(simd_double4x4);53extern simd_double4x4 __invert_d4(simd_double4x4);
4454
55#if SIMD_LIBRARY_VERSION >= 6
56extern simd_half2x2 __invert_h2(simd_half2x2);
57extern simd_half3x3 __invert_h3(simd_half3x3);
58extern simd_half4x4 __invert_h4(simd_half4x4);
59#endif /* SIMD_LIBRARY_VERSION */
60
45#ifdef __cplusplus61#ifdef __cplusplus
46}62}
47#endif63#endif
lib/libc/include/any-macos-any/simd/geometry.h+428-4
...@@ -136,6 +136,12 @@...@@ -136,6 +136,12 @@
136extern "C" {136extern "C" {
137#endif137#endif
138 138
139static _Float16 SIMD_CFUNC simd_dot(simd_half2 __x, simd_half2 __y);
140static _Float16 SIMD_CFUNC simd_dot(simd_half3 __x, simd_half3 __y);
141static _Float16 SIMD_CFUNC simd_dot(simd_half4 __x, simd_half4 __y);
142static _Float16 SIMD_CFUNC simd_dot(simd_half8 __x, simd_half8 __y);
143static _Float16 SIMD_CFUNC simd_dot(simd_half16 __x, simd_half16 __y);
144static _Float16 SIMD_CFUNC simd_dot(simd_half32 __x, simd_half32 __y);
139static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y);145static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y);
140static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y);146static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y);
141static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y);147static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y);
...@@ -147,6 +153,12 @@ static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y);...@@ -147,6 +153,12 @@ static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y);
147static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y);153static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y);
148#define vector_dot simd_dot154#define vector_dot simd_dot
149155
156static simd_half2 SIMD_CFUNC simd_precise_project(simd_half2 __x, simd_half2 __y);
157static simd_half3 SIMD_CFUNC simd_precise_project(simd_half3 __x, simd_half3 __y);
158static simd_half4 SIMD_CFUNC simd_precise_project(simd_half4 __x, simd_half4 __y);
159static simd_half8 SIMD_CFUNC simd_precise_project(simd_half8 __x, simd_half8 __y);
160static simd_half16 SIMD_CFUNC simd_precise_project(simd_half16 __x, simd_half16 __y);
161static simd_half32 SIMD_CFUNC simd_precise_project(simd_half32 __x, simd_half32 __y);
150static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y);162static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y);
151static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y);163static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y);
152static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y);164static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y);
...@@ -158,6 +170,12 @@ static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_doubl...@@ -158,6 +170,12 @@ static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_doubl
158static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y);170static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y);
159#define vector_precise_project simd_precise_project171#define vector_precise_project simd_precise_project
160172
173static simd_half2 SIMD_CFUNC simd_fast_project(simd_half2 __x, simd_half2 __y);
174static simd_half3 SIMD_CFUNC simd_fast_project(simd_half3 __x, simd_half3 __y);
175static simd_half4 SIMD_CFUNC simd_fast_project(simd_half4 __x, simd_half4 __y);
176static simd_half8 SIMD_CFUNC simd_fast_project(simd_half8 __x, simd_half8 __y);
177static simd_half16 SIMD_CFUNC simd_fast_project(simd_half16 __x, simd_half16 __y);
178static simd_half32 SIMD_CFUNC simd_fast_project(simd_half32 __x, simd_half32 __y);
161static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y);179static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y);
162static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y);180static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y);
163static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y);181static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y);
...@@ -169,6 +187,12 @@ static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4...@@ -169,6 +187,12 @@ static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4
169static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y);187static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y);
170#define vector_fast_project simd_fast_project188#define vector_fast_project simd_fast_project
171189
190static simd_half2 SIMD_CFUNC simd_project(simd_half2 __x, simd_half2 __y);
191static simd_half3 SIMD_CFUNC simd_project(simd_half3 __x, simd_half3 __y);
192static simd_half4 SIMD_CFUNC simd_project(simd_half4 __x, simd_half4 __y);
193static simd_half8 SIMD_CFUNC simd_project(simd_half8 __x, simd_half8 __y);
194static simd_half16 SIMD_CFUNC simd_project(simd_half16 __x, simd_half16 __y);
195static simd_half32 SIMD_CFUNC simd_project(simd_half32 __x, simd_half32 __y);
172static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y);196static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y);
173static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y);197static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y);
174static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y);198static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y);
...@@ -180,6 +204,14 @@ static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y);...@@ -180,6 +204,14 @@ static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y);
180static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y);204static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y);
181#define vector_project simd_project205#define vector_project simd_project
182206
207#if SIMD_LIBRARY_VERSION >= 6
208static _Float16 SIMD_CFUNC simd_precise_length(simd_half2 __x);
209static _Float16 SIMD_CFUNC simd_precise_length(simd_half3 __x);
210static _Float16 SIMD_CFUNC simd_precise_length(simd_half4 __x);
211static _Float16 SIMD_CFUNC simd_precise_length(simd_half8 __x);
212static _Float16 SIMD_CFUNC simd_precise_length(simd_half16 __x);
213static _Float16 SIMD_CFUNC simd_precise_length(simd_half32 __x);
214#endif // SIMD_LIBRARY_VERSION >= 6
183static float SIMD_CFUNC simd_precise_length(simd_float2 __x);215static float SIMD_CFUNC simd_precise_length(simd_float2 __x);
184static float SIMD_CFUNC simd_precise_length(simd_float3 __x);216static float SIMD_CFUNC simd_precise_length(simd_float3 __x);
185static float SIMD_CFUNC simd_precise_length(simd_float4 __x);217static float SIMD_CFUNC simd_precise_length(simd_float4 __x);
...@@ -191,6 +223,12 @@ static double SIMD_CFUNC simd_precise_length(simd_double4 __x);...@@ -191,6 +223,12 @@ static double SIMD_CFUNC simd_precise_length(simd_double4 __x);
191static double SIMD_CFUNC simd_precise_length(simd_double8 __x);223static double SIMD_CFUNC simd_precise_length(simd_double8 __x);
192#define vector_precise_length simd_precise_length224#define vector_precise_length simd_precise_length
193225
226static _Float16 SIMD_CFUNC simd_fast_length(simd_half2 __x);
227static _Float16 SIMD_CFUNC simd_fast_length(simd_half3 __x);
228static _Float16 SIMD_CFUNC simd_fast_length(simd_half4 __x);
229static _Float16 SIMD_CFUNC simd_fast_length(simd_half8 __x);
230static _Float16 SIMD_CFUNC simd_fast_length(simd_half16 __x);
231static _Float16 SIMD_CFUNC simd_fast_length(simd_half32 __x);
194static float SIMD_CFUNC simd_fast_length(simd_float2 __x);232static float SIMD_CFUNC simd_fast_length(simd_float2 __x);
195static float SIMD_CFUNC simd_fast_length(simd_float3 __x);233static float SIMD_CFUNC simd_fast_length(simd_float3 __x);
196static float SIMD_CFUNC simd_fast_length(simd_float4 __x);234static float SIMD_CFUNC simd_fast_length(simd_float4 __x);
...@@ -202,6 +240,12 @@ static double SIMD_CFUNC simd_fast_length(simd_double4 __x);...@@ -202,6 +240,12 @@ static double SIMD_CFUNC simd_fast_length(simd_double4 __x);
202static double SIMD_CFUNC simd_fast_length(simd_double8 __x);240static double SIMD_CFUNC simd_fast_length(simd_double8 __x);
203#define vector_fast_length simd_fast_length241#define vector_fast_length simd_fast_length
204242
243static _Float16 SIMD_CFUNC simd_length(simd_half2 __x);
244static _Float16 SIMD_CFUNC simd_length(simd_half3 __x);
245static _Float16 SIMD_CFUNC simd_length(simd_half4 __x);
246static _Float16 SIMD_CFUNC simd_length(simd_half8 __x);
247static _Float16 SIMD_CFUNC simd_length(simd_half16 __x);
248static _Float16 SIMD_CFUNC simd_length(simd_half32 __x);
205static float SIMD_CFUNC simd_length(simd_float2 __x);249static float SIMD_CFUNC simd_length(simd_float2 __x);
206static float SIMD_CFUNC simd_length(simd_float3 __x);250static float SIMD_CFUNC simd_length(simd_float3 __x);
207static float SIMD_CFUNC simd_length(simd_float4 __x);251static float SIMD_CFUNC simd_length(simd_float4 __x);
...@@ -213,6 +257,12 @@ static double SIMD_CFUNC simd_length(simd_double4 __x);...@@ -213,6 +257,12 @@ static double SIMD_CFUNC simd_length(simd_double4 __x);
213static double SIMD_CFUNC simd_length(simd_double8 __x);257static double SIMD_CFUNC simd_length(simd_double8 __x);
214#define vector_length simd_length258#define vector_length simd_length
215259
260static _Float16 SIMD_CFUNC simd_length_squared(simd_half2 __x);
261static _Float16 SIMD_CFUNC simd_length_squared(simd_half3 __x);
262static _Float16 SIMD_CFUNC simd_length_squared(simd_half4 __x);
263static _Float16 SIMD_CFUNC simd_length_squared(simd_half8 __x);
264static _Float16 SIMD_CFUNC simd_length_squared(simd_half16 __x);
265static _Float16 SIMD_CFUNC simd_length_squared(simd_half32 __x);
216static float SIMD_CFUNC simd_length_squared(simd_float2 __x);266static float SIMD_CFUNC simd_length_squared(simd_float2 __x);
217static float SIMD_CFUNC simd_length_squared(simd_float3 __x);267static float SIMD_CFUNC simd_length_squared(simd_float3 __x);
218static float SIMD_CFUNC simd_length_squared(simd_float4 __x);268static float SIMD_CFUNC simd_length_squared(simd_float4 __x);
...@@ -224,6 +274,12 @@ static double SIMD_CFUNC simd_length_squared(simd_double4 __x);...@@ -224,6 +274,12 @@ static double SIMD_CFUNC simd_length_squared(simd_double4 __x);
224static double SIMD_CFUNC simd_length_squared(simd_double8 __x);274static double SIMD_CFUNC simd_length_squared(simd_double8 __x);
225#define vector_length_squared simd_length_squared275#define vector_length_squared simd_length_squared
226276
277static _Float16 SIMD_CFUNC simd_norm_one(simd_half2 __x);
278static _Float16 SIMD_CFUNC simd_norm_one(simd_half3 __x);
279static _Float16 SIMD_CFUNC simd_norm_one(simd_half4 __x);
280static _Float16 SIMD_CFUNC simd_norm_one(simd_half8 __x);
281static _Float16 SIMD_CFUNC simd_norm_one(simd_half16 __x);
282static _Float16 SIMD_CFUNC simd_norm_one(simd_half32 __x);
227static float SIMD_CFUNC simd_norm_one(simd_float2 __x);283static float SIMD_CFUNC simd_norm_one(simd_float2 __x);
228static float SIMD_CFUNC simd_norm_one(simd_float3 __x);284static float SIMD_CFUNC simd_norm_one(simd_float3 __x);
229static float SIMD_CFUNC simd_norm_one(simd_float4 __x);285static float SIMD_CFUNC simd_norm_one(simd_float4 __x);
...@@ -235,6 +291,12 @@ static double SIMD_CFUNC simd_norm_one(simd_double4 __x);...@@ -235,6 +291,12 @@ static double SIMD_CFUNC simd_norm_one(simd_double4 __x);
235static double SIMD_CFUNC simd_norm_one(simd_double8 __x);291static double SIMD_CFUNC simd_norm_one(simd_double8 __x);
236#define vector_norm_one simd_norm_one292#define vector_norm_one simd_norm_one
237293
294static _Float16 SIMD_CFUNC simd_norm_inf(simd_half2 __x);
295static _Float16 SIMD_CFUNC simd_norm_inf(simd_half3 __x);
296static _Float16 SIMD_CFUNC simd_norm_inf(simd_half4 __x);
297static _Float16 SIMD_CFUNC simd_norm_inf(simd_half8 __x);
298static _Float16 SIMD_CFUNC simd_norm_inf(simd_half16 __x);
299static _Float16 SIMD_CFUNC simd_norm_inf(simd_half32 __x);
238static float SIMD_CFUNC simd_norm_inf(simd_float2 __x);300static float SIMD_CFUNC simd_norm_inf(simd_float2 __x);
239static float SIMD_CFUNC simd_norm_inf(simd_float3 __x);301static float SIMD_CFUNC simd_norm_inf(simd_float3 __x);
240static float SIMD_CFUNC simd_norm_inf(simd_float4 __x);302static float SIMD_CFUNC simd_norm_inf(simd_float4 __x);
...@@ -246,6 +308,12 @@ static double SIMD_CFUNC simd_norm_inf(simd_double4 __x);...@@ -246,6 +308,12 @@ static double SIMD_CFUNC simd_norm_inf(simd_double4 __x);
246static double SIMD_CFUNC simd_norm_inf(simd_double8 __x);308static double SIMD_CFUNC simd_norm_inf(simd_double8 __x);
247#define vector_norm_inf simd_norm_inf309#define vector_norm_inf simd_norm_inf
248310
311static _Float16 SIMD_CFUNC simd_precise_distance(simd_half2 __x, simd_half2 __y);
312static _Float16 SIMD_CFUNC simd_precise_distance(simd_half3 __x, simd_half3 __y);
313static _Float16 SIMD_CFUNC simd_precise_distance(simd_half4 __x, simd_half4 __y);
314static _Float16 SIMD_CFUNC simd_precise_distance(simd_half8 __x, simd_half8 __y);
315static _Float16 SIMD_CFUNC simd_precise_distance(simd_half16 __x, simd_half16 __y);
316static _Float16 SIMD_CFUNC simd_precise_distance(simd_half32 __x, simd_half32 __y);
249static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y);317static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y);
250static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y);318static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y);
251static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y);319static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y);
...@@ -257,6 +325,12 @@ static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __...@@ -257,6 +325,12 @@ static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __
257static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y);325static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y);
258#define vector_precise_distance simd_precise_distance326#define vector_precise_distance simd_precise_distance
259327
328static _Float16 SIMD_CFUNC simd_fast_distance(simd_half2 __x, simd_half2 __y);
329static _Float16 SIMD_CFUNC simd_fast_distance(simd_half3 __x, simd_half3 __y);
330static _Float16 SIMD_CFUNC simd_fast_distance(simd_half4 __x, simd_half4 __y);
331static _Float16 SIMD_CFUNC simd_fast_distance(simd_half8 __x, simd_half8 __y);
332static _Float16 SIMD_CFUNC simd_fast_distance(simd_half16 __x, simd_half16 __y);
333static _Float16 SIMD_CFUNC simd_fast_distance(simd_half32 __x, simd_half32 __y);
260static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y);334static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y);
261static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y);335static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y);
262static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y);336static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y);
...@@ -268,6 +342,12 @@ static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y);...@@ -268,6 +342,12 @@ static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y);
268static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y);342static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y);
269#define vector_fast_distance simd_fast_distance343#define vector_fast_distance simd_fast_distance
270344
345static _Float16 SIMD_CFUNC simd_distance(simd_half2 __x, simd_half2 __y);
346static _Float16 SIMD_CFUNC simd_distance(simd_half3 __x, simd_half3 __y);
347static _Float16 SIMD_CFUNC simd_distance(simd_half4 __x, simd_half4 __y);
348static _Float16 SIMD_CFUNC simd_distance(simd_half8 __x, simd_half8 __y);
349static _Float16 SIMD_CFUNC simd_distance(simd_half16 __x, simd_half16 __y);
350static _Float16 SIMD_CFUNC simd_distance(simd_half32 __x, simd_half32 __y);
271static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y);351static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y);
272static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y);352static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y);
273static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y);353static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y);
...@@ -279,6 +359,12 @@ static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y);...@@ -279,6 +359,12 @@ static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y);
279static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y);359static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y);
280#define vector_distance simd_distance360#define vector_distance simd_distance
281361
362static _Float16 SIMD_CFUNC simd_distance_squared(simd_half2 __x, simd_half2 __y);
363static _Float16 SIMD_CFUNC simd_distance_squared(simd_half3 __x, simd_half3 __y);
364static _Float16 SIMD_CFUNC simd_distance_squared(simd_half4 __x, simd_half4 __y);
365static _Float16 SIMD_CFUNC simd_distance_squared(simd_half8 __x, simd_half8 __y);
366static _Float16 SIMD_CFUNC simd_distance_squared(simd_half16 __x, simd_half16 __y);
367static _Float16 SIMD_CFUNC simd_distance_squared(simd_half32 __x, simd_half32 __y);
282static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y);368static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y);
283static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y);369static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y);
284static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y);370static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y);
...@@ -290,6 +376,12 @@ static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __...@@ -290,6 +376,12 @@ static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __
290static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y);376static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y);
291#define vector_distance_squared simd_distance_squared377#define vector_distance_squared simd_distance_squared
292378
379static simd_half2 SIMD_CFUNC simd_precise_normalize(simd_half2 __x);
380static simd_half3 SIMD_CFUNC simd_precise_normalize(simd_half3 __x);
381static simd_half4 SIMD_CFUNC simd_precise_normalize(simd_half4 __x);
382static simd_half8 SIMD_CFUNC simd_precise_normalize(simd_half8 __x);
383static simd_half16 SIMD_CFUNC simd_precise_normalize(simd_half16 __x);
384static simd_half32 SIMD_CFUNC simd_precise_normalize(simd_half32 __x);
293static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x);385static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x);
294static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x);386static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x);
295static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x);387static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x);
...@@ -301,6 +393,12 @@ static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x);...@@ -301,6 +393,12 @@ static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x);
301static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x);393static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x);
302#define vector_precise_normalize simd_precise_normalize394#define vector_precise_normalize simd_precise_normalize
303395
396static simd_half2 SIMD_CFUNC simd_fast_normalize(simd_half2 __x);
397static simd_half3 SIMD_CFUNC simd_fast_normalize(simd_half3 __x);
398static simd_half4 SIMD_CFUNC simd_fast_normalize(simd_half4 __x);
399static simd_half8 SIMD_CFUNC simd_fast_normalize(simd_half8 __x);
400static simd_half16 SIMD_CFUNC simd_fast_normalize(simd_half16 __x);
401static simd_half32 SIMD_CFUNC simd_fast_normalize(simd_half32 __x);
304static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x);402static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x);
305static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x);403static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x);
306static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x);404static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x);
...@@ -312,6 +410,12 @@ static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x);...@@ -312,6 +410,12 @@ static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x);
312static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x);410static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x);
313#define vector_fast_normalize simd_fast_normalize411#define vector_fast_normalize simd_fast_normalize
314412
413static simd_half2 SIMD_CFUNC simd_normalize(simd_half2 __x);
414static simd_half3 SIMD_CFUNC simd_normalize(simd_half3 __x);
415static simd_half4 SIMD_CFUNC simd_normalize(simd_half4 __x);
416static simd_half8 SIMD_CFUNC simd_normalize(simd_half8 __x);
417static simd_half16 SIMD_CFUNC simd_normalize(simd_half16 __x);
418static simd_half32 SIMD_CFUNC simd_normalize(simd_half32 __x);
315static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x);419static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x);
316static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x);420static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x);
317static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x);421static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x);
...@@ -323,12 +427,17 @@ static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x);...@@ -323,12 +427,17 @@ static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x);
323static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x);427static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x);
324#define vector_normalize simd_normalize428#define vector_normalize simd_normalize
325429
430static simd_half3 SIMD_CFUNC simd_cross(simd_half2 __x, simd_half2 __y);
431static simd_half3 SIMD_CFUNC simd_cross(simd_half3 __x, simd_half3 __y);
326static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y);432static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y);
327static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y);433static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y);
328static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y);434static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y);
329static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y);435static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y);
330#define vector_cross simd_cross436#define vector_cross simd_cross
331437
438static simd_half2 SIMD_CFUNC simd_reflect(simd_half2 __x, simd_half2 __n);
439static simd_half3 SIMD_CFUNC simd_reflect(simd_half3 __x, simd_half3 __n);
440static simd_half4 SIMD_CFUNC simd_reflect(simd_half4 __x, simd_half4 __n);
332static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n);441static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n);
333static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n);442static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n);
334static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n);443static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n);
...@@ -337,6 +446,11 @@ static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n);...@@ -337,6 +446,11 @@ static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n);
337static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n);446static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n);
338#define vector_reflect simd_reflect447#define vector_reflect simd_reflect
339448
449#if SIMD_LIBRARY_VERSION >= 6
450static simd_half2 SIMD_CFUNC simd_refract(simd_half2 __x, simd_half2 __n, _Float16 __eta);
451static simd_half3 SIMD_CFUNC simd_refract(simd_half3 __x, simd_half3 __n, _Float16 __eta);
452static simd_half4 SIMD_CFUNC simd_refract(simd_half4 __x, simd_half4 __n, _Float16 __eta);
453#endif // SIMD_LIBRARY_VERSION >= 6
340static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta);454static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta);
341static simd_float3 SIMD_CFUNC simd_refract(simd_float3 __x, simd_float3 __n, float __eta);455static simd_float3 SIMD_CFUNC simd_refract(simd_float3 __x, simd_float3 __n, float __eta);
342static simd_float4 SIMD_CFUNC simd_refract(simd_float4 __x, simd_float4 __n, float __eta);456static simd_float4 SIMD_CFUNC simd_refract(simd_float4 __x, simd_float4 __n, float __eta);
...@@ -578,11 +692,31 @@ static float SIMD_CFUNC simd_insphere(simd_float3 __x, simd_float3 __a, simd_flo...@@ -578,11 +692,31 @@ static float SIMD_CFUNC simd_insphere(simd_float3 __x, simd_float3 __a, simd_flo
578 * negatively-oriented. */692 * negatively-oriented. */
579static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d);693static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d);
580#endif /* SIMD_LIBRARY_VERSION */694#endif /* SIMD_LIBRARY_VERSION */
581 695
696#if SIMD_LIBRARY_VERSION >= 6
697/* fp16 support requires that you are building for OS X 15.0 or later,
698 * iOS 18.0 or later, watchOS 11.0 or later, and tvOS 18.0 or later. On
699 * earlier OS versions, the library functions that implement these
700 * operations are not available. */
701
702 static _Float16 SIMD_CFUNC simd_orient(simd_half2 __x, simd_half2 __y);
703 static _Float16 SIMD_CFUNC simd_orient(simd_half3 __x, simd_half3 __y, simd_half3 __z);
704 static _Float16 SIMD_CFUNC simd_orient(simd_half2 __a, simd_half2 __b, simd_half2 __c);
705 static _Float16 SIMD_CFUNC simd_orient(simd_half3 __a, simd_half3 __b, simd_half3 __c, simd_half3 __d);
706 static _Float16 SIMD_CFUNC simd_incircle(simd_half2 __x, simd_half2 __a, simd_half2 __b, simd_half2 __c);
707 static _Float16 SIMD_CFUNC simd_insphere(simd_half3 __x, simd_half3 __a, simd_half3 __b, simd_half3 __c, simd_half3 __d);
708#endif /* SIMD_LIBRARY_VERSION */
709
582#ifdef __cplusplus710#ifdef __cplusplus
583} /* extern "C" */711} /* extern "C" */
584712
585namespace simd {713namespace simd {
714 static SIMD_CPPFUNC _Float16 dot(const half2 x, const half2 y) { return ::simd_dot(x, y); }
715 static SIMD_CPPFUNC _Float16 dot(const half3 x, const half3 y) { return ::simd_dot(x, y); }
716 static SIMD_CPPFUNC _Float16 dot(const half4 x, const half4 y) { return ::simd_dot(x, y); }
717 static SIMD_CPPFUNC _Float16 dot(const half8 x, const half8 y) { return ::simd_dot(x, y); }
718 static SIMD_CPPFUNC _Float16 dot(const half16 x, const half16 y) { return ::simd_dot(x, y); }
719 static SIMD_CPPFUNC _Float16 dot(const half32 x, const half32 y) { return ::simd_dot(x, y); }
586 static SIMD_CPPFUNC float dot(const float2 x, const float2 y) { return ::simd_dot(x, y); }720 static SIMD_CPPFUNC float dot(const float2 x, const float2 y) { return ::simd_dot(x, y); }
587 static SIMD_CPPFUNC float dot(const float3 x, const float3 y) { return ::simd_dot(x, y); }721 static SIMD_CPPFUNC float dot(const float3 x, const float3 y) { return ::simd_dot(x, y); }
588 static SIMD_CPPFUNC float dot(const float4 x, const float4 y) { return ::simd_dot(x, y); }722 static SIMD_CPPFUNC float dot(const float4 x, const float4 y) { return ::simd_dot(x, y); }
...@@ -593,6 +727,12 @@ namespace simd {...@@ -593,6 +727,12 @@ namespace simd {
593 static SIMD_CPPFUNC double dot(const double4 x, const double4 y) { return ::simd_dot(x, y); }727 static SIMD_CPPFUNC double dot(const double4 x, const double4 y) { return ::simd_dot(x, y); }
594 static SIMD_CPPFUNC double dot(const double8 x, const double8 y) { return ::simd_dot(x, y); }728 static SIMD_CPPFUNC double dot(const double8 x, const double8 y) { return ::simd_dot(x, y); }
595 729
730 static SIMD_CPPFUNC half2 project(const half2 x, const half2 y) { return ::simd_project(x, y); }
731 static SIMD_CPPFUNC half3 project(const half3 x, const half3 y) { return ::simd_project(x, y); }
732 static SIMD_CPPFUNC half4 project(const half4 x, const half4 y) { return ::simd_project(x, y); }
733 static SIMD_CPPFUNC half8 project(const half8 x, const half8 y) { return ::simd_project(x, y); }
734 static SIMD_CPPFUNC half16 project(const half16 x, const half16 y) { return ::simd_project(x, y); }
735 static SIMD_CPPFUNC half32 project(const half32 x, const half32 y) { return ::simd_project(x, y); }
596 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_project(x, y); }736 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_project(x, y); }
597 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_project(x, y); }737 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_project(x, y); }
598 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_project(x, y); }738 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_project(x, y); }
...@@ -603,6 +743,12 @@ namespace simd {...@@ -603,6 +743,12 @@ namespace simd {
603 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_project(x, y); }743 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_project(x, y); }
604 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_project(x, y); }744 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_project(x, y); }
605 745
746 static SIMD_CPPFUNC _Float16 length_squared(const half2 x) { return ::simd_length_squared(x); }
747 static SIMD_CPPFUNC _Float16 length_squared(const half3 x) { return ::simd_length_squared(x); }
748 static SIMD_CPPFUNC _Float16 length_squared(const half4 x) { return ::simd_length_squared(x); }
749 static SIMD_CPPFUNC _Float16 length_squared(const half8 x) { return ::simd_length_squared(x); }
750 static SIMD_CPPFUNC _Float16 length_squared(const half16 x) { return ::simd_length_squared(x); }
751 static SIMD_CPPFUNC _Float16 length_squared(const half32 x) { return ::simd_length_squared(x); }
606 static SIMD_CPPFUNC float length_squared(const float2 x) { return ::simd_length_squared(x); }752 static SIMD_CPPFUNC float length_squared(const float2 x) { return ::simd_length_squared(x); }
607 static SIMD_CPPFUNC float length_squared(const float3 x) { return ::simd_length_squared(x); }753 static SIMD_CPPFUNC float length_squared(const float3 x) { return ::simd_length_squared(x); }
608 static SIMD_CPPFUNC float length_squared(const float4 x) { return ::simd_length_squared(x); }754 static SIMD_CPPFUNC float length_squared(const float4 x) { return ::simd_length_squared(x); }
...@@ -613,6 +759,12 @@ namespace simd {...@@ -613,6 +759,12 @@ namespace simd {
613 static SIMD_CPPFUNC double length_squared(const double4 x) { return ::simd_length_squared(x); }759 static SIMD_CPPFUNC double length_squared(const double4 x) { return ::simd_length_squared(x); }
614 static SIMD_CPPFUNC double length_squared(const double8 x) { return ::simd_length_squared(x); }760 static SIMD_CPPFUNC double length_squared(const double8 x) { return ::simd_length_squared(x); }
615 761
762 static SIMD_CPPFUNC _Float16 norm_one(const half2 x) { return ::simd_norm_one(x); }
763 static SIMD_CPPFUNC _Float16 norm_one(const half3 x) { return ::simd_norm_one(x); }
764 static SIMD_CPPFUNC _Float16 norm_one(const half4 x) { return ::simd_norm_one(x); }
765 static SIMD_CPPFUNC _Float16 norm_one(const half8 x) { return ::simd_norm_one(x); }
766 static SIMD_CPPFUNC _Float16 norm_one(const half16 x) { return ::simd_norm_one(x); }
767 static SIMD_CPPFUNC _Float16 norm_one(const half32 x) { return ::simd_norm_one(x); }
616 static SIMD_CPPFUNC float norm_one(const float2 x) { return ::simd_norm_one(x); }768 static SIMD_CPPFUNC float norm_one(const float2 x) { return ::simd_norm_one(x); }
617 static SIMD_CPPFUNC float norm_one(const float3 x) { return ::simd_norm_one(x); }769 static SIMD_CPPFUNC float norm_one(const float3 x) { return ::simd_norm_one(x); }
618 static SIMD_CPPFUNC float norm_one(const float4 x) { return ::simd_norm_one(x); }770 static SIMD_CPPFUNC float norm_one(const float4 x) { return ::simd_norm_one(x); }
...@@ -623,6 +775,12 @@ namespace simd {...@@ -623,6 +775,12 @@ namespace simd {
623 static SIMD_CPPFUNC double norm_one(const double4 x) { return ::simd_norm_one(x); }775 static SIMD_CPPFUNC double norm_one(const double4 x) { return ::simd_norm_one(x); }
624 static SIMD_CPPFUNC double norm_one(const double8 x) { return ::simd_norm_one(x); }776 static SIMD_CPPFUNC double norm_one(const double8 x) { return ::simd_norm_one(x); }
625 777
778 static SIMD_CPPFUNC _Float16 norm_inf(const half2 x) { return ::simd_norm_inf(x); }
779 static SIMD_CPPFUNC _Float16 norm_inf(const half3 x) { return ::simd_norm_inf(x); }
780 static SIMD_CPPFUNC _Float16 norm_inf(const half4 x) { return ::simd_norm_inf(x); }
781 static SIMD_CPPFUNC _Float16 norm_inf(const half8 x) { return ::simd_norm_inf(x); }
782 static SIMD_CPPFUNC _Float16 norm_inf(const half16 x) { return ::simd_norm_inf(x); }
783 static SIMD_CPPFUNC _Float16 norm_inf(const half32 x) { return ::simd_norm_inf(x); }
626 static SIMD_CPPFUNC float norm_inf(const float2 x) { return ::simd_norm_inf(x); }784 static SIMD_CPPFUNC float norm_inf(const float2 x) { return ::simd_norm_inf(x); }
627 static SIMD_CPPFUNC float norm_inf(const float3 x) { return ::simd_norm_inf(x); }785 static SIMD_CPPFUNC float norm_inf(const float3 x) { return ::simd_norm_inf(x); }
628 static SIMD_CPPFUNC float norm_inf(const float4 x) { return ::simd_norm_inf(x); }786 static SIMD_CPPFUNC float norm_inf(const float4 x) { return ::simd_norm_inf(x); }
...@@ -633,6 +791,12 @@ namespace simd {...@@ -633,6 +791,12 @@ namespace simd {
633 static SIMD_CPPFUNC double norm_inf(const double4 x) { return ::simd_norm_inf(x); }791 static SIMD_CPPFUNC double norm_inf(const double4 x) { return ::simd_norm_inf(x); }
634 static SIMD_CPPFUNC double norm_inf(const double8 x) { return ::simd_norm_inf(x); }792 static SIMD_CPPFUNC double norm_inf(const double8 x) { return ::simd_norm_inf(x); }
635 793
794 static SIMD_CPPFUNC _Float16 length(const half2 x) { return ::simd_length(x); }
795 static SIMD_CPPFUNC _Float16 length(const half3 x) { return ::simd_length(x); }
796 static SIMD_CPPFUNC _Float16 length(const half4 x) { return ::simd_length(x); }
797 static SIMD_CPPFUNC _Float16 length(const half8 x) { return ::simd_length(x); }
798 static SIMD_CPPFUNC _Float16 length(const half16 x) { return ::simd_length(x); }
799 static SIMD_CPPFUNC _Float16 length(const half32 x) { return ::simd_length(x); }
636 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_length(x); }800 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_length(x); }
637 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_length(x); }801 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_length(x); }
638 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_length(x); }802 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_length(x); }
...@@ -643,6 +807,12 @@ namespace simd {...@@ -643,6 +807,12 @@ namespace simd {
643 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_length(x); }807 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_length(x); }
644 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_length(x); }808 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_length(x); }
645 809
810 static SIMD_CPPFUNC _Float16 distance_squared(const half2 x, const half2 y) { return ::simd_distance_squared(x, y); }
811 static SIMD_CPPFUNC _Float16 distance_squared(const half3 x, const half3 y) { return ::simd_distance_squared(x, y); }
812 static SIMD_CPPFUNC _Float16 distance_squared(const half4 x, const half4 y) { return ::simd_distance_squared(x, y); }
813 static SIMD_CPPFUNC _Float16 distance_squared(const half8 x, const half8 y) { return ::simd_distance_squared(x, y); }
814 static SIMD_CPPFUNC _Float16 distance_squared(const half16 x, const half16 y) { return ::simd_distance_squared(x, y); }
815 static SIMD_CPPFUNC _Float16 distance_squared(const half32 x, const half32 y) { return ::simd_distance_squared(x, y); }
646 static SIMD_CPPFUNC float distance_squared(const float2 x, const float2 y) { return ::simd_distance_squared(x, y); }816 static SIMD_CPPFUNC float distance_squared(const float2 x, const float2 y) { return ::simd_distance_squared(x, y); }
647 static SIMD_CPPFUNC float distance_squared(const float3 x, const float3 y) { return ::simd_distance_squared(x, y); }817 static SIMD_CPPFUNC float distance_squared(const float3 x, const float3 y) { return ::simd_distance_squared(x, y); }
648 static SIMD_CPPFUNC float distance_squared(const float4 x, const float4 y) { return ::simd_distance_squared(x, y); }818 static SIMD_CPPFUNC float distance_squared(const float4 x, const float4 y) { return ::simd_distance_squared(x, y); }
...@@ -653,6 +823,12 @@ namespace simd {...@@ -653,6 +823,12 @@ namespace simd {
653 static SIMD_CPPFUNC double distance_squared(const double4 x, const double4 y) { return ::simd_distance_squared(x, y); }823 static SIMD_CPPFUNC double distance_squared(const double4 x, const double4 y) { return ::simd_distance_squared(x, y); }
654 static SIMD_CPPFUNC double distance_squared(const double8 x, const double8 y) { return ::simd_distance_squared(x, y); }824 static SIMD_CPPFUNC double distance_squared(const double8 x, const double8 y) { return ::simd_distance_squared(x, y); }
655 825
826 static SIMD_CPPFUNC _Float16 distance(const half2 x, const half2 y) { return ::simd_distance(x, y); }
827 static SIMD_CPPFUNC _Float16 distance(const half3 x, const half3 y) { return ::simd_distance(x, y); }
828 static SIMD_CPPFUNC _Float16 distance(const half4 x, const half4 y) { return ::simd_distance(x, y); }
829 static SIMD_CPPFUNC _Float16 distance(const half8 x, const half8 y) { return ::simd_distance(x, y); }
830 static SIMD_CPPFUNC _Float16 distance(const half16 x, const half16 y) { return ::simd_distance(x, y); }
831 static SIMD_CPPFUNC _Float16 distance(const half32 x, const half32 y) { return ::simd_distance(x, y); }
656 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_distance(x, y); }832 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_distance(x, y); }
657 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_distance(x, y); }833 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_distance(x, y); }
658 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_distance(x, y); }834 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_distance(x, y); }
...@@ -663,6 +839,12 @@ namespace simd {...@@ -663,6 +839,12 @@ namespace simd {
663 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_distance(x, y); }839 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_distance(x, y); }
664 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_distance(x, y); }840 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_distance(x, y); }
665 841
842 static SIMD_CPPFUNC half2 normalize(const half2 x) { return ::simd_normalize(x); }
843 static SIMD_CPPFUNC half3 normalize(const half3 x) { return ::simd_normalize(x); }
844 static SIMD_CPPFUNC half4 normalize(const half4 x) { return ::simd_normalize(x); }
845 static SIMD_CPPFUNC half8 normalize(const half8 x) { return ::simd_normalize(x); }
846 static SIMD_CPPFUNC half16 normalize(const half16 x) { return ::simd_normalize(x); }
847 static SIMD_CPPFUNC half32 normalize(const half32 x) { return ::simd_normalize(x); }
666 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_normalize(x); }848 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_normalize(x); }
667 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_normalize(x); }849 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_normalize(x); }
668 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_normalize(x); }850 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_normalize(x); }
...@@ -673,18 +855,28 @@ namespace simd {...@@ -673,18 +855,28 @@ namespace simd {
673 static SIMD_CPPFUNC double4 normalize(const double4 x) { return ::simd_normalize(x); }855 static SIMD_CPPFUNC double4 normalize(const double4 x) { return ::simd_normalize(x); }
674 static SIMD_CPPFUNC double8 normalize(const double8 x) { return ::simd_normalize(x); }856 static SIMD_CPPFUNC double8 normalize(const double8 x) { return ::simd_normalize(x); }
675 857
858 static SIMD_CPPFUNC half3 cross(const half2 x, const half2 y) { return ::simd_cross(x,y); }
859 static SIMD_CPPFUNC half3 cross(const half3 x, const half3 y) { return ::simd_cross(x,y); }
676 static SIMD_CPPFUNC float3 cross(const float2 x, const float2 y) { return ::simd_cross(x,y); }860 static SIMD_CPPFUNC float3 cross(const float2 x, const float2 y) { return ::simd_cross(x,y); }
677 static SIMD_CPPFUNC float3 cross(const float3 x, const float3 y) { return ::simd_cross(x,y); }861 static SIMD_CPPFUNC float3 cross(const float3 x, const float3 y) { return ::simd_cross(x,y); }
678 static SIMD_CPPFUNC double3 cross(const double2 x, const double2 y) { return ::simd_cross(x,y); }862 static SIMD_CPPFUNC double3 cross(const double2 x, const double2 y) { return ::simd_cross(x,y); }
679 static SIMD_CPPFUNC double3 cross(const double3 x, const double3 y) { return ::simd_cross(x,y); }863 static SIMD_CPPFUNC double3 cross(const double3 x, const double3 y) { return ::simd_cross(x,y); }
680 864
865 static SIMD_CPPFUNC half2 reflect(const half2 x, const half2 n) { return ::simd_reflect(x,n); }
866 static SIMD_CPPFUNC half3 reflect(const half3 x, const half3 n) { return ::simd_reflect(x,n); }
867 static SIMD_CPPFUNC half4 reflect(const half4 x, const half4 n) { return ::simd_reflect(x,n); }
681 static SIMD_CPPFUNC float2 reflect(const float2 x, const float2 n) { return ::simd_reflect(x,n); }868 static SIMD_CPPFUNC float2 reflect(const float2 x, const float2 n) { return ::simd_reflect(x,n); }
682 static SIMD_CPPFUNC float3 reflect(const float3 x, const float3 n) { return ::simd_reflect(x,n); }869 static SIMD_CPPFUNC float3 reflect(const float3 x, const float3 n) { return ::simd_reflect(x,n); }
683 static SIMD_CPPFUNC float4 reflect(const float4 x, const float4 n) { return ::simd_reflect(x,n); }870 static SIMD_CPPFUNC float4 reflect(const float4 x, const float4 n) { return ::simd_reflect(x,n); }
684 static SIMD_CPPFUNC double2 reflect(const double2 x, const double2 n) { return ::simd_reflect(x,n); }871 static SIMD_CPPFUNC double2 reflect(const double2 x, const double2 n) { return ::simd_reflect(x,n); }
685 static SIMD_CPPFUNC double3 reflect(const double3 x, const double3 n) { return ::simd_reflect(x,n); }872 static SIMD_CPPFUNC double3 reflect(const double3 x, const double3 n) { return ::simd_reflect(x,n); }
686 static SIMD_CPPFUNC double4 reflect(const double4 x, const double4 n) { return ::simd_reflect(x,n); }873 static SIMD_CPPFUNC double4 reflect(const double4 x, const double4 n) { return ::simd_reflect(x,n); }
687 874
875#if SIMD_LIBRARY_VERSION >= 6
876 static SIMD_CPPFUNC half2 refract(const half2 x, const half2 n, const _Float16 eta) { return ::simd_refract(x,n,eta); }
877 static SIMD_CPPFUNC half3 refract(const half3 x, const half3 n, const _Float16 eta) { return ::simd_refract(x,n,eta); }
878 static SIMD_CPPFUNC half4 refract(const half4 x, const half4 n, const _Float16 eta) { return ::simd_refract(x,n,eta); }
879#endif // SIMD_LIBRARY_VERSION >= 6
688 static SIMD_CPPFUNC float2 refract(const float2 x, const float2 n, const float eta) { return ::simd_refract(x,n,eta); }880 static SIMD_CPPFUNC float2 refract(const float2 x, const float2 n, const float eta) { return ::simd_refract(x,n,eta); }
689 static SIMD_CPPFUNC float3 refract(const float3 x, const float3 n, const float eta) { return ::simd_refract(x,n,eta); }881 static SIMD_CPPFUNC float3 refract(const float3 x, const float3 n, const float eta) { return ::simd_refract(x,n,eta); }
690 static SIMD_CPPFUNC float4 refract(const float4 x, const float4 n, const float eta) { return ::simd_refract(x,n,eta); }882 static SIMD_CPPFUNC float4 refract(const float4 x, const float4 n, const float eta) { return ::simd_refract(x,n,eta); }
...@@ -703,8 +895,21 @@ namespace simd {...@@ -703,8 +895,21 @@ namespace simd {
703 static SIMD_CPPFUNC double orient(const double3 a, const double3 b, const double3 c, const double3 d) { return ::simd_orient(a,b,c,d); }895 static SIMD_CPPFUNC double orient(const double3 a, const double3 b, const double3 c, const double3 d) { return ::simd_orient(a,b,c,d); }
704#endif896#endif
705897
898#if SIMD_LIBRARY_VERSION >= 6
899 static SIMD_CPPFUNC _Float16 orient(const half2 x, const half2 y) { return ::simd_orient(x,y); }
900 static SIMD_CPPFUNC _Float16 orient(const half2 a, const half2 b, const half2 c) { return ::simd_orient(a,b,c); }
901 static SIMD_CPPFUNC _Float16 orient(const half3 x, const half3 y, const half3 z) { return ::simd_orient(x,y,z); }
902 static SIMD_CPPFUNC _Float16 orient(const half3 a, const half3 b, const half3 c, const half3 d) { return ::simd_orient(a,b,c,d); }
903#endif
904
706 /* precise and fast sub-namespaces */905 /* precise and fast sub-namespaces */
707 namespace precise {906 namespace precise {
907 static SIMD_CPPFUNC half2 project(const half2 x, const half2 y) { return ::simd_precise_project(x, y); }
908 static SIMD_CPPFUNC half3 project(const half3 x, const half3 y) { return ::simd_precise_project(x, y); }
909 static SIMD_CPPFUNC half4 project(const half4 x, const half4 y) { return ::simd_precise_project(x, y); }
910 static SIMD_CPPFUNC half8 project(const half8 x, const half8 y) { return ::simd_precise_project(x, y); }
911 static SIMD_CPPFUNC half16 project(const half16 x, const half16 y) { return ::simd_precise_project(x, y); }
912 static SIMD_CPPFUNC half32 project(const half32 x, const half32 y) { return ::simd_precise_project(x, y); }
708 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_precise_project(x, y); }913 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_precise_project(x, y); }
709 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_precise_project(x, y); }914 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_precise_project(x, y); }
710 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_precise_project(x, y); }915 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_precise_project(x, y); }
...@@ -714,7 +919,15 @@ namespace simd {...@@ -714,7 +919,15 @@ namespace simd {
714 static SIMD_CPPFUNC double3 project(const double3 x, const double3 y) { return ::simd_precise_project(x, y); }919 static SIMD_CPPFUNC double3 project(const double3 x, const double3 y) { return ::simd_precise_project(x, y); }
715 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_precise_project(x, y); }920 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_precise_project(x, y); }
716 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_precise_project(x, y); }921 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_precise_project(x, y); }
717 922
923#if SIMD_LIBRARY_VERSION >= 6
924 static SIMD_CPPFUNC _Float16 length(const half2 x) { return ::simd_precise_length(x); }
925 static SIMD_CPPFUNC _Float16 length(const half3 x) { return ::simd_precise_length(x); }
926 static SIMD_CPPFUNC _Float16 length(const half4 x) { return ::simd_precise_length(x); }
927 static SIMD_CPPFUNC _Float16 length(const half8 x) { return ::simd_precise_length(x); }
928 static SIMD_CPPFUNC _Float16 length(const half16 x) { return ::simd_precise_length(x); }
929 static SIMD_CPPFUNC _Float16 length(const half32 x) { return ::simd_precise_length(x); }
930#endif // #if SIMD_LIBRARY_VERSION >= 6
718 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_precise_length(x); }931 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_precise_length(x); }
719 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_precise_length(x); }932 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_precise_length(x); }
720 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_precise_length(x); }933 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_precise_length(x); }
...@@ -725,6 +938,12 @@ namespace simd {...@@ -725,6 +938,12 @@ namespace simd {
725 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_precise_length(x); }938 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_precise_length(x); }
726 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_precise_length(x); }939 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_precise_length(x); }
727 940
941 static SIMD_CPPFUNC _Float16 distance(const half2 x, const half2 y) { return ::simd_precise_distance(x, y); }
942 static SIMD_CPPFUNC _Float16 distance(const half3 x, const half3 y) { return ::simd_precise_distance(x, y); }
943 static SIMD_CPPFUNC _Float16 distance(const half4 x, const half4 y) { return ::simd_precise_distance(x, y); }
944 static SIMD_CPPFUNC _Float16 distance(const half8 x, const half8 y) { return ::simd_precise_distance(x, y); }
945 static SIMD_CPPFUNC _Float16 distance(const half16 x, const half16 y) { return ::simd_precise_distance(x, y); }
946 static SIMD_CPPFUNC _Float16 distance(const half32 x, const half32 y) { return ::simd_precise_distance(x, y); }
728 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_precise_distance(x, y); }947 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_precise_distance(x, y); }
729 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_precise_distance(x, y); }948 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_precise_distance(x, y); }
730 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_precise_distance(x, y); }949 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_precise_distance(x, y); }
...@@ -735,6 +954,12 @@ namespace simd {...@@ -735,6 +954,12 @@ namespace simd {
735 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_precise_distance(x, y); }954 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_precise_distance(x, y); }
736 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_precise_distance(x, y); }955 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_precise_distance(x, y); }
737 956
957 static SIMD_CPPFUNC half2 normalize(const half2 x) { return ::simd_precise_normalize(x); }
958 static SIMD_CPPFUNC half3 normalize(const half3 x) { return ::simd_precise_normalize(x); }
959 static SIMD_CPPFUNC half4 normalize(const half4 x) { return ::simd_precise_normalize(x); }
960 static SIMD_CPPFUNC half8 normalize(const half8 x) { return ::simd_precise_normalize(x); }
961 static SIMD_CPPFUNC half16 normalize(const half16 x) { return ::simd_precise_normalize(x); }
962 static SIMD_CPPFUNC half32 normalize(const half32 x) { return ::simd_precise_normalize(x); }
738 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_precise_normalize(x); }963 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_precise_normalize(x); }
739 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_precise_normalize(x); }964 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_precise_normalize(x); }
740 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_precise_normalize(x); }965 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_precise_normalize(x); }
...@@ -747,6 +972,12 @@ namespace simd {...@@ -747,6 +972,12 @@ namespace simd {
747 }972 }
748 973
749 namespace fast {974 namespace fast {
975 static SIMD_CPPFUNC half2 project(const half2 x, const half2 y) { return ::simd_fast_project(x, y); }
976 static SIMD_CPPFUNC half3 project(const half3 x, const half3 y) { return ::simd_fast_project(x, y); }
977 static SIMD_CPPFUNC half4 project(const half4 x, const half4 y) { return ::simd_fast_project(x, y); }
978 static SIMD_CPPFUNC half8 project(const half8 x, const half8 y) { return ::simd_fast_project(x, y); }
979 static SIMD_CPPFUNC half16 project(const half16 x, const half16 y) { return ::simd_fast_project(x, y); }
980 static SIMD_CPPFUNC half32 project(const half32 x, const half32 y) { return ::simd_fast_project(x, y); }
750 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_fast_project(x, y); }981 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_fast_project(x, y); }
751 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_fast_project(x, y); }982 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_fast_project(x, y); }
752 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_fast_project(x, y); }983 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_fast_project(x, y); }
...@@ -757,6 +988,12 @@ namespace simd {...@@ -757,6 +988,12 @@ namespace simd {
757 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_fast_project(x, y); }988 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_fast_project(x, y); }
758 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_fast_project(x, y); }989 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_fast_project(x, y); }
759 990
991 static SIMD_CPPFUNC _Float16 length(const half2 x) { return ::simd_fast_length(x); }
992 static SIMD_CPPFUNC _Float16 length(const half3 x) { return ::simd_fast_length(x); }
993 static SIMD_CPPFUNC _Float16 length(const half4 x) { return ::simd_fast_length(x); }
994 static SIMD_CPPFUNC _Float16 length(const half8 x) { return ::simd_fast_length(x); }
995 static SIMD_CPPFUNC _Float16 length(const half16 x) { return ::simd_fast_length(x); }
996 static SIMD_CPPFUNC _Float16 length(const half32 x) { return ::simd_fast_length(x); }
760 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_fast_length(x); }997 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_fast_length(x); }
761 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_fast_length(x); }998 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_fast_length(x); }
762 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_fast_length(x); }999 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_fast_length(x); }
...@@ -767,6 +1004,12 @@ namespace simd {...@@ -767,6 +1004,12 @@ namespace simd {
767 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_fast_length(x); }1004 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_fast_length(x); }
768 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_fast_length(x); }1005 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_fast_length(x); }
769 1006
1007 static SIMD_CPPFUNC _Float16 distance(const half2 x, const half2 y) { return ::simd_fast_distance(x, y); }
1008 static SIMD_CPPFUNC _Float16 distance(const half3 x, const half3 y) { return ::simd_fast_distance(x, y); }
1009 static SIMD_CPPFUNC _Float16 distance(const half4 x, const half4 y) { return ::simd_fast_distance(x, y); }
1010 static SIMD_CPPFUNC _Float16 distance(const half8 x, const half8 y) { return ::simd_fast_distance(x, y); }
1011 static SIMD_CPPFUNC _Float16 distance(const half16 x, const half16 y) { return ::simd_fast_distance(x, y); }
1012 static SIMD_CPPFUNC _Float16 distance(const half32 x, const half32 y) { return ::simd_fast_distance(x, y); }
770 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_fast_distance(x, y); }1013 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_fast_distance(x, y); }
771 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_fast_distance(x, y); }1014 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_fast_distance(x, y); }
772 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_fast_distance(x, y); }1015 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_fast_distance(x, y); }
...@@ -777,6 +1020,12 @@ namespace simd {...@@ -777,6 +1020,12 @@ namespace simd {
777 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_fast_distance(x, y); }1020 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_fast_distance(x, y); }
778 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_fast_distance(x, y); }1021 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_fast_distance(x, y); }
779 1022
1023 static SIMD_CPPFUNC half2 normalize(const half2 x) { return ::simd_fast_normalize(x); }
1024 static SIMD_CPPFUNC half3 normalize(const half3 x) { return ::simd_fast_normalize(x); }
1025 static SIMD_CPPFUNC half4 normalize(const half4 x) { return ::simd_fast_normalize(x); }
1026 static SIMD_CPPFUNC half8 normalize(const half8 x) { return ::simd_fast_normalize(x); }
1027 static SIMD_CPPFUNC half16 normalize(const half16 x) { return ::simd_fast_normalize(x); }
1028 static SIMD_CPPFUNC half32 normalize(const half32 x) { return ::simd_fast_normalize(x); }
780 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_fast_normalize(x); }1029 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_fast_normalize(x); }
781 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_fast_normalize(x); }1030 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_fast_normalize(x); }
782 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_fast_normalize(x); }1031 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_fast_normalize(x); }
...@@ -794,6 +1043,12 @@ extern "C" {...@@ -794,6 +1043,12 @@ extern "C" {
794 1043
795#pragma mark - Implementation1044#pragma mark - Implementation
7961045
1046static _Float16 SIMD_CFUNC simd_dot(simd_half2 __x, simd_half2 __y) { return simd_reduce_add(__x*__y); }
1047static _Float16 SIMD_CFUNC simd_dot(simd_half3 __x, simd_half3 __y) { return simd_reduce_add(__x*__y); }
1048static _Float16 SIMD_CFUNC simd_dot(simd_half4 __x, simd_half4 __y) { return simd_reduce_add(__x*__y); }
1049static _Float16 SIMD_CFUNC simd_dot(simd_half8 __x, simd_half8 __y) { return simd_reduce_add(__x*__y); }
1050static _Float16 SIMD_CFUNC simd_dot(simd_half16 __x, simd_half16 __y) { return simd_reduce_add(__x*__y); }
1051static _Float16 SIMD_CFUNC simd_dot(simd_half32 __x, simd_half32 __y) { return simd_reduce_add(__x*__y); }
797static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y) { return simd_reduce_add(__x*__y); }1052static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y) { return simd_reduce_add(__x*__y); }
798static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y) { return simd_reduce_add(__x*__y); }1053static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y) { return simd_reduce_add(__x*__y); }
799static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y) { return simd_reduce_add(__x*__y); }1054static float SIMD_CFUNC simd_dot(simd_float4 __x, simd_float4 __y) { return simd_reduce_add(__x*__y); }
...@@ -804,6 +1059,12 @@ static double SIMD_CFUNC simd_dot(simd_double3 __x, simd_double3 __y) { return s...@@ -804,6 +1059,12 @@ static double SIMD_CFUNC simd_dot(simd_double3 __x, simd_double3 __y) { return s
804static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y) { return simd_reduce_add(__x*__y); }1059static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y) { return simd_reduce_add(__x*__y); }
805static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y) { return simd_reduce_add(__x*__y); }1060static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y) { return simd_reduce_add(__x*__y); }
8061061
1062static simd_half2 SIMD_CFUNC simd_precise_project(simd_half2 __x, simd_half2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
1063static simd_half3 SIMD_CFUNC simd_precise_project(simd_half3 __x, simd_half3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
1064static simd_half4 SIMD_CFUNC simd_precise_project(simd_half4 __x, simd_half4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
1065static simd_half8 SIMD_CFUNC simd_precise_project(simd_half8 __x, simd_half8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
1066static simd_half16 SIMD_CFUNC simd_precise_project(simd_half16 __x, simd_half16 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
1067static simd_half32 SIMD_CFUNC simd_precise_project(simd_half32 __x, simd_half32 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
807static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }1068static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
808static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }1069static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
809static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }1070static simd_float4 SIMD_CFUNC simd_precise_project(simd_float4 __x, simd_float4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
...@@ -814,6 +1075,12 @@ static simd_double3 SIMD_CFUNC simd_precise_project(simd_double3 __x, simd_doubl...@@ -814,6 +1075,12 @@ static simd_double3 SIMD_CFUNC simd_precise_project(simd_double3 __x, simd_doubl
814static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }1075static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
815static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }1076static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
8161077
1078static simd_half2 SIMD_CFUNC simd_fast_project(simd_half2 __x, simd_half2 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
1079static simd_half3 SIMD_CFUNC simd_fast_project(simd_half3 __x, simd_half3 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
1080static simd_half4 SIMD_CFUNC simd_fast_project(simd_half4 __x, simd_half4 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
1081static simd_half8 SIMD_CFUNC simd_fast_project(simd_half8 __x, simd_half8 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
1082static simd_half16 SIMD_CFUNC simd_fast_project(simd_half16 __x, simd_half16 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
1083static simd_half32 SIMD_CFUNC simd_fast_project(simd_half32 __x, simd_half32 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
817static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }1084static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
818static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }1085static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
819static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }1086static simd_float4 SIMD_CFUNC simd_fast_project(simd_float4 __x, simd_float4 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
...@@ -825,6 +1092,12 @@ static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4...@@ -825,6 +1092,12 @@ static simd_double4 SIMD_CFUNC simd_fast_project(simd_double4 __x, simd_double4
825static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }1092static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y) { return __y*simd_dot(__x,__y)*simd_fast_recip(simd_dot(__y,__y)); }
8261093
827#if defined __FAST_MATH__1094#if defined __FAST_MATH__
1095static simd_half2 SIMD_CFUNC simd_project(simd_half2 __x, simd_half2 __y) { return simd_fast_project(__x,__y); }
1096static simd_half3 SIMD_CFUNC simd_project(simd_half3 __x, simd_half3 __y) { return simd_fast_project(__x,__y); }
1097static simd_half4 SIMD_CFUNC simd_project(simd_half4 __x, simd_half4 __y) { return simd_fast_project(__x,__y); }
1098static simd_half8 SIMD_CFUNC simd_project(simd_half8 __x, simd_half8 __y) { return simd_fast_project(__x,__y); }
1099static simd_half16 SIMD_CFUNC simd_project(simd_half16 __x, simd_half16 __y) { return simd_fast_project(__x,__y); }
1100static simd_half32 SIMD_CFUNC simd_project(simd_half32 __x, simd_half32 __y) { return simd_fast_project(__x,__y); }
828static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_fast_project(__x,__y); }1101static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_fast_project(__x,__y); }
829static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_fast_project(__x,__y); }1102static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_fast_project(__x,__y); }
830static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_fast_project(__x,__y); }1103static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_fast_project(__x,__y); }
...@@ -835,6 +1108,12 @@ static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y)...@@ -835,6 +1108,12 @@ static simd_double3 SIMD_CFUNC simd_project(simd_double3 __x, simd_double3 __y)
835static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_fast_project(__x,__y); }1108static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_fast_project(__x,__y); }
836static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_fast_project(__x,__y); }1109static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_fast_project(__x,__y); }
837#else1110#else
1111static simd_half2 SIMD_CFUNC simd_project(simd_half2 __x, simd_half2 __y) { return simd_precise_project(__x,__y); }
1112static simd_half3 SIMD_CFUNC simd_project(simd_half3 __x, simd_half3 __y) { return simd_precise_project(__x,__y); }
1113static simd_half4 SIMD_CFUNC simd_project(simd_half4 __x, simd_half4 __y) { return simd_precise_project(__x,__y); }
1114static simd_half8 SIMD_CFUNC simd_project(simd_half8 __x, simd_half8 __y) { return simd_precise_project(__x,__y); }
1115static simd_half16 SIMD_CFUNC simd_project(simd_half16 __x, simd_half16 __y) { return simd_precise_project(__x,__y); }
1116static simd_half32 SIMD_CFUNC simd_project(simd_half32 __x, simd_half32 __y) { return simd_precise_project(__x,__y); }
838static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_precise_project(__x,__y); }1117static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_precise_project(__x,__y); }
839static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_precise_project(__x,__y); }1118static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_precise_project(__x,__y); }
840static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_precise_project(__x,__y); }1119static simd_float4 SIMD_CFUNC simd_project(simd_float4 __x, simd_float4 __y) { return simd_precise_project(__x,__y); }
...@@ -846,6 +1125,14 @@ static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y)...@@ -846,6 +1125,14 @@ static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y)
846static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_precise_project(__x,__y); }1125static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_precise_project(__x,__y); }
847#endif1126#endif
8481127
1128#if SIMD_LIBRARY_VERSION >= 6
1129static _Float16 SIMD_CFUNC simd_precise_length(simd_half2 __x) { return __sqrtf16(simd_length_squared(__x)); }
1130static _Float16 SIMD_CFUNC simd_precise_length(simd_half3 __x) { return __sqrtf16(simd_length_squared(__x)); }
1131static _Float16 SIMD_CFUNC simd_precise_length(simd_half4 __x) { return __sqrtf16(simd_length_squared(__x)); }
1132static _Float16 SIMD_CFUNC simd_precise_length(simd_half8 __x) { return __sqrtf16(simd_length_squared(__x)); }
1133static _Float16 SIMD_CFUNC simd_precise_length(simd_half16 __x) { return __sqrtf16(simd_length_squared(__x)); }
1134static _Float16 SIMD_CFUNC simd_precise_length(simd_half32 __x) { return __sqrtf16(simd_length_squared(__x)); }
1135#endif // SIMD_LIBRARY_VERSION >= 6
849static float SIMD_CFUNC simd_precise_length(simd_float2 __x) { return sqrtf(simd_length_squared(__x)); }1136static float SIMD_CFUNC simd_precise_length(simd_float2 __x) { return sqrtf(simd_length_squared(__x)); }
850static float SIMD_CFUNC simd_precise_length(simd_float3 __x) { return sqrtf(simd_length_squared(__x)); }1137static float SIMD_CFUNC simd_precise_length(simd_float3 __x) { return sqrtf(simd_length_squared(__x)); }
851static float SIMD_CFUNC simd_precise_length(simd_float4 __x) { return sqrtf(simd_length_squared(__x)); }1138static float SIMD_CFUNC simd_precise_length(simd_float4 __x) { return sqrtf(simd_length_squared(__x)); }
...@@ -855,7 +1142,14 @@ static double SIMD_CFUNC simd_precise_length(simd_double2 __x) { return sqrt(sim...@@ -855,7 +1142,14 @@ static double SIMD_CFUNC simd_precise_length(simd_double2 __x) { return sqrt(sim
855static double SIMD_CFUNC simd_precise_length(simd_double3 __x) { return sqrt(simd_length_squared(__x)); }1142static double SIMD_CFUNC simd_precise_length(simd_double3 __x) { return sqrt(simd_length_squared(__x)); }
856static double SIMD_CFUNC simd_precise_length(simd_double4 __x) { return sqrt(simd_length_squared(__x)); }1143static double SIMD_CFUNC simd_precise_length(simd_double4 __x) { return sqrt(simd_length_squared(__x)); }
857static double SIMD_CFUNC simd_precise_length(simd_double8 __x) { return sqrt(simd_length_squared(__x)); }1144static double SIMD_CFUNC simd_precise_length(simd_double8 __x) { return sqrt(simd_length_squared(__x)); }
8581145#if SIMD_LIBRARY_VERSION >= 6
1146static _Float16 SIMD_CFUNC simd_fast_length(simd_half2 __x) { return simd_precise_length(__x); }
1147static _Float16 SIMD_CFUNC simd_fast_length(simd_half3 __x) { return simd_precise_length(__x); }
1148static _Float16 SIMD_CFUNC simd_fast_length(simd_half4 __x) { return simd_precise_length(__x); }
1149static _Float16 SIMD_CFUNC simd_fast_length(simd_half8 __x) { return simd_precise_length(__x); }
1150static _Float16 SIMD_CFUNC simd_fast_length(simd_half16 __x) { return simd_precise_length(__x); }
1151static _Float16 SIMD_CFUNC simd_fast_length(simd_half32 __x) { return simd_precise_length(__x); }
1152#endif // SIMD_LIBRARY_VERSION >= 6
859static float SIMD_CFUNC simd_fast_length(simd_float2 __x) { return simd_precise_length(__x); }1153static float SIMD_CFUNC simd_fast_length(simd_float2 __x) { return simd_precise_length(__x); }
860static float SIMD_CFUNC simd_fast_length(simd_float3 __x) { return simd_precise_length(__x); }1154static float SIMD_CFUNC simd_fast_length(simd_float3 __x) { return simd_precise_length(__x); }
861static float SIMD_CFUNC simd_fast_length(simd_float4 __x) { return simd_precise_length(__x); }1155static float SIMD_CFUNC simd_fast_length(simd_float4 __x) { return simd_precise_length(__x); }
...@@ -867,6 +1161,12 @@ static double SIMD_CFUNC simd_fast_length(simd_double4 __x) { return simd_precis...@@ -867,6 +1161,12 @@ static double SIMD_CFUNC simd_fast_length(simd_double4 __x) { return simd_precis
867static double SIMD_CFUNC simd_fast_length(simd_double8 __x) { return simd_precise_length(__x); }1161static double SIMD_CFUNC simd_fast_length(simd_double8 __x) { return simd_precise_length(__x); }
8681162
869#if defined __FAST_MATH__1163#if defined __FAST_MATH__
1164static _Float16 SIMD_CFUNC simd_length(simd_half2 __x) { return simd_fast_length(__x); }
1165static _Float16 SIMD_CFUNC simd_length(simd_half3 __x) { return simd_fast_length(__x); }
1166static _Float16 SIMD_CFUNC simd_length(simd_half4 __x) { return simd_fast_length(__x); }
1167static _Float16 SIMD_CFUNC simd_length(simd_half8 __x) { return simd_fast_length(__x); }
1168static _Float16 SIMD_CFUNC simd_length(simd_half16 __x) { return simd_fast_length(__x); }
1169static _Float16 SIMD_CFUNC simd_length(simd_half32 __x) { return simd_fast_length(__x); }
870static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_fast_length(__x); }1170static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_fast_length(__x); }
871static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_fast_length(__x); }1171static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_fast_length(__x); }
872static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_fast_length(__x); }1172static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_fast_length(__x); }
...@@ -877,6 +1177,14 @@ static double SIMD_CFUNC simd_length(simd_double3 __x) { return simd_fast_length...@@ -877,6 +1177,14 @@ static double SIMD_CFUNC simd_length(simd_double3 __x) { return simd_fast_length
877static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_fast_length(__x); }1177static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_fast_length(__x); }
878static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_fast_length(__x); }1178static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_fast_length(__x); }
879#else1179#else
1180#if SIMD_LIBRARY_VERSION >= 6
1181static _Float16 SIMD_CFUNC simd_length(simd_half2 __x) { return simd_precise_length(__x); }
1182static _Float16 SIMD_CFUNC simd_length(simd_half3 __x) { return simd_precise_length(__x); }
1183static _Float16 SIMD_CFUNC simd_length(simd_half4 __x) { return simd_precise_length(__x); }
1184static _Float16 SIMD_CFUNC simd_length(simd_half8 __x) { return simd_precise_length(__x); }
1185static _Float16 SIMD_CFUNC simd_length(simd_half16 __x) { return simd_precise_length(__x); }
1186static _Float16 SIMD_CFUNC simd_length(simd_half32 __x) { return simd_precise_length(__x); }
1187#endif // SIMD_LIBRARY_VERSION >= 6
880static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_precise_length(__x); }1188static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_precise_length(__x); }
881static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_precise_length(__x); }1189static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_precise_length(__x); }
882static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_precise_length(__x); }1190static float SIMD_CFUNC simd_length(simd_float4 __x) { return simd_precise_length(__x); }
...@@ -888,6 +1196,12 @@ static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_precise_len...@@ -888,6 +1196,12 @@ static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_precise_len
888static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_precise_length(__x); }1196static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_precise_length(__x); }
889#endif1197#endif
8901198
1199static _Float16 SIMD_CFUNC simd_length_squared(simd_half2 __x) { return simd_dot(__x,__x); }
1200static _Float16 SIMD_CFUNC simd_length_squared(simd_half3 __x) { return simd_dot(__x,__x); }
1201static _Float16 SIMD_CFUNC simd_length_squared(simd_half4 __x) { return simd_dot(__x,__x); }
1202static _Float16 SIMD_CFUNC simd_length_squared(simd_half8 __x) { return simd_dot(__x,__x); }
1203static _Float16 SIMD_CFUNC simd_length_squared(simd_half16 __x) { return simd_dot(__x,__x); }
1204static _Float16 SIMD_CFUNC simd_length_squared(simd_half32 __x) { return simd_dot(__x,__x); }
891static float SIMD_CFUNC simd_length_squared(simd_float2 __x) { return simd_dot(__x,__x); }1205static float SIMD_CFUNC simd_length_squared(simd_float2 __x) { return simd_dot(__x,__x); }
892static float SIMD_CFUNC simd_length_squared(simd_float3 __x) { return simd_dot(__x,__x); }1206static float SIMD_CFUNC simd_length_squared(simd_float3 __x) { return simd_dot(__x,__x); }
893static float SIMD_CFUNC simd_length_squared(simd_float4 __x) { return simd_dot(__x,__x); }1207static float SIMD_CFUNC simd_length_squared(simd_float4 __x) { return simd_dot(__x,__x); }
...@@ -898,6 +1212,12 @@ static double SIMD_CFUNC simd_length_squared(simd_double3 __x) { return simd_dot...@@ -898,6 +1212,12 @@ static double SIMD_CFUNC simd_length_squared(simd_double3 __x) { return simd_dot
898static double SIMD_CFUNC simd_length_squared(simd_double4 __x) { return simd_dot(__x,__x); }1212static double SIMD_CFUNC simd_length_squared(simd_double4 __x) { return simd_dot(__x,__x); }
899static double SIMD_CFUNC simd_length_squared(simd_double8 __x) { return simd_dot(__x,__x); }1213static double SIMD_CFUNC simd_length_squared(simd_double8 __x) { return simd_dot(__x,__x); }
9001214
1215static _Float16 SIMD_CFUNC simd_norm_one(simd_half2 __x) { return simd_reduce_add(__tg_fabs(__x)); }
1216static _Float16 SIMD_CFUNC simd_norm_one(simd_half3 __x) { return simd_reduce_add(__tg_fabs(__x)); }
1217static _Float16 SIMD_CFUNC simd_norm_one(simd_half4 __x) { return simd_reduce_add(__tg_fabs(__x)); }
1218static _Float16 SIMD_CFUNC simd_norm_one(simd_half8 __x) { return simd_reduce_add(__tg_fabs(__x)); }
1219static _Float16 SIMD_CFUNC simd_norm_one(simd_half16 __x) { return simd_reduce_add(__tg_fabs(__x)); }
1220static _Float16 SIMD_CFUNC simd_norm_one(simd_half32 __x) { return simd_reduce_add(__tg_fabs(__x)); }
901static float SIMD_CFUNC simd_norm_one(simd_float2 __x) { return simd_reduce_add(__tg_fabs(__x)); }1221static float SIMD_CFUNC simd_norm_one(simd_float2 __x) { return simd_reduce_add(__tg_fabs(__x)); }
902static float SIMD_CFUNC simd_norm_one(simd_float3 __x) { return simd_reduce_add(__tg_fabs(__x)); }1222static float SIMD_CFUNC simd_norm_one(simd_float3 __x) { return simd_reduce_add(__tg_fabs(__x)); }
903static float SIMD_CFUNC simd_norm_one(simd_float4 __x) { return simd_reduce_add(__tg_fabs(__x)); }1223static float SIMD_CFUNC simd_norm_one(simd_float4 __x) { return simd_reduce_add(__tg_fabs(__x)); }
...@@ -908,6 +1228,12 @@ static double SIMD_CFUNC simd_norm_one(simd_double3 __x) { return simd_reduce_ad...@@ -908,6 +1228,12 @@ static double SIMD_CFUNC simd_norm_one(simd_double3 __x) { return simd_reduce_ad
908static double SIMD_CFUNC simd_norm_one(simd_double4 __x) { return simd_reduce_add(__tg_fabs(__x)); }1228static double SIMD_CFUNC simd_norm_one(simd_double4 __x) { return simd_reduce_add(__tg_fabs(__x)); }
909static double SIMD_CFUNC simd_norm_one(simd_double8 __x) { return simd_reduce_add(__tg_fabs(__x)); }1229static double SIMD_CFUNC simd_norm_one(simd_double8 __x) { return simd_reduce_add(__tg_fabs(__x)); }
9101230
1231static _Float16 SIMD_CFUNC simd_norm_inf(simd_half2 __x) { return simd_reduce_max(__tg_fabs(__x)); }
1232static _Float16 SIMD_CFUNC simd_norm_inf(simd_half3 __x) { return simd_reduce_max(__tg_fabs(__x)); }
1233static _Float16 SIMD_CFUNC simd_norm_inf(simd_half4 __x) { return simd_reduce_max(__tg_fabs(__x)); }
1234static _Float16 SIMD_CFUNC simd_norm_inf(simd_half8 __x) { return simd_reduce_max(__tg_fabs(__x)); }
1235static _Float16 SIMD_CFUNC simd_norm_inf(simd_half16 __x) { return simd_reduce_max(__tg_fabs(__x)); }
1236static _Float16 SIMD_CFUNC simd_norm_inf(simd_half32 __x) { return simd_reduce_max(__tg_fabs(__x)); }
911static float SIMD_CFUNC simd_norm_inf(simd_float2 __x) { return simd_reduce_max(__tg_fabs(__x)); }1237static float SIMD_CFUNC simd_norm_inf(simd_float2 __x) { return simd_reduce_max(__tg_fabs(__x)); }
912static float SIMD_CFUNC simd_norm_inf(simd_float3 __x) { return simd_reduce_max(__tg_fabs(__x)); }1238static float SIMD_CFUNC simd_norm_inf(simd_float3 __x) { return simd_reduce_max(__tg_fabs(__x)); }
913static float SIMD_CFUNC simd_norm_inf(simd_float4 __x) { return simd_reduce_max(__tg_fabs(__x)); }1239static float SIMD_CFUNC simd_norm_inf(simd_float4 __x) { return simd_reduce_max(__tg_fabs(__x)); }
...@@ -918,6 +1244,14 @@ static double SIMD_CFUNC simd_norm_inf(simd_double3 __x) { return simd_reduce_ma...@@ -918,6 +1244,14 @@ static double SIMD_CFUNC simd_norm_inf(simd_double3 __x) { return simd_reduce_ma
918static double SIMD_CFUNC simd_norm_inf(simd_double4 __x) { return simd_reduce_max(__tg_fabs(__x)); }1244static double SIMD_CFUNC simd_norm_inf(simd_double4 __x) { return simd_reduce_max(__tg_fabs(__x)); }
919static double SIMD_CFUNC simd_norm_inf(simd_double8 __x) { return simd_reduce_max(__tg_fabs(__x)); }1245static double SIMD_CFUNC simd_norm_inf(simd_double8 __x) { return simd_reduce_max(__tg_fabs(__x)); }
9201246
1247#if SIMD_LIBRARY_VERSION >= 6
1248static _Float16 SIMD_CFUNC simd_precise_distance(simd_half2 __x, simd_half2 __y) { return simd_precise_length(__x - __y); }
1249static _Float16 SIMD_CFUNC simd_precise_distance(simd_half3 __x, simd_half3 __y) { return simd_precise_length(__x - __y); }
1250static _Float16 SIMD_CFUNC simd_precise_distance(simd_half4 __x, simd_half4 __y) { return simd_precise_length(__x - __y); }
1251static _Float16 SIMD_CFUNC simd_precise_distance(simd_half8 __x, simd_half8 __y) { return simd_precise_length(__x - __y); }
1252static _Float16 SIMD_CFUNC simd_precise_distance(simd_half16 __x, simd_half16 __y) { return simd_precise_length(__x - __y); }
1253static _Float16 SIMD_CFUNC simd_precise_distance(simd_half32 __x, simd_half32 __y) { return simd_precise_length(__x - __y); }
1254#endif // SIMD_LIBRARY_VERSION >= 6
921static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_length(__x - __y); }1255static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_length(__x - __y); }
922static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_length(__x - __y); }1256static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_length(__x - __y); }
923static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_length(__x - __y); }1257static float SIMD_CFUNC simd_precise_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_length(__x - __y); }
...@@ -928,6 +1262,12 @@ static double SIMD_CFUNC simd_precise_distance(simd_double3 __x, simd_double3 __...@@ -928,6 +1262,12 @@ static double SIMD_CFUNC simd_precise_distance(simd_double3 __x, simd_double3 __
928static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_length(__x - __y); }1262static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_length(__x - __y); }
929static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_length(__x - __y); }1263static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_length(__x - __y); }
9301264
1265static _Float16 SIMD_CFUNC simd_fast_distance(simd_half2 __x, simd_half2 __y) { return simd_fast_length(__x - __y); }
1266static _Float16 SIMD_CFUNC simd_fast_distance(simd_half3 __x, simd_half3 __y) { return simd_fast_length(__x - __y); }
1267static _Float16 SIMD_CFUNC simd_fast_distance(simd_half4 __x, simd_half4 __y) { return simd_fast_length(__x - __y); }
1268static _Float16 SIMD_CFUNC simd_fast_distance(simd_half8 __x, simd_half8 __y) { return simd_fast_length(__x - __y); }
1269static _Float16 SIMD_CFUNC simd_fast_distance(simd_half16 __x, simd_half16 __y) { return simd_fast_length(__x - __y); }
1270static _Float16 SIMD_CFUNC simd_fast_distance(simd_half32 __x, simd_half32 __y) { return simd_fast_length(__x - __y); }
931static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_length(__x - __y); }1271static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_length(__x - __y); }
932static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_length(__x - __y); }1272static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_length(__x - __y); }
933static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_length(__x - __y); }1273static float SIMD_CFUNC simd_fast_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_length(__x - __y); }
...@@ -939,6 +1279,12 @@ static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y)...@@ -939,6 +1279,12 @@ static double SIMD_CFUNC simd_fast_distance(simd_double4 __x, simd_double4 __y)
939static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_length(__x - __y); }1279static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_length(__x - __y); }
9401280
941#if defined __FAST_MATH__1281#if defined __FAST_MATH__
1282static _Float16 SIMD_CFUNC simd_distance(simd_half2 __x, simd_half2 __y) { return simd_fast_distance(__x,__y); }
1283static _Float16 SIMD_CFUNC simd_distance(simd_half3 __x, simd_half3 __y) { return simd_fast_distance(__x,__y); }
1284static _Float16 SIMD_CFUNC simd_distance(simd_half4 __x, simd_half4 __y) { return simd_fast_distance(__x,__y); }
1285static _Float16 SIMD_CFUNC simd_distance(simd_half8 __x, simd_half8 __y) { return simd_fast_distance(__x,__y); }
1286static _Float16 SIMD_CFUNC simd_distance(simd_half16 __x, simd_half16 __y) { return simd_fast_distance(__x,__y); }
1287static _Float16 SIMD_CFUNC simd_distance(simd_half32 __x, simd_half32 __y) { return simd_fast_distance(__x,__y); }
942static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_distance(__x,__y); }1288static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_distance(__x,__y); }
943static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_distance(__x,__y); }1289static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_distance(__x,__y); }
944static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_distance(__x,__y); }1290static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_fast_distance(__x,__y); }
...@@ -949,6 +1295,12 @@ static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y) { ret...@@ -949,6 +1295,12 @@ static double SIMD_CFUNC simd_distance(simd_double3 __x, simd_double3 __y) { ret
949static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_distance(__x,__y); }1295static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_distance(__x,__y); }
950static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_distance(__x,__y); }1296static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_distance(__x,__y); }
951#else1297#else
1298static _Float16 SIMD_CFUNC simd_distance(simd_half2 __x, simd_half2 __y) { return simd_precise_distance(__x,__y); }
1299static _Float16 SIMD_CFUNC simd_distance(simd_half3 __x, simd_half3 __y) { return simd_precise_distance(__x,__y); }
1300static _Float16 SIMD_CFUNC simd_distance(simd_half4 __x, simd_half4 __y) { return simd_precise_distance(__x,__y); }
1301static _Float16 SIMD_CFUNC simd_distance(simd_half8 __x, simd_half8 __y) { return simd_precise_distance(__x,__y); }
1302static _Float16 SIMD_CFUNC simd_distance(simd_half16 __x, simd_half16 __y) { return simd_precise_distance(__x,__y); }
1303static _Float16 SIMD_CFUNC simd_distance(simd_half32 __x, simd_half32 __y) { return simd_precise_distance(__x,__y); }
952static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_distance(__x,__y); }1304static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_distance(__x,__y); }
953static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_distance(__x,__y); }1305static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_distance(__x,__y); }
954static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_distance(__x,__y); }1306static float SIMD_CFUNC simd_distance(simd_float4 __x, simd_float4 __y) { return simd_precise_distance(__x,__y); }
...@@ -960,6 +1312,12 @@ static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { ret...@@ -960,6 +1312,12 @@ static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { ret
960static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_distance(__x,__y); }1312static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_distance(__x,__y); }
961#endif1313#endif
9621314
1315static _Float16 SIMD_CFUNC simd_distance_squared(simd_half2 __x, simd_half2 __y) { return simd_length_squared(__x - __y); }
1316static _Float16 SIMD_CFUNC simd_distance_squared(simd_half3 __x, simd_half3 __y) { return simd_length_squared(__x - __y); }
1317static _Float16 SIMD_CFUNC simd_distance_squared(simd_half4 __x, simd_half4 __y) { return simd_length_squared(__x - __y); }
1318static _Float16 SIMD_CFUNC simd_distance_squared(simd_half8 __x, simd_half8 __y) { return simd_length_squared(__x - __y); }
1319static _Float16 SIMD_CFUNC simd_distance_squared(simd_half16 __x, simd_half16 __y) { return simd_length_squared(__x - __y); }
1320static _Float16 SIMD_CFUNC simd_distance_squared(simd_half32 __x, simd_half32 __y) { return simd_length_squared(__x - __y); }
963static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y) { return simd_length_squared(__x - __y); }1321static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y) { return simd_length_squared(__x - __y); }
964static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y) { return simd_length_squared(__x - __y); }1322static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y) { return simd_length_squared(__x - __y); }
965static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y) { return simd_length_squared(__x - __y); }1323static float SIMD_CFUNC simd_distance_squared(simd_float4 __x, simd_float4 __y) { return simd_length_squared(__x - __y); }
...@@ -970,6 +1328,12 @@ static double SIMD_CFUNC simd_distance_squared(simd_double3 __x, simd_double3 __...@@ -970,6 +1328,12 @@ static double SIMD_CFUNC simd_distance_squared(simd_double3 __x, simd_double3 __
970static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y) { return simd_length_squared(__x - __y); }1328static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y) { return simd_length_squared(__x - __y); }
971static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y) { return simd_length_squared(__x - __y); }1329static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y) { return simd_length_squared(__x - __y); }
9721330
1331static simd_half2 SIMD_CFUNC simd_precise_normalize(simd_half2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
1332static simd_half3 SIMD_CFUNC simd_precise_normalize(simd_half3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
1333static simd_half4 SIMD_CFUNC simd_precise_normalize(simd_half4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
1334static simd_half8 SIMD_CFUNC simd_precise_normalize(simd_half8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
1335static simd_half16 SIMD_CFUNC simd_precise_normalize(simd_half16 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
1336static simd_half32 SIMD_CFUNC simd_precise_normalize(simd_half32 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
973static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }1337static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
974static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }1338static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
975static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }1339static simd_float4 SIMD_CFUNC simd_precise_normalize(simd_float4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
...@@ -980,6 +1344,12 @@ static simd_double3 SIMD_CFUNC simd_precise_normalize(simd_double3 __x) { return...@@ -980,6 +1344,12 @@ static simd_double3 SIMD_CFUNC simd_precise_normalize(simd_double3 __x) { return
980static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }1344static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
981static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }1345static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
9821346
1347static simd_half2 SIMD_CFUNC simd_fast_normalize(simd_half2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
1348static simd_half3 SIMD_CFUNC simd_fast_normalize(simd_half3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
1349static simd_half4 SIMD_CFUNC simd_fast_normalize(simd_half4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
1350static simd_half8 SIMD_CFUNC simd_fast_normalize(simd_half8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
1351static simd_half16 SIMD_CFUNC simd_fast_normalize(simd_half16 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
1352static simd_half32 SIMD_CFUNC simd_fast_normalize(simd_half32 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
983static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }1353static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
984static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }1354static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
985static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }1355static simd_float4 SIMD_CFUNC simd_fast_normalize(simd_float4 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
...@@ -991,6 +1361,12 @@ static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x) { return __...@@ -991,6 +1361,12 @@ static simd_double4 SIMD_CFUNC simd_fast_normalize(simd_double4 __x) { return __
991static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }1361static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
9921362
993#if defined __FAST_MATH__1363#if defined __FAST_MATH__
1364static simd_half2 SIMD_CFUNC simd_normalize(simd_half2 __x) { return simd_fast_normalize(__x); }
1365static simd_half3 SIMD_CFUNC simd_normalize(simd_half3 __x) { return simd_fast_normalize(__x); }
1366static simd_half4 SIMD_CFUNC simd_normalize(simd_half4 __x) { return simd_fast_normalize(__x); }
1367static simd_half8 SIMD_CFUNC simd_normalize(simd_half8 __x) { return simd_fast_normalize(__x); }
1368static simd_half16 SIMD_CFUNC simd_normalize(simd_half16 __x) { return simd_fast_normalize(__x); }
1369static simd_half32 SIMD_CFUNC simd_normalize(simd_half32 __x) { return simd_fast_normalize(__x); }
994static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_fast_normalize(__x); }1370static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_fast_normalize(__x); }
995static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_fast_normalize(__x); }1371static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_fast_normalize(__x); }
996static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_fast_normalize(__x); }1372static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_fast_normalize(__x); }
...@@ -1001,6 +1377,12 @@ static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x) { return simd_fa...@@ -1001,6 +1377,12 @@ static simd_double3 SIMD_CFUNC simd_normalize(simd_double3 __x) { return simd_fa
1001static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_fast_normalize(__x); }1377static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_fast_normalize(__x); }
1002static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_fast_normalize(__x); }1378static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_fast_normalize(__x); }
1003#else1379#else
1380static simd_half2 SIMD_CFUNC simd_normalize(simd_half2 __x) { return simd_precise_normalize(__x); }
1381static simd_half3 SIMD_CFUNC simd_normalize(simd_half3 __x) { return simd_precise_normalize(__x); }
1382static simd_half4 SIMD_CFUNC simd_normalize(simd_half4 __x) { return simd_precise_normalize(__x); }
1383static simd_half8 SIMD_CFUNC simd_normalize(simd_half8 __x) { return simd_precise_normalize(__x); }
1384static simd_half16 SIMD_CFUNC simd_normalize(simd_half16 __x) { return simd_precise_normalize(__x); }
1385static simd_half32 SIMD_CFUNC simd_normalize(simd_half32 __x) { return simd_precise_normalize(__x); }
1004static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_precise_normalize(__x); }1386static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_precise_normalize(__x); }
1005static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_precise_normalize(__x); }1387static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_precise_normalize(__x); }
1006static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_precise_normalize(__x); }1388static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x) { return simd_precise_normalize(__x); }
...@@ -1012,11 +1394,16 @@ static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_pr...@@ -1012,11 +1394,16 @@ static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_pr
1012static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_precise_normalize(__x); }1394static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_precise_normalize(__x); }
1013#endif1395#endif
10141396
1397static simd_half3 SIMD_CFUNC simd_cross(simd_half2 __x, simd_half2 __y) { return (simd_half3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; }
1398static simd_half3 SIMD_CFUNC simd_cross(simd_half3 __x, simd_half3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }
1015static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y) { return (simd_float3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; }1399static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y) { return (simd_float3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; }
1016static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }1400static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }
1017static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y) { return (simd_double3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; }1401static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y) { return (simd_double3){ 0, 0, __x.x*__y.y - __x.y*__y.x }; }
1018static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }1402static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }
10191403
1404static simd_half2 SIMD_CFUNC simd_reflect(simd_half2 __x, simd_half2 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1405static simd_half3 SIMD_CFUNC simd_reflect(simd_half3 __x, simd_half3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1406static simd_half4 SIMD_CFUNC simd_reflect(simd_half4 __x, simd_half4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1020static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n) { return __x - 2*simd_dot(__x,__n)*__n; }1407static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1021static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }1408static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1022static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }1409static simd_float4 SIMD_CFUNC simd_reflect(simd_float4 __x, simd_float4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
...@@ -1024,6 +1411,20 @@ static simd_double2 SIMD_CFUNC simd_reflect(simd_double2 __x, simd_double2 __n)...@@ -1024,6 +1411,20 @@ static simd_double2 SIMD_CFUNC simd_reflect(simd_double2 __x, simd_double2 __n)
1024static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }1411static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
1025static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }1412static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
10261413
1414#if SIMD_LIBRARY_VERSION >= 6
1415static simd_half2 SIMD_CFUNC simd_refract(simd_half2 __x, simd_half2 __n, _Float16 __eta) {
1416 const _Float16 __k = 1.0f16 - __eta*__eta*(1.0f16 - simd_dot(__x,__n)*simd_dot(__x,__n));
1417 return (__k >= 0.0f16) ? __eta*__x - (__eta*simd_dot(__x,__n) + __sqrtf16(__k))*__n : (simd_half2)0.0f16;
1418}
1419static simd_half3 SIMD_CFUNC simd_refract(simd_half3 __x, simd_half3 __n, _Float16 __eta) {
1420 const _Float16 __k = 1.0f16 - __eta*__eta*(1.0f16 - simd_dot(__x,__n)*simd_dot(__x,__n));
1421 return (__k >= 0.0f16) ? __eta*__x - (__eta*simd_dot(__x,__n) + __sqrtf16(__k))*__n : (simd_half3)0.0f16;
1422}
1423static simd_half4 SIMD_CFUNC simd_refract(simd_half4 __x, simd_half4 __n, _Float16 __eta) {
1424 const _Float16 __k = 1.0f16 - __eta*__eta*(1.0f16 - simd_dot(__x,__n)*simd_dot(__x,__n));
1425 return (__k >= 0.0f16) ? __eta*__x - (__eta*simd_dot(__x,__n) + __sqrtf16(__k))*__n : (simd_half4)0.0f16;
1426}
1427#endif // SIMD_LIBRARY_VERSION >= 6
1027static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta) {1428static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta) {
1028 const float __k = 1.0f - __eta*__eta*(1.0f - simd_dot(__x,__n)*simd_dot(__x,__n));1429 const float __k = 1.0f - __eta*__eta*(1.0f - simd_dot(__x,__n)*simd_dot(__x,__n));
1029 return (__k >= 0.0f) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_float2)0.0f;1430 return (__k >= 0.0f) ? __eta*__x - (__eta*simd_dot(__x,__n) + sqrt(__k))*__n : (simd_float2)0.0f;
...@@ -1093,6 +1494,29 @@ static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_...@@ -1093,6 +1494,29 @@ static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_
1093}1494}
1094#endif /* SIMD_LIBRARY_VERSION */1495#endif /* SIMD_LIBRARY_VERSION */
10951496
1497#if SIMD_LIBRARY_VERSION >= 6
1498static _Float16 SIMD_CFUNC simd_orient(simd_half2 __x, simd_half2 __y) {
1499 return _simd_orient_vh2(__x, __y);
1500}
1501static _Float16 SIMD_CFUNC simd_orient(simd_half3 __x, simd_half3 __y, simd_half3 __z) {
1502 return _simd_orient_vh3(__x, __y, __z);
1503}
1504
1505static _Float16 SIMD_CFUNC simd_orient(simd_half2 __a, simd_half2 __b, simd_half2 __c) {
1506 return _simd_orient_ph2(__a, __b, __c);
1507}
1508static _Float16 SIMD_CFUNC simd_orient(simd_half3 __a, simd_half3 __b, simd_half3 __c, simd_half3 __d) {
1509 return _simd_orient_ph3(__a, __b, __c, __d);
1510}
1511
1512static _Float16 SIMD_CFUNC simd_incircle(simd_half2 __x, simd_half2 __a, simd_half2 __b, simd_half2 __c) {
1513 return _simd_incircle_ph2(__x, __a, __b, __c);
1514}
1515static _Float16 SIMD_CFUNC simd_insphere(simd_half3 __x, simd_half3 __a, simd_half3 __b, simd_half3 __c, simd_half3 __d) {
1516 return _simd_insphere_ph3(__x, __a, __b, __c, __d);
1517}
1518#endif /* SIMD_LIBRARY_VERSION */
1519
1096#ifdef __cplusplus1520#ifdef __cplusplus
1097}1521}
1098#endif1522#endif
lib/libc/include/any-macos-any/simd/logic.h+110-26
...@@ -343,6 +343,30 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x);...@@ -343,6 +343,30 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x);
343 * @discussion Deprecated. Use simd_all instead. */343 * @discussion Deprecated. Use simd_all instead. */
344#define vector_all simd_all344#define vector_all simd_all
345345
346/*! @abstract For each lane in the result, selects the corresponding element
347 * of x or y according to whether the high-order bit of the corresponding
348 * lane of mask is 0 or 1, respectively. */
349static inline SIMD_CFUNC simd_half2 simd_select(simd_half2 x, simd_half2 y, simd_short2 mask);
350/*! @abstract For each lane in the result, selects the corresponding element
351 * of x or y according to whether the high-order bit of the corresponding
352 * lane of mask is 0 or 1, respectively. */
353static inline SIMD_CFUNC simd_half3 simd_select(simd_half3 x, simd_half3 y, simd_short3 mask);
354/*! @abstract For each lane in the result, selects the corresponding element
355 * of x or y according to whether the high-order bit of the corresponding
356 * lane of mask is 0 or 1, respectively. */
357static inline SIMD_CFUNC simd_half4 simd_select(simd_half4 x, simd_half4 y, simd_short4 mask);
358/*! @abstract For each lane in the result, selects the corresponding element
359 * of x or y according to whether the high-order bit of the corresponding
360 * lane of mask is 0 or 1, respectively. */
361static inline SIMD_CFUNC simd_half8 simd_select(simd_half8 x, simd_half8 y, simd_short8 mask);
362/*! @abstract For each lane in the result, selects the corresponding element
363 * of x or y according to whether the high-order bit of the corresponding
364 * lane of mask is 0 or 1, respectively. */
365static inline SIMD_CFUNC simd_half16 simd_select(simd_half16 x, simd_half16 y, simd_short16 mask);
366/*! @abstract For each lane in the result, selects the corresponding element
367 * of x or y according to whether the high-order bit of the corresponding
368 * lane of mask is 0 or 1, respectively. */
369static inline SIMD_CFUNC simd_half32 simd_select(simd_half32 x, simd_half32 y, simd_short32 mask);
346/*! @abstract For each lane in the result, selects the corresponding element370/*! @abstract For each lane in the result, selects the corresponding element
347 * of x or y according to whether the high-order bit of the corresponding371 * of x or y according to whether the high-order bit of the corresponding
348 * lane of mask is 0 or 1, respectively. */372 * lane of mask is 0 or 1, respectively. */
...@@ -489,6 +513,30 @@ static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_usho...@@ -489,6 +513,30 @@ static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_usho
489 * or y according to whether the corresponding bit of mask is 0 or 1,513 * or y according to whether the corresponding bit of mask is 0 or 1,
490 * respectively. */514 * respectively. */
491static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask);515static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask);
516/*! @abstract For each bit in the result, selects the corresponding bit of x
517 * or y according to whether the corresponding bit of mask is 0 or 1,
518 * respectively. */
519static inline SIMD_CFUNC simd_half2 simd_bitselect(simd_half2 x, simd_half2 y, simd_short2 mask);
520/*! @abstract For each bit in the result, selects the corresponding bit of x
521 * or y according to whether the corresponding bit of mask is 0 or 1,
522 * respectively. */
523static inline SIMD_CFUNC simd_half3 simd_bitselect(simd_half3 x, simd_half3 y, simd_short3 mask);
524/*! @abstract For each bit in the result, selects the corresponding bit of x
525 * or y according to whether the corresponding bit of mask is 0 or 1,
526 * respectively. */
527static inline SIMD_CFUNC simd_half4 simd_bitselect(simd_half4 x, simd_half4 y, simd_short4 mask);
528/*! @abstract For each bit in the result, selects the corresponding bit of x
529 * or y according to whether the corresponding bit of mask is 0 or 1,
530 * respectively. */
531static inline SIMD_CFUNC simd_half8 simd_bitselect(simd_half8 x, simd_half8 y, simd_short8 mask);
532/*! @abstract For each bit in the result, selects the corresponding bit of x
533 * or y according to whether the corresponding bit of mask is 0 or 1,
534 * respectively. */
535static inline SIMD_CFUNC simd_half16 simd_bitselect(simd_half16 x, simd_half16 y, simd_short16 mask);
536/*! @abstract For each bit in the result, selects the corresponding bit of x
537 * or y according to whether the corresponding bit of mask is 0 or 1,
538 * respectively. */
539static inline SIMD_CFUNC simd_half32 simd_bitselect(simd_half32 x, simd_half32 y, simd_short32 mask);
492/*! @abstract For each bit in the result, selects the corresponding bit of x540/*! @abstract For each bit in the result, selects the corresponding bit of x
493 * or y according to whether the corresponding bit of mask is 0 or 1,541 * or y according to whether the corresponding bit of mask is 0 or 1,
494 * respectively. */542 * respectively. */
...@@ -629,7 +677,7 @@ extern "C" {...@@ -629,7 +677,7 @@ extern "C" {
629static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) {677static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) {
630#if defined __SSE2__678#if defined __SSE2__
631 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3);679 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3);
632#elif defined __arm64__680#elif defined __arm64__ || defined __aarch64__
633 return simd_any(x.xyxy);681 return simd_any(x.xyxy);
634#else682#else
635 union { uint16_t i; simd_char2 v; } u = { .v = x };683 union { uint16_t i; simd_char2 v; } u = { .v = x };
...@@ -639,7 +687,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) {...@@ -639,7 +687,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) {
639static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) {687static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) {
640#if defined __SSE2__688#if defined __SSE2__
641 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7);689 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7);
642#elif defined __arm64__690#elif defined __arm64__ || defined __aarch64__
643 return simd_any(x.xyzz);691 return simd_any(x.xyzz);
644#else692#else
645 union { uint32_t i; simd_char3 v; } u = { .v = x };693 union { uint32_t i; simd_char3 v; } u = { .v = x };
...@@ -649,7 +697,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) {...@@ -649,7 +697,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) {
649static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) {697static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) {
650#if defined __SSE2__698#if defined __SSE2__
651 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf);699 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf);
652#elif defined __arm64__700#elif defined __arm64__ || defined __aarch64__
653 return simd_any(x.xyzwxyzw);701 return simd_any(x.xyzwxyzw);
654#else702#else
655 union { uint32_t i; simd_char4 v; } u = { .v = x };703 union { uint32_t i; simd_char4 v; } u = { .v = x };
...@@ -659,7 +707,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) {...@@ -659,7 +707,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) {
659static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) {707static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) {
660#if defined __SSE2__708#if defined __SSE2__
661 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff);709 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff);
662#elif defined __arm64__710#elif defined __arm64__ || defined __aarch64__
663 return vmaxv_u8(x) & 0x80;711 return vmaxv_u8(x) & 0x80;
664#else712#else
665 union { uint64_t i; simd_char8 v; } u = { .v = x };713 union { uint64_t i; simd_char8 v; } u = { .v = x };
...@@ -669,7 +717,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) {...@@ -669,7 +717,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) {
669static inline SIMD_CFUNC simd_bool simd_any(simd_char16 x) {717static inline SIMD_CFUNC simd_bool simd_any(simd_char16 x) {
670#if defined __SSE2__718#if defined __SSE2__
671 return _mm_movemask_epi8((__m128i)x);719 return _mm_movemask_epi8((__m128i)x);
672#elif defined __arm64__720#elif defined __arm64__ || defined __aarch64__
673 return vmaxvq_u8(x) & 0x80;721 return vmaxvq_u8(x) & 0x80;
674#else722#else
675 return simd_any(x.lo | x.hi);723 return simd_any(x.lo | x.hi);
...@@ -709,7 +757,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x) {...@@ -709,7 +757,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x) {
709static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) {757static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) {
710#if defined __SSE2__758#if defined __SSE2__
711 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa);759 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa);
712#elif defined __arm64__760#elif defined __arm64__ || defined __aarch64__
713 return simd_any(x.xyxy);761 return simd_any(x.xyxy);
714#else762#else
715 union { uint32_t i; simd_short2 v; } u = { .v = x };763 union { uint32_t i; simd_short2 v; } u = { .v = x };
...@@ -719,7 +767,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) {...@@ -719,7 +767,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) {
719static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) {767static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) {
720#if defined __SSE2__768#if defined __SSE2__
721 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a);769 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a);
722#elif defined __arm64__770#elif defined __arm64__ || defined __aarch64__
723 return simd_any(x.xyzz);771 return simd_any(x.xyzz);
724#else772#else
725 union { uint64_t i; simd_short3 v; } u = { .v = x };773 union { uint64_t i; simd_short3 v; } u = { .v = x };
...@@ -729,7 +777,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) {...@@ -729,7 +777,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) {
729static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) {777static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) {
730#if defined __SSE2__778#if defined __SSE2__
731 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa);779 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa);
732#elif defined __arm64__780#elif defined __arm64__ || defined __aarch64__
733 return vmaxv_u16(x) & 0x8000;781 return vmaxv_u16(x) & 0x8000;
734#else782#else
735 union { uint64_t i; simd_short4 v; } u = { .v = x };783 union { uint64_t i; simd_short4 v; } u = { .v = x };
...@@ -739,7 +787,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) {...@@ -739,7 +787,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) {
739static inline SIMD_CFUNC simd_bool simd_any(simd_short8 x) {787static inline SIMD_CFUNC simd_bool simd_any(simd_short8 x) {
740#if defined __SSE2__788#if defined __SSE2__
741 return (_mm_movemask_epi8((__m128i)x) & 0xaaaa);789 return (_mm_movemask_epi8((__m128i)x) & 0xaaaa);
742#elif defined __arm64__790#elif defined __arm64__ || defined __aarch64__
743 return vmaxvq_u16(x) & 0x8000;791 return vmaxvq_u16(x) & 0x8000;
744#else792#else
745 return simd_any(x.lo | x.hi);793 return simd_any(x.lo | x.hi);
...@@ -776,7 +824,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x) {...@@ -776,7 +824,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x) {
776static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) {824static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) {
777#if defined __SSE2__825#if defined __SSE2__
778 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3);826 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3);
779#elif defined __arm64__827#elif defined __arm64__ || defined __aarch64__
780 return vmaxv_u32(x) & 0x80000000;828 return vmaxv_u32(x) & 0x80000000;
781#else829#else
782 union { uint64_t i; simd_int2 v; } u = { .v = x };830 union { uint64_t i; simd_int2 v; } u = { .v = x };
...@@ -786,7 +834,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) {...@@ -786,7 +834,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) {
786static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) {834static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) {
787#if defined __SSE2__835#if defined __SSE2__
788 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7);836 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7);
789#elif defined __arm64__837#elif defined __arm64__ || defined __aarch64__
790 return simd_any(x.xyzz);838 return simd_any(x.xyzz);
791#else839#else
792 return (x.x | x.y | x.z) & 0x80000000;840 return (x.x | x.y | x.z) & 0x80000000;
...@@ -795,7 +843,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) {...@@ -795,7 +843,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) {
795static inline SIMD_CFUNC simd_bool simd_any(simd_int4 x) {843static inline SIMD_CFUNC simd_bool simd_any(simd_int4 x) {
796#if defined __SSE2__844#if defined __SSE2__
797 return _mm_movemask_ps((__m128)x);845 return _mm_movemask_ps((__m128)x);
798#elif defined __arm64__846#elif defined __arm64__ || defined __aarch64__
799 return vmaxvq_u32(x) & 0x80000000;847 return vmaxvq_u32(x) & 0x80000000;
800#else848#else
801 return simd_any(x.lo | x.hi);849 return simd_any(x.lo | x.hi);
...@@ -829,7 +877,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x) {...@@ -829,7 +877,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x) {
829static inline SIMD_CFUNC simd_bool simd_any(simd_long2 x) {877static inline SIMD_CFUNC simd_bool simd_any(simd_long2 x) {
830#if defined __SSE2__878#if defined __SSE2__
831 return _mm_movemask_pd((__m128d)x);879 return _mm_movemask_pd((__m128d)x);
832#elif defined __arm64__880#elif defined __arm64__ || defined __aarch64__
833 return (x.x | x.y) & 0x8000000000000000U;881 return (x.x | x.y) & 0x8000000000000000U;
834#else882#else
835 return (x.x | x.y) & 0x8000000000000000U;883 return (x.x | x.y) & 0x8000000000000000U;
...@@ -868,7 +916,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x) {...@@ -868,7 +916,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x) {
868static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) {916static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) {
869#if defined __SSE2__917#if defined __SSE2__
870 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3) == 0x3;918 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3) == 0x3;
871#elif defined __arm64__919#elif defined __arm64__ || defined __aarch64__
872 return simd_all(x.xyxy);920 return simd_all(x.xyxy);
873#else921#else
874 union { uint16_t i; simd_char2 v; } u = { .v = x };922 union { uint16_t i; simd_char2 v; } u = { .v = x };
...@@ -878,7 +926,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) {...@@ -878,7 +926,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) {
878static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) {926static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) {
879#if defined __SSE2__927#if defined __SSE2__
880 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7) == 0x7;928 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7) == 0x7;
881#elif defined __arm64__929#elif defined __arm64__ || defined __aarch64__
882 return simd_all(x.xyzz);930 return simd_all(x.xyzz);
883#else931#else
884 union { uint32_t i; simd_char3 v; } u = { .v = x };932 union { uint32_t i; simd_char3 v; } u = { .v = x };
...@@ -888,7 +936,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) {...@@ -888,7 +936,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) {
888static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) {936static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) {
889#if defined __SSE2__937#if defined __SSE2__
890 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf) == 0xf;938 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf) == 0xf;
891#elif defined __arm64__939#elif defined __arm64__ || defined __aarch64__
892 return simd_all(x.xyzwxyzw);940 return simd_all(x.xyzwxyzw);
893#else941#else
894 union { uint32_t i; simd_char4 v; } u = { .v = x };942 union { uint32_t i; simd_char4 v; } u = { .v = x };
...@@ -898,7 +946,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) {...@@ -898,7 +946,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) {
898static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) {946static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) {
899#if defined __SSE2__947#if defined __SSE2__
900 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff) == 0xff;948 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff) == 0xff;
901#elif defined __arm64__949#elif defined __arm64__ || defined __aarch64__
902 return vminv_u8(x) & 0x80;950 return vminv_u8(x) & 0x80;
903#else951#else
904 union { uint64_t i; simd_char8 v; } u = { .v = x };952 union { uint64_t i; simd_char8 v; } u = { .v = x };
...@@ -908,7 +956,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) {...@@ -908,7 +956,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) {
908static inline SIMD_CFUNC simd_bool simd_all(simd_char16 x) {956static inline SIMD_CFUNC simd_bool simd_all(simd_char16 x) {
909#if defined __SSE2__957#if defined __SSE2__
910 return _mm_movemask_epi8((__m128i)x) == 0xffff;958 return _mm_movemask_epi8((__m128i)x) == 0xffff;
911#elif defined __arm64__959#elif defined __arm64__ || defined __aarch64__
912 return vminvq_u8(x) & 0x80;960 return vminvq_u8(x) & 0x80;
913#else961#else
914 return simd_all(x.lo & x.hi);962 return simd_all(x.lo & x.hi);
...@@ -948,7 +996,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x) {...@@ -948,7 +996,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x) {
948static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) {996static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) {
949#if defined __SSE2__997#if defined __SSE2__
950 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa) == 0xa;998 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa) == 0xa;
951#elif defined __arm64__999#elif defined __arm64__ || defined __aarch64__
952 return simd_all(x.xyxy);1000 return simd_all(x.xyxy);
953#else1001#else
954 union { uint32_t i; simd_short2 v; } u = { .v = x };1002 union { uint32_t i; simd_short2 v; } u = { .v = x };
...@@ -958,7 +1006,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) {...@@ -958,7 +1006,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) {
958static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) {1006static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) {
959#if defined __SSE2__1007#if defined __SSE2__
960 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a) == 0x2a;1008 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a) == 0x2a;
961#elif defined __arm64__1009#elif defined __arm64__ || defined __aarch64__
962 return simd_all(x.xyzz);1010 return simd_all(x.xyzz);
963#else1011#else
964 union { uint64_t i; simd_short3 v; } u = { .v = x };1012 union { uint64_t i; simd_short3 v; } u = { .v = x };
...@@ -968,7 +1016,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) {...@@ -968,7 +1016,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) {
968static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) {1016static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) {
969#if defined __SSE2__1017#if defined __SSE2__
970 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa) == 0xaa;1018 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa) == 0xaa;
971#elif defined __arm64__1019#elif defined __arm64__ || defined __aarch64__
972 return vminv_u16(x) & 0x8000;1020 return vminv_u16(x) & 0x8000;
973#else1021#else
974 union { uint64_t i; simd_short4 v; } u = { .v = x };1022 union { uint64_t i; simd_short4 v; } u = { .v = x };
...@@ -978,7 +1026,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) {...@@ -978,7 +1026,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) {
978static inline SIMD_CFUNC simd_bool simd_all(simd_short8 x) {1026static inline SIMD_CFUNC simd_bool simd_all(simd_short8 x) {
979#if defined __SSE2__1027#if defined __SSE2__
980 return (_mm_movemask_epi8((__m128i)x) & 0xaaaa) == 0xaaaa;1028 return (_mm_movemask_epi8((__m128i)x) & 0xaaaa) == 0xaaaa;
981#elif defined __arm64__1029#elif defined __arm64__ || defined __aarch64__
982 return vminvq_u16(x) & 0x8000;1030 return vminvq_u16(x) & 0x8000;
983#else1031#else
984 return simd_all(x.lo & x.hi);1032 return simd_all(x.lo & x.hi);
...@@ -1015,7 +1063,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x) {...@@ -1015,7 +1063,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x) {
1015static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) {1063static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) {
1016#if defined __SSE2__1064#if defined __SSE2__
1017 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3) == 0x3;1065 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3) == 0x3;
1018#elif defined __arm64__1066#elif defined __arm64__ || defined __aarch64__
1019 return vminv_u32(x) & 0x80000000;1067 return vminv_u32(x) & 0x80000000;
1020#else1068#else
1021 union { uint64_t i; simd_int2 v; } u = { .v = x };1069 union { uint64_t i; simd_int2 v; } u = { .v = x };
...@@ -1025,7 +1073,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) {...@@ -1025,7 +1073,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) {
1025static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) {1073static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) {
1026#if defined __SSE2__1074#if defined __SSE2__
1027 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7) == 0x7;1075 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7) == 0x7;
1028#elif defined __arm64__1076#elif defined __arm64__ || defined __aarch64__
1029 return simd_all(x.xyzz);1077 return simd_all(x.xyzz);
1030#else1078#else
1031 return (x.x & x.y & x.z) & 0x80000000;1079 return (x.x & x.y & x.z) & 0x80000000;
...@@ -1034,7 +1082,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) {...@@ -1034,7 +1082,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) {
1034static inline SIMD_CFUNC simd_bool simd_all(simd_int4 x) {1082static inline SIMD_CFUNC simd_bool simd_all(simd_int4 x) {
1035#if defined __SSE2__1083#if defined __SSE2__
1036 return _mm_movemask_ps((__m128)x) == 0xf;1084 return _mm_movemask_ps((__m128)x) == 0xf;
1037#elif defined __arm64__1085#elif defined __arm64__ || defined __aarch64__
1038 return vminvq_u32(x) & 0x80000000;1086 return vminvq_u32(x) & 0x80000000;
1039#else1087#else
1040 return simd_all(x.lo & x.hi);1088 return simd_all(x.lo & x.hi);
...@@ -1068,7 +1116,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x) {...@@ -1068,7 +1116,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x) {
1068static inline SIMD_CFUNC simd_bool simd_all(simd_long2 x) {1116static inline SIMD_CFUNC simd_bool simd_all(simd_long2 x) {
1069#if defined __SSE2__1117#if defined __SSE2__
1070 return _mm_movemask_pd((__m128d)x) == 0x3;1118 return _mm_movemask_pd((__m128d)x) == 0x3;
1071#elif defined __arm64__1119#elif defined __arm64__ || defined __aarch64__
1072 return (x.x & x.y) & 0x8000000000000000U;1120 return (x.x & x.y) & 0x8000000000000000U;
1073#else1121#else
1074 return (x.x & x.y) & 0x8000000000000000U;1122 return (x.x & x.y) & 0x8000000000000000U;
...@@ -1104,6 +1152,24 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x) {...@@ -1104,6 +1152,24 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x) {
1104 return simd_all((simd_long8)x);1152 return simd_all((simd_long8)x);
1105}1153}
1106 1154
1155static inline SIMD_CFUNC simd_half2 simd_select(simd_half2 x, simd_half2 y, simd_short2 mask) {
1156 return simd_make_half2(simd_select(simd_make_half8_undef(x), simd_make_half8_undef(y), simd_make_short8_undef(mask)));
1157}
1158static inline SIMD_CFUNC simd_half3 simd_select(simd_half3 x, simd_half3 y, simd_short3 mask) {
1159 return simd_make_half3(simd_select(simd_make_half8_undef(x), simd_make_half8_undef(y), simd_make_short8_undef(mask)));
1160}
1161static inline SIMD_CFUNC simd_half4 simd_select(simd_half4 x, simd_half4 y, simd_short4 mask) {
1162 return simd_make_half4(simd_select(simd_make_half8_undef(x), simd_make_half8_undef(y), simd_make_short8_undef(mask)));
1163}
1164static inline SIMD_CFUNC simd_half8 simd_select(simd_half8 x, simd_half8 y, simd_short8 mask) {
1165 return simd_bitselect(x, y, mask >> 15);
1166}
1167static inline SIMD_CFUNC simd_half16 simd_select(simd_half16 x, simd_half16 y, simd_short16 mask) {
1168 return simd_bitselect(x, y, mask >> 15);
1169}
1170static inline SIMD_CFUNC simd_half32 simd_select(simd_half32 x, simd_half32 y, simd_short32 mask) {
1171 return simd_bitselect(x, y, mask >> 15);
1172}
1107static inline SIMD_CFUNC simd_float2 simd_select(simd_float2 x, simd_float2 y, simd_int2 mask) {1173static inline SIMD_CFUNC simd_float2 simd_select(simd_float2 x, simd_float2 y, simd_int2 mask) {
1108 return simd_make_float2(simd_select(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_int4_undef(mask)));1174 return simd_make_float2(simd_select(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_int4_undef(mask)));
1109}1175}
...@@ -1226,6 +1292,24 @@ static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_usho...@@ -1226,6 +1292,24 @@ static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_usho
1226static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask) {1292static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask) {
1227 return (simd_ushort32)simd_bitselect((simd_short32)x, (simd_short32)y, mask);1293 return (simd_ushort32)simd_bitselect((simd_short32)x, (simd_short32)y, mask);
1228}1294}
1295static inline SIMD_CFUNC simd_half2 simd_bitselect(simd_half2 x, simd_half2 y, simd_short2 mask) {
1296 return (simd_half2)simd_bitselect((simd_short2)x, (simd_short2)y, mask);
1297}
1298static inline SIMD_CFUNC simd_half3 simd_bitselect(simd_half3 x, simd_half3 y, simd_short3 mask) {
1299 return (simd_half3)simd_bitselect((simd_short3)x, (simd_short3)y, mask);
1300}
1301static inline SIMD_CFUNC simd_half4 simd_bitselect(simd_half4 x, simd_half4 y, simd_short4 mask) {
1302 return (simd_half4)simd_bitselect((simd_short4)x, (simd_short4)y, mask);
1303}
1304static inline SIMD_CFUNC simd_half8 simd_bitselect(simd_half8 x, simd_half8 y, simd_short8 mask) {
1305 return (simd_half8)simd_bitselect((simd_short8)x, (simd_short8)y, mask);
1306}
1307static inline SIMD_CFUNC simd_half16 simd_bitselect(simd_half16 x, simd_half16 y, simd_short16 mask) {
1308 return (simd_half16)simd_bitselect((simd_short16)x, (simd_short16)y, mask);
1309}
1310static inline SIMD_CFUNC simd_half32 simd_bitselect(simd_half32 x, simd_half32 y, simd_short32 mask) {
1311 return (simd_half32)simd_bitselect((simd_short32)x, (simd_short32)y, mask);
1312}
1229static inline SIMD_CFUNC simd_int2 simd_bitselect(simd_int2 x, simd_int2 y, simd_int2 mask) {1313static inline SIMD_CFUNC simd_int2 simd_bitselect(simd_int2 x, simd_int2 y, simd_int2 mask) {
1230 return (x & ~mask) | (y & mask);1314 return (x & ~mask) | (y & mask);
1231}1315}
lib/libc/include/any-macos-any/simd/math.h+634-35
...@@ -1141,6 +1141,24 @@ static inline SIMD_NONCONST void __tg_sincospi(simd_double4 x, simd_double4 *sin...@@ -1141,6 +1141,24 @@ static inline SIMD_NONCONST void __tg_sincospi(simd_double4 x, simd_double4 *sin
1141static inline SIMD_NONCONST void __tg_sincospi(simd_double8 x, simd_double8 *sinp, simd_double8 *cosp);1141static inline SIMD_NONCONST void __tg_sincospi(simd_double8 x, simd_double8 *sinp, simd_double8 *cosp);
11421142
1143#endif1143#endif
1144/*! @abstract Do not call this function; instead use `isfinite` in C and
1145 * Objective-C, and `simd::isfinite` in C++. */
1146static inline SIMD_CFUNC simd_short2 __tg_isfinite(simd_half2 x);
1147/*! @abstract Do not call this function; instead use `isfinite` in C and
1148 * Objective-C, and `simd::isfinite` in C++. */
1149static inline SIMD_CFUNC simd_short3 __tg_isfinite(simd_half3 x);
1150/*! @abstract Do not call this function; instead use `isfinite` in C and
1151 * Objective-C, and `simd::isfinite` in C++. */
1152static inline SIMD_CFUNC simd_short4 __tg_isfinite(simd_half4 x);
1153/*! @abstract Do not call this function; instead use `isfinite` in C and
1154 * Objective-C, and `simd::isfinite` in C++. */
1155static inline SIMD_CFUNC simd_short8 __tg_isfinite(simd_half8 x);
1156/*! @abstract Do not call this function; instead use `isfinite` in C and
1157 * Objective-C, and `simd::isfinite` in C++. */
1158static inline SIMD_CFUNC simd_short16 __tg_isfinite(simd_half16 x);
1159/*! @abstract Do not call this function; instead use `isfinite` in C and
1160 * Objective-C, and `simd::isfinite` in C++. */
1161static inline SIMD_CFUNC simd_short32 __tg_isfinite(simd_half32 x);
1144/*! @abstract Do not call this function; instead use `isfinite` in C and1162/*! @abstract Do not call this function; instead use `isfinite` in C and
1145 * Objective-C, and `simd::isfinite` in C++. */1163 * Objective-C, and `simd::isfinite` in C++. */
1146static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x);1164static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x);
...@@ -1169,6 +1187,24 @@ static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x);...@@ -1169,6 +1187,24 @@ static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x);
1169 * Objective-C, and `simd::isfinite` in C++. */1187 * Objective-C, and `simd::isfinite` in C++. */
1170static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x);1188static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x);
11711189
1190/*! @abstract Do not call this function; instead use `isinf` in C and
1191 * Objective-C, and `simd::isinf` in C++. */
1192static inline SIMD_CFUNC simd_short2 __tg_isinf(simd_half2 x);
1193/*! @abstract Do not call this function; instead use `isinf` in C and
1194 * Objective-C, and `simd::isinf` in C++. */
1195static inline SIMD_CFUNC simd_short3 __tg_isinf(simd_half3 x);
1196/*! @abstract Do not call this function; instead use `isinf` in C and
1197 * Objective-C, and `simd::isinf` in C++. */
1198static inline SIMD_CFUNC simd_short4 __tg_isinf(simd_half4 x);
1199/*! @abstract Do not call this function; instead use `isinf` in C and
1200 * Objective-C, and `simd::isinf` in C++. */
1201static inline SIMD_CFUNC simd_short8 __tg_isinf(simd_half8 x);
1202/*! @abstract Do not call this function; instead use `isinf` in C and
1203 * Objective-C, and `simd::isinf` in C++. */
1204static inline SIMD_CFUNC simd_short16 __tg_isinf(simd_half16 x);
1205/*! @abstract Do not call this function; instead use `isinf` in C and
1206 * Objective-C, and `simd::isinf` in C++. */
1207static inline SIMD_CFUNC simd_short32 __tg_isinf(simd_half32 x);
1172/*! @abstract Do not call this function; instead use `isinf` in C and1208/*! @abstract Do not call this function; instead use `isinf` in C and
1173 * Objective-C, and `simd::isinf` in C++. */1209 * Objective-C, and `simd::isinf` in C++. */
1174static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x);1210static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x);
...@@ -1197,6 +1233,24 @@ static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x);...@@ -1197,6 +1233,24 @@ static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x);
1197 * Objective-C, and `simd::isinf` in C++. */1233 * Objective-C, and `simd::isinf` in C++. */
1198static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x);1234static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x);
11991235
1236/*! @abstract Do not call this function; instead use `isnan` in C and
1237 * Objective-C, and `simd::isnan` in C++. */
1238static inline SIMD_CFUNC simd_short2 __tg_isnan(simd_half2 x);
1239/*! @abstract Do not call this function; instead use `isnan` in C and
1240 * Objective-C, and `simd::isnan` in C++. */
1241static inline SIMD_CFUNC simd_short3 __tg_isnan(simd_half3 x);
1242/*! @abstract Do not call this function; instead use `isnan` in C and
1243 * Objective-C, and `simd::isnan` in C++. */
1244static inline SIMD_CFUNC simd_short4 __tg_isnan(simd_half4 x);
1245/*! @abstract Do not call this function; instead use `isnan` in C and
1246 * Objective-C, and `simd::isnan` in C++. */
1247static inline SIMD_CFUNC simd_short8 __tg_isnan(simd_half8 x);
1248/*! @abstract Do not call this function; instead use `isnan` in C and
1249 * Objective-C, and `simd::isnan` in C++. */
1250static inline SIMD_CFUNC simd_short16 __tg_isnan(simd_half16 x);
1251/*! @abstract Do not call this function; instead use `isnan` in C and
1252 * Objective-C, and `simd::isnan` in C++. */
1253static inline SIMD_CFUNC simd_short32 __tg_isnan(simd_half32 x);
1200/*! @abstract Do not call this function; instead use `isnan` in C and1254/*! @abstract Do not call this function; instead use `isnan` in C and
1201 * Objective-C, and `simd::isnan` in C++. */1255 * Objective-C, and `simd::isnan` in C++. */
1202static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x);1256static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x);
...@@ -1225,6 +1279,24 @@ static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x);...@@ -1225,6 +1279,24 @@ static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x);
1225 * Objective-C, and `simd::isnan` in C++. */1279 * Objective-C, and `simd::isnan` in C++. */
1226static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x);1280static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x);
12271281
1282/*! @abstract Do not call this function; instead use `isnormal` in C and
1283 * Objective-C, and `simd::isnormal` in C++. */
1284static inline SIMD_CFUNC simd_short2 __tg_isnormal(simd_half2 x);
1285/*! @abstract Do not call this function; instead use `isnormal` in C and
1286 * Objective-C, and `simd::isnormal` in C++. */
1287static inline SIMD_CFUNC simd_short3 __tg_isnormal(simd_half3 x);
1288/*! @abstract Do not call this function; instead use `isnormal` in C and
1289 * Objective-C, and `simd::isnormal` in C++. */
1290static inline SIMD_CFUNC simd_short4 __tg_isnormal(simd_half4 x);
1291/*! @abstract Do not call this function; instead use `isnormal` in C and
1292 * Objective-C, and `simd::isnormal` in C++. */
1293static inline SIMD_CFUNC simd_short8 __tg_isnormal(simd_half8 x);
1294/*! @abstract Do not call this function; instead use `isnormal` in C and
1295 * Objective-C, and `simd::isnormal` in C++. */
1296static inline SIMD_CFUNC simd_short16 __tg_isnormal(simd_half16 x);
1297/*! @abstract Do not call this function; instead use `isnormal` in C and
1298 * Objective-C, and `simd::isnormal` in C++. */
1299static inline SIMD_CFUNC simd_short32 __tg_isnormal(simd_half32 x);
1228/*! @abstract Do not call this function; instead use `isnormal` in C and1300/*! @abstract Do not call this function; instead use `isnormal` in C and
1229 * Objective-C, and `simd::isnormal` in C++. */1301 * Objective-C, and `simd::isnormal` in C++. */
1230static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x);1302static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x);
...@@ -1253,6 +1325,120 @@ static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x);...@@ -1253,6 +1325,120 @@ static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x);
1253 * Objective-C, and `simd::isnormal` in C++. */1325 * Objective-C, and `simd::isnormal` in C++. */
1254static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x);1326static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x);
12551327
1328/*! @abstract Do not call this function; instead use `fabs` in C and
1329 * Objective-C, and `simd::fabs` in C++. */
1330static inline SIMD_CFUNC simd_half2 __tg_fabs(simd_half2 x);
1331/*! @abstract Do not call this function; instead use `fabs` in C and
1332 * Objective-C, and `simd::fabs` in C++. */
1333static inline SIMD_CFUNC simd_half3 __tg_fabs(simd_half3 x);
1334/*! @abstract Do not call this function; instead use `fabs` in C and
1335 * Objective-C, and `simd::fabs` in C++. */
1336static inline SIMD_CFUNC simd_half4 __tg_fabs(simd_half4 x);
1337/*! @abstract Do not call this function; instead use `fabs` in C and
1338 * Objective-C, and `simd::fabs` in C++. */
1339static inline SIMD_CFUNC simd_half8 __tg_fabs(simd_half8 x);
1340/*! @abstract Do not call this function; instead use `fabs` in C and
1341 * Objective-C, and `simd::fabs` in C++. */
1342static inline SIMD_CFUNC simd_half16 __tg_fabs(simd_half16 x);
1343/*! @abstract Do not call this function; instead use `fabs` in C and
1344 * Objective-C, and `simd::fabs` in C++. */
1345static inline SIMD_CFUNC simd_half32 __tg_fabs(simd_half32 x);
1346
1347/*! @abstract Do not call this function; instead use `sqrt` in C and
1348 * Objective-C, and `simd::sqrt` in C++. */
1349static inline SIMD_CFUNC simd_half2 __tg_sqrt(simd_half2 x);
1350/*! @abstract Do not call this function; instead use `sqrt` in C and
1351 * Objective-C, and `simd::sqrt` in C++. */
1352static inline SIMD_CFUNC simd_half3 __tg_sqrt(simd_half3 x);
1353/*! @abstract Do not call this function; instead use `sqrt` in C and
1354 * Objective-C, and `simd::sqrt` in C++. */
1355static inline SIMD_CFUNC simd_half4 __tg_sqrt(simd_half4 x);
1356/*! @abstract Do not call this function; instead use `sqrt` in C and
1357 * Objective-C, and `simd::sqrt` in C++. */
1358static inline SIMD_CFUNC simd_half8 __tg_sqrt(simd_half8 x);
1359/*! @abstract Do not call this function; instead use `sqrt` in C and
1360 * Objective-C, and `simd::sqrt` in C++. */
1361static inline SIMD_CFUNC simd_half16 __tg_sqrt(simd_half16 x);
1362/*! @abstract Do not call this function; instead use `sqrt` in C and
1363 * Objective-C, and `simd::sqrt` in C++. */
1364static inline SIMD_CFUNC simd_half32 __tg_sqrt(simd_half32 x);
1365
1366/*! @abstract Do not call this function; instead use `ceil` in C and
1367 * Objective-C, and `simd::ceil` in C++. */
1368static inline SIMD_CFUNC simd_half2 __tg_ceil(simd_half2 x);
1369/*! @abstract Do not call this function; instead use `ceil` in C and
1370 * Objective-C, and `simd::ceil` in C++. */
1371static inline SIMD_CFUNC simd_half3 __tg_ceil(simd_half3 x);
1372/*! @abstract Do not call this function; instead use `ceil` in C and
1373 * Objective-C, and `simd::ceil` in C++. */
1374static inline SIMD_CFUNC simd_half4 __tg_ceil(simd_half4 x);
1375/*! @abstract Do not call this function; instead use `ceil` in C and
1376 * Objective-C, and `simd::ceil` in C++. */
1377static inline SIMD_CFUNC simd_half8 __tg_ceil(simd_half8 x);
1378/*! @abstract Do not call this function; instead use `ceil` in C and
1379 * Objective-C, and `simd::ceil` in C++. */
1380static inline SIMD_CFUNC simd_half16 __tg_ceil(simd_half16 x);
1381/*! @abstract Do not call this function; instead use `ceil` in C and
1382 * Objective-C, and `simd::ceil` in C++. */
1383static inline SIMD_CFUNC simd_half32 __tg_ceil(simd_half32 x);
1384
1385/*! @abstract Do not call this function; instead use `floor` in C and
1386 * Objective-C, and `simd::floor` in C++. */
1387static inline SIMD_CFUNC simd_half2 __tg_floor(simd_half2 x);
1388/*! @abstract Do not call this function; instead use `floor` in C and
1389 * Objective-C, and `simd::floor` in C++. */
1390static inline SIMD_CFUNC simd_half3 __tg_floor(simd_half3 x);
1391/*! @abstract Do not call this function; instead use `floor` in C and
1392 * Objective-C, and `simd::floor` in C++. */
1393static inline SIMD_CFUNC simd_half4 __tg_floor(simd_half4 x);
1394/*! @abstract Do not call this function; instead use `floor` in C and
1395 * Objective-C, and `simd::floor` in C++. */
1396static inline SIMD_CFUNC simd_half8 __tg_floor(simd_half8 x);
1397/*! @abstract Do not call this function; instead use `floor` in C and
1398 * Objective-C, and `simd::floor` in C++. */
1399static inline SIMD_CFUNC simd_half16 __tg_floor(simd_half16 x);
1400/*! @abstract Do not call this function; instead use `floor` in C and
1401 * Objective-C, and `simd::floor` in C++. */
1402static inline SIMD_CFUNC simd_half32 __tg_floor(simd_half32 x);
1403
1404/*! @abstract Do not call this function; instead use `rint` in C and
1405 * Objective-C, and `simd::rint` in C++. */
1406static inline SIMD_CFUNC simd_half2 __tg_rint(simd_half2 x);
1407/*! @abstract Do not call this function; instead use `rint` in C and
1408 * Objective-C, and `simd::rint` in C++. */
1409static inline SIMD_CFUNC simd_half3 __tg_rint(simd_half3 x);
1410/*! @abstract Do not call this function; instead use `rint` in C and
1411 * Objective-C, and `simd::rint` in C++. */
1412static inline SIMD_CFUNC simd_half4 __tg_rint(simd_half4 x);
1413/*! @abstract Do not call this function; instead use `rint` in C and
1414 * Objective-C, and `simd::rint` in C++. */
1415static inline SIMD_CFUNC simd_half8 __tg_rint(simd_half8 x);
1416/*! @abstract Do not call this function; instead use `rint` in C and
1417 * Objective-C, and `simd::rint` in C++. */
1418static inline SIMD_CFUNC simd_half16 __tg_rint(simd_half16 x);
1419/*! @abstract Do not call this function; instead use `rint` in C and
1420 * Objective-C, and `simd::rint` in C++. */
1421static inline SIMD_CFUNC simd_half32 __tg_rint(simd_half32 x);
1422
1423/*! @abstract Do not call this function; instead use `trunc` in C and
1424 * Objective-C, and `simd::trunc` in C++. */
1425static inline SIMD_CFUNC simd_half2 __tg_trunc(simd_half2 x);
1426/*! @abstract Do not call this function; instead use `trunc` in C and
1427 * Objective-C, and `simd::trunc` in C++. */
1428static inline SIMD_CFUNC simd_half3 __tg_trunc(simd_half3 x);
1429/*! @abstract Do not call this function; instead use `trunc` in C and
1430 * Objective-C, and `simd::trunc` in C++. */
1431static inline SIMD_CFUNC simd_half4 __tg_trunc(simd_half4 x);
1432/*! @abstract Do not call this function; instead use `trunc` in C and
1433 * Objective-C, and `simd::trunc` in C++. */
1434static inline SIMD_CFUNC simd_half8 __tg_trunc(simd_half8 x);
1435/*! @abstract Do not call this function; instead use `trunc` in C and
1436 * Objective-C, and `simd::trunc` in C++. */
1437static inline SIMD_CFUNC simd_half16 __tg_trunc(simd_half16 x);
1438/*! @abstract Do not call this function; instead use `trunc` in C and
1439 * Objective-C, and `simd::trunc` in C++. */
1440static inline SIMD_CFUNC simd_half32 __tg_trunc(simd_half32 x);
1441
12561442
1257/*! @abstract Do not call this function; instead use `atan2` in C and1443/*! @abstract Do not call this function; instead use `atan2` in C and
1258 * Objective-C, and `simd::atan2` in C++. */1444 * Objective-C, and `simd::atan2` in C++. */
...@@ -1534,6 +1720,63 @@ static inline SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y);...@@ -1534,6 +1720,63 @@ static inline SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y);
1534 * Objective-C, and `simd::fmin` in C++. */1720 * Objective-C, and `simd::fmin` in C++. */
1535static inline SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y);1721static inline SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y);
15361722
1723/*! @abstract Do not call this function; instead use `fmin` in C and
1724 * Objective-C, and `simd::fmin` in C++. */
1725static inline SIMD_CFUNC simd_half2 __tg_fmin(simd_half2 x, simd_half2 y);
1726/*! @abstract Do not call this function; instead use `fmin` in C and
1727 * Objective-C, and `simd::fmin` in C++. */
1728static inline SIMD_CFUNC simd_half3 __tg_fmin(simd_half3 x, simd_half3 y);
1729/*! @abstract Do not call this function; instead use `fmin` in C and
1730 * Objective-C, and `simd::fmin` in C++. */
1731static inline SIMD_CFUNC simd_half4 __tg_fmin(simd_half4 x, simd_half4 y);
1732/*! @abstract Do not call this function; instead use `fmin` in C and
1733 * Objective-C, and `simd::fmin` in C++. */
1734static inline SIMD_CFUNC simd_half8 __tg_fmin(simd_half8 x, simd_half8 y);
1735/*! @abstract Do not call this function; instead use `fmin` in C and
1736 * Objective-C, and `simd::fmin` in C++. */
1737static inline SIMD_CFUNC simd_half16 __tg_fmin(simd_half16 x, simd_half16 y);
1738/*! @abstract Do not call this function; instead use `fmin` in C and
1739 * Objective-C, and `simd::fmin` in C++. */
1740static inline SIMD_CFUNC simd_half32 __tg_fmin(simd_half32 x, simd_half32 y);
1741
1742/*! @abstract Do not call this function; instead use `fmax` in C and
1743 * Objective-C, and `simd::fmax` in C++. */
1744static inline SIMD_CFUNC simd_half2 __tg_fmax(simd_half2 x, simd_half2 y);
1745/*! @abstract Do not call this function; instead use `fmax` in C and
1746 * Objective-C, and `simd::fmax` in C++. */
1747static inline SIMD_CFUNC simd_half3 __tg_fmax(simd_half3 x, simd_half3 y);
1748/*! @abstract Do not call this function; instead use `fmax` in C and
1749 * Objective-C, and `simd::fmax` in C++. */
1750static inline SIMD_CFUNC simd_half4 __tg_fmax(simd_half4 x, simd_half4 y);
1751/*! @abstract Do not call this function; instead use `fmax` in C and
1752 * Objective-C, and `simd::fmax` in C++. */
1753static inline SIMD_CFUNC simd_half8 __tg_fmax(simd_half8 x, simd_half8 y);
1754/*! @abstract Do not call this function; instead use `fmax` in C and
1755 * Objective-C, and `simd::fmax` in C++. */
1756static inline SIMD_CFUNC simd_half16 __tg_fmax(simd_half16 x, simd_half16 y);
1757/*! @abstract Do not call this function; instead use `fmax` in C and
1758 * Objective-C, and `simd::fmax` in C++. */
1759static inline SIMD_CFUNC simd_half32 __tg_fmax(simd_half32 x, simd_half32 y);
1760
1761/*! @abstract Do not call this function; instead use `copysign` in C and
1762 * Objective-C, and `simd::copysign` in C++. */
1763static inline SIMD_CFUNC simd_half2 __tg_copysign(simd_half2 x, simd_half2 y);
1764/*! @abstract Do not call this function; instead use `copysign` in C and
1765 * Objective-C, and `simd::copysign` in C++. */
1766static inline SIMD_CFUNC simd_half3 __tg_copysign(simd_half3 x, simd_half3 y);
1767/*! @abstract Do not call this function; instead use `copysign` in C and
1768 * Objective-C, and `simd::copysign` in C++. */
1769static inline SIMD_CFUNC simd_half4 __tg_copysign(simd_half4 x, simd_half4 y);
1770/*! @abstract Do not call this function; instead use `copysign` in C and
1771 * Objective-C, and `simd::copysign` in C++. */
1772static inline SIMD_CFUNC simd_half8 __tg_copysign(simd_half8 x, simd_half8 y);
1773/*! @abstract Do not call this function; instead use `copysign` in C and
1774 * Objective-C, and `simd::copysign` in C++. */
1775static inline SIMD_CFUNC simd_half16 __tg_copysign(simd_half16 x, simd_half16 y);
1776/*! @abstract Do not call this function; instead use `copysign` in C and
1777 * Objective-C, and `simd::copysign` in C++. */
1778static inline SIMD_CFUNC simd_half32 __tg_copysign(simd_half32 x, simd_half32 y);
1779
15371780
1538/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,1781/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1539 * and `simd::fma` in C++. */1782 * and `simd::fma` in C++. */
...@@ -1563,6 +1806,27 @@ static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, s...@@ -1563,6 +1806,27 @@ static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, s
1563 * and `simd::fma` in C++. */1806 * and `simd::fma` in C++. */
1564static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z);1807static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z);
1565 1808
1809/*! @abstract Computes accum + x*y by the most efficient means available;
1810 * either a fused multiply add or separate multiply and add instructions. */
1811static inline SIMD_CFUNC _Float16 simd_muladd(_Float16 x, _Float16 y, _Float16 z);
1812/*! @abstract Computes accum + x*y by the most efficient means available;
1813 * either a fused multiply add or separate multiply and add instructions. */
1814static inline SIMD_CFUNC simd_half2 simd_muladd(simd_half2 x, simd_half2 y, simd_half2 z);
1815/*! @abstract Computes accum + x*y by the most efficient means available;
1816 * either a fused multiply add or separate multiply and add instructions. */
1817static inline SIMD_CFUNC simd_half3 simd_muladd(simd_half3 x, simd_half3 y, simd_half3 z);
1818/*! @abstract Computes accum + x*y by the most efficient means available;
1819 * either a fused multiply add or separate multiply and add instructions. */
1820static inline SIMD_CFUNC simd_half4 simd_muladd(simd_half4 x, simd_half4 y, simd_half4 z);
1821/*! @abstract Computes accum + x*y by the most efficient means available;
1822 * either a fused multiply add or separate multiply and add instructions. */
1823static inline SIMD_CFUNC simd_half8 simd_muladd(simd_half8 x, simd_half8 y, simd_half8 z);
1824/*! @abstract Computes accum + x*y by the most efficient means available;
1825 * either a fused multiply add or separate multiply and add instructions. */
1826static inline SIMD_CFUNC simd_half16 simd_muladd(simd_half16 x, simd_half16 y, simd_half16 z);
1827/*! @abstract Computes accum + x*y by the most efficient means available;
1828 * either a fused multiply add or separate multiply and add instructions. */
1829static inline SIMD_CFUNC simd_half32 simd_muladd(simd_half32 x, simd_half32 y, simd_half32 z);
1566/*! @abstract Computes accum + x*y by the most efficient means available;1830/*! @abstract Computes accum + x*y by the most efficient means available;
1567 * either a fused multiply add or separate multiply and add instructions. */1831 * either a fused multiply add or separate multiply and add instructions. */
1568static inline SIMD_CFUNC float simd_muladd(float x, float y, float z);1832static inline SIMD_CFUNC float simd_muladd(float x, float y, float z);
...@@ -1753,26 +2017,40 @@ static SIMD_INLINE SIMD_NODEBUG void __tg_sincospi(float x, float *sinp, float *...@@ -1753,26 +2017,40 @@ static SIMD_INLINE SIMD_NODEBUG void __tg_sincospi(float x, float *sinp, float *
1753 * instead. */2017 * instead. */
1754static SIMD_INLINE SIMD_NODEBUG void __tg_sincospi(double x, double *sinp, double *cosp) { ::__sincospi(x, sinp, cosp); }2018static SIMD_INLINE SIMD_NODEBUG void __tg_sincospi(double x, double *sinp, double *cosp) { ::__sincospi(x, sinp, cosp); }
1755#endif2019#endif
2020#if SIMD_LIBRARY_VERSION >= 6
2021/*! @abstract Do not call this function directly; use simd::fabs instead. */
2022static SIMD_CPPFUNC _Float16 __tg_fabs(_Float16 x) { return ::__fabsf16(x); }
2023/*! @abstract Do not call this function directly; use simd::sqrt instead. */
2024static SIMD_CPPFUNC _Float16 __tg_sqrt(_Float16 x) { return ::__sqrtf16(x); }
2025/*! @abstract Do not call this function directly; use simd::ceil instead. */
2026static SIMD_CPPFUNC _Float16 __tg_ceil(_Float16 x) { return ::__ceilf16(x); }
2027/*! @abstract Do not call this function directly; use simd::floor instead. */
2028static SIMD_CPPFUNC _Float16 __tg_floor(_Float16 x) { return ::__floorf16(x); }
2029/*! @abstract Do not call this function directly; use simd::rint instead. */
2030static SIMD_CPPFUNC _Float16 __tg_rint(_Float16 x) { return ::__rintf16(x); }
2031/*! @abstract Do not call this function directly; use simd::trunc instead. */
2032static SIMD_CPPFUNC _Float16 __tg_trunc(_Float16 x) { return ::__truncf16(x); }
2033#endif
1756/*! @abstract Do not call this function directly; use simd::isfinite2034/*! @abstract Do not call this function directly; use simd::isfinite
1757 * instead. */2035 * instead. */
1758static SIMD_CPPFUNC float __tg_isfinite(float x) { return ::isfinite(x); }2036static SIMD_CPPFUNC float __tg_isfinite(float x) { return std::isfinite(x); }
1759/*! @abstract Do not call this function directly; use simd::isfinite2037/*! @abstract Do not call this function directly; use simd::isfinite
1760 * instead. */2038 * instead. */
1761static SIMD_CPPFUNC double __tg_isfinite(double x) { return ::isfinite(x); }2039static SIMD_CPPFUNC double __tg_isfinite(double x) { return std::isfinite(x); }
1762/*! @abstract Do not call this function directly; use simd::isinf instead. */2040/*! @abstract Do not call this function directly; use simd::isinf instead. */
1763static SIMD_CPPFUNC float __tg_isinf(float x) { return ::isinf(x); }2041static SIMD_CPPFUNC float __tg_isinf(float x) { return std::isinf(x); }
1764/*! @abstract Do not call this function directly; use simd::isinf instead. */2042/*! @abstract Do not call this function directly; use simd::isinf instead. */
1765static SIMD_CPPFUNC double __tg_isinf(double x) { return ::isinf(x); }2043static SIMD_CPPFUNC double __tg_isinf(double x) { return std::isinf(x); }
1766/*! @abstract Do not call this function directly; use simd::isnan instead. */2044/*! @abstract Do not call this function directly; use simd::isnan instead. */
1767static SIMD_CPPFUNC float __tg_isnan(float x) { return ::isnan(x); }2045static SIMD_CPPFUNC float __tg_isnan(float x) { return std::isnan(x); }
1768/*! @abstract Do not call this function directly; use simd::isnan instead. */2046/*! @abstract Do not call this function directly; use simd::isnan instead. */
1769static SIMD_CPPFUNC double __tg_isnan(double x) { return ::isnan(x); }2047static SIMD_CPPFUNC double __tg_isnan(double x) { return std::isnan(x); }
1770/*! @abstract Do not call this function directly; use simd::isnormal2048/*! @abstract Do not call this function directly; use simd::isnormal
1771 * instead. */2049 * instead. */
1772static SIMD_CPPFUNC float __tg_isnormal(float x) { return ::isnormal(x); }2050static SIMD_CPPFUNC float __tg_isnormal(float x) { return std::isnormal(x); }
1773/*! @abstract Do not call this function directly; use simd::isnormal2051/*! @abstract Do not call this function directly; use simd::isnormal
1774 * instead. */2052 * instead. */
1775static SIMD_CPPFUNC double __tg_isnormal(double x) { return ::isnormal(x); }2053static SIMD_CPPFUNC double __tg_isnormal(double x) { return std::isnormal(x); }
1776/*! @abstract Do not call this function directly; use simd::atan2 instead. */2054/*! @abstract Do not call this function directly; use simd::atan2 instead. */
1777static SIMD_CPPFUNC float __tg_atan2(float x, float y) { return ::atan2f(x, y); }2055static SIMD_CPPFUNC float __tg_atan2(float x, float y) { return ::atan2f(x, y); }
1778/*! @abstract Do not call this function directly; use simd::atan2 instead. */2056/*! @abstract Do not call this function directly; use simd::atan2 instead. */
...@@ -1819,11 +2097,20 @@ static SIMD_CPPFUNC double __tg_fmax(double x, double y) { return ::fmax(x, y);...@@ -1819,11 +2097,20 @@ static SIMD_CPPFUNC double __tg_fmax(double x, double y) { return ::fmax(x, y);
1819static SIMD_CPPFUNC float __tg_fmin(float x, float y) { return ::fminf(x, y); }2097static SIMD_CPPFUNC float __tg_fmin(float x, float y) { return ::fminf(x, y); }
1820/*! @abstract Do not call this function directly; use simd::fmin instead. */2098/*! @abstract Do not call this function directly; use simd::fmin instead. */
1821static SIMD_CPPFUNC double __tg_fmin(double x, double y) { return ::fmin(x, y); }2099static SIMD_CPPFUNC double __tg_fmin(double x, double y) { return ::fmin(x, y); }
2100#if SIMD_LIBRARY_VERSION >= 6
2101/*! @abstract Do not call this function directly; use simd::fmin instead. */
2102static SIMD_CPPFUNC _Float16 __tg_fmin(_Float16 x, _Float16 y) { return ::__fminf16(x, y); }
2103/*! @abstract Do not call this function directly; use simd::fmax instead. */
2104static SIMD_CPPFUNC _Float16 __tg_fmax(_Float16 x, _Float16 y) { return ::__fmaxf16(x, y); }
2105/*! @abstract Do not call this function directly; use simd::copysign
2106 * instead. */
2107static SIMD_CPPFUNC _Float16 __tg_copysign(_Float16 x, _Float16 y) { return ::__copysignf16(x, y); }
2108#endif
1822/*! @abstract Do not call this function directly; use simd::fma instead. */2109/*! @abstract Do not call this function directly; use simd::fma instead. */
1823static SIMD_CPPFUNC float __tg_fma(float x, float y, float z) { return ::fmaf(x, y, z); }2110static SIMD_CPPFUNC float __tg_fma(float x, float y, float z) { return ::fmaf(x, y, z); }
1824/*! @abstract Do not call this function directly; use simd::fma instead. */2111/*! @abstract Do not call this function directly; use simd::fma instead. */
1825static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); }2112static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); }
1826 2113
1827namespace simd {2114namespace simd {
1828/*! @abstract Generalizes the <cmath> function acos to operate on vectors of2115/*! @abstract Generalizes the <cmath> function acos to operate on vectors of
1829 * floats and doubles. */2116 * floats and doubles. */
...@@ -2111,6 +2398,12 @@ extern "C" {...@@ -2111,6 +2398,12 @@ extern "C" {
2111#else2398#else
2112#include <tgmath.h>2399#include <tgmath.h>
2113/* C and Objective-C, we need some infrastructure to piggyback on tgmath.h */2400/* C and Objective-C, we need some infrastructure to piggyback on tgmath.h */
2401static SIMD_OVERLOAD simd_half2 __tg_promote(simd_half2);
2402static SIMD_OVERLOAD simd_half3 __tg_promote(simd_half3);
2403static SIMD_OVERLOAD simd_half4 __tg_promote(simd_half4);
2404static SIMD_OVERLOAD simd_half8 __tg_promote(simd_half8);
2405static SIMD_OVERLOAD simd_half16 __tg_promote(simd_half16);
2406static SIMD_OVERLOAD simd_half32 __tg_promote(simd_half32);
2114static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2);2407static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2);
2115static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3);2408static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3);
2116static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4);2409static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4);
...@@ -2186,6 +2479,7 @@ static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); }...@@ -2186,6 +2479,7 @@ static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); }
2186#define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x))2479#define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x))
2187#endif2480#endif
21882481
2482
2189#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__)2483#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__)
2190static inline SIMD_CFUNC int __tg_isfinite(float x) { return __inline_isfinitef(x); }2484static inline SIMD_CFUNC int __tg_isfinite(float x) { return __inline_isfinitef(x); }
2191static inline SIMD_CFUNC int __tg_isfinite(double x) { return __inline_isfinited(x); }2485static inline SIMD_CFUNC int __tg_isfinite(double x) { return __inline_isfinited(x); }
...@@ -2272,6 +2566,12 @@ static inline SIMD_CFUNC int __tg_isnormal(long double x) { return __isnormall(x...@@ -2272,6 +2566,12 @@ static inline SIMD_CFUNC int __tg_isnormal(long double x) { return __isnormall(x
2272#endif /* !__cplusplus */2566#endif /* !__cplusplus */
2273 2567
2274#pragma mark - fabs implementation2568#pragma mark - fabs implementation
2569static inline SIMD_CFUNC simd_half2 __tg_fabs(simd_half2 x) { return simd_bitselect(0.0, x, 0x7fff); }
2570static inline SIMD_CFUNC simd_half3 __tg_fabs(simd_half3 x) { return simd_bitselect(0.0, x, 0x7fff); }
2571static inline SIMD_CFUNC simd_half4 __tg_fabs(simd_half4 x) { return simd_bitselect(0.0, x, 0x7fff); }
2572static inline SIMD_CFUNC simd_half8 __tg_fabs(simd_half8 x) { return simd_bitselect(0.0, x, 0x7fff); }
2573static inline SIMD_CFUNC simd_half16 __tg_fabs(simd_half16 x) { return simd_bitselect(0.0, x, 0x7fff); }
2574static inline SIMD_CFUNC simd_half32 __tg_fabs(simd_half32 x) { return simd_bitselect(0.0, x, 0x7fff); }
2275static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); }2575static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2276static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); }2576static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2277static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x) { return simd_bitselect(0.0, x, 0x7fffffff); }2577static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
...@@ -2283,6 +2583,12 @@ static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x) { return simd_bi...@@ -2283,6 +2583,12 @@ static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x) { return simd_bi
2283static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffff); }2583static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffff); }
2284 2584
2285#pragma mark - isfinite implementation2585#pragma mark - isfinite implementation
2586static inline SIMD_CFUNC simd_short2 __tg_isfinite(simd_half2 x) { return x == x && __tg_fabs(x) != (simd_half2)INFINITY; }
2587static inline SIMD_CFUNC simd_short3 __tg_isfinite(simd_half3 x) { return x == x && __tg_fabs(x) != (simd_half3)INFINITY; }
2588static inline SIMD_CFUNC simd_short4 __tg_isfinite(simd_half4 x) { return x == x && __tg_fabs(x) != (simd_half4)INFINITY; }
2589static inline SIMD_CFUNC simd_short8 __tg_isfinite(simd_half8 x) { return x == x && __tg_fabs(x) != (simd_half8)INFINITY; }
2590static inline SIMD_CFUNC simd_short16 __tg_isfinite(simd_half16 x) { return x == x && __tg_fabs(x) != (simd_half16)INFINITY; }
2591static inline SIMD_CFUNC simd_short32 __tg_isfinite(simd_half32 x) { return x == x && __tg_fabs(x) != (simd_half32)INFINITY; }
2286static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x) { return x == x && __tg_fabs(x) != (simd_float2)INFINITY; }2592static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x) { return x == x && __tg_fabs(x) != (simd_float2)INFINITY; }
2287static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x) { return x == x && __tg_fabs(x) != (simd_float3)INFINITY; }2593static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x) { return x == x && __tg_fabs(x) != (simd_float3)INFINITY; }
2288static inline SIMD_CFUNC simd_int4 __tg_isfinite(simd_float4 x) { return x == x && __tg_fabs(x) != (simd_float4)INFINITY; }2594static inline SIMD_CFUNC simd_int4 __tg_isfinite(simd_float4 x) { return x == x && __tg_fabs(x) != (simd_float4)INFINITY; }
...@@ -2294,6 +2600,12 @@ static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x) { return x ==...@@ -2294,6 +2600,12 @@ static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x) { return x ==
2294static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x) { return x == x && __tg_fabs(x) != (simd_double8)INFINITY; }2600static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x) { return x == x && __tg_fabs(x) != (simd_double8)INFINITY; }
22952601
2296#pragma mark - isinf implementation2602#pragma mark - isinf implementation
2603static inline SIMD_CFUNC simd_short2 __tg_isinf(simd_half2 x) { return __tg_fabs(x) == (simd_half2)INFINITY; }
2604static inline SIMD_CFUNC simd_short3 __tg_isinf(simd_half3 x) { return __tg_fabs(x) == (simd_half3)INFINITY; }
2605static inline SIMD_CFUNC simd_short4 __tg_isinf(simd_half4 x) { return __tg_fabs(x) == (simd_half4)INFINITY; }
2606static inline SIMD_CFUNC simd_short8 __tg_isinf(simd_half8 x) { return __tg_fabs(x) == (simd_half8)INFINITY; }
2607static inline SIMD_CFUNC simd_short16 __tg_isinf(simd_half16 x) { return __tg_fabs(x) == (simd_half16)INFINITY; }
2608static inline SIMD_CFUNC simd_short32 __tg_isinf(simd_half32 x) { return __tg_fabs(x) == (simd_half32)INFINITY; }
2297static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x) { return __tg_fabs(x) == (simd_float2)INFINITY; }2609static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x) { return __tg_fabs(x) == (simd_float2)INFINITY; }
2298static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x) { return __tg_fabs(x) == (simd_float3)INFINITY; }2610static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x) { return __tg_fabs(x) == (simd_float3)INFINITY; }
2299static inline SIMD_CFUNC simd_int4 __tg_isinf(simd_float4 x) { return __tg_fabs(x) == (simd_float4)INFINITY; }2611static inline SIMD_CFUNC simd_int4 __tg_isinf(simd_float4 x) { return __tg_fabs(x) == (simd_float4)INFINITY; }
...@@ -2305,6 +2617,12 @@ static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x) { return __tg_fab...@@ -2305,6 +2617,12 @@ static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x) { return __tg_fab
2305static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x) { return __tg_fabs(x) == (simd_double8)INFINITY; }2617static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x) { return __tg_fabs(x) == (simd_double8)INFINITY; }
23062618
2307#pragma mark - isnan implementation2619#pragma mark - isnan implementation
2620static inline SIMD_CFUNC simd_short2 __tg_isnan(simd_half2 x) { return x != x; }
2621static inline SIMD_CFUNC simd_short3 __tg_isnan(simd_half3 x) { return x != x; }
2622static inline SIMD_CFUNC simd_short4 __tg_isnan(simd_half4 x) { return x != x; }
2623static inline SIMD_CFUNC simd_short8 __tg_isnan(simd_half8 x) { return x != x; }
2624static inline SIMD_CFUNC simd_short16 __tg_isnan(simd_half16 x) { return x != x; }
2625static inline SIMD_CFUNC simd_short32 __tg_isnan(simd_half32 x) { return x != x; }
2308static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x) { return x != x; }2626static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x) { return x != x; }
2309static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x) { return x != x; }2627static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x) { return x != x; }
2310static inline SIMD_CFUNC simd_int4 __tg_isnan(simd_float4 x) { return x != x; }2628static inline SIMD_CFUNC simd_int4 __tg_isnan(simd_float4 x) { return x != x; }
...@@ -2316,6 +2634,12 @@ static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x) { return x != x;...@@ -2316,6 +2634,12 @@ static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x) { return x != x;
2316static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x) { return x != x; }2634static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x) { return x != x; }
23172635
2318#pragma mark - isnormal implementation2636#pragma mark - isnormal implementation
2637static inline SIMD_CFUNC simd_short2 __tg_isnormal(simd_half2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_half2)__DBL_MIN__; }
2638static inline SIMD_CFUNC simd_short3 __tg_isnormal(simd_half3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_half3)__DBL_MIN__; }
2639static inline SIMD_CFUNC simd_short4 __tg_isnormal(simd_half4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_half4)__DBL_MIN__; }
2640static inline SIMD_CFUNC simd_short8 __tg_isnormal(simd_half8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_half8)__DBL_MIN__; }
2641static inline SIMD_CFUNC simd_short16 __tg_isnormal(simd_half16 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_half16)__DBL_MIN__; }
2642static inline SIMD_CFUNC simd_short32 __tg_isnormal(simd_half32 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_half32)__DBL_MIN__; }
2319static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float2)__FLT_MIN__; }2643static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float2)__FLT_MIN__; }
2320static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float3)__FLT_MIN__; }2644static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float3)__FLT_MIN__; }
2321static inline SIMD_CFUNC simd_int4 __tg_isnormal(simd_float4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float4)__FLT_MIN__; }2645static inline SIMD_CFUNC simd_int4 __tg_isnormal(simd_float4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float4)__FLT_MIN__; }
...@@ -2327,10 +2651,42 @@ static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x) { return __tg_...@@ -2327,10 +2651,42 @@ static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x) { return __tg_
2327static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double8)__DBL_MIN__; }2651static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double8)__DBL_MIN__; }
23282652
2329#pragma mark - fmin, fmax implementation2653#pragma mark - fmin, fmax implementation
2654static SIMD_CFUNC simd_half2 __tg_fmin(simd_half2 x, simd_half2 y) {
2655 return __tg_fmin(simd_make_half4_undef(x), simd_make_half4_undef(y)).lo;
2656}
2657
2658static SIMD_CFUNC simd_half3 __tg_fmin(simd_half3 x, simd_half3 y) {
2659 return simd_make_half3(__tg_fmin(simd_make_half4_undef(x), simd_make_half4_undef(y)));
2660}
2661
2662static SIMD_CFUNC simd_half4 __tg_fmin(simd_half4 x, simd_half4 y) {
2663#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2664 return vminnm_f16(x, y);
2665#else
2666 return simd_bitselect(y, x, (x <= y) | (y != y));
2667#endif
2668}
2669
2670static SIMD_CFUNC simd_half8 __tg_fmin(simd_half8 x, simd_half8 y) {
2671#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2672 return vminnmq_f16(x, y);
2673#else
2674 return simd_make_half8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2675#endif
2676}
2677
2678static SIMD_CFUNC simd_half16 __tg_fmin(simd_half16 x, simd_half16 y) {
2679 return simd_make_half16(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2680}
2681
2682static SIMD_CFUNC simd_half32 __tg_fmin(simd_half32 x, simd_half32 y) {
2683 return simd_make_half32(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2684}
2685
2330static SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y) {2686static SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y) {
2331#if defined __SSE2__2687#if defined __SSE2__
2332 return simd_make_float2(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y)));2688 return simd_make_float2(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2333#elif defined __arm64__2689#elif defined __arm64__ || defined __aarch64__
2334 return vminnm_f32(x, y);2690 return vminnm_f32(x, y);
2335#elif defined __arm__ && __FINITE_MATH_ONLY__2691#elif defined __arm__ && __FINITE_MATH_ONLY__
2336 return vmin_f32(x, y);2692 return vmin_f32(x, y);
...@@ -2350,7 +2706,7 @@ static SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y) {...@@ -2350,7 +2706,7 @@ static SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y) {
2350 return _mm_min_ps(x, y);2706 return _mm_min_ps(x, y);
2351#elif defined __SSE2__2707#elif defined __SSE2__
2352 return simd_bitselect(_mm_min_ps(x, y), x, y != y);2708 return simd_bitselect(_mm_min_ps(x, y), x, y != y);
2353#elif defined __arm64__2709#elif defined __arm64__ || defined __aarch64__
2354 return vminnmq_f32(x, y);2710 return vminnmq_f32(x, y);
2355#elif defined __arm__ && __FINITE_MATH_ONLY__2711#elif defined __arm__ && __FINITE_MATH_ONLY__
2356 return vminq_f32(x, y);2712 return vminq_f32(x, y);
...@@ -2390,7 +2746,7 @@ static SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y) {...@@ -2390,7 +2746,7 @@ static SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y) {
2390 return _mm_min_pd(x, y);2746 return _mm_min_pd(x, y);
2391#elif defined __SSE2__2747#elif defined __SSE2__
2392 return simd_bitselect(_mm_min_pd(x, y), x, y != y);2748 return simd_bitselect(_mm_min_pd(x, y), x, y != y);
2393#elif defined __arm64__2749#elif defined __arm64__ || defined __aarch64__
2394 return vminnmq_f64(x, y);2750 return vminnmq_f64(x, y);
2395#else2751#else
2396 return simd_bitselect(y, x, (x <= y) | (y != y));2752 return simd_bitselect(y, x, (x <= y) | (y != y));
...@@ -2425,10 +2781,42 @@ static SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y) {...@@ -2425,10 +2781,42 @@ static SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y) {
2425#endif2781#endif
2426}2782}
24272783
2784static SIMD_CFUNC simd_half2 __tg_fmax(simd_half2 x, simd_half2 y) {
2785 return __tg_fmax(simd_make_half4_undef(x), simd_make_half4_undef(y)).lo;
2786}
2787
2788static SIMD_CFUNC simd_half3 __tg_fmax(simd_half3 x, simd_half3 y) {
2789 return simd_make_half3(__tg_fmax(simd_make_half4_undef(x), simd_make_half4_undef(y)));
2790}
2791
2792static SIMD_CFUNC simd_half4 __tg_fmax(simd_half4 x, simd_half4 y) {
2793#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2794 return vmaxnm_f16(x, y);
2795#else
2796 return simd_bitselect(y, x, (x >= y) | (y != y));
2797#endif
2798}
2799
2800static SIMD_CFUNC simd_half8 __tg_fmax(simd_half8 x, simd_half8 y) {
2801#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2802 return vmaxnmq_f16(x, y);
2803#else
2804 return simd_make_half8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2805#endif
2806}
2807
2808static SIMD_CFUNC simd_half16 __tg_fmax(simd_half16 x, simd_half16 y) {
2809 return simd_make_half16(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2810}
2811
2812static SIMD_CFUNC simd_half32 __tg_fmax(simd_half32 x, simd_half32 y) {
2813 return simd_make_half32(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2814}
2815
2428static SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y) {2816static SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y) {
2429#if defined __SSE2__2817#if defined __SSE2__
2430 return simd_make_float2(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y)));2818 return simd_make_float2(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2431#elif defined __arm64__2819#elif defined __arm64__ || defined __aarch64__
2432 return vmaxnm_f32(x, y);2820 return vmaxnm_f32(x, y);
2433#elif defined __arm__ && __FINITE_MATH_ONLY__2821#elif defined __arm__ && __FINITE_MATH_ONLY__
2434 return vmax_f32(x, y);2822 return vmax_f32(x, y);
...@@ -2448,7 +2836,7 @@ static SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y) {...@@ -2448,7 +2836,7 @@ static SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y) {
2448 return _mm_max_ps(x, y);2836 return _mm_max_ps(x, y);
2449#elif defined __SSE2__2837#elif defined __SSE2__
2450 return simd_bitselect(_mm_max_ps(x, y), x, y != y);2838 return simd_bitselect(_mm_max_ps(x, y), x, y != y);
2451#elif defined __arm64__2839#elif defined __arm64__ || defined __aarch64__
2452 return vmaxnmq_f32(x, y);2840 return vmaxnmq_f32(x, y);
2453#elif defined __arm__ && __FINITE_MATH_ONLY__2841#elif defined __arm__ && __FINITE_MATH_ONLY__
2454 return vmaxq_f32(x, y);2842 return vmaxq_f32(x, y);
...@@ -2488,7 +2876,7 @@ static SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y) {...@@ -2488,7 +2876,7 @@ static SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y) {
2488 return _mm_max_pd(x, y);2876 return _mm_max_pd(x, y);
2489#elif defined __SSE2__2877#elif defined __SSE2__
2490 return simd_bitselect(_mm_max_pd(x, y), x, y != y);2878 return simd_bitselect(_mm_max_pd(x, y), x, y != y);
2491#elif defined __arm64__2879#elif defined __arm64__ || defined __aarch64__
2492 return vmaxnmq_f64(x, y);2880 return vmaxnmq_f64(x, y);
2493#else2881#else
2494 return simd_bitselect(y, x, (x >= y) | (y != y));2882 return simd_bitselect(y, x, (x >= y) | (y != y));
...@@ -2524,6 +2912,12 @@ static SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y) {...@@ -2524,6 +2912,12 @@ static SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y) {
2524}2912}
25252913
2526#pragma mark - copysign implementation2914#pragma mark - copysign implementation
2915static inline SIMD_CFUNC simd_half2 __tg_copysign(simd_half2 x, simd_half2 y) { return simd_bitselect(y, x, 0x7fff); }
2916static inline SIMD_CFUNC simd_half3 __tg_copysign(simd_half3 x, simd_half3 y) { return simd_bitselect(y, x, 0x7fff); }
2917static inline SIMD_CFUNC simd_half4 __tg_copysign(simd_half4 x, simd_half4 y) { return simd_bitselect(y, x, 0x7fff); }
2918static inline SIMD_CFUNC simd_half8 __tg_copysign(simd_half8 x, simd_half8 y) { return simd_bitselect(y, x, 0x7fff); }
2919static inline SIMD_CFUNC simd_half16 __tg_copysign(simd_half16 x, simd_half16 y) { return simd_bitselect(y, x, 0x7fff); }
2920static inline SIMD_CFUNC simd_half32 __tg_copysign(simd_half32 x, simd_half32 y) { return simd_bitselect(y, x, 0x7fff); }
2527static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); }2921static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); }
2528static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); }2922static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); }
2529static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y) { return simd_bitselect(y, x, 0x7fffffff); }2923static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y) { return simd_bitselect(y, x, 0x7fffffff); }
...@@ -2535,10 +2929,50 @@ static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4...@@ -2535,10 +2929,50 @@ static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4
2535static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y) { return simd_bitselect(y, x, 0x7fffffffffffffff); }2929static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y) { return simd_bitselect(y, x, 0x7fffffffffffffff); }
2536 2930
2537#pragma mark - sqrt implementation2931#pragma mark - sqrt implementation
2932static SIMD_CFUNC simd_half2 __tg_sqrt(simd_half2 x) {
2933#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2934 return __tg_sqrt(simd_make_half4_undef(x)).lo;
2935#else
2936 return simd_make_half2(__sqrtf16(x.x), __sqrtf16(x.y));
2937#endif
2938}
2939
2940static SIMD_CFUNC simd_half3 __tg_sqrt(simd_half3 x) {
2941#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2942 return simd_make_half3(__tg_sqrt(simd_make_half4_undef(x)));
2943#else
2944 return simd_make_half3(__sqrtf16(x.x), __sqrtf16(x.y), __sqrtf16(x.z));
2945#endif
2946}
2947
2948static SIMD_CFUNC simd_half4 __tg_sqrt(simd_half4 x) {
2949#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2950 return vsqrt_f16(x);
2951#else
2952 return simd_make_half4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2953#endif
2954}
2955
2956static SIMD_CFUNC simd_half8 __tg_sqrt(simd_half8 x) {
2957#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
2958 return vsqrtq_f16(x);
2959#else
2960 return simd_make_half8(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2961#endif
2962}
2963
2964static SIMD_CFUNC simd_half16 __tg_sqrt(simd_half16 x) {
2965 return simd_make_half16(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2966}
2967
2968static SIMD_CFUNC simd_half32 __tg_sqrt(simd_half32 x) {
2969 return simd_make_half32(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2970}
2971
2538static SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x) {2972static SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x) {
2539#if defined __SSE2__2973#if defined __SSE2__
2540 return simd_make_float2(__tg_sqrt(simd_make_float4_undef(x)));2974 return simd_make_float2(__tg_sqrt(simd_make_float4_undef(x)));
2541#elif defined __arm64__2975#elif defined __arm64__ || defined __aarch64__
2542 return vsqrt_f32(x);2976 return vsqrt_f32(x);
2543#else2977#else
2544 return simd_make_float2(sqrt(x.x), sqrt(x.y));2978 return simd_make_float2(sqrt(x.x), sqrt(x.y));
...@@ -2552,7 +2986,7 @@ static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) {...@@ -2552,7 +2986,7 @@ static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) {
2552static SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x) {2986static SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x) {
2553#if defined __SSE2__2987#if defined __SSE2__
2554 return _mm_sqrt_ps(x);2988 return _mm_sqrt_ps(x);
2555#elif defined __arm64__2989#elif defined __arm64__ || defined __aarch64__
2556 return vsqrtq_f32(x);2990 return vsqrtq_f32(x);
2557#else2991#else
2558 return simd_make_float4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));2992 return simd_make_float4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
...@@ -2578,7 +3012,7 @@ static SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x) {...@@ -2578,7 +3012,7 @@ static SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x) {
2578static SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x) {3012static SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x) {
2579#if defined __SSE2__3013#if defined __SSE2__
2580 return _mm_sqrt_pd(x);3014 return _mm_sqrt_pd(x);
2581#elif defined __arm64__3015#elif defined __arm64__ || defined __aarch64__
2582 return vsqrtq_f64(x);3016 return vsqrtq_f64(x);
2583#else3017#else
2584 return simd_make_double2(sqrt(x.x), sqrt(x.y));3018 return simd_make_double2(sqrt(x.x), sqrt(x.y));
...@@ -2606,8 +3040,145 @@ static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) {...@@ -2606,8 +3040,145 @@ static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) {
2606}3040}
2607 3041
2608#pragma mark - ceil, floor, rint, trunc implementation3042#pragma mark - ceil, floor, rint, trunc implementation
3043static SIMD_CFUNC simd_half2 __tg_ceil(simd_half2 x) {
3044 return simd_make_half2(__tg_ceil(simd_make_half8_undef(x)));
3045}
3046
3047static SIMD_CFUNC simd_half3 __tg_ceil(simd_half3 x) {
3048 return simd_make_half3(__tg_ceil(simd_make_half4_undef(x)));
3049}
3050
3051static SIMD_CFUNC simd_half4 __tg_ceil(simd_half4 x) {
3052#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3053 return vrndp_f16(x);
3054#else
3055 return simd_make_half4(__tg_ceil(simd_make_half8_undef(x)));
3056#endif
3057}
3058
3059static SIMD_CFUNC simd_half8 __tg_ceil(simd_half8 x) {
3060#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3061 return vrndpq_f16(x);
3062#else
3063 simd_half8 truncated = __tg_trunc(x);
3064 simd_half8 adjust = simd_bitselect((simd_half8)0, 1, truncated < x);
3065 return __tg_copysign(truncated + adjust, x);
3066#endif
3067}
3068
3069static SIMD_CFUNC simd_half16 __tg_ceil(simd_half16 x) {
3070 return simd_make_half16(__tg_ceil(x.lo), __tg_ceil(x.hi));
3071}
3072
3073static SIMD_CFUNC simd_half32 __tg_ceil(simd_half32 x) {
3074 return simd_make_half32(__tg_ceil(x.lo), __tg_ceil(x.hi));
3075}
3076
3077static SIMD_CFUNC simd_half2 __tg_floor(simd_half2 x) {
3078 return simd_make_half2(__tg_floor(simd_make_half8_undef(x)));
3079}
3080
3081static SIMD_CFUNC simd_half3 __tg_floor(simd_half3 x) {
3082 return simd_make_half3(__tg_floor(simd_make_half4_undef(x)));
3083}
3084
3085static SIMD_CFUNC simd_half4 __tg_floor(simd_half4 x) {
3086#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3087 return vrndm_f16(x);
3088#else
3089 return simd_make_half4(__tg_floor(simd_make_half8_undef(x)));
3090#endif
3091}
3092
3093static SIMD_CFUNC simd_half8 __tg_floor(simd_half8 x) {
3094#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3095 return vrndmq_f16(x);
3096#else
3097 simd_half8 truncated = __tg_trunc(x);
3098 simd_half8 adjust = simd_bitselect((simd_half8)0, 1, truncated > x);
3099 return truncated - adjust;
3100#endif
3101}
3102
3103static SIMD_CFUNC simd_half16 __tg_floor(simd_half16 x) {
3104 return simd_make_half16(__tg_floor(x.lo), __tg_floor(x.hi));
3105}
3106
3107static SIMD_CFUNC simd_half32 __tg_floor(simd_half32 x) {
3108 return simd_make_half32(__tg_floor(x.lo), __tg_floor(x.hi));
3109}
3110
3111static SIMD_CFUNC simd_half2 __tg_rint(simd_half2 x) {
3112 return simd_make_half2(__tg_rint(simd_make_half8_undef(x)));
3113}
3114
3115static SIMD_CFUNC simd_half3 __tg_rint(simd_half3 x) {
3116 return simd_make_half3(__tg_rint(simd_make_half4_undef(x)));
3117}
3118
3119static SIMD_CFUNC simd_half4 __tg_rint(simd_half4 x) {
3120#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3121 return vrndx_f16(x);
3122#else
3123 return simd_make_half4(__tg_rint(simd_make_half8_undef(x)));
3124#endif
3125}
3126
3127static SIMD_CFUNC simd_half8 __tg_rint(simd_half8 x) {
3128#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3129 return vrndxq_f16(x);
3130#else
3131 simd_half8 magic = __tg_copysign(0x1.0p10, x);
3132 simd_short8 x_is_small = __tg_fabs(x) < 0x1.0p10;
3133 return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fff);
3134#endif
3135}
3136
3137static SIMD_CFUNC simd_half16 __tg_rint(simd_half16 x) {
3138 return simd_make_half16(__tg_rint(x.lo), __tg_rint(x.hi));
3139}
3140
3141static SIMD_CFUNC simd_half32 __tg_rint(simd_half32 x) {
3142 return simd_make_half32(__tg_rint(x.lo), __tg_rint(x.hi));
3143}
3144
3145static SIMD_CFUNC simd_half2 __tg_trunc(simd_half2 x) {
3146 return simd_make_half2(__tg_trunc(simd_make_half8_undef(x)));
3147}
3148
3149static SIMD_CFUNC simd_half3 __tg_trunc(simd_half3 x) {
3150 return simd_make_half3(__tg_trunc(simd_make_half4_undef(x)));
3151}
3152
3153static SIMD_CFUNC simd_half4 __tg_trunc(simd_half4 x) {
3154#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3155 return vrnd_f16(x);
3156#else
3157 return simd_make_half4(__tg_trunc(simd_make_half8_undef(x)));
3158#endif
3159}
3160
3161static SIMD_CFUNC simd_half8 __tg_trunc(simd_half8 x) {
3162#if defined __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
3163 return vrndq_f16(x);
3164#else
3165 simd_half8 binade = simd_bitselect(0, x, 0x3c00);
3166 simd_short8 mask = (simd_short8)__tg_fmin(-2*binade + 1, -0);
3167 simd_half8 result = simd_bitselect(0, x, mask);
3168 return simd_bitselect(x, result, binade < 0x1.0p10);
3169#endif
3170}
3171
3172static SIMD_CFUNC simd_half16 __tg_trunc(simd_half16 x) {
3173 return simd_make_half16(__tg_trunc(x.lo), __tg_trunc(x.hi));
3174}
3175
3176static SIMD_CFUNC simd_half32 __tg_trunc(simd_half32 x) {
3177 return simd_make_half32(__tg_trunc(x.lo), __tg_trunc(x.hi));
3178}
3179
2609static SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x) {3180static SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x) {
2610#if defined __arm64__3181#if defined __arm64__ || defined __aarch64__
2611 return vrndp_f32(x);3182 return vrndp_f32(x);
2612#else3183#else
2613 return simd_make_float2(__tg_ceil(simd_make_float4_undef(x)));3184 return simd_make_float2(__tg_ceil(simd_make_float4_undef(x)));
...@@ -2625,7 +3196,7 @@ extern simd_float4 _simd_ceil_f4(simd_float4 x);...@@ -2625,7 +3196,7 @@ extern simd_float4 _simd_ceil_f4(simd_float4 x);
2625static SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x) {3196static SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x) {
2626#if defined __SSE4_1__3197#if defined __SSE4_1__
2627 return _mm_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);3198 return _mm_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2628#elif defined __arm64__3199#elif defined __arm64__ || defined __aarch64__
2629 return vrndpq_f32(x);3200 return vrndpq_f32(x);
2630#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33201#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2631 return _simd_ceil_f4(x);3202 return _simd_ceil_f4(x);
...@@ -2659,7 +3230,7 @@ extern simd_double2 _simd_ceil_d2(simd_double2 x);...@@ -2659,7 +3230,7 @@ extern simd_double2 _simd_ceil_d2(simd_double2 x);
2659static SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x) {3230static SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x) {
2660#if defined __SSE4_1__3231#if defined __SSE4_1__
2661 return _mm_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);3232 return _mm_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2662#elif defined __arm64__3233#elif defined __arm64__ || defined __aarch64__
2663 return vrndpq_f64(x);3234 return vrndpq_f64(x);
2664#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33235#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2665 return _simd_ceil_d2(x);3236 return _simd_ceil_d2(x);
...@@ -2691,7 +3262,7 @@ static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) {...@@ -2691,7 +3262,7 @@ static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) {
2691}3262}
26923263
2693static SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x) {3264static SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x) {
2694#if defined __arm64__3265#if defined __arm64__ || defined __aarch64__
2695 return vrndm_f32(x);3266 return vrndm_f32(x);
2696#else3267#else
2697 return simd_make_float2(__tg_floor(simd_make_float4_undef(x)));3268 return simd_make_float2(__tg_floor(simd_make_float4_undef(x)));
...@@ -2709,7 +3280,7 @@ extern simd_float4 _simd_floor_f4(simd_float4 x);...@@ -2709,7 +3280,7 @@ extern simd_float4 _simd_floor_f4(simd_float4 x);
2709static SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x) {3280static SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x) {
2710#if defined __SSE4_1__3281#if defined __SSE4_1__
2711 return _mm_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);3282 return _mm_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2712#elif defined __arm64__3283#elif defined __arm64__ || defined __aarch64__
2713 return vrndmq_f32(x);3284 return vrndmq_f32(x);
2714#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33285#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2715 return _simd_floor_f4(x);3286 return _simd_floor_f4(x);
...@@ -2743,7 +3314,7 @@ extern simd_double2 _simd_floor_d2(simd_double2 x);...@@ -2743,7 +3314,7 @@ extern simd_double2 _simd_floor_d2(simd_double2 x);
2743static SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x) {3314static SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x) {
2744#if defined __SSE4_1__3315#if defined __SSE4_1__
2745 return _mm_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);3316 return _mm_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2746#elif defined __arm64__3317#elif defined __arm64__ || defined __aarch64__
2747 return vrndmq_f64(x);3318 return vrndmq_f64(x);
2748#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33319#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2749 return _simd_floor_d2(x);3320 return _simd_floor_d2(x);
...@@ -2775,7 +3346,7 @@ static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) {...@@ -2775,7 +3346,7 @@ static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) {
2775}3346}
27763347
2777static SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x) {3348static SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x) {
2778#if defined __arm64__3349#if defined __arm64__ || defined __aarch64__
2779 return vrndx_f32(x);3350 return vrndx_f32(x);
2780#else3351#else
2781 return simd_make_float2(__tg_rint(simd_make_float4_undef(x)));3352 return simd_make_float2(__tg_rint(simd_make_float4_undef(x)));
...@@ -2793,7 +3364,7 @@ extern simd_float4 _simd_rint_f4(simd_float4 x);...@@ -2793,7 +3364,7 @@ extern simd_float4 _simd_rint_f4(simd_float4 x);
2793static SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x) {3364static SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x) {
2794#if defined __SSE4_1__3365#if defined __SSE4_1__
2795 return _mm_round_ps(x, _MM_FROUND_RINT);3366 return _mm_round_ps(x, _MM_FROUND_RINT);
2796#elif defined __arm64__3367#elif defined __arm64__ || defined __aarch64__
2797 return vrndxq_f32(x);3368 return vrndxq_f32(x);
2798#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33369#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2799 return _simd_rint_f4(x);3370 return _simd_rint_f4(x);
...@@ -2827,7 +3398,7 @@ extern simd_double2 _simd_rint_d2(simd_double2 x);...@@ -2827,7 +3398,7 @@ extern simd_double2 _simd_rint_d2(simd_double2 x);
2827static SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x) {3398static SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x) {
2828#if defined __SSE4_1__3399#if defined __SSE4_1__
2829 return _mm_round_pd(x, _MM_FROUND_RINT);3400 return _mm_round_pd(x, _MM_FROUND_RINT);
2830#elif defined __arm64__3401#elif defined __arm64__ || defined __aarch64__
2831 return vrndxq_f64(x);3402 return vrndxq_f64(x);
2832#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33403#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2833 return _simd_rint_d2(x);3404 return _simd_rint_d2(x);
...@@ -2859,7 +3430,7 @@ static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) {...@@ -2859,7 +3430,7 @@ static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) {
2859}3430}
28603431
2861static SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x) {3432static SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x) {
2862#if defined __arm64__3433#if defined __arm64__ || defined __aarch64__
2863 return vrnd_f32(x);3434 return vrnd_f32(x);
2864#else3435#else
2865 return simd_make_float2(__tg_trunc(simd_make_float4_undef(x)));3436 return simd_make_float2(__tg_trunc(simd_make_float4_undef(x)));
...@@ -2877,7 +3448,7 @@ extern simd_float4 _simd_trunc_f4(simd_float4 x);...@@ -2877,7 +3448,7 @@ extern simd_float4 _simd_trunc_f4(simd_float4 x);
2877static SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x) {3448static SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x) {
2878#if defined __SSE4_1__3449#if defined __SSE4_1__
2879 return _mm_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);3450 return _mm_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2880#elif defined __arm64__3451#elif defined __arm64__ || defined __aarch64__
2881 return vrndq_f32(x);3452 return vrndq_f32(x);
2882#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33453#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2883 return _simd_trunc_f4(x);3454 return _simd_trunc_f4(x);
...@@ -2912,7 +3483,7 @@ extern simd_double2 _simd_trunc_d2(simd_double2 x);...@@ -2912,7 +3483,7 @@ extern simd_double2 _simd_trunc_d2(simd_double2 x);
2912static SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x) {3483static SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x) {
2913#if defined __SSE4_1__3484#if defined __SSE4_1__
2914 return _mm_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);3485 return _mm_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2915#elif defined __arm64__3486#elif defined __arm64__ || defined __aarch64__
2916 return vrndq_f64(x);3487 return vrndq_f64(x);
2917#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 33488#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2918 return _simd_trunc_d2(x);3489 return _simd_trunc_d2(x);
...@@ -5117,7 +5688,7 @@ static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x) {...@@ -5117,7 +5688,7 @@ static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x) {
5117#if SIMD_LIBRARY_VERSION >= 35688#if SIMD_LIBRARY_VERSION >= 3
5118extern simd_float4 _simd_round_f4(simd_float4 x);5689extern simd_float4 _simd_round_f4(simd_float4 x);
5119static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {5690static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {
5120#if defined __arm64__5691#if defined __arm64__ || defined __aarch64__
5121 return vrndaq_f32(x);5692 return vrndaq_f32(x);
5122#else5693#else
5123 return _simd_round_f4(x);5694 return _simd_round_f4(x);
...@@ -5154,7 +5725,7 @@ static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {...@@ -5154,7 +5725,7 @@ static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
5154#if SIMD_LIBRARY_VERSION >= 35725#if SIMD_LIBRARY_VERSION >= 3
5155extern simd_double2 _simd_round_d2(simd_double2 x);5726extern simd_double2 _simd_round_d2(simd_double2 x);
5156static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {5727static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {
5157#if defined __arm64__5728#if defined __arm64__ || defined __aarch64__
5158 return vrndaq_f64(x);5729 return vrndaq_f64(x);
5159#else5730#else
5160 return _simd_round_d2(x);5731 return _simd_round_d2(x);
...@@ -5868,7 +6439,7 @@ static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y)...@@ -5868,7 +6439,7 @@ static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y)
5868static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); }6439static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); }
5869 6440
5870static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z) {6441static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z) {
5871#if defined __arm64__ || defined __ARM_VFPV4__6442#if defined __arm64__ || defined __aarch64__ || defined __ARM_VFPV4__
5872 return vfma_f32(z, x, y);6443 return vfma_f32(z, x, y);
5873#else6444#else
5874 return simd_make_float2(__tg_fma(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_float4_undef(z)));6445 return simd_make_float2(__tg_fma(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_float4_undef(z)));
...@@ -5883,7 +6454,7 @@ static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd...@@ -5883,7 +6454,7 @@ static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd
5883extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z);6454extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z);
5884#endif6455#endif
5885static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z) {6456static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z) {
5886#if defined __arm64__ || defined __ARM_VFPV4__6457#if defined __arm64__ || defined __aarch64__ || defined __ARM_VFPV4__
5887 return vfmaq_f32(z, x, y);6458 return vfmaq_f32(z, x, y);
5888#elif (defined __i386__ || defined __x86_64__) && defined __FMA__6459#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
5889 return _mm_fmadd_ps(x, y, z);6460 return _mm_fmadd_ps(x, y, z);
...@@ -5914,7 +6485,7 @@ static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, s...@@ -5914,7 +6485,7 @@ static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, s
5914extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z);6485extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z);
5915#endif6486#endif
5916static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z) {6487static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z) {
5917#if defined __arm64__6488#if defined __arm64__ || defined __aarch64__
5918 return vfmaq_f64(z, x, y);6489 return vfmaq_f64(z, x, y);
5919#elif (defined __i386__ || defined __x86_64__) && defined __FMA__6490#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
5920 return _mm_fmadd_pd(x, y, z);6491 return _mm_fmadd_pd(x, y, z);
...@@ -5945,6 +6516,34 @@ static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, s...@@ -5945,6 +6516,34 @@ static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, s
5945#endif6516#endif
5946}6517}
59476518
6519static inline SIMD_CFUNC _Float16 simd_muladd(_Float16 x, _Float16 y, _Float16 z) {
6520#pragma STDC FP_CONTRACT ON
6521 return x*y + z;
6522}
6523static inline SIMD_CFUNC simd_half2 simd_muladd(simd_half2 x, simd_half2 y, simd_half2 z) {
6524#pragma STDC FP_CONTRACT ON
6525 return x*y + z;
6526}
6527static inline SIMD_CFUNC simd_half3 simd_muladd(simd_half3 x, simd_half3 y, simd_half3 z) {
6528#pragma STDC FP_CONTRACT ON
6529 return x*y + z;
6530}
6531static inline SIMD_CFUNC simd_half4 simd_muladd(simd_half4 x, simd_half4 y, simd_half4 z) {
6532#pragma STDC FP_CONTRACT ON
6533 return x*y + z;
6534}
6535static inline SIMD_CFUNC simd_half8 simd_muladd(simd_half8 x, simd_half8 y, simd_half8 z) {
6536#pragma STDC FP_CONTRACT ON
6537 return x*y + z;
6538}
6539static inline SIMD_CFUNC simd_half16 simd_muladd(simd_half16 x, simd_half16 y, simd_half16 z) {
6540#pragma STDC FP_CONTRACT ON
6541 return x*y + z;
6542}
6543static inline SIMD_CFUNC simd_half32 simd_muladd(simd_half32 x, simd_half32 y, simd_half32 z) {
6544#pragma STDC FP_CONTRACT ON
6545 return x*y + z;
6546}
5948static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) {6547static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) {
5949#pragma STDC FP_CONTRACT ON6548#pragma STDC FP_CONTRACT ON
5950 return x*y + z;6549 return x*y + z;
lib/libc/include/any-macos-any/simd/matrix.h+894-19
...@@ -93,6 +93,9 @@...@@ -93,6 +93,9 @@
93 extern "C" {93 extern "C" {
94#endif94#endif
9595
96extern const simd_half2x2 matrix_identity_half2x2 __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
97extern const simd_half3x3 matrix_identity_half3x3 __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
98extern const simd_half4x4 matrix_identity_half4x4 __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
96extern const simd_float2x2 matrix_identity_float2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));99extern const simd_float2x2 matrix_identity_float2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
97extern const simd_float3x3 matrix_identity_float3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));100extern const simd_float3x3 matrix_identity_float3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
98extern const simd_float4x4 matrix_identity_float4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));101extern const simd_float4x4 matrix_identity_float4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
...@@ -100,6 +103,9 @@ extern const simd_double2x2 matrix_identity_double2x2 __API_AVAILABLE(macos(10.1...@@ -100,6 +103,9 @@ extern const simd_double2x2 matrix_identity_double2x2 __API_AVAILABLE(macos(10.1
100extern const simd_double3x3 matrix_identity_double3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));103extern const simd_double3x3 matrix_identity_double3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
101extern const simd_double4x4 matrix_identity_double4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));104extern const simd_double4x4 matrix_identity_double4x4 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
102105
106static simd_half2x2 SIMD_CFUNC simd_diagonal_matrix(simd_half2 __x);
107static simd_half3x3 SIMD_CFUNC simd_diagonal_matrix(simd_half3 __x);
108static simd_half4x4 SIMD_CFUNC simd_diagonal_matrix(simd_half4 __x);
103static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x);109static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x);
104static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x);110static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x);
105static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x);111static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x);
...@@ -108,6 +114,15 @@ static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x);...@@ -108,6 +114,15 @@ static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x);
108static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x);114static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x);
109#define matrix_from_diagonal simd_diagonal_matrix115#define matrix_from_diagonal simd_diagonal_matrix
110116
117static simd_half2x2 SIMD_CFUNC simd_matrix(simd_half2 col0, simd_half2 col1);
118static simd_half3x2 SIMD_CFUNC simd_matrix(simd_half2 col0, simd_half2 col1, simd_half2 col2);
119static simd_half4x2 SIMD_CFUNC simd_matrix(simd_half2 col0, simd_half2 col1, simd_half2 col2, simd_half2 col3);
120static simd_half2x3 SIMD_CFUNC simd_matrix(simd_half3 col0, simd_half3 col1);
121static simd_half3x3 SIMD_CFUNC simd_matrix(simd_half3 col0, simd_half3 col1, simd_half3 col2);
122static simd_half4x3 SIMD_CFUNC simd_matrix(simd_half3 col0, simd_half3 col1, simd_half3 col2, simd_half3 col3);
123static simd_half2x4 SIMD_CFUNC simd_matrix(simd_half4 col0, simd_half4 col1);
124static simd_half3x4 SIMD_CFUNC simd_matrix(simd_half4 col0, simd_half4 col1, simd_half4 col2);
125static simd_half4x4 SIMD_CFUNC simd_matrix(simd_half4 col0, simd_half4 col1, simd_half4 col2, simd_half4 col3);
111static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1);126static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1);
112static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2);127static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2);
113static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3);128static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3);
...@@ -128,6 +143,15 @@ static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col...@@ -128,6 +143,15 @@ static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col
128static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3);143static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3);
129#define matrix_from_columns simd_matrix144#define matrix_from_columns simd_matrix
130145
146static simd_half2x2 SIMD_CFUNC simd_matrix_from_rows(simd_half2 row0, simd_half2 row1);
147static simd_half2x3 SIMD_CFUNC simd_matrix_from_rows(simd_half2 row0, simd_half2 row1, simd_half2 row2);
148static simd_half2x4 SIMD_CFUNC simd_matrix_from_rows(simd_half2 row0, simd_half2 row1, simd_half2 row2, simd_half2 row3);
149static simd_half3x2 SIMD_CFUNC simd_matrix_from_rows(simd_half3 row0, simd_half3 row1);
150static simd_half3x3 SIMD_CFUNC simd_matrix_from_rows(simd_half3 row0, simd_half3 row1, simd_half3 row2);
151static simd_half3x4 SIMD_CFUNC simd_matrix_from_rows(simd_half3 row0, simd_half3 row1, simd_half3 row2, simd_half3 row3);
152static simd_half4x2 SIMD_CFUNC simd_matrix_from_rows(simd_half4 row0, simd_half4 row1);
153static simd_half4x3 SIMD_CFUNC simd_matrix_from_rows(simd_half4 row0, simd_half4 row1, simd_half4 row2);
154static simd_half4x4 SIMD_CFUNC simd_matrix_from_rows(simd_half4 row0, simd_half4 row1, simd_half4 row2, simd_half4 row3);
131static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1);155static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1);
132static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2);156static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2);
133static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3);157static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3);
...@@ -148,11 +172,22 @@ static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_d...@@ -148,11 +172,22 @@ static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_d
148static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3);172static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3);
149#define matrix_from_rows simd_matrix_from_rows173#define matrix_from_rows simd_matrix_from_rows
150 174
175static simd_half3x3 SIMD_NOINLINE simd_matrix3x3(simd_quath q);
176static simd_half4x4 SIMD_NOINLINE simd_matrix4x4(simd_quath q);
151static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);177static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);
152static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);178static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);
153static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);179static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);
154static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);180static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);
155181
182static simd_half2x2 SIMD_CFUNC simd_mul(_Float16 __a, simd_half2x2 __x);
183static simd_half3x2 SIMD_CFUNC simd_mul(_Float16 __a, simd_half3x2 __x);
184static simd_half4x2 SIMD_CFUNC simd_mul(_Float16 __a, simd_half4x2 __x);
185static simd_half2x3 SIMD_CFUNC simd_mul(_Float16 __a, simd_half2x3 __x);
186static simd_half3x3 SIMD_CFUNC simd_mul(_Float16 __a, simd_half3x3 __x);
187static simd_half4x3 SIMD_CFUNC simd_mul(_Float16 __a, simd_half4x3 __x);
188static simd_half2x4 SIMD_CFUNC simd_mul(_Float16 __a, simd_half2x4 __x);
189static simd_half3x4 SIMD_CFUNC simd_mul(_Float16 __a, simd_half3x4 __x);
190static simd_half4x4 SIMD_CFUNC simd_mul(_Float16 __a, simd_half4x4 __x);
156static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x);191static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x);
157static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x);192static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x);
158static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x);193static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x);
...@@ -172,6 +207,15 @@ static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x);...@@ -172,6 +207,15 @@ static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x);
172static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x);207static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x);
173static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x);208static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x);
174209
210static simd_half2x2 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half2x2 __x, _Float16 __b, simd_half2x2 __y);
211static simd_half3x2 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half3x2 __x, _Float16 __b, simd_half3x2 __y);
212static simd_half4x2 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half4x2 __x, _Float16 __b, simd_half4x2 __y);
213static simd_half2x3 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half2x3 __x, _Float16 __b, simd_half2x3 __y);
214static simd_half3x3 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half3x3 __x, _Float16 __b, simd_half3x3 __y);
215static simd_half4x3 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half4x3 __x, _Float16 __b, simd_half4x3 __y);
216static simd_half2x4 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half2x4 __x, _Float16 __b, simd_half2x4 __y);
217static simd_half3x4 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half3x4 __x, _Float16 __b, simd_half3x4 __y);
218static simd_half4x4 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half4x4 __x, _Float16 __b, simd_half4x4 __y);
175static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y);219static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y);
176static simd_float3x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x2 __x, float __b, simd_float3x2 __y);220static simd_float3x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x2 __x, float __b, simd_float3x2 __y);
177static simd_float4x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x2 __x, float __b, simd_float4x2 __y);221static simd_float4x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float4x2 __x, float __b, simd_float4x2 __y);
...@@ -192,6 +236,15 @@ static simd_double3x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double...@@ -192,6 +236,15 @@ static simd_double3x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double
192static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x4 __x, double __b, simd_double4x4 __y);236static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x4 __x, double __b, simd_double4x4 __y);
193#define matrix_linear_combination simd_linear_combination237#define matrix_linear_combination simd_linear_combination
194 238
239static simd_half2x2 SIMD_CFUNC simd_add(simd_half2x2 __x, simd_half2x2 __y);
240static simd_half3x2 SIMD_CFUNC simd_add(simd_half3x2 __x, simd_half3x2 __y);
241static simd_half4x2 SIMD_CFUNC simd_add(simd_half4x2 __x, simd_half4x2 __y);
242static simd_half2x3 SIMD_CFUNC simd_add(simd_half2x3 __x, simd_half2x3 __y);
243static simd_half3x3 SIMD_CFUNC simd_add(simd_half3x3 __x, simd_half3x3 __y);
244static simd_half4x3 SIMD_CFUNC simd_add(simd_half4x3 __x, simd_half4x3 __y);
245static simd_half2x4 SIMD_CFUNC simd_add(simd_half2x4 __x, simd_half2x4 __y);
246static simd_half3x4 SIMD_CFUNC simd_add(simd_half3x4 __x, simd_half3x4 __y);
247static simd_half4x4 SIMD_CFUNC simd_add(simd_half4x4 __x, simd_half4x4 __y);
195static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y);248static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y);
196static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y);249static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y);
197static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y);250static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y);
...@@ -212,6 +265,15 @@ static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y...@@ -212,6 +265,15 @@ static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y
212static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y);265static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y);
213#define matrix_add simd_add266#define matrix_add simd_add
214 267
268static simd_half2x2 SIMD_CFUNC simd_sub(simd_half2x2 __x, simd_half2x2 __y);
269static simd_half3x2 SIMD_CFUNC simd_sub(simd_half3x2 __x, simd_half3x2 __y);
270static simd_half4x2 SIMD_CFUNC simd_sub(simd_half4x2 __x, simd_half4x2 __y);
271static simd_half2x3 SIMD_CFUNC simd_sub(simd_half2x3 __x, simd_half2x3 __y);
272static simd_half3x3 SIMD_CFUNC simd_sub(simd_half3x3 __x, simd_half3x3 __y);
273static simd_half4x3 SIMD_CFUNC simd_sub(simd_half4x3 __x, simd_half4x3 __y);
274static simd_half2x4 SIMD_CFUNC simd_sub(simd_half2x4 __x, simd_half2x4 __y);
275static simd_half3x4 SIMD_CFUNC simd_sub(simd_half3x4 __x, simd_half3x4 __y);
276static simd_half4x4 SIMD_CFUNC simd_sub(simd_half4x4 __x, simd_half4x4 __y);
215static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y);277static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y);
216static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y);278static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y);
217static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y);279static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y);
...@@ -232,6 +294,15 @@ static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y...@@ -232,6 +294,15 @@ static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y
232static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y);294static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y);
233#define matrix_sub simd_sub295#define matrix_sub simd_sub
234296
297static simd_half2x2 SIMD_CFUNC simd_transpose(simd_half2x2 __x);
298static simd_half2x3 SIMD_CFUNC simd_transpose(simd_half3x2 __x);
299static simd_half2x4 SIMD_CFUNC simd_transpose(simd_half4x2 __x);
300static simd_half3x2 SIMD_CFUNC simd_transpose(simd_half2x3 __x);
301static simd_half3x3 SIMD_CFUNC simd_transpose(simd_half3x3 __x);
302static simd_half3x4 SIMD_CFUNC simd_transpose(simd_half4x3 __x);
303static simd_half4x2 SIMD_CFUNC simd_transpose(simd_half2x4 __x);
304static simd_half4x3 SIMD_CFUNC simd_transpose(simd_half3x4 __x);
305static simd_half4x4 SIMD_CFUNC simd_transpose(simd_half4x4 __x);
235static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x);306static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x);
236static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x);307static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x);
237static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x);308static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x);
...@@ -252,6 +323,9 @@ static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x);...@@ -252,6 +323,9 @@ static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x);
252static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x);323static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x);
253#define matrix_transpose simd_transpose324#define matrix_transpose simd_transpose
254325
326static _Float16 SIMD_CFUNC simd_trace(simd_half2x2 __x);
327static _Float16 SIMD_CFUNC simd_trace(simd_half3x3 __x);
328static _Float16 SIMD_CFUNC simd_trace(simd_half4x4 __x);
255static float SIMD_CFUNC simd_trace(simd_float2x2 __x);329static float SIMD_CFUNC simd_trace(simd_float2x2 __x);
256static float SIMD_CFUNC simd_trace(simd_float3x3 __x);330static float SIMD_CFUNC simd_trace(simd_float3x3 __x);
257static float SIMD_CFUNC simd_trace(simd_float4x4 __x);331static float SIMD_CFUNC simd_trace(simd_float4x4 __x);
...@@ -260,6 +334,9 @@ static double SIMD_CFUNC simd_trace(simd_double3x3 __x);...@@ -260,6 +334,9 @@ static double SIMD_CFUNC simd_trace(simd_double3x3 __x);
260static double SIMD_CFUNC simd_trace(simd_double4x4 __x);334static double SIMD_CFUNC simd_trace(simd_double4x4 __x);
261#define matrix_trace simd_trace335#define matrix_trace simd_trace
262336
337static _Float16 SIMD_CFUNC simd_determinant(simd_half2x2 __x);
338static _Float16 SIMD_CFUNC simd_determinant(simd_half3x3 __x);
339static _Float16 SIMD_CFUNC simd_determinant(simd_half4x4 __x);
263static float SIMD_CFUNC simd_determinant(simd_float2x2 __x);340static float SIMD_CFUNC simd_determinant(simd_float2x2 __x);
264static float SIMD_CFUNC simd_determinant(simd_float3x3 __x);341static float SIMD_CFUNC simd_determinant(simd_float3x3 __x);
265static float SIMD_CFUNC simd_determinant(simd_float4x4 __x);342static float SIMD_CFUNC simd_determinant(simd_float4x4 __x);
...@@ -268,6 +345,9 @@ static double SIMD_CFUNC simd_determinant(simd_double3x3 __x);...@@ -268,6 +345,9 @@ static double SIMD_CFUNC simd_determinant(simd_double3x3 __x);
268static double SIMD_CFUNC simd_determinant(simd_double4x4 __x);345static double SIMD_CFUNC simd_determinant(simd_double4x4 __x);
269#define matrix_determinant simd_determinant346#define matrix_determinant simd_determinant
270347
348static simd_half2x2 SIMD_CFUNC simd_inverse(simd_half2x2 __x) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
349static simd_half3x3 SIMD_CFUNC simd_inverse(simd_half3x3 __x) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
350static simd_half4x4 SIMD_CFUNC simd_inverse(simd_half4x4 __x) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
271static simd_float2x2 SIMD_CFUNC simd_inverse(simd_float2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));351static simd_float2x2 SIMD_CFUNC simd_inverse(simd_float2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
272static simd_float3x3 SIMD_CFUNC simd_inverse(simd_float3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));352static simd_float3x3 SIMD_CFUNC simd_inverse(simd_float3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
273static simd_float4x4 SIMD_CFUNC simd_inverse(simd_float4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));353static simd_float4x4 SIMD_CFUNC simd_inverse(simd_float4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
...@@ -276,6 +356,15 @@ static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) __API_AVAILABL...@@ -276,6 +356,15 @@ static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) __API_AVAILABL
276static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));356static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
277#define matrix_invert simd_inverse357#define matrix_invert simd_inverse
278358
359static simd_half2 SIMD_CFUNC simd_mul(simd_half2x2 __x, simd_half2 __y);
360static simd_half2 SIMD_CFUNC simd_mul(simd_half3x2 __x, simd_half3 __y);
361static simd_half2 SIMD_CFUNC simd_mul(simd_half4x2 __x, simd_half4 __y);
362static simd_half3 SIMD_CFUNC simd_mul(simd_half2x3 __x, simd_half2 __y);
363static simd_half3 SIMD_CFUNC simd_mul(simd_half3x3 __x, simd_half3 __y);
364static simd_half3 SIMD_CFUNC simd_mul(simd_half4x3 __x, simd_half4 __y);
365static simd_half4 SIMD_CFUNC simd_mul(simd_half2x4 __x, simd_half2 __y);
366static simd_half4 SIMD_CFUNC simd_mul(simd_half3x4 __x, simd_half3 __y);
367static simd_half4 SIMD_CFUNC simd_mul(simd_half4x4 __x, simd_half4 __y);
279static simd_float2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2 __y);368static simd_float2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2 __y);
280static simd_float2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3 __y);369static simd_float2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3 __y);
281static simd_float2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4 __y);370static simd_float2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4 __y);
...@@ -294,6 +383,15 @@ static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y);...@@ -294,6 +383,15 @@ static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y);
294static simd_double4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2 __y);383static simd_double4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2 __y);
295static simd_double4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3 __y);384static simd_double4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3 __y);
296static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y);385static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y);
386static simd_half2 SIMD_CFUNC simd_mul(simd_half2 __x, simd_half2x2 __y);
387static simd_half3 SIMD_CFUNC simd_mul(simd_half2 __x, simd_half3x2 __y);
388static simd_half4 SIMD_CFUNC simd_mul(simd_half2 __x, simd_half4x2 __y);
389static simd_half2 SIMD_CFUNC simd_mul(simd_half3 __x, simd_half2x3 __y);
390static simd_half3 SIMD_CFUNC simd_mul(simd_half3 __x, simd_half3x3 __y);
391static simd_half4 SIMD_CFUNC simd_mul(simd_half3 __x, simd_half4x3 __y);
392static simd_half2 SIMD_CFUNC simd_mul(simd_half4 __x, simd_half2x4 __y);
393static simd_half3 SIMD_CFUNC simd_mul(simd_half4 __x, simd_half3x4 __y);
394static simd_half4 SIMD_CFUNC simd_mul(simd_half4 __x, simd_half4x4 __y);
297static simd_float2 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float2x2 __y);395static simd_float2 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float2x2 __y);
298static simd_float3 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float3x2 __y);396static simd_float3 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float3x2 __y);
299static simd_float4 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float4x2 __y);397static simd_float4 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float4x2 __y);
...@@ -312,6 +410,15 @@ static simd_double4 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double4x3 __y);...@@ -312,6 +410,15 @@ static simd_double4 SIMD_CFUNC simd_mul(simd_double3 __x, simd_double4x3 __y);
312static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y);410static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y);
313static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y);411static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y);
314static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y);412static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y);
413static simd_half2x2 SIMD_CFUNC simd_mul(simd_half2x2 __x, simd_half2x2 __y);
414static simd_half3x2 SIMD_CFUNC simd_mul(simd_half2x2 __x, simd_half3x2 __y);
415static simd_half4x2 SIMD_CFUNC simd_mul(simd_half2x2 __x, simd_half4x2 __y);
416static simd_half2x3 SIMD_CFUNC simd_mul(simd_half2x3 __x, simd_half2x2 __y);
417static simd_half3x3 SIMD_CFUNC simd_mul(simd_half2x3 __x, simd_half3x2 __y);
418static simd_half4x3 SIMD_CFUNC simd_mul(simd_half2x3 __x, simd_half4x2 __y);
419static simd_half2x4 SIMD_CFUNC simd_mul(simd_half2x4 __x, simd_half2x2 __y);
420static simd_half3x4 SIMD_CFUNC simd_mul(simd_half2x4 __x, simd_half3x2 __y);
421static simd_half4x4 SIMD_CFUNC simd_mul(simd_half2x4 __x, simd_half4x2 __y);
315static simd_float2x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2x2 __y);422static simd_float2x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2x2 __y);
316static simd_float3x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float3x2 __y);423static simd_float3x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float3x2 __y);
317static simd_float4x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float4x2 __y);424static simd_float4x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float4x2 __y);
...@@ -330,6 +437,15 @@ static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y...@@ -330,6 +437,15 @@ static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y
330static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y);437static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y);
331static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y);438static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y);
332static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y);439static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y);
440static simd_half2x2 SIMD_CFUNC simd_mul(simd_half3x2 __x, simd_half2x3 __y);
441static simd_half3x2 SIMD_CFUNC simd_mul(simd_half3x2 __x, simd_half3x3 __y);
442static simd_half4x2 SIMD_CFUNC simd_mul(simd_half3x2 __x, simd_half4x3 __y);
443static simd_half2x3 SIMD_CFUNC simd_mul(simd_half3x3 __x, simd_half2x3 __y);
444static simd_half3x3 SIMD_CFUNC simd_mul(simd_half3x3 __x, simd_half3x3 __y);
445static simd_half4x3 SIMD_CFUNC simd_mul(simd_half3x3 __x, simd_half4x3 __y);
446static simd_half2x4 SIMD_CFUNC simd_mul(simd_half3x4 __x, simd_half2x3 __y);
447static simd_half3x4 SIMD_CFUNC simd_mul(simd_half3x4 __x, simd_half3x3 __y);
448static simd_half4x4 SIMD_CFUNC simd_mul(simd_half3x4 __x, simd_half4x3 __y);
333static simd_float2x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float2x3 __y);449static simd_float2x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float2x3 __y);
334static simd_float3x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3x3 __y);450static simd_float3x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3x3 __y);
335static simd_float4x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float4x3 __y);451static simd_float4x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float4x3 __y);
...@@ -348,6 +464,15 @@ static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y...@@ -348,6 +464,15 @@ static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y
348static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y);464static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y);
349static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y);465static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y);
350static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y);466static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y);
467static simd_half2x2 SIMD_CFUNC simd_mul(simd_half4x2 __x, simd_half2x4 __y);
468static simd_half3x2 SIMD_CFUNC simd_mul(simd_half4x2 __x, simd_half3x4 __y);
469static simd_half4x2 SIMD_CFUNC simd_mul(simd_half4x2 __x, simd_half4x4 __y);
470static simd_half2x3 SIMD_CFUNC simd_mul(simd_half4x3 __x, simd_half2x4 __y);
471static simd_half3x3 SIMD_CFUNC simd_mul(simd_half4x3 __x, simd_half3x4 __y);
472static simd_half4x3 SIMD_CFUNC simd_mul(simd_half4x3 __x, simd_half4x4 __y);
473static simd_half2x4 SIMD_CFUNC simd_mul(simd_half4x4 __x, simd_half2x4 __y);
474static simd_half3x4 SIMD_CFUNC simd_mul(simd_half4x4 __x, simd_half3x4 __y);
475static simd_half4x4 SIMD_CFUNC simd_mul(simd_half4x4 __x, simd_half4x4 __y);
351static simd_float2x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float2x4 __y);476static simd_float2x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float2x4 __y);
352static simd_float3x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float3x4 __y);477static simd_float3x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float3x4 __y);
353static simd_float4x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4x4 __y);478static simd_float4x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float4x4 __y);
...@@ -367,6 +492,15 @@ static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y...@@ -367,6 +492,15 @@ static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y
367static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y);492static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y);
368static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y);493static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y);
369 494
495static simd_bool SIMD_CFUNC simd_equal(simd_half2x2 __x, simd_half2x2 __y);
496static simd_bool SIMD_CFUNC simd_equal(simd_half2x3 __x, simd_half2x3 __y);
497static simd_bool SIMD_CFUNC simd_equal(simd_half2x4 __x, simd_half2x4 __y);
498static simd_bool SIMD_CFUNC simd_equal(simd_half3x2 __x, simd_half3x2 __y);
499static simd_bool SIMD_CFUNC simd_equal(simd_half3x3 __x, simd_half3x3 __y);
500static simd_bool SIMD_CFUNC simd_equal(simd_half3x4 __x, simd_half3x4 __y);
501static simd_bool SIMD_CFUNC simd_equal(simd_half4x2 __x, simd_half4x2 __y);
502static simd_bool SIMD_CFUNC simd_equal(simd_half4x3 __x, simd_half4x3 __y);
503static simd_bool SIMD_CFUNC simd_equal(simd_half4x4 __x, simd_half4x4 __y);
370static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y);504static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y);
371static simd_bool SIMD_CFUNC simd_equal(simd_float2x3 __x, simd_float2x3 __y);505static simd_bool SIMD_CFUNC simd_equal(simd_float2x3 __x, simd_float2x3 __y);
372static simd_bool SIMD_CFUNC simd_equal(simd_float2x4 __x, simd_float2x4 __y);506static simd_bool SIMD_CFUNC simd_equal(simd_float2x4 __x, simd_float2x4 __y);
...@@ -387,6 +521,15 @@ static simd_bool SIMD_CFUNC simd_equal(simd_double4x3 __x, simd_double4x3 __y);...@@ -387,6 +521,15 @@ static simd_bool SIMD_CFUNC simd_equal(simd_double4x3 __x, simd_double4x3 __y);
387static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y);521static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y);
388#define matrix_equal simd_equal522#define matrix_equal simd_equal
389 523
524static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half2x2 __x, simd_half2x2 __y, _Float16 __tol);
525static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half2x3 __x, simd_half2x3 __y, _Float16 __tol);
526static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half2x4 __x, simd_half2x4 __y, _Float16 __tol);
527static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half3x2 __x, simd_half3x2 __y, _Float16 __tol);
528static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half3x3 __x, simd_half3x3 __y, _Float16 __tol);
529static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half3x4 __x, simd_half3x4 __y, _Float16 __tol);
530static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half4x2 __x, simd_half4x2 __y, _Float16 __tol);
531static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half4x3 __x, simd_half4x3 __y, _Float16 __tol);
532static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half4x4 __x, simd_half4x4 __y, _Float16 __tol);
390static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol);533static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol);
391static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x3 __x, simd_float2x3 __y, float __tol);534static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x3 __x, simd_float2x3 __y, float __tol);
392static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x4 __x, simd_float2x4 __y, float __tol);535static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x4 __x, simd_float2x4 __y, float __tol);
...@@ -407,6 +550,15 @@ static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x3 __x, simd_...@@ -407,6 +550,15 @@ static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x3 __x, simd_
407static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_double4x4 __y, double __tol);550static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_double4x4 __y, double __tol);
408#define matrix_almost_equal_elements simd_almost_equal_elements551#define matrix_almost_equal_elements simd_almost_equal_elements
409 552
553static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half2x2 __x, simd_half2x2 __y, _Float16 __tol);
554static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half2x3 __x, simd_half2x3 __y, _Float16 __tol);
555static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half2x4 __x, simd_half2x4 __y, _Float16 __tol);
556static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half3x2 __x, simd_half3x2 __y, _Float16 __tol);
557static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half3x3 __x, simd_half3x3 __y, _Float16 __tol);
558static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half3x4 __x, simd_half3x4 __y, _Float16 __tol);
559static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half4x2 __x, simd_half4x2 __y, _Float16 __tol);
560static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half4x3 __x, simd_half4x3 __y, _Float16 __tol);
561static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half4x4 __x, simd_half4x4 __y, _Float16 __tol);
410static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol);562static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol);
411static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x3 __x, simd_float2x3 __y, float __tol);563static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x3 __x, simd_float2x3 __y, float __tol);
412static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x4 __x, simd_float2x4 __y, float __tol);564static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x4 __x, simd_float2x4 __y, float __tol);
...@@ -431,6 +583,198 @@ static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x4 _...@@ -431,6 +583,198 @@ static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_double4x4 _
431} /* extern "C" */583} /* extern "C" */
432584
433namespace simd {585namespace simd {
586 static SIMD_CPPFUNC half2x2 operator+(const half2x2 x, const half2x2 y) { return half2x2(::simd_linear_combination(1, x, 1, y)); }
587 static SIMD_CPPFUNC half2x3 operator+(const half2x3 x, const half2x3 y) { return half2x3(::simd_linear_combination(1, x, 1, y)); }
588 static SIMD_CPPFUNC half2x4 operator+(const half2x4 x, const half2x4 y) { return half2x4(::simd_linear_combination(1, x, 1, y)); }
589 static SIMD_CPPFUNC half3x2 operator+(const half3x2 x, const half3x2 y) { return half3x2(::simd_linear_combination(1, x, 1, y)); }
590 static SIMD_CPPFUNC half3x3 operator+(const half3x3 x, const half3x3 y) { return half3x3(::simd_linear_combination(1, x, 1, y)); }
591 static SIMD_CPPFUNC half3x4 operator+(const half3x4 x, const half3x4 y) { return half3x4(::simd_linear_combination(1, x, 1, y)); }
592 static SIMD_CPPFUNC half4x2 operator+(const half4x2 x, const half4x2 y) { return half4x2(::simd_linear_combination(1, x, 1, y)); }
593 static SIMD_CPPFUNC half4x3 operator+(const half4x3 x, const half4x3 y) { return half4x3(::simd_linear_combination(1, x, 1, y)); }
594 static SIMD_CPPFUNC half4x4 operator+(const half4x4 x, const half4x4 y) { return half4x4(::simd_linear_combination(1, x, 1, y)); }
595
596 static SIMD_CPPFUNC half2x2 operator-(const half2x2 x, const half2x2 y) { return half2x2(::simd_linear_combination(1, x, -1, y)); }
597 static SIMD_CPPFUNC half2x3 operator-(const half2x3 x, const half2x3 y) { return half2x3(::simd_linear_combination(1, x, -1, y)); }
598 static SIMD_CPPFUNC half2x4 operator-(const half2x4 x, const half2x4 y) { return half2x4(::simd_linear_combination(1, x, -1, y)); }
599 static SIMD_CPPFUNC half3x2 operator-(const half3x2 x, const half3x2 y) { return half3x2(::simd_linear_combination(1, x, -1, y)); }
600 static SIMD_CPPFUNC half3x3 operator-(const half3x3 x, const half3x3 y) { return half3x3(::simd_linear_combination(1, x, -1, y)); }
601 static SIMD_CPPFUNC half3x4 operator-(const half3x4 x, const half3x4 y) { return half3x4(::simd_linear_combination(1, x, -1, y)); }
602 static SIMD_CPPFUNC half4x2 operator-(const half4x2 x, const half4x2 y) { return half4x2(::simd_linear_combination(1, x, -1, y)); }
603 static SIMD_CPPFUNC half4x3 operator-(const half4x3 x, const half4x3 y) { return half4x3(::simd_linear_combination(1, x, -1, y)); }
604 static SIMD_CPPFUNC half4x4 operator-(const half4x4 x, const half4x4 y) { return half4x4(::simd_linear_combination(1, x, -1, y)); }
605
606 static SIMD_INLINE SIMD_NODEBUG half2x2& operator+=(half2x2& x, const half2x2 y) { x = x + y; return x; }
607 static SIMD_INLINE SIMD_NODEBUG half2x3& operator+=(half2x3& x, const half2x3 y) { x = x + y; return x; }
608 static SIMD_INLINE SIMD_NODEBUG half2x4& operator+=(half2x4& x, const half2x4 y) { x = x + y; return x; }
609 static SIMD_INLINE SIMD_NODEBUG half3x2& operator+=(half3x2& x, const half3x2 y) { x = x + y; return x; }
610 static SIMD_INLINE SIMD_NODEBUG half3x3& operator+=(half3x3& x, const half3x3 y) { x = x + y; return x; }
611 static SIMD_INLINE SIMD_NODEBUG half3x4& operator+=(half3x4& x, const half3x4 y) { x = x + y; return x; }
612 static SIMD_INLINE SIMD_NODEBUG half4x2& operator+=(half4x2& x, const half4x2 y) { x = x + y; return x; }
613 static SIMD_INLINE SIMD_NODEBUG half4x3& operator+=(half4x3& x, const half4x3 y) { x = x + y; return x; }
614 static SIMD_INLINE SIMD_NODEBUG half4x4& operator+=(half4x4& x, const half4x4 y) { x = x + y; return x; }
615
616 static SIMD_INLINE SIMD_NODEBUG half2x2& operator-=(half2x2& x, const half2x2 y) { x = x - y; return x; }
617 static SIMD_INLINE SIMD_NODEBUG half2x3& operator-=(half2x3& x, const half2x3 y) { x = x - y; return x; }
618 static SIMD_INLINE SIMD_NODEBUG half2x4& operator-=(half2x4& x, const half2x4 y) { x = x - y; return x; }
619 static SIMD_INLINE SIMD_NODEBUG half3x2& operator-=(half3x2& x, const half3x2 y) { x = x - y; return x; }
620 static SIMD_INLINE SIMD_NODEBUG half3x3& operator-=(half3x3& x, const half3x3 y) { x = x - y; return x; }
621 static SIMD_INLINE SIMD_NODEBUG half3x4& operator-=(half3x4& x, const half3x4 y) { x = x - y; return x; }
622 static SIMD_INLINE SIMD_NODEBUG half4x2& operator-=(half4x2& x, const half4x2 y) { x = x - y; return x; }
623 static SIMD_INLINE SIMD_NODEBUG half4x3& operator-=(half4x3& x, const half4x3 y) { x = x - y; return x; }
624 static SIMD_INLINE SIMD_NODEBUG half4x4& operator-=(half4x4& x, const half4x4 y) { x = x - y; return x; }
625
626 static SIMD_CPPFUNC half2x2 transpose(const half2x2 x) { return ::simd_transpose(x); }
627 static SIMD_CPPFUNC half2x3 transpose(const half3x2 x) { return ::simd_transpose(x); }
628 static SIMD_CPPFUNC half2x4 transpose(const half4x2 x) { return ::simd_transpose(x); }
629 static SIMD_CPPFUNC half3x2 transpose(const half2x3 x) { return ::simd_transpose(x); }
630 static SIMD_CPPFUNC half3x3 transpose(const half3x3 x) { return ::simd_transpose(x); }
631 static SIMD_CPPFUNC half3x4 transpose(const half4x3 x) { return ::simd_transpose(x); }
632 static SIMD_CPPFUNC half4x2 transpose(const half2x4 x) { return ::simd_transpose(x); }
633 static SIMD_CPPFUNC half4x3 transpose(const half3x4 x) { return ::simd_transpose(x); }
634 static SIMD_CPPFUNC half4x4 transpose(const half4x4 x) { return ::simd_transpose(x); }
635
636 static SIMD_CPPFUNC _Float16 trace(const half2x2 x) { return ::simd_trace(x); }
637 static SIMD_CPPFUNC _Float16 trace(const half3x3 x) { return ::simd_trace(x); }
638 static SIMD_CPPFUNC _Float16 trace(const half4x4 x) { return ::simd_trace(x); }
639
640 static SIMD_CPPFUNC _Float16 determinant(const half2x2 x) { return ::simd_determinant(x); }
641 static SIMD_CPPFUNC _Float16 determinant(const half3x3 x) { return ::simd_determinant(x); }
642 static SIMD_CPPFUNC _Float16 determinant(const half4x4 x) { return ::simd_determinant(x); }
643
644#pragma clang diagnostic push
645#pragma clang diagnostic ignored "-Wgcc-compat"
646 static SIMD_CPPFUNC half2x2 inverse(const half2x2 x) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)) { return ::simd_inverse(x); }
647 static SIMD_CPPFUNC half3x3 inverse(const half3x3 x) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)) { return ::simd_inverse(x); }
648 static SIMD_CPPFUNC half4x4 inverse(const half4x4 x) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)) { return ::simd_inverse(x); }
649#pragma clang diagnostic pop
650
651 static SIMD_CPPFUNC half2x2 operator*(const _Float16 a, const half2x2 x) { return ::simd_mul(a, x); }
652 static SIMD_CPPFUNC half2x3 operator*(const _Float16 a, const half2x3 x) { return ::simd_mul(a, x); }
653 static SIMD_CPPFUNC half2x4 operator*(const _Float16 a, const half2x4 x) { return ::simd_mul(a, x); }
654 static SIMD_CPPFUNC half3x2 operator*(const _Float16 a, const half3x2 x) { return ::simd_mul(a, x); }
655 static SIMD_CPPFUNC half3x3 operator*(const _Float16 a, const half3x3 x) { return ::simd_mul(a, x); }
656 static SIMD_CPPFUNC half3x4 operator*(const _Float16 a, const half3x4 x) { return ::simd_mul(a, x); }
657 static SIMD_CPPFUNC half4x2 operator*(const _Float16 a, const half4x2 x) { return ::simd_mul(a, x); }
658 static SIMD_CPPFUNC half4x3 operator*(const _Float16 a, const half4x3 x) { return ::simd_mul(a, x); }
659 static SIMD_CPPFUNC half4x4 operator*(const _Float16 a, const half4x4 x) { return ::simd_mul(a, x); }
660 static SIMD_CPPFUNC half2x2 operator*(const half2x2 x, const _Float16 a) { return ::simd_mul(a, x); }
661 static SIMD_CPPFUNC half2x3 operator*(const half2x3 x, const _Float16 a) { return ::simd_mul(a, x); }
662 static SIMD_CPPFUNC half2x4 operator*(const half2x4 x, const _Float16 a) { return ::simd_mul(a, x); }
663 static SIMD_CPPFUNC half3x2 operator*(const half3x2 x, const _Float16 a) { return ::simd_mul(a, x); }
664 static SIMD_CPPFUNC half3x3 operator*(const half3x3 x, const _Float16 a) { return ::simd_mul(a, x); }
665 static SIMD_CPPFUNC half3x4 operator*(const half3x4 x, const _Float16 a) { return ::simd_mul(a, x); }
666 static SIMD_CPPFUNC half4x2 operator*(const half4x2 x, const _Float16 a) { return ::simd_mul(a, x); }
667 static SIMD_CPPFUNC half4x3 operator*(const half4x3 x, const _Float16 a) { return ::simd_mul(a, x); }
668 static SIMD_CPPFUNC half4x4 operator*(const half4x4 x, const _Float16 a) { return ::simd_mul(a, x); }
669 static SIMD_INLINE SIMD_NODEBUG half2x2& operator*=(half2x2& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
670 static SIMD_INLINE SIMD_NODEBUG half2x3& operator*=(half2x3& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
671 static SIMD_INLINE SIMD_NODEBUG half2x4& operator*=(half2x4& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
672 static SIMD_INLINE SIMD_NODEBUG half3x2& operator*=(half3x2& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
673 static SIMD_INLINE SIMD_NODEBUG half3x3& operator*=(half3x3& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
674 static SIMD_INLINE SIMD_NODEBUG half3x4& operator*=(half3x4& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
675 static SIMD_INLINE SIMD_NODEBUG half4x2& operator*=(half4x2& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
676 static SIMD_INLINE SIMD_NODEBUG half4x3& operator*=(half4x3& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
677 static SIMD_INLINE SIMD_NODEBUG half4x4& operator*=(half4x4& x, const _Float16 a) { x = ::simd_mul(a, x); return x; }
678
679 static SIMD_CPPFUNC half2 operator*(const half2 x, const half2x2 y) { return ::simd_mul(x, y); }
680 static SIMD_CPPFUNC half3 operator*(const half2 x, const half3x2 y) { return ::simd_mul(x, y); }
681 static SIMD_CPPFUNC half4 operator*(const half2 x, const half4x2 y) { return ::simd_mul(x, y); }
682 static SIMD_CPPFUNC half2 operator*(const half3 x, const half2x3 y) { return ::simd_mul(x, y); }
683 static SIMD_CPPFUNC half3 operator*(const half3 x, const half3x3 y) { return ::simd_mul(x, y); }
684 static SIMD_CPPFUNC half4 operator*(const half3 x, const half4x3 y) { return ::simd_mul(x, y); }
685 static SIMD_CPPFUNC half2 operator*(const half4 x, const half2x4 y) { return ::simd_mul(x, y); }
686 static SIMD_CPPFUNC half3 operator*(const half4 x, const half3x4 y) { return ::simd_mul(x, y); }
687 static SIMD_CPPFUNC half4 operator*(const half4 x, const half4x4 y) { return ::simd_mul(x, y); }
688 static SIMD_CPPFUNC half2 operator*(const half2x2 x, const half2 y) { return ::simd_mul(x, y); }
689 static SIMD_CPPFUNC half2 operator*(const half3x2 x, const half3 y) { return ::simd_mul(x, y); }
690 static SIMD_CPPFUNC half2 operator*(const half4x2 x, const half4 y) { return ::simd_mul(x, y); }
691 static SIMD_CPPFUNC half3 operator*(const half2x3 x, const half2 y) { return ::simd_mul(x, y); }
692 static SIMD_CPPFUNC half3 operator*(const half3x3 x, const half3 y) { return ::simd_mul(x, y); }
693 static SIMD_CPPFUNC half3 operator*(const half4x3 x, const half4 y) { return ::simd_mul(x, y); }
694 static SIMD_CPPFUNC half4 operator*(const half2x4 x, const half2 y) { return ::simd_mul(x, y); }
695 static SIMD_CPPFUNC half4 operator*(const half3x4 x, const half3 y) { return ::simd_mul(x, y); }
696 static SIMD_CPPFUNC half4 operator*(const half4x4 x, const half4 y) { return ::simd_mul(x, y); }
697 static SIMD_INLINE SIMD_NODEBUG half2& operator*=(half2& x, const half2x2 y) { x = ::simd_mul(x, y); return x; }
698 static SIMD_INLINE SIMD_NODEBUG half3& operator*=(half3& x, const half3x3 y) { x = ::simd_mul(x, y); return x; }
699 static SIMD_INLINE SIMD_NODEBUG half4& operator*=(half4& x, const half4x4 y) { x = ::simd_mul(x, y); return x; }
700
701 static SIMD_CPPFUNC half2x2 operator*(const half2x2 x, const half2x2 y) { return ::simd_mul(x, y); }
702 static SIMD_CPPFUNC half3x2 operator*(const half2x2 x, const half3x2 y) { return ::simd_mul(x, y); }
703 static SIMD_CPPFUNC half4x2 operator*(const half2x2 x, const half4x2 y) { return ::simd_mul(x, y); }
704 static SIMD_CPPFUNC half2x3 operator*(const half2x3 x, const half2x2 y) { return ::simd_mul(x, y); }
705 static SIMD_CPPFUNC half3x3 operator*(const half2x3 x, const half3x2 y) { return ::simd_mul(x, y); }
706 static SIMD_CPPFUNC half4x3 operator*(const half2x3 x, const half4x2 y) { return ::simd_mul(x, y); }
707 static SIMD_CPPFUNC half2x4 operator*(const half2x4 x, const half2x2 y) { return ::simd_mul(x, y); }
708 static SIMD_CPPFUNC half3x4 operator*(const half2x4 x, const half3x2 y) { return ::simd_mul(x, y); }
709 static SIMD_CPPFUNC half4x4 operator*(const half2x4 x, const half4x2 y) { return ::simd_mul(x, y); }
710 static SIMD_CPPFUNC half2x2 operator*(const half3x2 x, const half2x3 y) { return ::simd_mul(x, y); }
711 static SIMD_CPPFUNC half3x2 operator*(const half3x2 x, const half3x3 y) { return ::simd_mul(x, y); }
712 static SIMD_CPPFUNC half4x2 operator*(const half3x2 x, const half4x3 y) { return ::simd_mul(x, y); }
713 static SIMD_CPPFUNC half2x3 operator*(const half3x3 x, const half2x3 y) { return ::simd_mul(x, y); }
714 static SIMD_CPPFUNC half3x3 operator*(const half3x3 x, const half3x3 y) { return ::simd_mul(x, y); }
715 static SIMD_CPPFUNC half4x3 operator*(const half3x3 x, const half4x3 y) { return ::simd_mul(x, y); }
716 static SIMD_CPPFUNC half2x4 operator*(const half3x4 x, const half2x3 y) { return ::simd_mul(x, y); }
717 static SIMD_CPPFUNC half3x4 operator*(const half3x4 x, const half3x3 y) { return ::simd_mul(x, y); }
718 static SIMD_CPPFUNC half4x4 operator*(const half3x4 x, const half4x3 y) { return ::simd_mul(x, y); }
719 static SIMD_CPPFUNC half2x2 operator*(const half4x2 x, const half2x4 y) { return ::simd_mul(x, y); }
720 static SIMD_CPPFUNC half3x2 operator*(const half4x2 x, const half3x4 y) { return ::simd_mul(x, y); }
721 static SIMD_CPPFUNC half4x2 operator*(const half4x2 x, const half4x4 y) { return ::simd_mul(x, y); }
722 static SIMD_CPPFUNC half2x3 operator*(const half4x3 x, const half2x4 y) { return ::simd_mul(x, y); }
723 static SIMD_CPPFUNC half3x3 operator*(const half4x3 x, const half3x4 y) { return ::simd_mul(x, y); }
724 static SIMD_CPPFUNC half4x3 operator*(const half4x3 x, const half4x4 y) { return ::simd_mul(x, y); }
725 static SIMD_CPPFUNC half2x4 operator*(const half4x4 x, const half2x4 y) { return ::simd_mul(x, y); }
726 static SIMD_CPPFUNC half3x4 operator*(const half4x4 x, const half3x4 y) { return ::simd_mul(x, y); }
727 static SIMD_CPPFUNC half4x4 operator*(const half4x4 x, const half4x4 y) { return ::simd_mul(x, y); }
728 static SIMD_INLINE SIMD_NODEBUG half2x2& operator*=(half2x2& x, const half2x2 y) { x = ::simd_mul(x, y); return x; }
729 static SIMD_INLINE SIMD_NODEBUG half2x3& operator*=(half2x3& x, const half2x2 y) { x = ::simd_mul(x, y); return x; }
730 static SIMD_INLINE SIMD_NODEBUG half2x4& operator*=(half2x4& x, const half2x2 y) { x = ::simd_mul(x, y); return x; }
731 static SIMD_INLINE SIMD_NODEBUG half3x2& operator*=(half3x2& x, const half3x3 y) { x = ::simd_mul(x, y); return x; }
732 static SIMD_INLINE SIMD_NODEBUG half3x3& operator*=(half3x3& x, const half3x3 y) { x = ::simd_mul(x, y); return x; }
733 static SIMD_INLINE SIMD_NODEBUG half3x4& operator*=(half3x4& x, const half3x3 y) { x = ::simd_mul(x, y); return x; }
734 static SIMD_INLINE SIMD_NODEBUG half4x2& operator*=(half4x2& x, const half4x4 y) { x = ::simd_mul(x, y); return x; }
735 static SIMD_INLINE SIMD_NODEBUG half4x3& operator*=(half4x3& x, const half4x4 y) { x = ::simd_mul(x, y); return x; }
736 static SIMD_INLINE SIMD_NODEBUG half4x4& operator*=(half4x4& x, const half4x4 y) { x = ::simd_mul(x, y); return x; }
737
738 static SIMD_CPPFUNC bool operator==(const half2x2& x, const half2x2& y) { return ::simd_equal(x, y); }
739 static SIMD_CPPFUNC bool operator==(const half2x3& x, const half2x3& y) { return ::simd_equal(x, y); }
740 static SIMD_CPPFUNC bool operator==(const half2x4& x, const half2x4& y) { return ::simd_equal(x, y); }
741 static SIMD_CPPFUNC bool operator==(const half3x2& x, const half3x2& y) { return ::simd_equal(x, y); }
742 static SIMD_CPPFUNC bool operator==(const half3x3& x, const half3x3& y) { return ::simd_equal(x, y); }
743 static SIMD_CPPFUNC bool operator==(const half3x4& x, const half3x4& y) { return ::simd_equal(x, y); }
744 static SIMD_CPPFUNC bool operator==(const half4x2& x, const half4x2& y) { return ::simd_equal(x, y); }
745 static SIMD_CPPFUNC bool operator==(const half4x3& x, const half4x3& y) { return ::simd_equal(x, y); }
746 static SIMD_CPPFUNC bool operator==(const half4x4& x, const half4x4& y) { return ::simd_equal(x, y); }
747
748 static SIMD_CPPFUNC bool operator!=(const half2x2& x, const half2x2& y) { return !(x == y); }
749 static SIMD_CPPFUNC bool operator!=(const half2x3& x, const half2x3& y) { return !(x == y); }
750 static SIMD_CPPFUNC bool operator!=(const half2x4& x, const half2x4& y) { return !(x == y); }
751 static SIMD_CPPFUNC bool operator!=(const half3x2& x, const half3x2& y) { return !(x == y); }
752 static SIMD_CPPFUNC bool operator!=(const half3x3& x, const half3x3& y) { return !(x == y); }
753 static SIMD_CPPFUNC bool operator!=(const half3x4& x, const half3x4& y) { return !(x == y); }
754 static SIMD_CPPFUNC bool operator!=(const half4x2& x, const half4x2& y) { return !(x == y); }
755 static SIMD_CPPFUNC bool operator!=(const half4x3& x, const half4x3& y) { return !(x == y); }
756 static SIMD_CPPFUNC bool operator!=(const half4x4& x, const half4x4& y) { return !(x == y); }
757
758 static SIMD_CPPFUNC bool almost_equal_elements(const half2x2 x, const half2x2 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
759 static SIMD_CPPFUNC bool almost_equal_elements(const half2x3 x, const half2x3 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
760 static SIMD_CPPFUNC bool almost_equal_elements(const half2x4 x, const half2x4 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
761 static SIMD_CPPFUNC bool almost_equal_elements(const half3x2 x, const half3x2 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
762 static SIMD_CPPFUNC bool almost_equal_elements(const half3x3 x, const half3x3 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
763 static SIMD_CPPFUNC bool almost_equal_elements(const half3x4 x, const half3x4 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
764 static SIMD_CPPFUNC bool almost_equal_elements(const half4x2 x, const half4x2 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
765 static SIMD_CPPFUNC bool almost_equal_elements(const half4x3 x, const half4x3 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
766 static SIMD_CPPFUNC bool almost_equal_elements(const half4x4 x, const half4x4 y, const _Float16 tol) { return ::simd_almost_equal_elements(x, y, tol); }
767
768 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half2x2 x, const half2x2 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
769 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half2x3 x, const half2x3 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
770 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half2x4 x, const half2x4 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
771 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half3x2 x, const half3x2 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
772 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half3x3 x, const half3x3 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
773 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half3x4 x, const half3x4 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
774 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half4x2 x, const half4x2 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
775 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half4x3 x, const half4x3 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
776 static SIMD_CPPFUNC bool almost_equal_elements_relative(const half4x4 x, const half4x4 y, const _Float16 tol) { return ::simd_almost_equal_elements_relative(x, y, tol); }
777
434 static SIMD_CPPFUNC float2x2 operator+(const float2x2 x, const float2x2 y) { return float2x2(::simd_linear_combination(1, x, 1, y)); }778 static SIMD_CPPFUNC float2x2 operator+(const float2x2 x, const float2x2 y) { return float2x2(::simd_linear_combination(1, x, 1, y)); }
435 static SIMD_CPPFUNC float2x3 operator+(const float2x3 x, const float2x3 y) { return float2x3(::simd_linear_combination(1, x, 1, y)); }779 static SIMD_CPPFUNC float2x3 operator+(const float2x3 x, const float2x3 y) { return float2x3(::simd_linear_combination(1, x, 1, y)); }
436 static SIMD_CPPFUNC float2x4 operator+(const float2x4 x, const float2x4 y) { return float2x4(::simd_linear_combination(1, x, 1, y)); }780 static SIMD_CPPFUNC float2x4 operator+(const float2x4 x, const float2x4 y) { return float2x4(::simd_linear_combination(1, x, 1, y)); }
...@@ -821,25 +1165,37 @@ extern "C" {...@@ -821,25 +1165,37 @@ extern "C" {
8211165
822#pragma mark - Implementation1166#pragma mark - Implementation
8231167
1168static simd_half2x2 SIMD_CFUNC simd_diagonal_matrix(simd_half2 __x) { simd_half2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; }
824static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x) { simd_float2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; }1169static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x) { simd_float2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; }
825static simd_double2x2 SIMD_CFUNC simd_diagonal_matrix(simd_double2 __x) { simd_double2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; }1170static simd_double2x2 SIMD_CFUNC simd_diagonal_matrix(simd_double2 __x) { simd_double2x2 __r = { .columns[0] = {__x.x,0}, .columns[1] = {0,__x.y} }; return __r; }
1171static simd_half3x3 SIMD_CFUNC simd_diagonal_matrix(simd_half3 __x) { simd_half3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; }
826static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x) { simd_float3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; }1172static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x) { simd_float3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; }
827static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x) { simd_double3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; }1173static simd_double3x3 SIMD_CFUNC simd_diagonal_matrix(simd_double3 __x) { simd_double3x3 __r = { .columns[0] = {__x.x,0,0}, .columns[1] = {0,__x.y,0}, .columns[2] = {0,0,__x.z} }; return __r; }
1174static simd_half4x4 SIMD_CFUNC simd_diagonal_matrix(simd_half4 __x) { simd_half4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; }
828static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x) { simd_float4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; }1175static simd_float4x4 SIMD_CFUNC simd_diagonal_matrix(simd_float4 __x) { simd_float4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; }
829static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x) { simd_double4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; }1176static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x) { simd_double4x4 __r = { .columns[0] = {__x.x,0,0,0}, .columns[1] = {0,__x.y,0,0}, .columns[2] = {0,0,__x.z,0}, .columns[3] = {0,0,0,__x.w} }; return __r; }
8301177
1178static simd_half2x2 SIMD_CFUNC simd_matrix(simd_half2 col0, simd_half2 col1) { simd_half2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
1179static simd_half2x3 SIMD_CFUNC simd_matrix(simd_half3 col0, simd_half3 col1) { simd_half2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
1180static simd_half2x4 SIMD_CFUNC simd_matrix(simd_half4 col0, simd_half4 col1) { simd_half2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
831static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1) { simd_float2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }1181static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1) { simd_float2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
832static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1) { simd_float2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }1182static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1) { simd_float2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
833static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1) { simd_float2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }1183static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1) { simd_float2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
834static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1) { simd_double2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }1184static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1) { simd_double2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
835static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1) { simd_double2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }1185static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1) { simd_double2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
836static simd_double2x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1) { simd_double2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }1186static simd_double2x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1) { simd_double2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
1187static simd_half3x2 SIMD_CFUNC simd_matrix(simd_half2 col0, simd_half2 col1, simd_half2 col2) { simd_half3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
1188static simd_half3x3 SIMD_CFUNC simd_matrix(simd_half3 col0, simd_half3 col1, simd_half3 col2) { simd_half3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
1189static simd_half3x4 SIMD_CFUNC simd_matrix(simd_half4 col0, simd_half4 col1, simd_half4 col2) { simd_half3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
837static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2) { simd_float3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }1190static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2) { simd_float3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
838static simd_float3x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2) { simd_float3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }1191static simd_float3x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2) { simd_float3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
839static simd_float3x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2) { simd_float3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }1192static simd_float3x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2) { simd_float3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
840static simd_double3x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2) { simd_double3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }1193static simd_double3x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1, simd_double2 col2) { simd_double3x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
841static simd_double3x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2) { simd_double3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }1194static simd_double3x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2) { simd_double3x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
842static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2) { simd_double3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }1195static simd_double3x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2) { simd_double3x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2 }; return __r; }
1196static simd_half4x2 SIMD_CFUNC simd_matrix(simd_half2 col0, simd_half2 col1, simd_half2 col2, simd_half2 col3) { simd_half4x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
1197static simd_half4x3 SIMD_CFUNC simd_matrix(simd_half3 col0, simd_half3 col1, simd_half3 col2, simd_half3 col3) { simd_half4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
1198static simd_half4x4 SIMD_CFUNC simd_matrix(simd_half4 col0, simd_half4 col1, simd_half4 col2, simd_half4 col3) { simd_half4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
843static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3) { simd_float4x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }1199static simd_float4x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2, simd_float2 col3) { simd_float4x2 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
844static simd_float4x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2, simd_float3 col3) { simd_float4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }1200static simd_float4x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1, simd_float3 col2, simd_float3 col3) { simd_float4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
845static simd_float4x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2, simd_float4 col3) { simd_float4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }1201static simd_float4x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1, simd_float4 col2, simd_float4 col3) { simd_float4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
...@@ -847,18 +1203,27 @@ static simd_double4x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col...@@ -847,18 +1203,27 @@ static simd_double4x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col
847static simd_double4x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2, simd_double3 col3) { simd_double4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }1203static simd_double4x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1, simd_double3 col2, simd_double3 col3) { simd_double4x3 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
848static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3) { simd_double4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }1204static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3) { simd_double4x4 __r = { .columns[0] = col0, .columns[1] = col1, .columns[2] = col2, .columns[3] = col3 }; return __r; }
8491205
1206static simd_half2x2 SIMD_CFUNC simd_matrix_from_rows(simd_half2 row0, simd_half2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
1207static simd_half3x2 SIMD_CFUNC simd_matrix_from_rows(simd_half3 row0, simd_half3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
1208static simd_half4x2 SIMD_CFUNC simd_matrix_from_rows(simd_half4 row0, simd_half4 row1) { return simd_transpose(simd_matrix(row0, row1)); }
850static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1) { return simd_transpose(simd_matrix(row0, row1)); }1209static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
851static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1) { return simd_transpose(simd_matrix(row0, row1)); }1210static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
852static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1) { return simd_transpose(simd_matrix(row0, row1)); }1211static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1) { return simd_transpose(simd_matrix(row0, row1)); }
853static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1) { return simd_transpose(simd_matrix(row0, row1)); }1212static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
854static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1) { return simd_transpose(simd_matrix(row0, row1)); }1213static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
855static simd_double4x2 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1) { return simd_transpose(simd_matrix(row0, row1)); }1214static simd_double4x2 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1) { return simd_transpose(simd_matrix(row0, row1)); }
1215static simd_half2x3 SIMD_CFUNC simd_matrix_from_rows(simd_half2 row0, simd_half2 row1, simd_half2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
1216static simd_half3x3 SIMD_CFUNC simd_matrix_from_rows(simd_half3 row0, simd_half3 row1, simd_half3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
1217static simd_half4x3 SIMD_CFUNC simd_matrix_from_rows(simd_half4 row0, simd_half4 row1, simd_half4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
856static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }1218static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
857static simd_float3x3 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }1219static simd_float3x3 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
858static simd_float4x3 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }1220static simd_float4x3 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
859static simd_double2x3 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }1221static simd_double2x3 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1, simd_double2 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
860static simd_double3x3 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }1222static simd_double3x3 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
861static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }1223static simd_double4x3 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2) { return simd_transpose(simd_matrix(row0, row1, row2)); }
1224static simd_half2x4 SIMD_CFUNC simd_matrix_from_rows(simd_half2 row0, simd_half2 row1, simd_half2 row2, simd_half2 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
1225static simd_half3x4 SIMD_CFUNC simd_matrix_from_rows(simd_half3 row0, simd_half3 row1, simd_half3 row2, simd_half3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
1226static simd_half4x4 SIMD_CFUNC simd_matrix_from_rows(simd_half4 row0, simd_half4 row1, simd_half4 row2, simd_half4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
862static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }1227static simd_float2x4 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2, simd_float2 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
863static simd_float3x4 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2, simd_float3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }1228static simd_float3x4 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1, simd_float3 row2, simd_float3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
864static simd_float4x4 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2, simd_float4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }1229static simd_float4x4 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1, simd_float4 row2, simd_float4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
...@@ -866,6 +1231,28 @@ static simd_double2x4 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_d...@@ -866,6 +1231,28 @@ static simd_double2x4 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_d
866static simd_double3x4 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2, simd_double3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }1231static simd_double3x4 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1, simd_double3 row2, simd_double3 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
867static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }1232static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3) { return simd_transpose(simd_matrix(row0, row1, row2, row3)); }
868 1233
1234static simd_half3x3 SIMD_NOINLINE simd_matrix3x3(simd_quath q) {
1235 simd_half4x4 r = simd_matrix4x4(q);
1236 return (simd_half3x3){ r.columns[0].xyz, r.columns[1].xyz, r.columns[2].xyz };
1237}
1238
1239static simd_half4x4 SIMD_NOINLINE simd_matrix4x4(simd_quath q) {
1240 simd_half4 v = q.vector;
1241 simd_half4x4 r = {
1242 .columns[0] = { v.x*v.x - v.y*v.y - v.z*v.z + v.w*v.w,
1243 2*(v.x*v.y + v.z*v.w),
1244 2*(v.x*v.z - v.y*v.w), 0 },
1245 .columns[1] = { 2*(v.x*v.y - v.z*v.w),
1246 v.y*v.y - v.z*v.z + v.w*v.w - v.x*v.x,
1247 2*(v.y*v.z + v.x*v.w), 0 },
1248 .columns[2] = { 2*(v.z*v.x + v.y*v.w),
1249 2*(v.y*v.z - v.x*v.w),
1250 v.z*v.z + v.w*v.w - v.x*v.x - v.y*v.y, 0 },
1251 .columns[3] = { 0, 0, 0, 1 }
1252 };
1253 return r;
1254}
1255
869static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q) {1256static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q) {
870 simd_float4x4 r = simd_matrix4x4(q);1257 simd_float4x4 r = simd_matrix4x4(q);
871 return (simd_float3x3){ r.columns[0].xyz, r.columns[1].xyz, r.columns[2].xyz };1258 return (simd_float3x3){ r.columns[0].xyz, r.columns[1].xyz, r.columns[2].xyz };
...@@ -910,6 +1297,15 @@ static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q) {...@@ -910,6 +1297,15 @@ static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q) {
910 return r;1297 return r;
911}1298}
9121299
1300static simd_half2x2 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
1301static simd_half3x2 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
1302static simd_half4x2 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
1303static simd_half2x3 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
1304static simd_half3x3 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half3x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
1305static simd_half4x3 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half4x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
1306static simd_half2x4 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
1307static simd_half3x4 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
1308static simd_half4x4 SIMD_CFUNC matrix_scale(_Float16 __a, simd_half4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
913static simd_float2x2 SIMD_CFUNC matrix_scale(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }1309static simd_float2x2 SIMD_CFUNC matrix_scale(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
914static simd_float3x2 SIMD_CFUNC matrix_scale(float __a, simd_float3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }1310static simd_float3x2 SIMD_CFUNC matrix_scale(float __a, simd_float3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
915static simd_float4x2 SIMD_CFUNC matrix_scale(float __a, simd_float4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }1311static simd_float4x2 SIMD_CFUNC matrix_scale(float __a, simd_float4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
...@@ -929,6 +1325,15 @@ static simd_double2x4 SIMD_CFUNC matrix_scale(double __a, simd_double2x4 __x) {...@@ -929,6 +1325,15 @@ static simd_double2x4 SIMD_CFUNC matrix_scale(double __a, simd_double2x4 __x) {
929static simd_double3x4 SIMD_CFUNC matrix_scale(double __a, simd_double3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }1325static simd_double3x4 SIMD_CFUNC matrix_scale(double __a, simd_double3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
930static simd_double4x4 SIMD_CFUNC matrix_scale(double __a, simd_double4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }1326static simd_double4x4 SIMD_CFUNC matrix_scale(double __a, simd_double4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
931 1327
1328static simd_half2x2 SIMD_CFUNC simd_mul(_Float16 __a, simd_half2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
1329static simd_half3x2 SIMD_CFUNC simd_mul(_Float16 __a, simd_half3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
1330static simd_half4x2 SIMD_CFUNC simd_mul(_Float16 __a, simd_half4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
1331static simd_half2x3 SIMD_CFUNC simd_mul(_Float16 __a, simd_half2x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
1332static simd_half3x3 SIMD_CFUNC simd_mul(_Float16 __a, simd_half3x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
1333static simd_half4x3 SIMD_CFUNC simd_mul(_Float16 __a, simd_half4x3 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
1334static simd_half2x4 SIMD_CFUNC simd_mul(_Float16 __a, simd_half2x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
1335static simd_half3x4 SIMD_CFUNC simd_mul(_Float16 __a, simd_half3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
1336static simd_half4x4 SIMD_CFUNC simd_mul(_Float16 __a, simd_half4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
932static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }1337static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
933static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }1338static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
934static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }1339static simd_float4x2 SIMD_CFUNC simd_mul(float __a, simd_float4x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
...@@ -948,6 +1353,60 @@ static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x) { __x....@@ -948,6 +1353,60 @@ static simd_double2x4 SIMD_CFUNC simd_mul(double __a, simd_double2x4 __x) { __x.
948static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }1353static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; return __x; }
949static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }1354static simd_double4x4 SIMD_CFUNC simd_mul(double __a, simd_double4x4 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; __x.columns[2] *= __a; __x.columns[3] *= __a; return __x; }
9501355
1356static simd_half2x2 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half2x2 __x, _Float16 __b, simd_half2x2 __y) {
1357 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1358 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1359 return __x;
1360}
1361static simd_half3x2 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half3x2 __x, _Float16 __b, simd_half3x2 __y) {
1362 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1363 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1364 __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2];
1365 return __x;
1366}
1367static simd_half4x2 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half4x2 __x, _Float16 __b, simd_half4x2 __y) {
1368 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1369 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1370 __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2];
1371 __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3];
1372 return __x;
1373}
1374static simd_half2x3 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half2x3 __x, _Float16 __b, simd_half2x3 __y) {
1375 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1376 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1377 return __x;
1378}
1379static simd_half3x3 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half3x3 __x, _Float16 __b, simd_half3x3 __y) {
1380 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1381 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1382 __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2];
1383 return __x;
1384}
1385static simd_half4x3 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half4x3 __x, _Float16 __b, simd_half4x3 __y) {
1386 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1387 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1388 __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2];
1389 __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3];
1390 return __x;
1391}
1392static simd_half2x4 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half2x4 __x, _Float16 __b, simd_half2x4 __y) {
1393 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1394 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1395 return __x;
1396}
1397static simd_half3x4 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half3x4 __x, _Float16 __b, simd_half3x4 __y) {
1398 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1399 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1400 __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2];
1401 return __x;
1402}
1403static simd_half4x4 SIMD_CFUNC simd_linear_combination(_Float16 __a, simd_half4x4 __x, _Float16 __b, simd_half4x4 __y) {
1404 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
1405 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
1406 __x.columns[2] = __a*__x.columns[2] + __b*__y.columns[2];
1407 __x.columns[3] = __a*__x.columns[3] + __b*__y.columns[3];
1408 return __x;
1409}
951static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y) {1410static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y) {
952 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];1411 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
953 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];1412 __x.columns[1] = __a*__x.columns[1] + __b*__y.columns[1];
...@@ -1057,6 +1516,15 @@ static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double...@@ -1057,6 +1516,15 @@ static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double
1057 return __x;1516 return __x;
1058}1517}
1059 1518
1519static simd_half2x2 SIMD_CFUNC simd_add(simd_half2x2 __x, simd_half2x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1520static simd_half3x2 SIMD_CFUNC simd_add(simd_half3x2 __x, simd_half3x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1521static simd_half4x2 SIMD_CFUNC simd_add(simd_half4x2 __x, simd_half4x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1522static simd_half2x3 SIMD_CFUNC simd_add(simd_half2x3 __x, simd_half2x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1523static simd_half3x3 SIMD_CFUNC simd_add(simd_half3x3 __x, simd_half3x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1524static simd_half4x3 SIMD_CFUNC simd_add(simd_half4x3 __x, simd_half4x3 __y) { return simd_linear_combination(1, __x, 1, __y); }
1525static simd_half2x4 SIMD_CFUNC simd_add(simd_half2x4 __x, simd_half2x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1526static simd_half3x4 SIMD_CFUNC simd_add(simd_half3x4 __x, simd_half3x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1527static simd_half4x4 SIMD_CFUNC simd_add(simd_half4x4 __x, simd_half4x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1060static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, 1, __y); }1528static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1061static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, 1, __y); }1529static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
1062static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, 1, __y); }1530static simd_float4x2 SIMD_CFUNC simd_add(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
...@@ -1076,6 +1544,15 @@ static simd_double2x4 SIMD_CFUNC simd_add(simd_double2x4 __x, simd_double2x4 __y...@@ -1076,6 +1544,15 @@ static simd_double2x4 SIMD_CFUNC simd_add(simd_double2x4 __x, simd_double2x4 __y
1076static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, 1, __y); }1544static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1077static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, 1, __y); }1545static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
1078 1546
1547static simd_half2x2 SIMD_CFUNC simd_sub(simd_half2x2 __x, simd_half2x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1548static simd_half3x2 SIMD_CFUNC simd_sub(simd_half3x2 __x, simd_half3x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1549static simd_half4x2 SIMD_CFUNC simd_sub(simd_half4x2 __x, simd_half4x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1550static simd_half2x3 SIMD_CFUNC simd_sub(simd_half2x3 __x, simd_half2x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1551static simd_half3x3 SIMD_CFUNC simd_sub(simd_half3x3 __x, simd_half3x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1552static simd_half4x3 SIMD_CFUNC simd_sub(simd_half4x3 __x, simd_half4x3 __y) { return simd_linear_combination(1, __x, -1, __y); }
1553static simd_half2x4 SIMD_CFUNC simd_sub(simd_half2x4 __x, simd_half2x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1554static simd_half3x4 SIMD_CFUNC simd_sub(simd_half3x4 __x, simd_half3x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1555static simd_half4x4 SIMD_CFUNC simd_sub(simd_half4x4 __x, simd_half4x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1079static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, -1, __y); }1556static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1080static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, -1, __y); }1557static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
1081static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, -1, __y); }1558static simd_float4x2 SIMD_CFUNC simd_sub(simd_float4x2 __x, simd_float4x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
...@@ -1095,13 +1572,165 @@ static simd_double2x4 SIMD_CFUNC simd_sub(simd_double2x4 __x, simd_double2x4 __y...@@ -1095,13 +1572,165 @@ static simd_double2x4 SIMD_CFUNC simd_sub(simd_double2x4 __x, simd_double2x4 __y
1095static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, -1, __y); }1572static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
1096static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, -1, __y); }1573static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
10971574
1575static simd_half2x2 SIMD_CFUNC simd_transpose(simd_half2x2 __x) {
1576 simd_half4 __x0, __x1;
1577 __x0.xy = __x.columns[0];
1578 __x1.xy = __x.columns[1];
1579 simd_half4 __r01 = { __x0[0], __x1[0], __x0[1], __x1[1] };
1580 return simd_matrix(__r01.lo, __r01.hi);
1581}
1582
1583static simd_half3x2 SIMD_CFUNC simd_transpose(simd_half2x3 __x) {
1584 simd_half4 __x0, __x1;
1585 __x0.xyz = __x.columns[0];
1586 __x1.xyz = __x.columns[1];
1587#if defined __arm64e__
1588 simd_half4 __r01 = vzip1_f16(__x0, __x1);
1589 simd_half4 __r2x = vzip2_f16(__x0, __x1);
1590#else
1591 simd_half4 __r01 = { __x0[0], __x1[0], __x0[1], __x1[1] };
1592 simd_half4 __r2x = { __x0[2], __x1[2] };
1593#endif
1594 return simd_matrix(__r01.lo, __r01.hi, __r2x.lo);
1595}
1596
1597static simd_half4x2 SIMD_CFUNC simd_transpose(simd_half2x4 __x) {
1598#if defined __arm64e__
1599 simd_half4 __r01 = vzip1_f16(__x.columns[0], __x.columns[1]);
1600 simd_half4 __r23 = vzip2_f16(__x.columns[0], __x.columns[1]);
1601#else
1602 simd_half4 __r01 = { __x.columns[0][0], __x.columns[1][0], __x.columns[0][1], __x.columns[1][1] };
1603 simd_half4 __r23 = { __x.columns[0][2], __x.columns[1][2], __x.columns[0][3], __x.columns[1][3] };
1604#endif
1605 return simd_matrix(__r01.lo, __r01.hi, __r23.lo, __r23.hi);
1606}
1607
1608static simd_half2x3 SIMD_CFUNC simd_transpose(simd_half3x2 __x) {
1609 simd_half4 __x0, __x1, __x2;
1610 __x0.xy = __x.columns[0];
1611 __x1.xy = __x.columns[1];
1612 __x2.xy = __x.columns[2];
1613#if defined __arm64e__
1614 simd_half4 padding = { 0 };
1615 simd_half4 __t0 = vzip1_f16(__x0,__x2);
1616 simd_half4 __t1 = vzip1_f16(__x1,padding);
1617 simd_half4 __r0 = vzip1_f16(__t0,__t1);
1618 simd_half4 __r1 = vzip2_f16(__t0,__t1);
1619#else
1620 simd_half4 __r0 = { __x0[0], __x1[0], __x2[0] };
1621 simd_half4 __r1 = { __x0[1], __x1[1], __x2[1] };
1622#endif
1623 return simd_matrix(__r0.xyz, __r1.xyz);
1624}
1625
1626static simd_half3x3 SIMD_CFUNC simd_transpose(simd_half3x3 __x) {
1627 simd_half4 __x0, __x1, __x2;
1628 __x0.xyz = __x.columns[0];
1629 __x1.xyz = __x.columns[1];
1630 __x2.xyz = __x.columns[2];
1631#if defined __arm64e__
1632 simd_half4 padding = { 0 };
1633 simd_half4 __t0 = vzip1_f16(__x0,__x2);
1634 simd_half4 __t1 = vzip2_f16(__x0,__x2);
1635 simd_half4 __t2 = vzip1_f16(__x1,padding);
1636 simd_half4 __t3 = vzip2_f16(__x1,padding);
1637 simd_half4 __r0 = vzip1_f16(__t0,__t2);
1638 simd_half4 __r1 = vzip2_f16(__t0,__t2);
1639 simd_half4 __r2 = vzip1_f16(__t1,__t3);
1640#else
1641 simd_half4 __r0 = {__x0[0], __x1[0], __x2[0]};
1642 simd_half4 __r1 = {__x0[1], __x1[1], __x2[1]};
1643 simd_half4 __r2 = {__x0[2], __x1[2], __x2[2]};
1644#endif
1645 return simd_matrix(__r0.xyz, __r1.xyz, __r2.xyz);
1646}
1647
1648static simd_half4x3 SIMD_CFUNC simd_transpose(simd_half3x4 __x) {
1649#if defined __arm64e__
1650 simd_half4 padding = { 0 };
1651 simd_half4 __t0 = vzip1_f16(__x.columns[0],__x.columns[2]);
1652 simd_half4 __t1 = vzip2_f16(__x.columns[0],__x.columns[2]);
1653 simd_half4 __t2 = vzip1_f16(__x.columns[1],padding);
1654 simd_half4 __t3 = vzip2_f16(__x.columns[1],padding);
1655 simd_half4 __r0 = vzip1_f16(__t0,__t2);
1656 simd_half4 __r1 = vzip2_f16(__t0,__t2);
1657 simd_half4 __r2 = vzip1_f16(__t1,__t3);
1658 simd_half4 __r3 = vzip2_f16(__t1,__t3);
1659#else
1660 simd_half4 __r0 = {__x.columns[0][0], __x.columns[1][0], __x.columns[2][0]};
1661 simd_half4 __r1 = {__x.columns[0][1], __x.columns[1][1], __x.columns[2][1]};
1662 simd_half4 __r2 = {__x.columns[0][2], __x.columns[1][2], __x.columns[2][2]};
1663 simd_half4 __r3 = {__x.columns[0][3], __x.columns[1][3], __x.columns[2][3]};
1664#endif
1665 return simd_matrix(__r0.xyz, __r1.xyz, __r2.xyz, __r3.xyz);
1666}
1667
1668static simd_half2x4 SIMD_CFUNC simd_transpose(simd_half4x2 __x) {
1669 simd_half4 __x0, __x1, __x2, __x3;
1670 __x0.xy = __x.columns[0];
1671 __x1.xy = __x.columns[1];
1672 __x2.xy = __x.columns[2];
1673 __x3.xy = __x.columns[3];
1674#if defined __arm64e__
1675 simd_half4 __t0 = vzip1_f16(__x0,__x2);
1676 simd_half4 __t1 = vzip1_f16(__x1,__x3);
1677 simd_half4 __r0 = vzip1_f16(__t0,__t1);
1678 simd_half4 __r1 = vzip2_f16(__t0,__t1);
1679#else
1680 simd_half4 __r0 = {__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]};
1681 simd_half4 __r1 = {__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]};
1682#endif
1683 return simd_matrix(__r0,__r1);
1684}
1685
1686static simd_half3x4 SIMD_CFUNC simd_transpose(simd_half4x3 __x) {
1687 simd_half4 __x0, __x1, __x2, __x3;
1688 __x0.xyz = __x.columns[0];
1689 __x1.xyz = __x.columns[1];
1690 __x2.xyz = __x.columns[2];
1691 __x3.xyz = __x.columns[3];
1692#if defined __arm64e__
1693 simd_half4 __t0 = vzip1_f16(__x0,__x2);
1694 simd_half4 __t1 = vzip2_f16(__x0,__x2);
1695 simd_half4 __t2 = vzip1_f16(__x1,__x3);
1696 simd_half4 __t3 = vzip2_f16(__x1,__x3);
1697 simd_half4 __r0 = vzip1_f16(__t0,__t2);
1698 simd_half4 __r1 = vzip2_f16(__t0,__t2);
1699 simd_half4 __r2 = vzip1_f16(__t1,__t3);
1700#else
1701 simd_half4 __r0 = {__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]};
1702 simd_half4 __r1 = {__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]};
1703 simd_half4 __r2 = {__x.columns[0][2], __x.columns[1][2], __x.columns[2][2], __x.columns[3][2]};
1704#endif
1705 return simd_matrix(__r0,__r1,__r2);
1706}
1707
1708static simd_half4x4 SIMD_CFUNC simd_transpose(simd_half4x4 __x) {
1709#if defined __arm64e__
1710 simd_half4 __t0 = vzip1_f16(__x.columns[0],__x.columns[2]);
1711 simd_half4 __t1 = vzip2_f16(__x.columns[0],__x.columns[2]);
1712 simd_half4 __t2 = vzip1_f16(__x.columns[1],__x.columns[3]);
1713 simd_half4 __t3 = vzip2_f16(__x.columns[1],__x.columns[3]);
1714 simd_half4 __r0 = vzip1_f16(__t0,__t2);
1715 simd_half4 __r1 = vzip2_f16(__t0,__t2);
1716 simd_half4 __r2 = vzip1_f16(__t1,__t3);
1717 simd_half4 __r3 = vzip2_f16(__t1,__t3);
1718#else
1719 simd_half4 __r0 = {__x.columns[0][0], __x.columns[1][0], __x.columns[2][0], __x.columns[3][0]};
1720 simd_half4 __r1 = {__x.columns[0][1], __x.columns[1][1], __x.columns[2][1], __x.columns[3][1]};
1721 simd_half4 __r2 = {__x.columns[0][2], __x.columns[1][2], __x.columns[2][2], __x.columns[3][2]};
1722 simd_half4 __r3 = {__x.columns[0][3], __x.columns[1][3], __x.columns[2][3], __x.columns[3][3]};
1723#endif
1724 return simd_matrix(__r0,__r1,__r2,__r3);
1725}
1726
1098static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x) {1727static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x) {
1099 simd_float4 __x0, __x1;1728 simd_float4 __x0, __x1;
1100 __x0.xy = __x.columns[0];1729 __x0.xy = __x.columns[0];
1101 __x1.xy = __x.columns[1];1730 __x1.xy = __x.columns[1];
1102#if defined __SSE__1731#if defined __SSE__
1103 simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1);1732 simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1);
1104#elif defined __ARM_NEON__1733#elif defined __ARM_NEON__ && defined __arm64__
1105 simd_float4 __r01 = vzip1q_f32(__x0, __x1);1734 simd_float4 __r01 = vzip1q_f32(__x0, __x1);
1106#else1735#else
1107 simd_float4 __r01 = { __x0[0], __x1[0], __x0[1], __x1[1] };1736 simd_float4 __r01 = { __x0[0], __x1[0], __x0[1], __x1[1] };
...@@ -1116,7 +1745,7 @@ static simd_float3x2 SIMD_CFUNC simd_transpose(simd_float2x3 __x) {...@@ -1116,7 +1745,7 @@ static simd_float3x2 SIMD_CFUNC simd_transpose(simd_float2x3 __x) {
1116#if defined __SSE__1745#if defined __SSE__
1117 simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1);1746 simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1);
1118 simd_float4 __r2x = _mm_unpackhi_ps(__x0, __x1);1747 simd_float4 __r2x = _mm_unpackhi_ps(__x0, __x1);
1119#elif defined __ARM_NEON__1748#elif defined __ARM_NEON__ && defined __arm64__
1120 simd_float4 __r01 = vzip1q_f32(__x0, __x1);1749 simd_float4 __r01 = vzip1q_f32(__x0, __x1);
1121 simd_float4 __r2x = vzip2q_f32(__x0, __x1);1750 simd_float4 __r2x = vzip2q_f32(__x0, __x1);
1122#else1751#else
...@@ -1130,7 +1759,7 @@ static simd_float4x2 SIMD_CFUNC simd_transpose(simd_float2x4 __x) {...@@ -1130,7 +1759,7 @@ static simd_float4x2 SIMD_CFUNC simd_transpose(simd_float2x4 __x) {
1130#if defined __SSE__1759#if defined __SSE__
1131 simd_float4 __r01 = _mm_unpacklo_ps(__x.columns[0], __x.columns[1]);1760 simd_float4 __r01 = _mm_unpacklo_ps(__x.columns[0], __x.columns[1]);
1132 simd_float4 __r23 = _mm_unpackhi_ps(__x.columns[0], __x.columns[1]);1761 simd_float4 __r23 = _mm_unpackhi_ps(__x.columns[0], __x.columns[1]);
1133#elif defined __ARM_NEON__1762#elif defined __ARM_NEON__ && defined __arm64__
1134 simd_float4 __r01 = vzip1q_f32(__x.columns[0], __x.columns[1]);1763 simd_float4 __r01 = vzip1q_f32(__x.columns[0], __x.columns[1]);
1135 simd_float4 __r23 = vzip2q_f32(__x.columns[0], __x.columns[1]);1764 simd_float4 __r23 = vzip2q_f32(__x.columns[0], __x.columns[1]);
1136#else1765#else
...@@ -1149,7 +1778,7 @@ static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x) {...@@ -1149,7 +1778,7 @@ static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x) {
1149 simd_float4 __t = _mm_unpacklo_ps(__x0, __x1);1778 simd_float4 __t = _mm_unpacklo_ps(__x0, __x1);
1150 simd_float4 __r0 = _mm_shuffle_ps(__t,__x2,0xc4);1779 simd_float4 __r0 = _mm_shuffle_ps(__t,__x2,0xc4);
1151 simd_float4 __r1 = _mm_shuffle_ps(__t,__x2,0xde);1780 simd_float4 __r1 = _mm_shuffle_ps(__t,__x2,0xde);
1152#elif defined __ARM_NEON__1781#elif defined __ARM_NEON__ && defined __arm64__
1153 simd_float4 padding = { 0 };1782 simd_float4 padding = { 0 };
1154 simd_float4 __t0 = vzip1q_f32(__x0,__x2);1783 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
1155 simd_float4 __t1 = vzip1q_f32(__x1,padding);1784 simd_float4 __t1 = vzip1q_f32(__x1,padding);
...@@ -1173,7 +1802,7 @@ static simd_float3x3 SIMD_CFUNC simd_transpose(simd_float3x3 __x) {...@@ -1173,7 +1802,7 @@ static simd_float3x3 SIMD_CFUNC simd_transpose(simd_float3x3 __x) {
1173 simd_float4 __r0 = __t0; __r0.hi = __x2.lo;1802 simd_float4 __r0 = __t0; __r0.hi = __x2.lo;
1174 simd_float4 __r1 = _mm_shuffle_ps(__t0, __x2, 0xde);1803 simd_float4 __r1 = _mm_shuffle_ps(__t0, __x2, 0xde);
1175 simd_float4 __r2 = __x2; __r2.lo = __t1.lo;1804 simd_float4 __r2 = __x2; __r2.lo = __t1.lo;
1176#elif defined __ARM_NEON__1805#elif defined __ARM_NEON__ && defined __arm64__
1177 simd_float4 padding = { 0 };1806 simd_float4 padding = { 0 };
1178 simd_float4 __t0 = vzip1q_f32(__x0,__x2);1807 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
1179 simd_float4 __t1 = vzip2q_f32(__x0,__x2);1808 simd_float4 __t1 = vzip2q_f32(__x0,__x2);
...@@ -1198,7 +1827,7 @@ static simd_float4x3 SIMD_CFUNC simd_transpose(simd_float3x4 __x) {...@@ -1198,7 +1827,7 @@ static simd_float4x3 SIMD_CFUNC simd_transpose(simd_float3x4 __x) {
1198 simd_float4 __r1 = _mm_shuffle_ps(__t0, __x.columns[2], 0xde);1827 simd_float4 __r1 = _mm_shuffle_ps(__t0, __x.columns[2], 0xde);
1199 simd_float4 __r2 = __x.columns[2]; __r2.lo = __t1.lo;1828 simd_float4 __r2 = __x.columns[2]; __r2.lo = __t1.lo;
1200 simd_float4 __r3 = _mm_shuffle_ps(__t1, __x.columns[2], 0xfe);1829 simd_float4 __r3 = _mm_shuffle_ps(__t1, __x.columns[2], 0xfe);
1201#elif defined __ARM_NEON__1830#elif defined __ARM_NEON__ && defined __arm64__
1202 simd_float4 padding = { 0 };1831 simd_float4 padding = { 0 };
1203 simd_float4 __t0 = vzip1q_f32(__x.columns[0],__x.columns[2]);1832 simd_float4 __t0 = vzip1q_f32(__x.columns[0],__x.columns[2]);
1204 simd_float4 __t1 = vzip2q_f32(__x.columns[0],__x.columns[2]);1833 simd_float4 __t1 = vzip2q_f32(__x.columns[0],__x.columns[2]);
...@@ -1228,7 +1857,7 @@ static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x) {...@@ -1228,7 +1857,7 @@ static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x) {
1228 simd_float4 __t1 = _mm_unpacklo_ps(__x1,__x3);1857 simd_float4 __t1 = _mm_unpacklo_ps(__x1,__x3);
1229 simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t1);1858 simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t1);
1230 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t1);1859 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t1);
1231#elif defined __ARM_NEON__1860#elif defined __ARM_NEON__ && defined __arm64__
1232 simd_float4 __t0 = vzip1q_f32(__x0,__x2);1861 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
1233 simd_float4 __t1 = vzip1q_f32(__x1,__x3);1862 simd_float4 __t1 = vzip1q_f32(__x1,__x3);
1234 simd_float4 __r0 = vzip1q_f32(__t0,__t1);1863 simd_float4 __r0 = vzip1q_f32(__t0,__t1);
...@@ -1254,7 +1883,7 @@ static simd_float3x4 SIMD_CFUNC simd_transpose(simd_float4x3 __x) {...@@ -1254,7 +1883,7 @@ static simd_float3x4 SIMD_CFUNC simd_transpose(simd_float4x3 __x) {
1254 simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t2);1883 simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t2);
1255 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2);1884 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2);
1256 simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3);1885 simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3);
1257#elif defined __ARM_NEON__1886#elif defined __ARM_NEON__ && defined __arm64__
1258 simd_float4 __t0 = vzip1q_f32(__x0,__x2);1887 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
1259 simd_float4 __t1 = vzip2q_f32(__x0,__x2);1888 simd_float4 __t1 = vzip2q_f32(__x0,__x2);
1260 simd_float4 __t2 = vzip1q_f32(__x1,__x3);1889 simd_float4 __t2 = vzip1q_f32(__x1,__x3);
...@@ -1280,7 +1909,7 @@ static simd_float4x4 SIMD_CFUNC simd_transpose(simd_float4x4 __x) {...@@ -1280,7 +1909,7 @@ static simd_float4x4 SIMD_CFUNC simd_transpose(simd_float4x4 __x) {
1280 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2);1909 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2);
1281 simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3);1910 simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3);
1282 simd_float4 __r3 = _mm_unpackhi_ps(__t1,__t3);1911 simd_float4 __r3 = _mm_unpackhi_ps(__t1,__t3);
1283#elif defined __ARM_NEON__1912#elif defined __ARM_NEON__ && defined __arm64__
1284 simd_float4 __t0 = vzip1q_f32(__x.columns[0],__x.columns[2]);1913 simd_float4 __t0 = vzip1q_f32(__x.columns[0],__x.columns[2]);
1285 simd_float4 __t1 = vzip2q_f32(__x.columns[0],__x.columns[2]);1914 simd_float4 __t1 = vzip2q_f32(__x.columns[0],__x.columns[2]);
1286 simd_float4 __t2 = vzip1q_f32(__x.columns[1],__x.columns[3]);1915 simd_float4 __t2 = vzip1q_f32(__x.columns[1],__x.columns[3]);
...@@ -1302,7 +1931,7 @@ static simd_double2x2 SIMD_CFUNC simd_transpose(simd_double2x2 __x) {...@@ -1302,7 +1931,7 @@ static simd_double2x2 SIMD_CFUNC simd_transpose(simd_double2x2 __x) {
1302 simd_double2 __x0, __x1;1931 simd_double2 __x0, __x1;
1303 __x0 = __x.columns[0];1932 __x0 = __x.columns[0];
1304 __x1 = __x.columns[1];1933 __x1 = __x.columns[1];
1305#if defined __ARM_NEON__1934#if defined __ARM_NEON__ && defined __arm64__
1306 simd_double2 __r0 = vzip1q_f64(__x0, __x1);1935 simd_double2 __r0 = vzip1q_f64(__x0, __x1);
1307 simd_double2 __r1 = vzip2q_f64(__x0, __x1);1936 simd_double2 __r1 = vzip2q_f64(__x0, __x1);
1308#else1937#else
...@@ -1316,7 +1945,7 @@ static simd_double3x2 SIMD_CFUNC simd_transpose(simd_double2x3 __x) {...@@ -1316,7 +1945,7 @@ static simd_double3x2 SIMD_CFUNC simd_transpose(simd_double2x3 __x) {
1316 simd_double4 __x0, __x1;1945 simd_double4 __x0, __x1;
1317 __x0.xyz = __x.columns[0];1946 __x0.xyz = __x.columns[0];
1318 __x1.xyz = __x.columns[1];1947 __x1.xyz = __x.columns[1];
1319#if defined __ARM_NEON__1948#if defined __ARM_NEON__ && defined __arm64__
1320 simd_double2 __r0 = vzip1q_f64(__x0.lo,__x1.lo);1949 simd_double2 __r0 = vzip1q_f64(__x0.lo,__x1.lo);
1321 simd_double2 __r1 = vzip2q_f64(__x0.lo,__x1.lo);1950 simd_double2 __r1 = vzip2q_f64(__x0.lo,__x1.lo);
1322 simd_double2 __r2 = vzip1q_f64(__x0.hi,__x1.hi);1951 simd_double2 __r2 = vzip1q_f64(__x0.hi,__x1.hi);
...@@ -1332,7 +1961,7 @@ static simd_double4x2 SIMD_CFUNC simd_transpose(simd_double2x4 __x) {...@@ -1332,7 +1961,7 @@ static simd_double4x2 SIMD_CFUNC simd_transpose(simd_double2x4 __x) {
1332 simd_double4 __x0, __x1;1961 simd_double4 __x0, __x1;
1333 __x0 = __x.columns[0];1962 __x0 = __x.columns[0];
1334 __x1 = __x.columns[1];1963 __x1 = __x.columns[1];
1335#if defined __ARM_NEON__1964#if defined __ARM_NEON__ && defined __arm64__
1336 simd_double2 __r0 = vzip1q_f64(__x0.lo,__x1.lo);1965 simd_double2 __r0 = vzip1q_f64(__x0.lo,__x1.lo);
1337 simd_double2 __r1 = vzip2q_f64(__x0.lo,__x1.lo);1966 simd_double2 __r1 = vzip2q_f64(__x0.lo,__x1.lo);
1338 simd_double2 __r2 = vzip1q_f64(__x0.hi,__x1.hi);1967 simd_double2 __r2 = vzip1q_f64(__x0.hi,__x1.hi);
...@@ -1351,7 +1980,7 @@ static simd_double2x3 SIMD_CFUNC simd_transpose(simd_double3x2 __x) {...@@ -1351,7 +1980,7 @@ static simd_double2x3 SIMD_CFUNC simd_transpose(simd_double3x2 __x) {
1351 __x0 = __x.columns[0];1980 __x0 = __x.columns[0];
1352 __x1 = __x.columns[1];1981 __x1 = __x.columns[1];
1353 __x2 = __x.columns[2];1982 __x2 = __x.columns[2];
1354#if defined __ARM_NEON__1983#if defined __ARM_NEON__ && defined __arm64__
1355 simd_double2 padding = { 0 };1984 simd_double2 padding = { 0 };
1356 simd_double4 __r0,__r1;1985 simd_double4 __r0,__r1;
1357 __r0.lo = vzip1q_f64(__x0,__x1);1986 __r0.lo = vzip1q_f64(__x0,__x1);
...@@ -1370,7 +1999,7 @@ static simd_double3x3 SIMD_CFUNC simd_transpose(simd_double3x3 __x) {...@@ -1370,7 +1999,7 @@ static simd_double3x3 SIMD_CFUNC simd_transpose(simd_double3x3 __x) {
1370 __x0.xyz = __x.columns[0];1999 __x0.xyz = __x.columns[0];
1371 __x1.xyz = __x.columns[1];2000 __x1.xyz = __x.columns[1];
1372 __x2.xyz = __x.columns[2];2001 __x2.xyz = __x.columns[2];
1373#if defined __ARM_NEON__2002#if defined __ARM_NEON__ && defined __arm64__
1374 simd_double2 padding = { 0 };2003 simd_double2 padding = { 0 };
1375 simd_double4 __r0,__r1,__r2;2004 simd_double4 __r0,__r1,__r2;
1376 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);2005 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
...@@ -1392,7 +2021,7 @@ static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x) {...@@ -1392,7 +2021,7 @@ static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x) {
1392 __x0 = __x.columns[0];2021 __x0 = __x.columns[0];
1393 __x1 = __x.columns[1];2022 __x1 = __x.columns[1];
1394 __x2 = __x.columns[2];2023 __x2 = __x.columns[2];
1395#if defined __ARM_NEON__2024#if defined __ARM_NEON__ && defined __arm64__
1396 simd_double2 padding = { 0 };2025 simd_double2 padding = { 0 };
1397 simd_double4 __r0,__r1,__r2,__r3;2026 simd_double4 __r0,__r1,__r2,__r3;
1398 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);2027 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
...@@ -1418,7 +2047,7 @@ static simd_double2x4 SIMD_CFUNC simd_transpose(simd_double4x2 __x) {...@@ -1418,7 +2047,7 @@ static simd_double2x4 SIMD_CFUNC simd_transpose(simd_double4x2 __x) {
1418 __x1 = __x.columns[1];2047 __x1 = __x.columns[1];
1419 __x2 = __x.columns[2];2048 __x2 = __x.columns[2];
1420 __x3 = __x.columns[3];2049 __x3 = __x.columns[3];
1421#if defined __ARM_NEON__2050#if defined __ARM_NEON__ && defined __arm64__
1422 simd_double4 __r0,__r1;2051 simd_double4 __r0,__r1;
1423 __r0.lo = vzip1q_f64(__x0,__x1);2052 __r0.lo = vzip1q_f64(__x0,__x1);
1424 __r1.lo = vzip2q_f64(__x0,__x1);2053 __r1.lo = vzip2q_f64(__x0,__x1);
...@@ -1437,7 +2066,7 @@ static simd_double3x4 SIMD_CFUNC simd_transpose(simd_double4x3 __x) {...@@ -1437,7 +2066,7 @@ static simd_double3x4 SIMD_CFUNC simd_transpose(simd_double4x3 __x) {
1437 __x1.xyz = __x.columns[1];2066 __x1.xyz = __x.columns[1];
1438 __x2.xyz = __x.columns[2];2067 __x2.xyz = __x.columns[2];
1439 __x3.xyz = __x.columns[3];2068 __x3.xyz = __x.columns[3];
1440#if defined __ARM_NEON__2069#if defined __ARM_NEON__ && defined __arm64__
1441 simd_double4 __r0,__r1,__r2;2070 simd_double4 __r0,__r1,__r2;
1442 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);2071 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
1443 __r1.lo = vzip2q_f64(__x0.lo,__x1.lo);2072 __r1.lo = vzip2q_f64(__x0.lo,__x1.lo);
...@@ -1459,7 +2088,7 @@ static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) {...@@ -1459,7 +2088,7 @@ static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) {
1459 __x1 = __x.columns[1];2088 __x1 = __x.columns[1];
1460 __x2 = __x.columns[2];2089 __x2 = __x.columns[2];
1461 __x3 = __x.columns[3];2090 __x3 = __x.columns[3];
1462#if defined __ARM_NEON__2091#if defined __ARM_NEON__ && defined __arm64__
1463 simd_double4 __r0,__r1,__r2,__r3;2092 simd_double4 __r0,__r1,__r2,__r3;
1464 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);2093 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
1465 __r1.lo = vzip2q_f64(__x0.lo,__x1.lo);2094 __r1.lo = vzip2q_f64(__x0.lo,__x1.lo);
...@@ -1478,6 +2107,11 @@ static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) {...@@ -1478,6 +2107,11 @@ static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) {
1478 return simd_matrix(__r0,__r1,__r2,__r3);2107 return simd_matrix(__r0,__r1,__r2,__r3);
1479}2108}
14802109
2110static simd_half3 SIMD_CFUNC __rotate1( simd_half3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); }
2111static simd_half3 SIMD_CFUNC __rotate2( simd_half3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); }
2112static simd_half4 SIMD_CFUNC __rotate1( simd_half4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); }
2113static simd_half4 SIMD_CFUNC __rotate2( simd_half4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); }
2114static simd_half4 SIMD_CFUNC __rotate3( simd_half4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); }
1481static simd_float3 SIMD_CFUNC __rotate1( simd_float3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); }2115static simd_float3 SIMD_CFUNC __rotate1( simd_float3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); }
1482static simd_float3 SIMD_CFUNC __rotate2( simd_float3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); }2116static simd_float3 SIMD_CFUNC __rotate2( simd_float3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); }
1483static simd_float4 SIMD_CFUNC __rotate1( simd_float4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); }2117static simd_float4 SIMD_CFUNC __rotate1( simd_float4 __x) { return __builtin_shufflevector(__x,__x,1,2,3,0); }
...@@ -1489,17 +2123,28 @@ static simd_double4 SIMD_CFUNC __rotate1(simd_double4 __x) { return __builtin_sh...@@ -1489,17 +2123,28 @@ static simd_double4 SIMD_CFUNC __rotate1(simd_double4 __x) { return __builtin_sh
1489static simd_double4 SIMD_CFUNC __rotate2(simd_double4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); }2123static simd_double4 SIMD_CFUNC __rotate2(simd_double4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); }
1490static simd_double4 SIMD_CFUNC __rotate3(simd_double4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); }2124static simd_double4 SIMD_CFUNC __rotate3(simd_double4 __x) { return __builtin_shufflevector(__x,__x,3,0,1,2); }
14912125
2126static _Float16 SIMD_CFUNC simd_trace(simd_half2x2 __x) { return __x.columns[0][0] + __x.columns[1][1]; }
1492static float SIMD_CFUNC simd_trace( simd_float2x2 __x) { return __x.columns[0][0] + __x.columns[1][1]; }2127static float SIMD_CFUNC simd_trace( simd_float2x2 __x) { return __x.columns[0][0] + __x.columns[1][1]; }
1493static double SIMD_CFUNC simd_trace(simd_double2x2 __x) { return __x.columns[0][0] + __x.columns[1][1]; }2128static double SIMD_CFUNC simd_trace(simd_double2x2 __x) { return __x.columns[0][0] + __x.columns[1][1]; }
2129static _Float16 SIMD_CFUNC simd_trace(simd_half3x3 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2]; }
1494static float SIMD_CFUNC simd_trace( simd_float3x3 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2]; }2130static float SIMD_CFUNC simd_trace( simd_float3x3 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2]; }
1495static double SIMD_CFUNC simd_trace(simd_double3x3 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2]; }2131static double SIMD_CFUNC simd_trace(simd_double3x3 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2]; }
2132static _Float16 SIMD_CFUNC simd_trace(simd_half4x4 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2] + __x.columns[3][3]; }
1496static float SIMD_CFUNC simd_trace( simd_float4x4 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2] + __x.columns[3][3]; }2133static float SIMD_CFUNC simd_trace( simd_float4x4 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2] + __x.columns[3][3]; }
1497static double SIMD_CFUNC simd_trace(simd_double4x4 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2] + __x.columns[3][3]; }2134static double SIMD_CFUNC simd_trace(simd_double4x4 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2] + __x.columns[3][3]; }
14982135
2136static _Float16 SIMD_CFUNC simd_determinant(simd_half2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; }
1499static float SIMD_CFUNC simd_determinant( simd_float2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; }2137static float SIMD_CFUNC simd_determinant( simd_float2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; }
1500static double SIMD_CFUNC simd_determinant(simd_double2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; }2138static double SIMD_CFUNC simd_determinant(simd_double2x2 __x) { return __x.columns[0][0]*__x.columns[1][1] - __x.columns[0][1]*__x.columns[1][0]; }
2139static _Float16 SIMD_CFUNC simd_determinant(simd_half3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); }
1501static float SIMD_CFUNC simd_determinant( simd_float3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); }2140static float SIMD_CFUNC simd_determinant( simd_float3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); }
1502static double SIMD_CFUNC simd_determinant(simd_double3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); }2141static double SIMD_CFUNC simd_determinant(simd_double3x3 __x) { return simd_reduce_add(__x.columns[0]*(__rotate1(__x.columns[1])*__rotate2(__x.columns[2]) - __rotate2(__x.columns[1])*__rotate1(__x.columns[2]))); }
2142static _Float16 SIMD_CFUNC simd_determinant( simd_half4x4 __x) {
2143 simd_half4 codet = __x.columns[0]*(__rotate1(__x.columns[1])*(__rotate2(__x.columns[2])*__rotate3(__x.columns[3])-__rotate3(__x.columns[2])*__rotate2(__x.columns[3])) +
2144 __rotate2(__x.columns[1])*(__rotate3(__x.columns[2])*__rotate1(__x.columns[3])-__rotate1(__x.columns[2])*__rotate3(__x.columns[3])) +
2145 __rotate3(__x.columns[1])*(__rotate1(__x.columns[2])*__rotate2(__x.columns[3])-__rotate2(__x.columns[2])*__rotate1(__x.columns[3])));
2146 return simd_reduce_add(codet.even - codet.odd);
2147}
1503static float SIMD_CFUNC simd_determinant( simd_float4x4 __x) {2148static float SIMD_CFUNC simd_determinant( simd_float4x4 __x) {
1504 simd_float4 codet = __x.columns[0]*(__rotate1(__x.columns[1])*(__rotate2(__x.columns[2])*__rotate3(__x.columns[3])-__rotate3(__x.columns[2])*__rotate2(__x.columns[3])) +2149 simd_float4 codet = __x.columns[0]*(__rotate1(__x.columns[1])*(__rotate2(__x.columns[2])*__rotate3(__x.columns[3])-__rotate3(__x.columns[2])*__rotate2(__x.columns[3])) +
1505 __rotate2(__x.columns[1])*(__rotate3(__x.columns[2])*__rotate1(__x.columns[3])-__rotate1(__x.columns[2])*__rotate3(__x.columns[3])) +2150 __rotate2(__x.columns[1])*(__rotate3(__x.columns[2])*__rotate1(__x.columns[3])-__rotate1(__x.columns[2])*__rotate3(__x.columns[3])) +
...@@ -1513,6 +2158,11 @@ static double SIMD_CFUNC simd_determinant(simd_double4x4 __x) {...@@ -1513,6 +2158,11 @@ static double SIMD_CFUNC simd_determinant(simd_double4x4 __x) {
1513 return simd_reduce_add(codet.even - codet.odd);2158 return simd_reduce_add(codet.even - codet.odd);
1514}2159}
15152160
2161#if SIMD_LIBRARY_VERSION >= 6
2162static simd_half2x2 SIMD_CFUNC simd_inverse( simd_half2x2 __x) { return __invert_h2(__x); }
2163static simd_half3x3 SIMD_CFUNC simd_inverse( simd_half3x3 __x) { return __invert_h3(__x); }
2164static simd_half4x4 SIMD_CFUNC simd_inverse( simd_half4x4 __x) { return __invert_h4(__x); }
2165#endif /* SIMD_LIBRARY_VERSION */
1516static simd_float2x2 SIMD_CFUNC simd_inverse( simd_float2x2 __x) { return __invert_f2(__x); }2166static simd_float2x2 SIMD_CFUNC simd_inverse( simd_float2x2 __x) { return __invert_f2(__x); }
1517static simd_float3x3 SIMD_CFUNC simd_inverse( simd_float3x3 __x) { return __invert_f3(__x); }2167static simd_float3x3 SIMD_CFUNC simd_inverse( simd_float3x3 __x) { return __invert_f3(__x); }
1518static simd_float4x4 SIMD_CFUNC simd_inverse( simd_float4x4 __x) { return __invert_f4(__x); }2168static simd_float4x4 SIMD_CFUNC simd_inverse( simd_float4x4 __x) { return __invert_f4(__x); }
...@@ -1520,6 +2170,15 @@ static simd_double2x2 SIMD_CFUNC simd_inverse(simd_double2x2 __x) { return __inv...@@ -1520,6 +2170,15 @@ static simd_double2x2 SIMD_CFUNC simd_inverse(simd_double2x2 __x) { return __inv
1520static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) { return __invert_d3(__x); }2170static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) { return __invert_d3(__x); }
1521static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) { return __invert_d4(__x); }2171static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) { return __invert_d4(__x); }
15222172
2173static simd_half2 SIMD_CFUNC simd_mul( simd_half2x2 __x, simd_half2 __y) { simd_half2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }
2174static simd_half3 SIMD_CFUNC simd_mul( simd_half2x3 __x, simd_half2 __y) { simd_half3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }
2175static simd_half4 SIMD_CFUNC simd_mul( simd_half2x4 __x, simd_half2 __y) { simd_half4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }
2176static simd_half2 SIMD_CFUNC simd_mul( simd_half3x2 __x, simd_half3 __y) { simd_half2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; }
2177static simd_half3 SIMD_CFUNC simd_mul( simd_half3x3 __x, simd_half3 __y) { simd_half3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; }
2178static simd_half4 SIMD_CFUNC simd_mul( simd_half3x4 __x, simd_half3 __y) { simd_half4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); return __r; }
2179static simd_half2 SIMD_CFUNC simd_mul( simd_half4x2 __x, simd_half4 __y) { simd_half2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }
2180static simd_half3 SIMD_CFUNC simd_mul( simd_half4x3 __x, simd_half4 __y) { simd_half3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }
2181static simd_half4 SIMD_CFUNC simd_mul( simd_half4x4 __x, simd_half4 __y) { simd_half4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }
1523static simd_float2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float2 __y) { simd_float2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }2182static simd_float2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float2 __y) { simd_float2 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }
1524static simd_float3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float2 __y) { simd_float3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }2183static simd_float3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float2 __y) { simd_float3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }
1525static simd_float4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float2 __y) { simd_float4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }2184static simd_float4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float2 __y) { simd_float4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); return __r; }
...@@ -1539,6 +2198,15 @@ static simd_double2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4 __y) {...@@ -1539,6 +2198,15 @@ static simd_double2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4 __y) {
1539static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y) { simd_double3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }2198static simd_double3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4 __y) { simd_double3 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }
1540static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y) { simd_double4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }2199static simd_double4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4 __y) { simd_double4 __r = __x.columns[0]*__y[0]; __r = simd_muladd( __x.columns[1], __y[1],__r); __r = simd_muladd( __x.columns[2], __y[2],__r); __r = simd_muladd( __x.columns[3], __y[3],__r); return __r; }
15412200
2201static simd_half2 SIMD_CFUNC simd_mul( simd_half2 __x, simd_half2x2 __y) { return simd_mul(simd_transpose(__y), __x); }
2202static simd_half3 SIMD_CFUNC simd_mul( simd_half2 __x, simd_half3x2 __y) { return simd_mul(simd_transpose(__y), __x); }
2203static simd_half4 SIMD_CFUNC simd_mul( simd_half2 __x, simd_half4x2 __y) { return simd_mul(simd_transpose(__y), __x); }
2204static simd_half2 SIMD_CFUNC simd_mul( simd_half3 __x, simd_half2x3 __y) { return simd_mul(simd_transpose(__y), __x); }
2205static simd_half3 SIMD_CFUNC simd_mul( simd_half3 __x, simd_half3x3 __y) { return simd_mul(simd_transpose(__y), __x); }
2206static simd_half4 SIMD_CFUNC simd_mul( simd_half3 __x, simd_half4x3 __y) { return simd_mul(simd_transpose(__y), __x); }
2207static simd_half2 SIMD_CFUNC simd_mul( simd_half4 __x, simd_half2x4 __y) { return simd_mul(simd_transpose(__y), __x); }
2208static simd_half3 SIMD_CFUNC simd_mul( simd_half4 __x, simd_half3x4 __y) { return simd_mul(simd_transpose(__y), __x); }
2209static simd_half4 SIMD_CFUNC simd_mul( simd_half4 __x, simd_half4x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1542static simd_float2 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float2x2 __y) { return simd_mul(simd_transpose(__y), __x); }2210static simd_float2 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float2x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1543static simd_float3 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float3x2 __y) { return simd_mul(simd_transpose(__y), __x); }2211static simd_float3 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float3x2 __y) { return simd_mul(simd_transpose(__y), __x); }
1544static simd_float4 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float4x2 __y) { return simd_mul(simd_transpose(__y), __x); }2212static simd_float4 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float4x2 __y) { return simd_mul(simd_transpose(__y), __x); }
...@@ -1558,63 +2226,99 @@ static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y) {...@@ -1558,63 +2226,99 @@ static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y) {
1558static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y) { return simd_mul(simd_transpose(__y), __x); }2226static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y) { return simd_mul(simd_transpose(__y), __x); }
1559static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y) { return simd_mul(simd_transpose(__y), __x); }2227static simd_double4 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double4x4 __y) { return simd_mul(simd_transpose(__y), __x); }
15602228
2229static simd_half2x2 SIMD_CFUNC simd_mul( simd_half2x2 __x, simd_half2x2 __y) { simd_half2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1561static simd_float2x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float2x2 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2230static simd_float2x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float2x2 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1562static simd_double2x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2x2 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2231static simd_double2x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double2x2 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2232static simd_half2x3 SIMD_CFUNC simd_mul( simd_half2x3 __x, simd_half2x2 __y) { simd_half2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1563static simd_float2x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float2x2 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2233static simd_float2x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float2x2 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1564static simd_double2x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2x2 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2234static simd_double2x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double2x2 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2235static simd_half2x4 SIMD_CFUNC simd_mul( simd_half2x4 __x, simd_half2x2 __y) { simd_half2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1565static simd_float2x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float2x2 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2236static simd_float2x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float2x2 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1566static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2237static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2238static simd_half2x2 SIMD_CFUNC simd_mul( simd_half3x2 __x, simd_half2x3 __y) { simd_half2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1567static simd_float2x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float2x3 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2239static simd_float2x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float2x3 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1568static simd_double2x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double2x3 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2240static simd_double2x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double2x3 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2241static simd_half2x3 SIMD_CFUNC simd_mul( simd_half3x3 __x, simd_half2x3 __y) { simd_half2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1569static simd_float2x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float2x3 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2242static simd_float2x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float2x3 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1570static simd_double2x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double2x3 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2243static simd_double2x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double2x3 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2244static simd_half2x4 SIMD_CFUNC simd_mul( simd_half3x4 __x, simd_half2x3 __y) { simd_half2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1571static simd_float2x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float2x3 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2245static simd_float2x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float2x3 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1572static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2246static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2247static simd_half2x2 SIMD_CFUNC simd_mul( simd_half4x2 __x, simd_half2x4 __y) { simd_half2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1573static simd_float2x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float2x4 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2248static simd_float2x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float2x4 __y) { simd_float2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1574static simd_double2x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double2x4 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2249static simd_double2x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double2x4 __y) { simd_double2x2 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2250static simd_half2x3 SIMD_CFUNC simd_mul( simd_half4x3 __x, simd_half2x4 __y) { simd_half2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1575static simd_float2x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float2x4 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2251static simd_float2x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float2x4 __y) { simd_float2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1576static simd_double2x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double2x4 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2252static simd_double2x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double2x4 __y) { simd_double2x3 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2253static simd_half2x4 SIMD_CFUNC simd_mul( simd_half4x4 __x, simd_half2x4 __y) { simd_half2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1577static simd_float2x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float2x4 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2254static simd_float2x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float2x4 __y) { simd_float2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1578static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2255static simd_double2x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double2x4 __y) { simd_double2x4 __r; for (int i=0; i<2; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
15792256
2257static simd_half3x2 SIMD_CFUNC simd_mul( simd_half2x2 __x, simd_half3x2 __y) { simd_half3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1580static simd_float3x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float3x2 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2258static simd_float3x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float3x2 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1581static simd_double3x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double3x2 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2259static simd_double3x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double3x2 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2260static simd_half3x3 SIMD_CFUNC simd_mul( simd_half2x3 __x, simd_half3x2 __y) { simd_half3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1582static simd_float3x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float3x2 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2261static simd_float3x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float3x2 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1583static simd_double3x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double3x2 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2262static simd_double3x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double3x2 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2263static simd_half3x4 SIMD_CFUNC simd_mul( simd_half2x4 __x, simd_half3x2 __y) { simd_half3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1584static simd_float3x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float3x2 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2264static simd_float3x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float3x2 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1585static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2265static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2266static simd_half3x2 SIMD_CFUNC simd_mul( simd_half3x2 __x, simd_half3x3 __y) { simd_half3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1586static simd_float3x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float3x3 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2267static simd_float3x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float3x3 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1587static simd_double3x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3x3 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2268static simd_double3x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double3x3 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2269static simd_half3x3 SIMD_CFUNC simd_mul( simd_half3x3 __x, simd_half3x3 __y) { simd_half3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1588static simd_float3x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float3x3 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2270static simd_float3x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float3x3 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1589static simd_double3x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3x3 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2271static simd_double3x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double3x3 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2272static simd_half3x4 SIMD_CFUNC simd_mul( simd_half3x4 __x, simd_half3x3 __y) { simd_half3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1590static simd_float3x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float3x3 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2273static simd_float3x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float3x3 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1591static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2274static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2275static simd_half3x2 SIMD_CFUNC simd_mul( simd_half4x2 __x, simd_half3x4 __y) { simd_half3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1592static simd_float3x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float3x4 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2276static simd_float3x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float3x4 __y) { simd_float3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1593static simd_double3x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double3x4 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2277static simd_double3x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double3x4 __y) { simd_double3x2 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2278static simd_half3x3 SIMD_CFUNC simd_mul( simd_half4x3 __x, simd_half3x4 __y) { simd_half3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1594static simd_float3x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float3x4 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2279static simd_float3x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float3x4 __y) { simd_float3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1595static simd_double3x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double3x4 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2280static simd_double3x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double3x4 __y) { simd_double3x3 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2281static simd_half3x4 SIMD_CFUNC simd_mul( simd_half4x4 __x, simd_half3x4 __y) { simd_half3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1596static simd_float3x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float3x4 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2282static simd_float3x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float3x4 __y) { simd_float3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1597static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2283static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y) { simd_double3x4 __r; for (int i=0; i<3; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
15982284
2285static simd_half4x2 SIMD_CFUNC simd_mul( simd_half2x2 __x, simd_half4x2 __y) { simd_half4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1599static simd_float4x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float4x2 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2286static simd_float4x2 SIMD_CFUNC simd_mul( simd_float2x2 __x, simd_float4x2 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1600static simd_double4x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double4x2 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2287static simd_double4x2 SIMD_CFUNC simd_mul(simd_double2x2 __x, simd_double4x2 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2288static simd_half4x3 SIMD_CFUNC simd_mul( simd_half2x3 __x, simd_half4x2 __y) { simd_half4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1601static simd_float4x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float4x2 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2289static simd_float4x3 SIMD_CFUNC simd_mul( simd_float2x3 __x, simd_float4x2 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1602static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2290static simd_double4x3 SIMD_CFUNC simd_mul(simd_double2x3 __x, simd_double4x2 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2291static simd_half4x4 SIMD_CFUNC simd_mul( simd_half2x4 __x, simd_half4x2 __y) { simd_half4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1603static simd_float4x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float4x2 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2292static simd_float4x4 SIMD_CFUNC simd_mul( simd_float2x4 __x, simd_float4x2 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1604static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2293static simd_double4x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double4x2 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2294static simd_half4x2 SIMD_CFUNC simd_mul( simd_half3x2 __x, simd_half4x3 __y) { simd_half4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1605static simd_float4x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float4x3 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2295static simd_float4x2 SIMD_CFUNC simd_mul( simd_float3x2 __x, simd_float4x3 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1606static simd_double4x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double4x3 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2296static simd_double4x2 SIMD_CFUNC simd_mul(simd_double3x2 __x, simd_double4x3 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2297static simd_half4x3 SIMD_CFUNC simd_mul( simd_half3x3 __x, simd_half4x3 __y) { simd_half4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1607static simd_float4x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float4x3 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2298static simd_float4x3 SIMD_CFUNC simd_mul( simd_float3x3 __x, simd_float4x3 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1608static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2299static simd_double4x3 SIMD_CFUNC simd_mul(simd_double3x3 __x, simd_double4x3 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2300static simd_half4x4 SIMD_CFUNC simd_mul( simd_half3x4 __x, simd_half4x3 __y) { simd_half4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1609static simd_float4x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float4x3 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2301static simd_float4x4 SIMD_CFUNC simd_mul( simd_float3x4 __x, simd_float4x3 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1610static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2302static simd_double4x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double4x3 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2303static simd_half4x2 SIMD_CFUNC simd_mul( simd_half4x2 __x, simd_half4x4 __y) { simd_half4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1611static simd_float4x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float4x4 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2304static simd_float4x2 SIMD_CFUNC simd_mul( simd_float4x2 __x, simd_float4x4 __y) { simd_float4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1612static simd_double4x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4x4 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2305static simd_double4x2 SIMD_CFUNC simd_mul(simd_double4x2 __x, simd_double4x4 __y) { simd_double4x2 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2306static simd_half4x3 SIMD_CFUNC simd_mul( simd_half4x3 __x, simd_half4x4 __y) { simd_half4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1613static simd_float4x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float4x4 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2307static simd_float4x3 SIMD_CFUNC simd_mul( simd_float4x3 __x, simd_float4x4 __y) { simd_float4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1614static simd_double4x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4x4 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2308static simd_double4x3 SIMD_CFUNC simd_mul(simd_double4x3 __x, simd_double4x4 __y) { simd_double4x3 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
2309static simd_half4x4 SIMD_CFUNC simd_mul( simd_half4x4 __x, simd_half4x4 __y) { simd_half4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1615static simd_float4x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float4x4 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2310static simd_float4x4 SIMD_CFUNC simd_mul( simd_float4x4 __x, simd_float4x4 __y) { simd_float4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1616static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }2311static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y) { simd_double4x4 __r; for (int i=0; i<4; ++i) __r.columns[i] = simd_mul(__x, __y.columns[i]); return __r; }
1617 2312
2313static simd_half2 SIMD_CFUNC matrix_multiply( simd_half2x2 __x, simd_half2 __y) { return simd_mul(__x, __y); }
2314static simd_half3 SIMD_CFUNC matrix_multiply( simd_half2x3 __x, simd_half2 __y) { return simd_mul(__x, __y); }
2315static simd_half4 SIMD_CFUNC matrix_multiply( simd_half2x4 __x, simd_half2 __y) { return simd_mul(__x, __y); }
2316static simd_half2 SIMD_CFUNC matrix_multiply( simd_half3x2 __x, simd_half3 __y) { return simd_mul(__x, __y); }
2317static simd_half3 SIMD_CFUNC matrix_multiply( simd_half3x3 __x, simd_half3 __y) { return simd_mul(__x, __y); }
2318static simd_half4 SIMD_CFUNC matrix_multiply( simd_half3x4 __x, simd_half3 __y) { return simd_mul(__x, __y); }
2319static simd_half2 SIMD_CFUNC matrix_multiply( simd_half4x2 __x, simd_half4 __y) { return simd_mul(__x, __y); }
2320static simd_half3 SIMD_CFUNC matrix_multiply( simd_half4x3 __x, simd_half4 __y) { return simd_mul(__x, __y); }
2321static simd_half4 SIMD_CFUNC matrix_multiply( simd_half4x4 __x, simd_half4 __y) { return simd_mul(__x, __y); }
1618static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2 __y) { return simd_mul(__x, __y); }2322static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2 __y) { return simd_mul(__x, __y); }
1619static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2 __y) { return simd_mul(__x, __y); }2323static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2 __y) { return simd_mul(__x, __y); }
1620static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2 __y) { return simd_mul(__x, __y); }2324static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2 __y) { return simd_mul(__x, __y); }
...@@ -1634,6 +2338,15 @@ static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4...@@ -1634,6 +2338,15 @@ static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4
1634static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4 __y) { return simd_mul(__x, __y); }2338static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4 __y) { return simd_mul(__x, __y); }
1635static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4 __y) { return simd_mul(__x, __y); }2339static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4 __y) { return simd_mul(__x, __y); }
1636 2340
2341static simd_half2 SIMD_CFUNC matrix_multiply( simd_half2 __x, simd_half2x2 __y) { return simd_mul(__x, __y); }
2342static simd_half3 SIMD_CFUNC matrix_multiply( simd_half2 __x, simd_half3x2 __y) { return simd_mul(__x, __y); }
2343static simd_half4 SIMD_CFUNC matrix_multiply( simd_half2 __x, simd_half4x2 __y) { return simd_mul(__x, __y); }
2344static simd_half2 SIMD_CFUNC matrix_multiply( simd_half3 __x, simd_half2x3 __y) { return simd_mul(__x, __y); }
2345static simd_half3 SIMD_CFUNC matrix_multiply( simd_half3 __x, simd_half3x3 __y) { return simd_mul(__x, __y); }
2346static simd_half4 SIMD_CFUNC matrix_multiply( simd_half3 __x, simd_half4x3 __y) { return simd_mul(__x, __y); }
2347static simd_half2 SIMD_CFUNC matrix_multiply( simd_half4 __x, simd_half2x4 __y) { return simd_mul(__x, __y); }
2348static simd_half3 SIMD_CFUNC matrix_multiply( simd_half4 __x, simd_half3x4 __y) { return simd_mul(__x, __y); }
2349static simd_half4 SIMD_CFUNC matrix_multiply( simd_half4 __x, simd_half4x4 __y) { return simd_mul(__x, __y); }
1637static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }2350static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1638static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }2351static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1639static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }2352static simd_float4 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
...@@ -1652,64 +2365,136 @@ static simd_double4 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double4x3...@@ -1652,64 +2365,136 @@ static simd_double4 SIMD_CFUNC matrix_multiply(simd_double3 __x, simd_double4x3
1652static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }2365static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
1653static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }2366static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
1654static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }2367static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
1655 2368
2369static simd_half2x2 SIMD_CFUNC matrix_multiply( simd_half2x2 __x, simd_half2x2 __y) { return simd_mul(__x, __y); }
1656static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }2370static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1657static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }2371static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
2372static simd_half2x3 SIMD_CFUNC matrix_multiply( simd_half2x3 __x, simd_half2x2 __y) { return simd_mul(__x, __y); }
1658static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }2373static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1659static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }2374static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
2375static simd_half2x4 SIMD_CFUNC matrix_multiply( simd_half2x4 __x, simd_half2x2 __y) { return simd_mul(__x, __y); }
1660static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }2376static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
1661static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }2377static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double2x2 __y) { return simd_mul(__x, __y); }
2378static simd_half2x2 SIMD_CFUNC matrix_multiply( simd_half3x2 __x, simd_half2x3 __y) { return simd_mul(__x, __y); }
1662static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }2379static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1663static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }2380static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
2381static simd_half2x3 SIMD_CFUNC matrix_multiply( simd_half3x3 __x, simd_half2x3 __y) { return simd_mul(__x, __y); }
1664static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }2382static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1665static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }2383static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
2384static simd_half2x4 SIMD_CFUNC matrix_multiply( simd_half3x4 __x, simd_half2x3 __y) { return simd_mul(__x, __y); }
1666static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }2385static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
1667static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }2386static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double2x3 __y) { return simd_mul(__x, __y); }
2387static simd_half2x2 SIMD_CFUNC matrix_multiply( simd_half4x2 __x, simd_half2x4 __y) { return simd_mul(__x, __y); }
1668static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }2388static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1669static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }2389static simd_double2x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
2390static simd_half2x3 SIMD_CFUNC matrix_multiply( simd_half4x3 __x, simd_half2x4 __y) { return simd_mul(__x, __y); }
1670static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }2391static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1671static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }2392static simd_double2x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
2393static simd_half2x4 SIMD_CFUNC matrix_multiply( simd_half4x4 __x, simd_half2x4 __y) { return simd_mul(__x, __y); }
1672static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }2394static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
1673static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }2395static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
1674 2396
2397static simd_half3x2 SIMD_CFUNC matrix_multiply( simd_half2x2 __x, simd_half3x2 __y) { return simd_mul(__x, __y); }
1675static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }2398static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1676static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }2399static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
2400static simd_half3x3 SIMD_CFUNC matrix_multiply( simd_half2x3 __x, simd_half3x2 __y) { return simd_mul(__x, __y); }
1677static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }2401static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1678static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }2402static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
2403static simd_half3x4 SIMD_CFUNC matrix_multiply( simd_half2x4 __x, simd_half3x2 __y) { return simd_mul(__x, __y); }
1679static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }2404static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
1680static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }2405static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double3x2 __y) { return simd_mul(__x, __y); }
2406static simd_half3x2 SIMD_CFUNC matrix_multiply( simd_half3x2 __x, simd_half3x3 __y) { return simd_mul(__x, __y); }
1681static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }2407static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1682static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }2408static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
2409static simd_half3x3 SIMD_CFUNC matrix_multiply( simd_half3x3 __x, simd_half3x3 __y) { return simd_mul(__x, __y); }
1683static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }2410static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1684static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }2411static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
2412static simd_half3x4 SIMD_CFUNC matrix_multiply( simd_half3x4 __x, simd_half3x3 __y) { return simd_mul(__x, __y); }
1685static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }2413static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
1686static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }2414static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double3x3 __y) { return simd_mul(__x, __y); }
2415static simd_half3x2 SIMD_CFUNC matrix_multiply( simd_half4x2 __x, simd_half3x4 __y) { return simd_mul(__x, __y); }
1687static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }2416static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1688static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }2417static simd_double3x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
2418static simd_half3x3 SIMD_CFUNC matrix_multiply( simd_half4x3 __x, simd_half3x4 __y) { return simd_mul(__x, __y); }
1689static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }2419static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1690static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }2420static simd_double3x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
2421static simd_half3x4 SIMD_CFUNC matrix_multiply( simd_half4x4 __x, simd_half3x4 __y) { return simd_mul(__x, __y); }
1691static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }2422static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
1692static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }2423static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
1693 2424
2425static simd_half4x2 SIMD_CFUNC matrix_multiply( simd_half2x2 __x, simd_half4x2 __y) { return simd_mul(__x, __y); }
1694static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }2426static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1695static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }2427static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double2x2 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
2428static simd_half4x3 SIMD_CFUNC matrix_multiply( simd_half2x3 __x, simd_half4x2 __y) { return simd_mul(__x, __y); }
1696static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }2429static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1697static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }2430static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double2x3 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
2431static simd_half4x4 SIMD_CFUNC matrix_multiply( simd_half2x4 __x, simd_half4x2 __y) { return simd_mul(__x, __y); }
1698static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }2432static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
1699static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }2433static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double2x4 __x, simd_double4x2 __y) { return simd_mul(__x, __y); }
2434static simd_half4x2 SIMD_CFUNC matrix_multiply( simd_half3x2 __x, simd_half4x3 __y) { return simd_mul(__x, __y); }
1700static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }2435static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1701static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }2436static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double3x2 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
2437static simd_half4x3 SIMD_CFUNC matrix_multiply( simd_half3x3 __x, simd_half4x3 __y) { return simd_mul(__x, __y); }
1702static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }2438static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1703static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }2439static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double3x3 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
2440static simd_half4x4 SIMD_CFUNC matrix_multiply( simd_half3x4 __x, simd_half4x3 __y) { return simd_mul(__x, __y); }
1704static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }2441static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
1705static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }2442static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double3x4 __x, simd_double4x3 __y) { return simd_mul(__x, __y); }
2443static simd_half4x2 SIMD_CFUNC matrix_multiply( simd_half4x2 __x, simd_half4x4 __y) { return simd_mul(__x, __y); }
1706static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }2444static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1707static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }2445static simd_double4x2 SIMD_CFUNC matrix_multiply(simd_double4x2 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
2446static simd_half4x3 SIMD_CFUNC matrix_multiply( simd_half4x3 __x, simd_half4x4 __y) { return simd_mul(__x, __y); }
1708static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }2447static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1709static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }2448static simd_double4x3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
2449static simd_half4x4 SIMD_CFUNC matrix_multiply( simd_half4x4 __x, simd_half4x4 __y) { return simd_mul(__x, __y); }
1710static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }2450static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
1711static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }2451static simd_double4x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4x4 __y) { return simd_mul(__x, __y); }
17122452
2453static simd_bool SIMD_CFUNC simd_equal(simd_half2x2 __x, simd_half2x2 __y) {
2454 return simd_all((__x.columns[0] == __y.columns[0]) &
2455 (__x.columns[1] == __y.columns[1]));
2456}
2457static simd_bool SIMD_CFUNC simd_equal(simd_half2x3 __x, simd_half2x3 __y) {
2458 return simd_all((__x.columns[0] == __y.columns[0]) &
2459 (__x.columns[1] == __y.columns[1]));
2460}
2461static simd_bool SIMD_CFUNC simd_equal(simd_half2x4 __x, simd_half2x4 __y) {
2462 return simd_all((__x.columns[0] == __y.columns[0]) &
2463 (__x.columns[1] == __y.columns[1]));
2464}
2465static simd_bool SIMD_CFUNC simd_equal(simd_half3x2 __x, simd_half3x2 __y) {
2466 return simd_all((__x.columns[0] == __y.columns[0]) &
2467 (__x.columns[1] == __y.columns[1]) &
2468 (__x.columns[2] == __y.columns[2]));
2469}
2470static simd_bool SIMD_CFUNC simd_equal(simd_half3x3 __x, simd_half3x3 __y) {
2471 return simd_all((__x.columns[0] == __y.columns[0]) &
2472 (__x.columns[1] == __y.columns[1]) &
2473 (__x.columns[2] == __y.columns[2]));
2474}
2475static simd_bool SIMD_CFUNC simd_equal(simd_half3x4 __x, simd_half3x4 __y) {
2476 return simd_all((__x.columns[0] == __y.columns[0]) &
2477 (__x.columns[1] == __y.columns[1]) &
2478 (__x.columns[2] == __y.columns[2]));
2479}
2480static simd_bool SIMD_CFUNC simd_equal(simd_half4x2 __x, simd_half4x2 __y) {
2481 return simd_all((__x.columns[0] == __y.columns[0]) &
2482 (__x.columns[1] == __y.columns[1]) &
2483 (__x.columns[2] == __y.columns[2]) &
2484 (__x.columns[3] == __y.columns[3]));
2485}
2486static simd_bool SIMD_CFUNC simd_equal(simd_half4x3 __x, simd_half4x3 __y) {
2487 return simd_all((__x.columns[0] == __y.columns[0]) &
2488 (__x.columns[1] == __y.columns[1]) &
2489 (__x.columns[2] == __y.columns[2]) &
2490 (__x.columns[3] == __y.columns[3]));
2491}
2492static simd_bool SIMD_CFUNC simd_equal(simd_half4x4 __x, simd_half4x4 __y) {
2493 return simd_all((__x.columns[0] == __y.columns[0]) &
2494 (__x.columns[1] == __y.columns[1]) &
2495 (__x.columns[2] == __y.columns[2]) &
2496 (__x.columns[3] == __y.columns[3]));
2497}
1713static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y) {2498static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y) {
1714 return simd_all((__x.columns[0] == __y.columns[0]) &2499 return simd_all((__x.columns[0] == __y.columns[0]) &
1715 (__x.columns[1] == __y.columns[1]));2500 (__x.columns[1] == __y.columns[1]));
...@@ -1801,6 +2586,51 @@ static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y) {...@@ -1801,6 +2586,51 @@ static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y) {
1801 (__x.columns[3] == __y.columns[3]));2586 (__x.columns[3] == __y.columns[3]));
1802}2587}
18032588
2589static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half2x2 __x, simd_half2x2 __y, _Float16 __tol) {
2590 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2591 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol));
2592}
2593static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half2x3 __x, simd_half2x3 __y, _Float16 __tol) {
2594 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2595 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol));
2596}
2597static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half2x4 __x, simd_half2x4 __y, _Float16 __tol) {
2598 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2599 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol));
2600}
2601static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half3x2 __x, simd_half3x2 __y, _Float16 __tol) {
2602 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2603 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) &
2604 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol));
2605}
2606static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half3x3 __x, simd_half3x3 __y, _Float16 __tol) {
2607 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2608 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) &
2609 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol));
2610}
2611static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half3x4 __x, simd_half3x4 __y, _Float16 __tol) {
2612 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2613 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) &
2614 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol));
2615}
2616static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half4x2 __x, simd_half4x2 __y, _Float16 __tol) {
2617 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2618 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) &
2619 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) &
2620 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol));
2621}
2622static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half4x3 __x, simd_half4x3 __y, _Float16 __tol) {
2623 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2624 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) &
2625 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) &
2626 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol));
2627}
2628static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_half4x4 __x, simd_half4x4 __y, _Float16 __tol) {
2629 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
2630 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol) &
2631 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol) &
2632 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol));
2633}
1804static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol) {2634static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol) {
1805 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &2635 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
1806 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol));2636 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol));
...@@ -1892,6 +2722,51 @@ static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_...@@ -1892,6 +2722,51 @@ static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_
1892 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol));2722 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol));
1893}2723}
18942724
2725static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half2x2 __x, simd_half2x2 __y, _Float16 __tol) {
2726 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2727 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])));
2728}
2729static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half2x3 __x, simd_half2x3 __y, _Float16 __tol) {
2730 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2731 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])));
2732}
2733static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half2x4 __x, simd_half2x4 __y, _Float16 __tol) {
2734 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2735 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])));
2736}
2737static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half3x2 __x, simd_half3x2 __y, _Float16 __tol) {
2738 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2739 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) &
2740 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])));
2741}
2742static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half3x3 __x, simd_half3x3 __y, _Float16 __tol) {
2743 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2744 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) &
2745 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])));
2746}
2747static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half3x4 __x, simd_half3x4 __y, _Float16 __tol) {
2748 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2749 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) &
2750 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])));
2751}
2752static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half4x2 __x, simd_half4x2 __y, _Float16 __tol) {
2753 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2754 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) &
2755 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) &
2756 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3])));
2757}
2758static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half4x3 __x, simd_half4x3 __y, _Float16 __tol) {
2759 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2760 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) &
2761 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) &
2762 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3])));
2763}
2764static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_half4x4 __x, simd_half4x4 __y, _Float16 __tol) {
2765 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
2766 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])) &
2767 (__tg_fabs(__x.columns[2] - __y.columns[2]) <= __tol*__tg_fabs(__x.columns[2])) &
2768 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol*__tg_fabs(__x.columns[3])));
2769}
1895static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol) {2770static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol) {
1896 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &2771 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
1897 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])));2772 (__tg_fabs(__x.columns[1] - __y.columns[1]) <= __tol*__tg_fabs(__x.columns[1])));
lib/libc/include/any-macos-any/simd/matrix_types.h+233
...@@ -34,6 +34,18 @@...@@ -34,6 +34,18 @@
34#if SIMD_COMPILER_HAS_REQUIRED_FEATURES34#if SIMD_COMPILER_HAS_REQUIRED_FEATURES
3535
36/* Matrix types available in C, Objective-C, and C++ */36/* Matrix types available in C, Objective-C, and C++ */
37typedef simd_half2x2 matrix_half2x2;
38typedef simd_half3x2 matrix_half3x2;
39typedef simd_half4x2 matrix_half4x2;
40
41typedef simd_half2x3 matrix_half2x3;
42typedef simd_half3x3 matrix_half3x3;
43typedef simd_half4x3 matrix_half4x3;
44
45typedef simd_half2x4 matrix_half2x4;
46typedef simd_half3x4 matrix_half3x4;
47typedef simd_half4x4 matrix_half4x4;
48
37typedef simd_float2x2 matrix_float2x2;49typedef simd_float2x2 matrix_float2x2;
38typedef simd_float3x2 matrix_float3x2;50typedef simd_float3x2 matrix_float3x2;
39typedef simd_float4x2 matrix_float4x2;51typedef simd_float4x2 matrix_float4x2;
...@@ -60,6 +72,8 @@ typedef simd_double4x4 matrix_double4x4;...@@ -60,6 +72,8 @@ typedef simd_double4x4 matrix_double4x4;
6072
61#ifdef __cplusplus73#ifdef __cplusplus
62#if defined SIMD_MATRIX_HEADER74#if defined SIMD_MATRIX_HEADER
75static simd_half3x3 SIMD_NOINLINE simd_matrix3x3(simd_quath q);
76static simd_half4x4 SIMD_NOINLINE simd_matrix4x4(simd_quath q);
63static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);77static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);
64static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);78static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);
65static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);79static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);
...@@ -68,6 +82,117 @@ static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);...@@ -68,6 +82,117 @@ static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);
6882
69namespace simd {83namespace simd {
70 84
85 struct half2x2 : ::simd_half2x2 {
86 SIMD_CONSTEXPR half2x2() SIMD_NOEXCEPT : ::simd_half2x2((simd_half2x2){0}) { }
87#if __has_feature(cxx_delegating_constructors)
88 SIMD_CONSTEXPR half2x2(_Float16 diagonal) SIMD_NOEXCEPT : half2x2((half2)diagonal) { }
89#endif
90 SIMD_CONSTEXPR half2x2(half2 v) SIMD_NOEXCEPT :
91 ::simd_half2x2((simd_half2x2){(half2){v.x,0}, (half2){0,v.y}}) { }
92 SIMD_CONSTEXPR half2x2(half2 c0, half2 c1) SIMD_NOEXCEPT : simd_half2x2((simd_half2x2){c0, c1}) { }
93 SIMD_CONSTEXPR half2x2(::simd_half2x2 m) SIMD_NOEXCEPT : ::simd_half2x2(m) { }
94 };
95
96 struct half3x2 : ::simd_half3x2 {
97 SIMD_CONSTEXPR half3x2() SIMD_NOEXCEPT : ::simd_half3x2((simd_half3x2){0}) { }
98#if __has_feature(cxx_delegating_constructors)
99 SIMD_CONSTEXPR half3x2(_Float16 diagonal) SIMD_NOEXCEPT : half3x2((half2)diagonal) { }
100#endif
101 SIMD_CONSTEXPR half3x2(half2 v) SIMD_NOEXCEPT :
102 ::simd_half3x2((simd_half3x2){(half2){v.x,0}, (half2){0,v.y}, (half2){0}}) { }
103 SIMD_CONSTEXPR half3x2(half2 c0, half2 c1, half2 c2) SIMD_NOEXCEPT :
104 ::simd_half3x2((simd_half3x2){c0, c1, c2}) { }
105 SIMD_CONSTEXPR half3x2(::simd_half3x2 m) SIMD_NOEXCEPT : ::simd_half3x2(m) { }
106 };
107
108 struct half4x2 : ::simd_half4x2 {
109 SIMD_CONSTEXPR half4x2() SIMD_NOEXCEPT : ::simd_half4x2((simd_half4x2){0}) { }
110#if __has_feature(cxx_delegating_constructors)
111 SIMD_CONSTEXPR half4x2(_Float16 diagonal) SIMD_NOEXCEPT : half4x2((half2)diagonal) { }
112#endif
113 SIMD_CONSTEXPR half4x2(half2 v) SIMD_NOEXCEPT :
114 ::simd_half4x2((simd_half4x2){(half2){v.x,0}, (half2){0,v.y}, (half2){0}, (half2){0}}) { }
115 SIMD_CONSTEXPR half4x2(half2 c0, half2 c1, half2 c2, half2 c3) SIMD_NOEXCEPT :
116 ::simd_half4x2((simd_half4x2){c0, c1, c2, c3}) { }
117 SIMD_CONSTEXPR half4x2(::simd_half4x2 m) SIMD_NOEXCEPT : ::simd_half4x2(m) { }
118 };
119
120 struct half2x3 : ::simd_half2x3 {
121 SIMD_CONSTEXPR half2x3() SIMD_NOEXCEPT : ::simd_half2x3((simd_half2x3){0}) { }
122#if __has_feature(cxx_delegating_constructors)
123 SIMD_CONSTEXPR half2x3(_Float16 diagonal) SIMD_NOEXCEPT : half2x3((half2)diagonal) { }
124#endif
125 SIMD_CONSTEXPR half2x3(half2 v) SIMD_NOEXCEPT :
126 ::simd_half2x3((simd_half2x3){(half3){v.x,0,0}, (half3){0,v.y,0}}) { }
127 SIMD_CONSTEXPR half2x3(half3 c0, half3 c1) SIMD_NOEXCEPT : ::simd_half2x3((simd_half2x3){c0, c1}) { }
128 SIMD_CONSTEXPR half2x3(::simd_half2x3 m) SIMD_NOEXCEPT : ::simd_half2x3(m) { }
129 };
130
131 struct half3x3 : ::simd_half3x3 {
132 SIMD_CONSTEXPR half3x3() SIMD_NOEXCEPT : ::simd_half3x3((simd_half3x3){0}) { }
133#if __has_feature(cxx_delegating_constructors)
134 SIMD_CONSTEXPR half3x3(_Float16 diagonal) SIMD_NOEXCEPT : half3x3((half3)diagonal) { }
135#endif
136 SIMD_CONSTEXPR half3x3(half3 v) SIMD_NOEXCEPT :
137 ::simd_half3x3((simd_half3x3){(half3){v.x,0,0}, (half3){0,v.y,0}, (half3){0,0,v.z}}) { }
138 SIMD_CONSTEXPR half3x3(half3 c0, half3 c1, half3 c2) SIMD_NOEXCEPT :
139 ::simd_half3x3((simd_half3x3){c0, c1, c2}) { }
140 SIMD_CONSTEXPR half3x3(::simd_half3x3 m) SIMD_NOEXCEPT : ::simd_half3x3(m) { }
141#if defined SIMD_MATRIX_HEADER
142 SIMD_CONSTEXPR half3x3(::simd_quath q) SIMD_NOEXCEPT : ::simd_half3x3(::simd_matrix3x3(q)) { }
143#endif
144 };
145
146 struct half4x3 : ::simd_half4x3 {
147 SIMD_CONSTEXPR half4x3() SIMD_NOEXCEPT : ::simd_half4x3((simd_half4x3){0}) { }
148#if __has_feature(cxx_delegating_constructors)
149 SIMD_CONSTEXPR half4x3(_Float16 diagonal) SIMD_NOEXCEPT : half4x3((half3)diagonal) { }
150#endif
151 SIMD_CONSTEXPR half4x3(half3 v) SIMD_NOEXCEPT :
152 ::simd_half4x3((simd_half4x3){(half3){v.x,0,0}, (half3){0,v.y,0}, (half3){0,0,v.z}, (half3){0}}) { }
153 SIMD_CONSTEXPR half4x3(half3 c0, half3 c1, half3 c2, half3 c3) SIMD_NOEXCEPT :
154 ::simd_half4x3((simd_half4x3){c0, c1, c2, c3}) { }
155 SIMD_CONSTEXPR half4x3(::simd_half4x3 m) SIMD_NOEXCEPT : ::simd_half4x3(m) { }
156 };
157
158 struct half2x4 : ::simd_half2x4 {
159 SIMD_CONSTEXPR half2x4() SIMD_NOEXCEPT : ::simd_half2x4((simd_half2x4){0}) { }
160#if __has_feature(cxx_delegating_constructors)
161 SIMD_CONSTEXPR half2x4(_Float16 diagonal) SIMD_NOEXCEPT : half2x4((half2)diagonal) { }
162#endif
163 SIMD_CONSTEXPR half2x4(half2 v) SIMD_NOEXCEPT :
164 ::simd_half2x4((simd_half2x4){(half4){v.x,0,0,0}, (half4){0,v.y,0,0}}) { }
165 SIMD_CONSTEXPR half2x4(half4 c0, half4 c1) SIMD_NOEXCEPT : ::simd_half2x4((simd_half2x4){c0, c1}) { }
166 SIMD_CONSTEXPR half2x4(::simd_half2x4 m) SIMD_NOEXCEPT : ::simd_half2x4(m) { }
167 };
168
169 struct half3x4 : ::simd_half3x4 {
170 SIMD_CONSTEXPR half3x4() SIMD_NOEXCEPT : ::simd_half3x4((simd_half3x4){0}) { }
171#if __has_feature(cxx_delegating_constructors)
172 SIMD_CONSTEXPR half3x4(_Float16 diagonal) SIMD_NOEXCEPT : half3x4((half3)diagonal) { }
173#endif
174 SIMD_CONSTEXPR half3x4(half3 v) SIMD_NOEXCEPT :
175 ::simd_half3x4((simd_half3x4){(half4){v.x,0,0,0}, (half4){0,v.y,0,0}, (half4){0,0,v.z,0}}) { }
176 SIMD_CONSTEXPR half3x4(half4 c0, half4 c1, half4 c2) SIMD_NOEXCEPT :
177 ::simd_half3x4((simd_half3x4){c0, c1, c2}) { }
178 SIMD_CONSTEXPR half3x4(::simd_half3x4 m) SIMD_NOEXCEPT : ::simd_half3x4(m) { }
179 };
180
181 struct half4x4 : ::simd_half4x4 {
182 SIMD_CONSTEXPR half4x4() SIMD_NOEXCEPT : ::simd_half4x4((simd_half4x4){0}) { }
183#if __has_feature(cxx_delegating_constructors)
184 SIMD_CONSTEXPR half4x4(_Float16 diagonal) SIMD_NOEXCEPT : half4x4((half4)diagonal) { }
185#endif
186 SIMD_CONSTEXPR half4x4(half4 v) SIMD_NOEXCEPT :
187 ::simd_half4x4((simd_half4x4){(half4){v.x,0,0,0}, (half4){0,v.y,0,0}, (half4){0,0,v.z,0}, (half4){0,0,0,v.w}}) { }
188 SIMD_CONSTEXPR half4x4(half4 c0, half4 c1, half4 c2, half4 c3) SIMD_NOEXCEPT :
189 ::simd_half4x4((simd_half4x4){c0, c1, c2, c3}) { }
190 SIMD_CONSTEXPR half4x4(::simd_half4x4 m) SIMD_NOEXCEPT : ::simd_half4x4(m) { }
191#if defined SIMD_MATRIX_HEADER
192 SIMD_CONSTEXPR half4x4(::simd_quath q) SIMD_NOEXCEPT : ::simd_half4x4(::simd_matrix4x4(q)) { }
193#endif
194 };
195
71 struct float2x2 : ::simd_float2x2 {196 struct float2x2 : ::simd_float2x2 {
72 SIMD_CONSTEXPR float2x2() SIMD_NOEXCEPT : ::simd_float2x2((simd_float2x2){0}) { }197 SIMD_CONSTEXPR float2x2() SIMD_NOEXCEPT : ::simd_float2x2((simd_float2x2){0}) { }
73#if __has_feature(cxx_delegating_constructors)198#if __has_feature(cxx_delegating_constructors)
...@@ -303,6 +428,69 @@ template <typename ScalarType, size_t col, size_t row> struct Matrix {...@@ -303,6 +428,69 @@ template <typename ScalarType, size_t col, size_t row> struct Matrix {
303template <typename ScalarType, size_t col, size_t row>428template <typename ScalarType, size_t col, size_t row>
304using Matrix_t = typename Matrix<ScalarType, col, row>::type;429using Matrix_t = typename Matrix<ScalarType, col, row>::type;
305430
431template<> struct Matrix<_Float16, 2, 2> {
432 static const size_t col = 2;
433 static const size_t row = 2;
434 typedef _Float16 scalar_t;
435 typedef half2x2 type;
436};
437
438template<> struct Matrix<_Float16, 3, 2> {
439 static const size_t col = 3;
440 static const size_t row = 2;
441 typedef _Float16 scalar_t;
442 typedef half3x2 type;
443};
444
445template<> struct Matrix<_Float16, 4, 2> {
446 static const size_t col = 4;
447 static const size_t row = 2;
448 typedef _Float16 scalar_t;
449 typedef half4x2 type;
450};
451
452template<> struct Matrix<_Float16, 2, 3> {
453 static const size_t col = 2;
454 static const size_t row = 3;
455 typedef _Float16 scalar_t;
456 typedef half2x3 type;
457};
458
459template<> struct Matrix<_Float16, 3, 3> {
460 static const size_t col = 3;
461 static const size_t row = 3;
462 typedef _Float16 scalar_t;
463 typedef half3x3 type;
464};
465
466template<> struct Matrix<_Float16, 4, 3> {
467 static const size_t col = 4;
468 static const size_t row = 3;
469 typedef _Float16 scalar_t;
470 typedef half4x3 type;
471};
472
473template<> struct Matrix<_Float16, 2, 4> {
474 static const size_t col = 2;
475 static const size_t row = 4;
476 typedef _Float16 scalar_t;
477 typedef half2x4 type;
478};
479
480template<> struct Matrix<_Float16, 3, 4> {
481 static const size_t col = 3;
482 static const size_t row = 4;
483 typedef _Float16 scalar_t;
484 typedef half3x4 type;
485};
486
487template<> struct Matrix<_Float16, 4, 4> {
488 static const size_t col = 4;
489 static const size_t row = 4;
490 typedef _Float16 scalar_t;
491 typedef half4x4 type;
492};
493
306template<> struct Matrix<float, 2, 2> {494template<> struct Matrix<float, 2, 2> {
307 static const size_t col = 2;495 static const size_t col = 2;
308 static const size_t row = 2;496 static const size_t row = 2;
...@@ -429,6 +617,51 @@ template<> struct Matrix<double, 4, 4> {...@@ -429,6 +617,51 @@ template<> struct Matrix<double, 4, 4> {
429 typedef double4x4 type;617 typedef double4x4 type;
430};618};
431619
620template <> struct get_traits<half2x2>
621{
622 using type = Matrix<_Float16, 2, 2>;
623};
624
625template <> struct get_traits<half3x2>
626{
627 using type = Matrix<_Float16, 3, 2>;
628};
629
630template <> struct get_traits<half4x2>
631{
632 using type = Matrix<_Float16, 4, 2>;
633};
634
635template <> struct get_traits<half2x3>
636{
637 using type = Matrix<_Float16, 2, 3>;
638};
639
640template <> struct get_traits<half3x3>
641{
642 using type = Matrix<_Float16, 3, 3>;
643};
644
645template <> struct get_traits<half4x3>
646{
647 using type = Matrix<_Float16, 4, 3>;
648};
649
650template <> struct get_traits<half2x4>
651{
652 using type = Matrix<_Float16, 2, 4>;
653};
654
655template <> struct get_traits<half3x4>
656{
657 using type = Matrix<_Float16, 3, 4>;
658};
659
660template <> struct get_traits<half4x4>
661{
662 using type = Matrix<_Float16, 4, 4>;
663};
664
432template <> struct get_traits<float2x2>665template <> struct get_traits<float2x2>
433{666{
434 using type = Matrix<float, 2, 2>;667 using type = Matrix<float, 2, 2>;
lib/libc/include/any-macos-any/simd/packed.h+80
...@@ -208,6 +208,46 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) unsigned short s...@@ -208,6 +208,46 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) unsigned short s
208 * type, so you can use it to load or store from an array of that type. */208 * type, so you can use it to load or store from an array of that type. */
209typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) unsigned short simd_packed_ushort32;209typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) unsigned short simd_packed_ushort32;
210210
211/*! @abstract A vector of two 16-bit floating-point numbers with relaxed
212 * alignment.
213 * @description In C++ and Metal, this type is also available as
214 * simd::packed::half2. The alignment of this type is that of the
215 * underlying scalar element type, so you can use it to load or store from
216 * an array of that type. */
217typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) _Float16 simd_packed_half2;
218
219/*! @abstract A vector of four 16-bit floating-point numbers with relaxed
220 * alignment.
221 * @description In C++ and Metal, this type is also available as
222 * simd::packed::half4. The alignment of this type is that of the
223 * underlying scalar element type, so you can use it to load or store from
224 * an array of that type. */
225typedef __attribute__((__ext_vector_type__(4),__aligned__(2))) _Float16 simd_packed_half4;
226
227/*! @abstract A vector of eight 16-bit floating-point numbers with relaxed
228 * alignment.
229 * @description In C++ this type is also available as simd::packed::half8.
230 * This type is not available in Metal. The alignment of this type is only
231 * that of the underlying scalar element type, so you can use it to load or
232 * store from an array of that type. */
233typedef __attribute__((__ext_vector_type__(8),__aligned__(2))) _Float16 simd_packed_half8;
234
235/*! @abstract A vector of sixteen 16-bit floating-point numbers with relaxed
236 * alignment.
237 * @description In C++ this type is also available as simd::packed::half16.
238 * This type is not available in Metal. The alignment of this type is only
239 * that of the underlying scalar element type, so you can use it to load or
240 * store from an array of that type. */
241typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) _Float16 simd_packed_half16;
242
243/*! @abstract A vector of thirty-two 16-bit floating-point numbers with
244 * relaxed alignment.
245 * @description In C++ this type is also available as simd::packed::half32.
246 * This type is not available in Metal. The alignment of this type is only
247 * that of the underlying scalar element type, so you can use it to load or
248 * store from an array of that type. */
249typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) _Float16 simd_packed_half32;
250
211/*! @abstract A vector of two 32-bit signed (twos-complement) integers with251/*! @abstract A vector of two 32-bit signed (twos-complement) integers with
212 * relaxed alignment.252 * relaxed alignment.
213 * @description In C++ and Metal, this type is also available as253 * @description In C++ and Metal, this type is also available as
...@@ -592,6 +632,46 @@ typedef ::simd_packed_ushort16 ushort16;...@@ -592,6 +632,46 @@ typedef ::simd_packed_ushort16 ushort16;
592 * type, so you can use it to load or store from an array of that type. */632 * type, so you can use it to load or store from an array of that type. */
593typedef ::simd_packed_ushort32 ushort32;633typedef ::simd_packed_ushort32 ushort32;
594 634
635 /*! @abstract A vector of two 16-bit floating-point numbers with relaxed
636 * alignment.
637 * @description In C or Objective-C, this type is available as
638 * simd_packed_half2. The alignment of this type is only that of the
639 * underlying scalar element type, so you can use it to load or store
640 * from an array of that type. */
641typedef ::simd_packed_half2 half2;
642
643 /*! @abstract A vector of four 16-bit floating-point numbers with
644 * relaxed alignment.
645 * @description In C or Objective-C, this type is available as
646 * simd_packed_half4. The alignment of this type is only that of the
647 * underlying scalar element type, so you can use it to load or store
648 * from an array of that type. */
649typedef ::simd_packed_half4 half4;
650
651 /*! @abstract A vector of eight 16-bit floating-point numbers with
652 * relaxed alignment.
653 * @description This type is not available in Metal. In C or
654 * Objective-C, this type is available as simd_packed_half8. The
655 * alignment of this type is only that of the underlying scalar element
656 * type, so you can use it to load or store from an array of that type. */
657typedef ::simd_packed_half8 half8;
658
659 /*! @abstract A vector of sixteen 16-bit floating-point numbers with
660 * relaxed alignment.
661 * @description This type is not available in Metal. In C or
662 * Objective-C, this type is available as simd_packed_half16. The
663 * alignment of this type is only that of the underlying scalar element
664 * type, so you can use it to load or store from an array of that type. */
665typedef ::simd_packed_half16 half16;
666
667 /*! @abstract A vector of thirty-two 16-bit floating-point numbers with
668 * relaxed alignment.
669 * @description This type is not available in Metal. In C or
670 * Objective-C, this type is available as simd_packed_half32. The
671 * alignment of this type is only that of the underlying scalar element
672 * type, so you can use it to load or store from an array of that type. */
673typedef ::simd_packed_half32 half32;
674
595 /*! @abstract A vector of two 32-bit signed (twos-complement) integers675 /*! @abstract A vector of two 32-bit signed (twos-complement) integers
596 * with relaxed alignment.676 * with relaxed alignment.
597 * @description In C or Objective-C, this type is available as677 * @description In C or Objective-C, this type is available as
lib/libc/include/any-macos-any/simd/quaternion.h+598-12
...@@ -15,6 +15,592 @@...@@ -15,6 +15,592 @@
15extern "C" {15extern "C" {
16#endif16#endif
17 17
18/* MARK: - C and Objective-C _Float16 interfaces */
19
20/*! @abstract Constructs a quaternion from four scalar values.
21 *
22 * @param ix The first component of the imaginary (vector) part.
23 * @param iy The second component of the imaginary (vector) part.
24 * @param iz The third component of the imaginary (vector) part.
25 *
26 * @param r The real (scalar) part. */
27static inline SIMD_CFUNC simd_quath simd_quaternion(_Float16 ix, _Float16 iy, _Float16 iz, _Float16 r) {
28 return (simd_quath){ { ix, iy, iz, r } };
29}
30
31/*! @abstract Constructs a quaternion from an array of four scalars.
32 *
33 * @discussion Note that the imaginary part of the quaternion comes from
34 * array elements 0, 1, and 2, and the real part comes from element 3. */
35static inline SIMD_NONCONST simd_quath simd_quaternion(const _Float16 xyzr[4]) {
36 return (simd_quath){ *(const simd_packed_half4 *)xyzr };
37}
38
39/*! @abstract Constructs a quaternion from a four-element vector.
40 *
41 * @discussion Note that the imaginary (vector) part of the quaternion comes
42 * from lanes 0, 1, and 2 of the vector, and the real (scalar) part comes from
43 * lane 3. */
44static inline SIMD_CFUNC simd_quath simd_quaternion(simd_half4 xyzr) {
45 return (simd_quath){ xyzr };
46}
47
48/*! @abstract Constructs a quaternion that rotates by `angle` radians about
49 * `axis`. */
50static inline SIMD_CFUNC simd_quath simd_quaternion(_Float16 angle, simd_half3 axis);
51
52/*! @abstract Construct a quaternion that rotates from one vector to another.
53 *
54 * @param from A normalized three-element vector.
55 * @param to A normalized three-element vector.
56 *
57 * @discussion The rotation axis is `simd_cross(from, to)`. If `from` and
58 * `to` point in opposite directions (to within machine precision), an
59 * arbitrary rotation axis is chosen, and the angle is pi radians. */
60static SIMD_NOINLINE simd_quath simd_quaternion(simd_half3 from, simd_half3 to);
61
62/*! @abstract Construct a quaternion from a 3x3 rotation `matrix`.
63 *
64 * @discussion If `matrix` is not orthogonal with determinant 1, the result
65 * is undefined. */
66static SIMD_NOINLINE simd_quath simd_quaternion(simd_half3x3 matrix);
67
68/*! @abstract Construct a quaternion from a 4x4 rotation `matrix`.
69 *
70 * @discussion The last row and column of the matrix are ignored. This
71 * function is equivalent to calling simd_quaternion with the upper-left 3x3
72 * submatrix . */
73static SIMD_NOINLINE simd_quath simd_quaternion(simd_half4x4 matrix);
74
75/*! @abstract The real (scalar) part of the quaternion `q`. */
76static inline SIMD_CFUNC _Float16 simd_real(simd_quath q) {
77 return q.vector.w;
78}
79
80/*! @abstract The imaginary (vector) part of the quaternion `q`. */
81static inline SIMD_CFUNC simd_half3 simd_imag(simd_quath q) {
82 return q.vector.xyz;
83}
84
85/*! @abstract The angle (in radians) of rotation represented by `q`. */
86static inline SIMD_CFUNC _Float16 simd_angle(simd_quath q);
87
88/*! @abstract The normalized axis (a 3-element vector) around which the
89 * action of the quaternion `q` rotates. */
90static inline SIMD_CFUNC simd_half3 simd_axis(simd_quath q);
91
92/*! @abstract The sum of the quaternions `p` and `q`. */
93static inline SIMD_CFUNC simd_quath simd_add(simd_quath p, simd_quath q);
94
95/*! @abstract The difference of the quaternions `p` and `q`. */
96static inline SIMD_CFUNC simd_quath simd_sub(simd_quath p, simd_quath q);
97
98/*! @abstract The product of the quaternions `p` and `q`. */
99static inline SIMD_CFUNC simd_quath simd_mul(simd_quath p, simd_quath q);
100
101/*! @abstract The quaternion `q` scaled by the real value `a`. */
102static inline SIMD_CFUNC simd_quath simd_mul(simd_quath q, _Float16 a);
103
104/*! @abstract The quaternion `q` scaled by the real value `a`. */
105static inline SIMD_CFUNC simd_quath simd_mul(_Float16 a, simd_quath q);
106
107/*! @abstract The conjugate of the quaternion `q`. */
108static inline SIMD_CFUNC simd_quath simd_conjugate(simd_quath q);
109
110/*! @abstract The (multiplicative) inverse of the quaternion `q`. */
111static inline SIMD_CFUNC simd_quath simd_inverse(simd_quath q);
112
113/*! @abstract The negation (additive inverse) of the quaternion `q`. */
114static inline SIMD_CFUNC simd_quath simd_negate(simd_quath q);
115
116/*! @abstract The dot product of the quaternions `p` and `q` interpreted as
117 * four-dimensional vectors. */
118static inline SIMD_CFUNC _Float16 simd_dot(simd_quath p, simd_quath q);
119
120/*! @abstract The length of the quaternion `q`. */
121static inline SIMD_CFUNC _Float16 simd_length(simd_quath q);
122
123/*! @abstract The unit quaternion obtained by normalizing `q`. */
124static inline SIMD_CFUNC simd_quath simd_normalize(simd_quath q);
125
126/*! @abstract Rotates the vector `v` by the quaternion `q`. */
127static inline SIMD_CFUNC simd_half3 simd_act(simd_quath q, simd_half3 v);
128
129/*! @abstract Logarithm of the quaternion `q`.
130 * @discussion Do not call this function directly; use `log(q)` instead.
131 *
132 * We can write a quaternion `q` in the form: `r(cos(t) + sin(t)v)` where
133 * `r` is the length of `q`, `t` is an angle, and `v` is a unit 3-vector.
134 * The logarithm of `q` is `log(r) + tv`, just like the logarithm of the
135 * complex number `r*(cos(t) + i sin(t))` is `log(r) + it`.
136 *
137 * Note that this function is not robust against poorly-scaled non-unit
138 * quaternions, because it is primarily used for spline interpolation of
139 * unit quaternions. If you need to compute a robust logarithm of general
140 * quaternions, you can use the following approach:
141 *
142 * scale = simd_reduce_max(simd_abs(q.vector));
143 * logq = log(simd_recip(scale)*q);
144 * logq.real += log(scale);
145 * return logq; */
146static SIMD_NOINLINE simd_quath __tg_log(simd_quath q);
147
148/*! @abstract Inverse of `log( )`; the exponential map on quaternions.
149 * @discussion Do not call this function directly; use `exp(q)` instead. */
150static SIMD_NOINLINE simd_quath __tg_exp(simd_quath q);
151
152/*! @abstract Spherical linear interpolation along the shortest arc between
153 * quaternions `q0` and `q1`. */
154static SIMD_NOINLINE simd_quath simd_slerp(simd_quath q0, simd_quath q1, _Float16 t);
155
156/*! @abstract Spherical linear interpolation along the longest arc between
157 * quaternions `q0` and `q1`. */
158static SIMD_NOINLINE simd_quath simd_slerp_longest(simd_quath q0, simd_quath q1, _Float16 t);
159
160/*! @abstract Interpolate between quaternions along a spherical cubic spline.
161 *
162 * @discussion The function interpolates between q1 and q2. q0 is the left
163 * endpoint of the previous interval, and q3 is the right endpoint of the next
164 * interval. Use this function to smoothly interpolate between a sequence of
165 * rotations. */
166static SIMD_NOINLINE simd_quath simd_spline(simd_quath q0, simd_quath q1, simd_quath q2, simd_quath q3, _Float16 t);
167
168/*! @abstract Spherical cubic Bezier interpolation between quaternions.
169 *
170 * @discussion The function treats q0 ... q3 as control points and uses slerp
171 * in place of lerp in the De Castlejeau algorithm. The endpoints of
172 * interpolation are thus q0 and q3, and the curve will not generally pass
173 * through q1 or q2. Note that the convex hull property of "standard" Bezier
174 * curve does not hold on the sphere. */
175static SIMD_NOINLINE simd_quath simd_bezier(simd_quath q0, simd_quath q1, simd_quath q2, simd_quath q3, _Float16 t);
176
177#ifdef __cplusplus
178} /* extern "C" */
179/* MARK: - C++ _Float16 interfaces */
180
181namespace simd {
182 struct quath : ::simd_quath {
183 /*! @abstract The identity quaternion. */
184 quath( ) : ::simd_quath(::simd_quaternion((half4){0,0,0,1})) { }
185
186 /*! @abstract Constructs a C++ quaternion from a C quaternion. */
187 quath(::simd_quath q) : ::simd_quath(q) { }
188
189 /*! @abstract Constructs a quaternion from components. */
190 quath(_Float16 ix, _Float16 iy, _Float16 iz, _Float16 r) : ::simd_quath(::simd_quaternion(ix, iy, iz, r)) { }
191
192 /*! @abstract Constructs a quaternion from an array of scalars. */
193 quath(const _Float16 xyzr[4]) : ::simd_quath(::simd_quaternion(xyzr)) { }
194
195 /*! @abstract Constructs a quaternion from a vector. */
196 quath(half4 xyzr) : ::simd_quath(::simd_quaternion(xyzr)) { }
197
198 /*! @abstract Quaternion representing rotation about `axis` by `angle`
199 * radians. */
200 quath(_Float16 angle, half3 axis) : ::simd_quath(::simd_quaternion(angle, axis)) { }
201
202 /*! @abstract Quaternion that rotates `from` into `to`. */
203 quath(half3 from, half3 to) : ::simd_quath(::simd_quaternion(from, to)) { }
204
205 /*! @abstract Constructs a quaternion from a rotation matrix. */
206 quath(::simd_half3x3 matrix) : ::simd_quath(::simd_quaternion(matrix)) { }
207
208 /*! @abstract Constructs a quaternion from a rotation matrix. */
209 quath(::simd_half4x4 matrix) : ::simd_quath(::simd_quaternion(matrix)) { }
210
211 /*! @abstract The real (scalar) part of the quaternion. */
212 _Float16 real(void) const { return ::simd_real(*this); }
213
214 /*! @abstract The imaginary (vector) part of the quaternion. */
215 half3 imag(void) const { return ::simd_imag(*this); }
216
217 /*! @abstract The angle the quaternion rotates by. */
218 _Float16 angle(void) const { return ::simd_angle(*this); }
219
220 /*! @abstract The axis the quaternion rotates about. */
221 half3 axis(void) const { return ::simd_axis(*this); }
222
223 /*! @abstract The length of the quaternion. */
224 _Float16 length(void) const { return ::simd_length(*this); }
225
226 /*! @abstract Act on the vector `v` by rotation. */
227 half3 operator()(const ::simd_half3 v) const { return ::simd_act(*this, v); }
228 };
229
230 static SIMD_CPPFUNC quath operator+(const ::simd_quath p, const ::simd_quath q) { return ::simd_add(p, q); }
231 static SIMD_CPPFUNC quath operator-(const ::simd_quath p, const ::simd_quath q) { return ::simd_sub(p, q); }
232 static SIMD_CPPFUNC quath operator-(const ::simd_quath p) { return ::simd_negate(p); }
233 static SIMD_CPPFUNC quath operator*(const _Float16 r, const ::simd_quath p) { return ::simd_mul(r, p); }
234 static SIMD_CPPFUNC quath operator*(const ::simd_quath p, const _Float16 r) { return ::simd_mul(p, r); }
235 static SIMD_CPPFUNC quath operator*(const ::simd_quath p, const ::simd_quath q) { return ::simd_mul(p, q); }
236 static SIMD_CPPFUNC quath operator/(const ::simd_quath p, const ::simd_quath q) { return ::simd_mul(p, ::simd_inverse(q)); }
237 static SIMD_INLINE SIMD_NODEBUG quath operator+=(quath &p, const ::simd_quath q) { return p = p+q; }
238 static SIMD_INLINE SIMD_NODEBUG quath operator-=(quath &p, const ::simd_quath q) { return p = p-q; }
239 static SIMD_INLINE SIMD_NODEBUG quath operator*=(quath &p, const _Float16 r) { return p = p*r; }
240 static SIMD_INLINE SIMD_NODEBUG quath operator*=(quath &p, const ::simd_quath q) { return p = p*q; }
241 static SIMD_INLINE SIMD_NODEBUG quath operator/=(quath &p, const ::simd_quath q) { return p = p/q; }
242
243 /*! @abstract The conjugate of the quaternion `q`. */
244 static SIMD_CPPFUNC quath conjugate(const ::simd_quath p) { return ::simd_conjugate(p); }
245
246 /*! @abstract The (multiplicative) inverse of the quaternion `q`. */
247 static SIMD_CPPFUNC quath inverse(const ::simd_quath p) { return ::simd_inverse(p); }
248
249 /*! @abstract The dot product of the quaternions `p` and `q` interpreted as
250 * four-dimensional vectors. */
251 static SIMD_CPPFUNC _Float16 dot(const ::simd_quath p, const ::simd_quath q) { return ::simd_dot(p, q); }
252
253 /*! @abstract The unit quaternion obtained by normalizing `q`. */
254 static SIMD_CPPFUNC quath normalize(const ::simd_quath p) { return ::simd_normalize(p); }
255
256 /*! @abstract logarithm of the quaternion `q`. */
257 static SIMD_CPPFUNC quath log(const ::simd_quath q) { return ::__tg_log(q); }
258
259 /*! @abstract exponential map of quaterion `q`. */
260 static SIMD_CPPFUNC quath exp(const ::simd_quath q) { return ::__tg_exp(q); }
261
262 /*! @abstract Spherical linear interpolation along the shortest arc between
263 * quaternions `q0` and `q1`. */
264 static SIMD_CPPFUNC quath slerp(const ::simd_quath p0, const ::simd_quath p1, _Float16 t) { return ::simd_slerp(p0, p1, t); }
265
266 /*! @abstract Spherical linear interpolation along the longest arc between
267 * quaternions `q0` and `q1`. */
268 static SIMD_CPPFUNC quath slerp_longest(const ::simd_quath p0, const ::simd_quath p1, _Float16 t) { return ::simd_slerp_longest(p0, p1, t); }
269
270 /*! @abstract Interpolate between quaternions along a spherical cubic spline.
271 *
272 * @discussion The function interpolates between q1 and q2. q0 is the left
273 * endpoint of the previous interval, and q3 is the right endpoint of the next
274 * interval. Use this function to smoothly interpolate between a sequence of
275 * rotations. */
276 static SIMD_CPPFUNC quath spline(const ::simd_quath p0, const ::simd_quath p1, const ::simd_quath p2, const ::simd_quath p3, _Float16 t) { return ::simd_spline(p0, p1, p2, p3, t); }
277
278 /*! @abstract Spherical cubic Bezier interpolation between quaternions.
279 *
280 * @discussion The function treats q0 ... q3 as control points and uses slerp
281 * in place of lerp in the De Castlejeau algorithm. The endpoints of
282 * interpolation are thus q0 and q3, and the curve will not generally pass
283 * through q1 or q2. Note that the convex hull property of "standard" Bezier
284 * curve does not hold on the sphere. */
285 static SIMD_CPPFUNC quath bezier(const ::simd_quath p0, const ::simd_quath p1, const ::simd_quath p2, const ::simd_quath p3, _Float16 t) { return ::simd_bezier(p0, p1, p2, p3, t); }
286}
287
288extern "C" {
289#endif /* __cplusplus */
290
291/* MARK: - _Float16 implementations */
292
293#include <simd/math.h>
294#include <simd/geometry.h>
295
296/* tg_promote is implementation gobbledygook that enables the compile-time
297 * dispatching in tgmath.h to work its magic. */
298static simd_quath __attribute__((__overloadable__)) __tg_promote(simd_quath);
299
300/*! @abstract Constructs a quaternion from imaginary and real parts.
301 * @discussion This function is hidden behind an underscore to avoid confusion
302 * with the angle-axis constructor. */
303static inline SIMD_CFUNC simd_quath _simd_quaternion(simd_half3 imag, _Float16 real) {
304 return simd_quaternion(simd_make_half4(imag, real));
305}
306
307static inline SIMD_CFUNC simd_quath simd_quaternion(_Float16 angle, simd_half3 axis) {
308 return _simd_quaternion((_Float16)sinf(angle/2) * axis, (_Float16)cosf(angle/2));
309}
310
311static inline SIMD_CFUNC _Float16 simd_angle(simd_quath q) {
312 return 2*(_Float16)atan2f(simd_length(q.vector.xyz), q.vector.w);
313}
314
315static inline SIMD_CFUNC simd_half3 simd_axis(simd_quath q) {
316 return simd_normalize(q.vector.xyz);
317}
318
319static inline SIMD_CFUNC simd_quath simd_add(simd_quath p, simd_quath q) {
320 return simd_quaternion(p.vector + q.vector);
321}
322
323static inline SIMD_CFUNC simd_quath simd_sub(simd_quath p, simd_quath q) {
324 return simd_quaternion(p.vector - q.vector);
325}
326
327static inline SIMD_CFUNC simd_quath simd_mul(simd_quath p, simd_quath q) {
328 #pragma STDC FP_CONTRACT ON
329 return simd_quaternion((p.vector.x * __builtin_shufflevector(q.vector, -q.vector, 3,6,1,4) +
330 p.vector.y * __builtin_shufflevector(q.vector, -q.vector, 2,3,4,5)) +
331 (p.vector.z * __builtin_shufflevector(q.vector, -q.vector, 5,0,3,6) +
332 p.vector.w * q.vector));
333}
334
335static inline SIMD_CFUNC simd_quath simd_mul(simd_quath q, _Float16 a) {
336 return simd_quaternion(a * q.vector);
337}
338
339static inline SIMD_CFUNC simd_quath simd_mul(_Float16 a, simd_quath q) {
340 return simd_mul(q,a);
341}
342
343static inline SIMD_CFUNC simd_quath simd_conjugate(simd_quath q) {
344 return simd_quaternion(q.vector * (simd_half4){-1,-1,-1, 1});
345}
346
347static inline SIMD_CFUNC simd_quath simd_inverse(simd_quath q) {
348 return simd_quaternion(simd_conjugate(q).vector * simd_recip(simd_length_squared(q.vector)));
349}
350
351static inline SIMD_CFUNC simd_quath simd_negate(simd_quath q) {
352 return simd_quaternion(-q.vector);
353}
354
355static inline SIMD_CFUNC _Float16 simd_dot(simd_quath p, simd_quath q) {
356 return simd_dot(p.vector, q.vector);
357}
358
359static inline SIMD_CFUNC _Float16 simd_length(simd_quath q) {
360 return simd_length(q.vector);
361}
362
363static inline SIMD_CFUNC simd_quath simd_normalize(simd_quath q) {
364 _Float16 length_squared = simd_length_squared(q.vector);
365 if (length_squared == 0) {
366 return simd_quaternion((simd_half4){0,0,0,1});
367 }
368 return simd_quaternion(q.vector * simd_rsqrt(length_squared));
369}
370
371#if defined __arm__ || defined __arm64__ || defined __aarch64__
372/*! @abstract Multiplies the vector `v` by the quaternion `q`.
373 *
374 * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation
375 * by `q`. That operation is provided by `simd_act(q, v)`. This function is an
376 * implementation detail and you should not call it directly. It may be
377 * removed or modified in future versions of the simd module. */
378static inline SIMD_CFUNC simd_quath _simd_mul_vq(simd_half3 v, simd_quath q) {
379 #pragma STDC FP_CONTRACT ON
380 return simd_quaternion(v.x * __builtin_shufflevector(q.vector, -q.vector, 3,6,1,4) +
381 v.y * __builtin_shufflevector(q.vector, -q.vector, 2,3,4,5) +
382 v.z * __builtin_shufflevector(q.vector, -q.vector, 5,0,3,6));
383}
384#endif
385
386static inline SIMD_CFUNC simd_half3 simd_act(simd_quath q, simd_half3 v) {
387#if defined __arm__ || defined __arm64__ || defined __aarch64__
388 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;
389#else
390 #pragma STDC FP_CONTRACT ON
391 simd_half3 t = 2*simd_cross(simd_imag(q),v);
392 return v + simd_real(q)*t + simd_cross(simd_imag(q), t);
393#endif
394}
395
396static SIMD_NOINLINE simd_quath __tg_log(simd_quath q) {
397 _Float16 real = (_Float16)logf(simd_length_squared(q.vector))/2;
398 if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real);
399 simd_half3 imag = (_Float16)acosf(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q));
400 return _simd_quaternion(imag, real);
401}
402
403static SIMD_NOINLINE simd_quath __tg_exp(simd_quath q) {
404 // angle is actually *twice* the angle of the rotation corresponding to
405 // the resulting quaternion, which is why we don't simply use the (angle,
406 // axis) constructor to generate `unit`.
407 _Float16 angle = simd_length(simd_imag(q));
408 if (angle == 0) return _simd_quaternion((simd_half3)0, (_Float16)expf(simd_real(q)));
409 simd_half3 axis = simd_normalize(simd_imag(q));
410 simd_quath unit = _simd_quaternion((_Float16)sinf(angle)*axis, (_Float16)cosf(angle));
411 return simd_mul((_Float16)expf(simd_real(q)), unit);
412}
413
414/*! @abstract Implementation detail of the `simd_quaternion(from, to)`
415 * initializer.
416 *
417 * @discussion Computes the quaternion rotation `from` to `to` if they are
418 * separated by less than 90 degrees. Not numerically stable for larger
419 * angles. This function is an implementation detail and you should not
420 * call it directly. It may be removed or modified in future versions of the
421 * simd module. */
422static inline SIMD_CFUNC simd_quath _simd_quaternion_reduced(simd_half3 from, simd_half3 to) {
423 simd_half3 half = simd_normalize(from + to);
424 return _simd_quaternion(simd_cross(from, half), simd_dot(from, half));
425}
426
427static SIMD_NOINLINE simd_quath simd_quaternion(simd_half3 from, simd_half3 to) {
428
429 // If the angle between from and to is not too big, we can compute the
430 // rotation accurately using a simple implementation.
431 if (simd_dot(from, to) >= 0) {
432 return _simd_quaternion_reduced(from, to);
433 }
434
435 // Because from and to are more than 90 degrees apart, we compute the
436 // rotation in two stages (from -> half), (half -> to) to preserve numerical
437 // accuracy.
438 simd_half3 half = simd_normalize(from) + simd_normalize(to);
439
440 if (simd_length_squared(half) <= 0x1p-46f) {
441 // half is nearly zero, so from and to point in nearly opposite directions
442 // and the rotation is numerically underspecified. Pick an axis orthogonal
443 // to the vectors, and use an angle of pi radians.
444 simd_half3 abs_from = simd_abs(from);
445 if (abs_from.x <= abs_from.y && abs_from.x <= abs_from.z)
446 return _simd_quaternion(simd_normalize(simd_cross(from, (simd_half3){1,0,0})), 0.f);
447 else if (abs_from.y <= abs_from.z)
448 return _simd_quaternion(simd_normalize(simd_cross(from, (simd_half3){0,1,0})), 0.f);
449 else
450 return _simd_quaternion(simd_normalize(simd_cross(from, (simd_half3){0,0,1})), 0.f);
451 }
452
453 // Compute the two-step rotation. */
454 half = simd_normalize(half);
455 return simd_mul(_simd_quaternion_reduced(from, half),
456 _simd_quaternion_reduced(half, to));
457}
458
459static SIMD_NOINLINE simd_quath simd_quaternion(simd_half3x3 matrix) {
460 const simd_half3 *mat = matrix.columns;
461 _Float16 trace = mat[0][0] + mat[1][1] + mat[2][2];
462 if (trace >= 0.0) {
463 _Float16 r = 2*__sqrtf16(1 + trace);
464 _Float16 rinv = simd_recip(r);
465 return simd_quaternion(rinv*(mat[1][2] - mat[2][1]),
466 rinv*(mat[2][0] - mat[0][2]),
467 rinv*(mat[0][1] - mat[1][0]),
468 r/4);
469 } else if (mat[0][0] >= mat[1][1] && mat[0][0] >= mat[2][2]) {
470 _Float16 r = 2*__sqrtf16(1 - mat[1][1] - mat[2][2] + mat[0][0]);
471 _Float16 rinv = simd_recip(r);
472 return simd_quaternion(r/4,
473 rinv*(mat[0][1] + mat[1][0]),
474 rinv*(mat[0][2] + mat[2][0]),
475 rinv*(mat[1][2] - mat[2][1]));
476 } else if (mat[1][1] >= mat[2][2]) {
477 _Float16 r = 2*__sqrtf16(1 - mat[0][0] - mat[2][2] + mat[1][1]);
478 _Float16 rinv = simd_recip(r);
479 return simd_quaternion(rinv*(mat[0][1] + mat[1][0]),
480 r/4,
481 rinv*(mat[1][2] + mat[2][1]),
482 rinv*(mat[2][0] - mat[0][2]));
483 } else {
484 _Float16 r = 2*__sqrtf16(1 - mat[0][0] - mat[1][1] + mat[2][2]);
485 _Float16 rinv = simd_recip(r);
486 return simd_quaternion(rinv*(mat[0][2] + mat[2][0]),
487 rinv*(mat[1][2] + mat[2][1]),
488 r/4,
489 rinv*(mat[0][1] - mat[1][0]));
490 }
491}
492
493static SIMD_NOINLINE simd_quath simd_quaternion(simd_half4x4 matrix) {
494 const simd_half4 *mat = matrix.columns;
495 _Float16 trace = mat[0][0] + mat[1][1] + mat[2][2];
496 if (trace >= 0.0) {
497 _Float16 r = 2*__sqrtf16(1 + trace);
498 _Float16 rinv = simd_recip(r);
499 return simd_quaternion(rinv*(mat[1][2] - mat[2][1]),
500 rinv*(mat[2][0] - mat[0][2]),
501 rinv*(mat[0][1] - mat[1][0]),
502 r/4);
503 } else if (mat[0][0] >= mat[1][1] && mat[0][0] >= mat[2][2]) {
504 _Float16 r = 2*__sqrtf16(1 - mat[1][1] - mat[2][2] + mat[0][0]);
505 _Float16 rinv = simd_recip(r);
506 return simd_quaternion(r/4,
507 rinv*(mat[0][1] + mat[1][0]),
508 rinv*(mat[0][2] + mat[2][0]),
509 rinv*(mat[1][2] - mat[2][1]));
510 } else if (mat[1][1] >= mat[2][2]) {
511 _Float16 r = 2*__sqrtf16(1 - mat[0][0] - mat[2][2] + mat[1][1]);
512 _Float16 rinv = simd_recip(r);
513 return simd_quaternion(rinv*(mat[0][1] + mat[1][0]),
514 r/4,
515 rinv*(mat[1][2] + mat[2][1]),
516 rinv*(mat[2][0] - mat[0][2]));
517 } else {
518 _Float16 r = 2*__sqrtf16(1 - mat[0][0] - mat[1][1] + mat[2][2]);
519 _Float16 rinv = simd_recip(r);
520 return simd_quaternion(rinv*(mat[0][2] + mat[2][0]),
521 rinv*(mat[1][2] + mat[2][1]),
522 r/4,
523 rinv*(mat[0][1] - mat[1][0]));
524 }
525}
526
527/*! @abstract The angle between p and q interpreted as 4-dimensional vectors.
528 *
529 * @discussion This function is an implementation detail and you should not
530 * call it directly. It may be removed or modified in future versions of the
531 * simd module. */
532static SIMD_NOINLINE _Float16 _simd_angle(simd_quath p, simd_quath q) {
533 return 2*(_Float16)atan2f(simd_length(p.vector - q.vector), simd_length(p.vector + q.vector));
534}
535
536/*! @abstract sin(x)/x.
537 *
538 * @discussion This function is an implementation detail and you should not
539 * call it directly. It may be removed or modified in future versions of the
540 * simd module. */
541static SIMD_CFUNC _Float16 _simd_sinc(_Float16 x) {
542 if (x == 0) return 1;
543 return (_Float16)sinf(x)/x;
544}
545
546/*! @abstract Spherical lerp between q0 and q1.
547 *
548 * @discussion This function may interpolate along either the longer or
549 * shorter path between q0 and q1; it is used as an implementation detail
550 * in `simd_slerp` and `simd_slerp_longest`; you should use those functions
551 * instead of calling this directly. */
552static SIMD_NOINLINE simd_quath _simd_slerp_internal(simd_quath q0, simd_quath q1, _Float16 t) {
553 _Float16 s = 1 - t;
554 _Float16 a = _simd_angle(q0, q1);
555 _Float16 r = simd_recip(_simd_sinc(a));
556 return simd_normalize(simd_quaternion(_simd_sinc(s*a)*r*s*q0.vector + _simd_sinc(t*a)*r*t*q1.vector));
557}
558
559static SIMD_NOINLINE simd_quath simd_slerp(simd_quath q0, simd_quath q1, _Float16 t) {
560 if (simd_dot(q0, q1) >= 0)
561 return _simd_slerp_internal(q0, q1, t);
562 return _simd_slerp_internal(q0, simd_negate(q1), t);
563}
564
565static SIMD_NOINLINE simd_quath simd_slerp_longest(simd_quath q0, simd_quath q1, _Float16 t) {
566 if (simd_dot(q0, q1) >= 0)
567 return _simd_slerp_internal(q0, simd_negate(q1), t);
568 return _simd_slerp_internal(q0, q1, t);
569}
570
571/*! @discussion This function is an implementation detail and you should not
572 * call it directly. It may be removed or modified in future versions of the
573 * simd module. */
574static SIMD_NOINLINE simd_quath _simd_intermediate(simd_quath q0, simd_quath q1, simd_quath q2) {
575 simd_quath p0 = __tg_log(simd_mul(q0, simd_inverse(q1)));
576 simd_quath p2 = __tg_log(simd_mul(q2, simd_inverse(q1)));
577 return simd_normalize(simd_mul(q1, __tg_exp(simd_mul(-0.25, simd_add(p0,p2)))));
578}
579
580/*! @discussion This function is an implementation detail and you should not
581 * call it directly. It may be removed or modified in future versions of the
582 * simd module. */
583static SIMD_NOINLINE simd_quath _simd_squad(simd_quath q0, simd_quath qa, simd_quath qb, simd_quath q1, _Float16 t) {
584 simd_quath r0 = _simd_slerp_internal(q0, q1, t);
585 simd_quath r1 = _simd_slerp_internal(qa, qb, t);
586 return _simd_slerp_internal(r0, r1, 2*t*(1 - t));
587}
588
589static SIMD_NOINLINE simd_quath simd_spline(simd_quath q0, simd_quath q1, simd_quath q2, simd_quath q3, _Float16 t) {
590 simd_quath qa = _simd_intermediate(q0, q1, q2);
591 simd_quath qb = _simd_intermediate(q1, q2, q3);
592 return _simd_squad(q1, qa, qb, q2, t);
593}
594
595static SIMD_NOINLINE simd_quath simd_bezier(simd_quath q0, simd_quath q1, simd_quath q2, simd_quath q3, _Float16 t) {
596 simd_quath q01 = _simd_slerp_internal(q0, q1, t);
597 simd_quath q12 = _simd_slerp_internal(q1, q2, t);
598 simd_quath q23 = _simd_slerp_internal(q2, q3, t);
599 simd_quath q012 = _simd_slerp_internal(q01, q12, t);
600 simd_quath q123 = _simd_slerp_internal(q12, q23, t);
601 return _simd_slerp_internal(q012, q123, t);
602}
603
18/* MARK: - C and Objective-C float interfaces */604/* MARK: - C and Objective-C float interfaces */
19605
20/*! @abstract Constructs a quaternion from four scalar values.606/*! @abstract Constructs a quaternion from four scalar values.
...@@ -368,7 +954,7 @@ static inline SIMD_CFUNC simd_quatf simd_normalize(simd_quatf q) {...@@ -368,7 +954,7 @@ static inline SIMD_CFUNC simd_quatf simd_normalize(simd_quatf q) {
368 return simd_quaternion(q.vector * simd_rsqrt(length_squared));954 return simd_quaternion(q.vector * simd_rsqrt(length_squared));
369}955}
370956
371#if defined __arm__ || defined __arm64__957#if defined __arm__ || defined __arm64__ || defined __aarch64__
372/*! @abstract Multiplies the vector `v` by the quaternion `q`.958/*! @abstract Multiplies the vector `v` by the quaternion `q`.
373 * 959 *
374 * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation960 * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation
...@@ -384,7 +970,7 @@ static inline SIMD_CFUNC simd_quatf _simd_mul_vq(simd_float3 v, simd_quatf q) {...@@ -384,7 +970,7 @@ static inline SIMD_CFUNC simd_quatf _simd_mul_vq(simd_float3 v, simd_quatf q) {
384#endif970#endif
385 971
386static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v) {972static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v) {
387#if defined __arm__ || defined __arm64__973#if defined __arm__ || defined __arm64__ || defined __aarch64__
388 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;974 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;
389#else975#else
390 #pragma STDC FP_CONTRACT ON976 #pragma STDC FP_CONTRACT ON
...@@ -394,9 +980,9 @@ static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v) {...@@ -394,9 +980,9 @@ static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v) {
394}980}
395981
396static SIMD_NOINLINE simd_quatf __tg_log(simd_quatf q) {982static SIMD_NOINLINE simd_quatf __tg_log(simd_quatf q) {
397 float real = __tg_log(simd_length_squared(q.vector))/2;983 float real = log(simd_length_squared(q.vector))/2;
398 if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real);984 if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real);
399 simd_float3 imag = __tg_acos(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q));985 simd_float3 imag = acos(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q));
400 return _simd_quaternion(imag, real);986 return _simd_quaternion(imag, real);
401}987}
402 988
...@@ -405,9 +991,9 @@ static SIMD_NOINLINE simd_quatf __tg_exp(simd_quatf q) {...@@ -405,9 +991,9 @@ static SIMD_NOINLINE simd_quatf __tg_exp(simd_quatf q) {
405 // the resulting quaternion, which is why we don't simply use the (angle,991 // the resulting quaternion, which is why we don't simply use the (angle,
406 // axis) constructor to generate `unit`.992 // axis) constructor to generate `unit`.
407 float angle = simd_length(simd_imag(q));993 float angle = simd_length(simd_imag(q));
408 if (angle == 0) return _simd_quaternion(0, exp(simd_real(q)));994 if (angle == 0) return _simd_quaternion((simd_float3)0, exp(simd_real(q)));
409 simd_float3 axis = simd_normalize(simd_imag(q));995 simd_float3 axis = simd_normalize(simd_imag(q));
410 simd_quatf unit = _simd_quaternion(sin(angle)*axis, cosf(angle));996 simd_quatf unit = _simd_quaternion(sin(angle)*axis, cos(angle));
411 return simd_mul(exp(simd_real(q)), unit);997 return simd_mul(exp(simd_real(q)), unit);
412}998}
413 999
...@@ -954,7 +1540,7 @@ static inline SIMD_CFUNC simd_quatd simd_normalize(simd_quatd q) {...@@ -954,7 +1540,7 @@ static inline SIMD_CFUNC simd_quatd simd_normalize(simd_quatd q) {
954 return simd_quaternion(q.vector * simd_rsqrt(length_squared));1540 return simd_quaternion(q.vector * simd_rsqrt(length_squared));
955}1541}
9561542
957#if defined __arm__ || defined __arm64__1543#if defined __arm__ || defined __arm64__ || defined __aarch64__
958/*! @abstract Multiplies the vector `v` by the quaternion `q`.1544/*! @abstract Multiplies the vector `v` by the quaternion `q`.
959 * 1545 *
960 * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation1546 * @discussion This IS NOT the action of `q` on `v` (i.e. this is not rotation
...@@ -970,7 +1556,7 @@ static inline SIMD_CFUNC simd_quatd _simd_mul_vq(simd_double3 v, simd_quatd q) {...@@ -970,7 +1556,7 @@ static inline SIMD_CFUNC simd_quatd _simd_mul_vq(simd_double3 v, simd_quatd q) {
970#endif1556#endif
971 1557
972static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v) {1558static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v) {
973#if defined __arm__ || defined __arm64__1559#if defined __arm__ || defined __arm64__ || defined __aarch64__
974 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;1560 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;
975#else1561#else
976 #pragma STDC FP_CONTRACT ON1562 #pragma STDC FP_CONTRACT ON
...@@ -980,9 +1566,9 @@ static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v) {...@@ -980,9 +1566,9 @@ static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v) {
980}1566}
9811567
982static SIMD_NOINLINE simd_quatd __tg_log(simd_quatd q) {1568static SIMD_NOINLINE simd_quatd __tg_log(simd_quatd q) {
983 double real = __tg_log(simd_length_squared(q.vector))/2;1569 double real = log(simd_length_squared(q.vector))/2;
984 if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real);1570 if (simd_equal(simd_imag(q), 0)) return _simd_quaternion(0, real);
985 simd_double3 imag = __tg_acos(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q));1571 simd_double3 imag = acos(simd_real(q)/simd_length(q)) * simd_normalize(simd_imag(q));
986 return _simd_quaternion(imag, real);1572 return _simd_quaternion(imag, real);
987}1573}
988 1574
...@@ -991,9 +1577,9 @@ static SIMD_NOINLINE simd_quatd __tg_exp(simd_quatd q) {...@@ -991,9 +1577,9 @@ static SIMD_NOINLINE simd_quatd __tg_exp(simd_quatd q) {
991 // the resulting quaternion, which is why we don't simply use the (angle,1577 // the resulting quaternion, which is why we don't simply use the (angle,
992 // axis) constructor to generate `unit`.1578 // axis) constructor to generate `unit`.
993 double angle = simd_length(simd_imag(q));1579 double angle = simd_length(simd_imag(q));
994 if (angle == 0) return _simd_quaternion(0, exp(simd_real(q)));1580 if (angle == 0) return _simd_quaternion((simd_double3)0, exp(simd_real(q)));
995 simd_double3 axis = simd_normalize(simd_imag(q));1581 simd_double3 axis = simd_normalize(simd_imag(q));
996 simd_quatd unit = _simd_quaternion(sin(angle)*axis, cosf(angle));1582 simd_quatd unit = _simd_quaternion(sin(angle)*axis, cos(angle));
997 return simd_mul(exp(simd_real(q)), unit);1583 return simd_mul(exp(simd_real(q)), unit);
998}1584}
999 1585
lib/libc/include/any-macos-any/simd/types.h+30
...@@ -36,6 +36,33 @@...@@ -36,6 +36,33 @@
36 * storage details of matrices, you don't need to worry about this at all.36 * storage details of matrices, you don't need to worry about this at all.
37 * Consider this yet another good reason to avoid doing so. */37 * Consider this yet another good reason to avoid doing so. */
3838
39/*! @abstract A matrix with 2 rows and 2 columns. */
40typedef struct { simd_half2 columns[2]; } simd_half2x2;
41
42/*! @abstract A matrix with 2 rows and 3 columns. */
43typedef struct { simd_half2 columns[3]; } simd_half3x2;
44
45/*! @abstract A matrix with 2 rows and 4 columns. */
46typedef struct { simd_half2 columns[4]; } simd_half4x2;
47
48/*! @abstract A matrix with 3 rows and 2 columns. */
49typedef struct { simd_half3 columns[2]; } simd_half2x3;
50
51/*! @abstract A matrix with 3 rows and 3 columns. */
52typedef struct { simd_half3 columns[3]; } simd_half3x3;
53
54/*! @abstract A matrix with 3 rows and 4 columns. */
55typedef struct { simd_half3 columns[4]; } simd_half4x3;
56
57/*! @abstract A matrix with 4 rows and 2 columns. */
58typedef struct { simd_half4 columns[2]; } simd_half2x4;
59
60/*! @abstract A matrix with 4 rows and 3 columns. */
61typedef struct { simd_half4 columns[3]; } simd_half3x4;
62
63/*! @abstract A matrix with 4 rows and 4 columns. */
64typedef struct { simd_half4 columns[4]; } simd_half4x4;
65
39/*! @abstract A matrix with 2 rows and 2 columns. */66/*! @abstract A matrix with 2 rows and 2 columns. */
40typedef struct { simd_float2 columns[2]; } simd_float2x2;67typedef struct { simd_float2 columns[2]; } simd_float2x2;
4168
...@@ -118,6 +145,9 @@ typedef struct { simd_double4 columns[4]; } simd_double4x4;...@@ -118,6 +145,9 @@ typedef struct { simd_double4 columns[4]; } simd_double4x4;
118 * While the C types are defined here, the operations on quaternions and the145 * While the C types are defined here, the operations on quaternions and the
119 * C++ quaternion types are defined in <simd/quaternion.h> */146 * C++ quaternion types are defined in <simd/quaternion.h> */
120147
148/*! @abstract A half-precision quaternion. */
149typedef struct { simd_half4 vector; } simd_quath;
150
121/*! @abstract A single-precision quaternion. */151/*! @abstract A single-precision quaternion. */
122typedef struct { simd_float4 vector; } simd_quatf;152typedef struct { simd_float4 vector; } simd_quatf;
123153
lib/libc/include/any-macos-any/simd/vector_make.h+885
...@@ -70,6 +70,7 @@...@@ -70,6 +70,7 @@
70#define SIMD_VECTOR_CONSTRUCTORS70#define SIMD_VECTOR_CONSTRUCTORS
7171
72#include <simd/vector_types.h>72#include <simd/vector_types.h>
73#include <stddef.h>
73#if SIMD_COMPILER_HAS_REQUIRED_FEATURES74#if SIMD_COMPILER_HAS_REQUIRED_FEATURES
7475
75#ifdef __cplusplus76#ifdef __cplusplus
...@@ -2876,6 +2877,617 @@ static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort32 other) {...@@ -2876,6 +2877,617 @@ static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort32 other) {
2876 return other;2877 return other;
2877}2878}
28782879
2880/*! @abstract Concatenates `x` and `y` to form a vector of two 16-bit
2881 * floating-point numbers. */
2882static inline SIMD_CFUNC simd_half2 simd_make_half2(_Float16 x, _Float16 y) {
2883 simd_half2 result;
2884 result.x = x;
2885 result.y = y;
2886 return result;
2887}
2888
2889/*! @abstract Zero-extends `other` to form a vector of two 16-bit floating-
2890 * point numbers. */
2891static inline SIMD_CFUNC simd_half2 simd_make_half2(_Float16 other) {
2892 simd_half2 result = 0;
2893 result.x = other;
2894 return result;
2895}
2896
2897/*! @abstract Extends `other` to form a vector of two 16-bit floating-point
2898 * numbers. The contents of the newly-created vector lanes are unspecified. */
2899static inline SIMD_CFUNC simd_half2 simd_make_half2_undef(_Float16 other) {
2900 simd_half2 result;
2901 result.x = other;
2902 return result;
2903}
2904
2905/*! @abstract Returns `other` unmodified. This function is a convenience for
2906 * templated and autogenerated code. */
2907static inline SIMD_CFUNC simd_half2 simd_make_half2(simd_half2 other) {
2908 return other;
2909}
2910
2911/*! @abstract Truncates `other` to form a vector of two 16-bit floating-
2912 * point numbers. */
2913static inline SIMD_CFUNC simd_half2 simd_make_half2(simd_half3 other) {
2914 return other.xy;
2915}
2916
2917/*! @abstract Truncates `other` to form a vector of two 16-bit floating-
2918 * point numbers. */
2919static inline SIMD_CFUNC simd_half2 simd_make_half2(simd_half4 other) {
2920 return other.xy;
2921}
2922
2923/*! @abstract Truncates `other` to form a vector of two 16-bit floating-
2924 * point numbers. */
2925static inline SIMD_CFUNC simd_half2 simd_make_half2(simd_half8 other) {
2926 return other.xy;
2927}
2928
2929/*! @abstract Truncates `other` to form a vector of two 16-bit floating-
2930 * point numbers. */
2931static inline SIMD_CFUNC simd_half2 simd_make_half2(simd_half16 other) {
2932 return other.xy;
2933}
2934
2935/*! @abstract Truncates `other` to form a vector of two 16-bit floating-
2936 * point numbers. */
2937static inline SIMD_CFUNC simd_half2 simd_make_half2(simd_half32 other) {
2938 return other.xy;
2939}
2940
2941/*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 16-bit
2942 * floating-point numbers. */
2943static inline SIMD_CFUNC simd_half3 simd_make_half3(_Float16 x, _Float16 y, _Float16 z) {
2944 simd_half3 result;
2945 result.x = x;
2946 result.y = y;
2947 result.z = z;
2948 return result;
2949}
2950
2951/*! @abstract Concatenates `x` and `yz` to form a vector of three 16-bit
2952 * floating-point numbers. */
2953static inline SIMD_CFUNC simd_half3 simd_make_half3(_Float16 x, simd_half2 yz) {
2954 simd_half3 result;
2955 result.x = x;
2956 result.yz = yz;
2957 return result;
2958}
2959
2960/*! @abstract Concatenates `xy` and `z` to form a vector of three 16-bit
2961 * floating-point numbers. */
2962static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half2 xy, _Float16 z) {
2963 simd_half3 result;
2964 result.xy = xy;
2965 result.z = z;
2966 return result;
2967}
2968
2969/*! @abstract Zero-extends `other` to form a vector of three 16-bit
2970 * floating-point numbers. */
2971static inline SIMD_CFUNC simd_half3 simd_make_half3(_Float16 other) {
2972 simd_half3 result = 0;
2973 result.x = other;
2974 return result;
2975}
2976
2977/*! @abstract Extends `other` to form a vector of three 16-bit floating-
2978 * point numbers. The contents of the newly-created vector lanes are
2979 * unspecified. */
2980static inline SIMD_CFUNC simd_half3 simd_make_half3_undef(_Float16 other) {
2981 simd_half3 result;
2982 result.x = other;
2983 return result;
2984}
2985
2986/*! @abstract Zero-extends `other` to form a vector of three 16-bit
2987 * floating-point numbers. */
2988static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half2 other) {
2989 simd_half3 result = 0;
2990 result.xy = other;
2991 return result;
2992}
2993
2994/*! @abstract Extends `other` to form a vector of three 16-bit floating-
2995 * point numbers. The contents of the newly-created vector lanes are
2996 * unspecified. */
2997static inline SIMD_CFUNC simd_half3 simd_make_half3_undef(simd_half2 other) {
2998 simd_half3 result;
2999 result.xy = other;
3000 return result;
3001}
3002
3003/*! @abstract Returns `other` unmodified. This function is a convenience for
3004 * templated and autogenerated code. */
3005static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half3 other) {
3006 return other;
3007}
3008
3009/*! @abstract Truncates `other` to form a vector of three 16-bit floating-
3010 * point numbers. */
3011static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half4 other) {
3012 return other.xyz;
3013}
3014
3015/*! @abstract Truncates `other` to form a vector of three 16-bit floating-
3016 * point numbers. */
3017static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half8 other) {
3018 return other.xyz;
3019}
3020
3021/*! @abstract Truncates `other` to form a vector of three 16-bit floating-
3022 * point numbers. */
3023static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half16 other) {
3024 return other.xyz;
3025}
3026
3027/*! @abstract Truncates `other` to form a vector of three 16-bit floating-
3028 * point numbers. */
3029static inline SIMD_CFUNC simd_half3 simd_make_half3(simd_half32 other) {
3030 return other.xyz;
3031}
3032
3033/*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four
3034 * 16-bit floating-point numbers. */
3035static inline SIMD_CFUNC simd_half4 simd_make_half4(_Float16 x, _Float16 y, _Float16 z, _Float16 w) {
3036 simd_half4 result;
3037 result.x = x;
3038 result.y = y;
3039 result.z = z;
3040 result.w = w;
3041 return result;
3042}
3043
3044/*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 16-bit
3045 * floating-point numbers. */
3046static inline SIMD_CFUNC simd_half4 simd_make_half4(_Float16 x, _Float16 y, simd_half2 zw) {
3047 simd_half4 result;
3048 result.x = x;
3049 result.y = y;
3050 result.zw = zw;
3051 return result;
3052}
3053
3054/*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 16-bit
3055 * floating-point numbers. */
3056static inline SIMD_CFUNC simd_half4 simd_make_half4(_Float16 x, simd_half2 yz, _Float16 w) {
3057 simd_half4 result;
3058 result.x = x;
3059 result.yz = yz;
3060 result.w = w;
3061 return result;
3062}
3063
3064/*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 16-bit
3065 * floating-point numbers. */
3066static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half2 xy, _Float16 z, _Float16 w) {
3067 simd_half4 result;
3068 result.xy = xy;
3069 result.z = z;
3070 result.w = w;
3071 return result;
3072}
3073
3074/*! @abstract Concatenates `x` and `yzw` to form a vector of four 16-bit
3075 * floating-point numbers. */
3076static inline SIMD_CFUNC simd_half4 simd_make_half4(_Float16 x, simd_half3 yzw) {
3077 simd_half4 result;
3078 result.x = x;
3079 result.yzw = yzw;
3080 return result;
3081}
3082
3083/*! @abstract Concatenates `xy` and `zw` to form a vector of four 16-bit
3084 * floating-point numbers. */
3085static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half2 xy, simd_half2 zw) {
3086 simd_half4 result;
3087 result.xy = xy;
3088 result.zw = zw;
3089 return result;
3090}
3091
3092/*! @abstract Concatenates `xyz` and `w` to form a vector of four 16-bit
3093 * floating-point numbers. */
3094static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half3 xyz, _Float16 w) {
3095 simd_half4 result;
3096 result.xyz = xyz;
3097 result.w = w;
3098 return result;
3099}
3100
3101/*! @abstract Zero-extends `other` to form a vector of four 16-bit floating-
3102 * point numbers. */
3103static inline SIMD_CFUNC simd_half4 simd_make_half4(_Float16 other) {
3104 simd_half4 result = 0;
3105 result.x = other;
3106 return result;
3107}
3108
3109/*! @abstract Extends `other` to form a vector of four 16-bit floating-point
3110 * numbers. The contents of the newly-created vector lanes are unspecified. */
3111static inline SIMD_CFUNC simd_half4 simd_make_half4_undef(_Float16 other) {
3112 simd_half4 result;
3113 result.x = other;
3114 return result;
3115}
3116
3117/*! @abstract Zero-extends `other` to form a vector of four 16-bit floating-
3118 * point numbers. */
3119static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half2 other) {
3120 simd_half4 result = 0;
3121 result.xy = other;
3122 return result;
3123}
3124
3125/*! @abstract Extends `other` to form a vector of four 16-bit floating-point
3126 * numbers. The contents of the newly-created vector lanes are unspecified. */
3127static inline SIMD_CFUNC simd_half4 simd_make_half4_undef(simd_half2 other) {
3128 simd_half4 result;
3129 result.xy = other;
3130 return result;
3131}
3132
3133/*! @abstract Zero-extends `other` to form a vector of four 16-bit floating-
3134 * point numbers. */
3135static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half3 other) {
3136 simd_half4 result = 0;
3137 result.xyz = other;
3138 return result;
3139}
3140
3141/*! @abstract Extends `other` to form a vector of four 16-bit floating-point
3142 * numbers. The contents of the newly-created vector lanes are unspecified. */
3143static inline SIMD_CFUNC simd_half4 simd_make_half4_undef(simd_half3 other) {
3144 simd_half4 result;
3145 result.xyz = other;
3146 return result;
3147}
3148
3149/*! @abstract Returns `other` unmodified. This function is a convenience for
3150 * templated and autogenerated code. */
3151static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half4 other) {
3152 return other;
3153}
3154
3155/*! @abstract Truncates `other` to form a vector of four 16-bit floating-
3156 * point numbers. */
3157static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half8 other) {
3158 return other.xyzw;
3159}
3160
3161/*! @abstract Truncates `other` to form a vector of four 16-bit floating-
3162 * point numbers. */
3163static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half16 other) {
3164 return other.xyzw;
3165}
3166
3167/*! @abstract Truncates `other` to form a vector of four 16-bit floating-
3168 * point numbers. */
3169static inline SIMD_CFUNC simd_half4 simd_make_half4(simd_half32 other) {
3170 return other.xyzw;
3171}
3172
3173/*! @abstract Concatenates `lo` and `hi` to form a vector of eight 16-bit
3174 * floating-point numbers. */
3175static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half4 lo, simd_half4 hi) {
3176 simd_half8 result;
3177 result.lo = lo;
3178 result.hi = hi;
3179 return result;
3180}
3181
3182/*! @abstract Zero-extends `other` to form a vector of eight 16-bit
3183 * floating-point numbers. */
3184static inline SIMD_CFUNC simd_half8 simd_make_half8(_Float16 other) {
3185 simd_half8 result = 0;
3186 result.x = other;
3187 return result;
3188}
3189
3190/*! @abstract Extends `other` to form a vector of eight 16-bit floating-
3191 * point numbers. The contents of the newly-created vector lanes are
3192 * unspecified. */
3193static inline SIMD_CFUNC simd_half8 simd_make_half8_undef(_Float16 other) {
3194 simd_half8 result;
3195 result.x = other;
3196 return result;
3197}
3198
3199/*! @abstract Zero-extends `other` to form a vector of eight 16-bit
3200 * floating-point numbers. */
3201static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half2 other) {
3202 simd_half8 result = 0;
3203 result.xy = other;
3204 return result;
3205}
3206
3207/*! @abstract Extends `other` to form a vector of eight 16-bit floating-
3208 * point numbers. The contents of the newly-created vector lanes are
3209 * unspecified. */
3210static inline SIMD_CFUNC simd_half8 simd_make_half8_undef(simd_half2 other) {
3211 simd_half8 result;
3212 result.xy = other;
3213 return result;
3214}
3215
3216/*! @abstract Zero-extends `other` to form a vector of eight 16-bit
3217 * floating-point numbers. */
3218static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half3 other) {
3219 simd_half8 result = 0;
3220 result.xyz = other;
3221 return result;
3222}
3223
3224/*! @abstract Extends `other` to form a vector of eight 16-bit floating-
3225 * point numbers. The contents of the newly-created vector lanes are
3226 * unspecified. */
3227static inline SIMD_CFUNC simd_half8 simd_make_half8_undef(simd_half3 other) {
3228 simd_half8 result;
3229 result.xyz = other;
3230 return result;
3231}
3232
3233/*! @abstract Zero-extends `other` to form a vector of eight 16-bit
3234 * floating-point numbers. */
3235static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half4 other) {
3236 simd_half8 result = 0;
3237 result.xyzw = other;
3238 return result;
3239}
3240
3241/*! @abstract Extends `other` to form a vector of eight 16-bit floating-
3242 * point numbers. The contents of the newly-created vector lanes are
3243 * unspecified. */
3244static inline SIMD_CFUNC simd_half8 simd_make_half8_undef(simd_half4 other) {
3245 simd_half8 result;
3246 result.xyzw = other;
3247 return result;
3248}
3249
3250/*! @abstract Returns `other` unmodified. This function is a convenience for
3251 * templated and autogenerated code. */
3252static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half8 other) {
3253 return other;
3254}
3255
3256/*! @abstract Truncates `other` to form a vector of eight 16-bit floating-
3257 * point numbers. */
3258static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half16 other) {
3259 return simd_make_half8(other.lo);
3260}
3261
3262/*! @abstract Truncates `other` to form a vector of eight 16-bit floating-
3263 * point numbers. */
3264static inline SIMD_CFUNC simd_half8 simd_make_half8(simd_half32 other) {
3265 return simd_make_half8(other.lo);
3266}
3267
3268/*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 16-bit
3269 * floating-point numbers. */
3270static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half8 lo, simd_half8 hi) {
3271 simd_half16 result;
3272 result.lo = lo;
3273 result.hi = hi;
3274 return result;
3275}
3276
3277/*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit
3278 * floating-point numbers. */
3279static inline SIMD_CFUNC simd_half16 simd_make_half16(_Float16 other) {
3280 simd_half16 result = 0;
3281 result.x = other;
3282 return result;
3283}
3284
3285/*! @abstract Extends `other` to form a vector of sixteen 16-bit floating-
3286 * point numbers. The contents of the newly-created vector lanes are
3287 * unspecified. */
3288static inline SIMD_CFUNC simd_half16 simd_make_half16_undef(_Float16 other) {
3289 simd_half16 result;
3290 result.x = other;
3291 return result;
3292}
3293
3294/*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit
3295 * floating-point numbers. */
3296static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half2 other) {
3297 simd_half16 result = 0;
3298 result.xy = other;
3299 return result;
3300}
3301
3302/*! @abstract Extends `other` to form a vector of sixteen 16-bit floating-
3303 * point numbers. The contents of the newly-created vector lanes are
3304 * unspecified. */
3305static inline SIMD_CFUNC simd_half16 simd_make_half16_undef(simd_half2 other) {
3306 simd_half16 result;
3307 result.xy = other;
3308 return result;
3309}
3310
3311/*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit
3312 * floating-point numbers. */
3313static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half3 other) {
3314 simd_half16 result = 0;
3315 result.xyz = other;
3316 return result;
3317}
3318
3319/*! @abstract Extends `other` to form a vector of sixteen 16-bit floating-
3320 * point numbers. The contents of the newly-created vector lanes are
3321 * unspecified. */
3322static inline SIMD_CFUNC simd_half16 simd_make_half16_undef(simd_half3 other) {
3323 simd_half16 result;
3324 result.xyz = other;
3325 return result;
3326}
3327
3328/*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit
3329 * floating-point numbers. */
3330static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half4 other) {
3331 simd_half16 result = 0;
3332 result.xyzw = other;
3333 return result;
3334}
3335
3336/*! @abstract Extends `other` to form a vector of sixteen 16-bit floating-
3337 * point numbers. The contents of the newly-created vector lanes are
3338 * unspecified. */
3339static inline SIMD_CFUNC simd_half16 simd_make_half16_undef(simd_half4 other) {
3340 simd_half16 result;
3341 result.xyzw = other;
3342 return result;
3343}
3344
3345/*! @abstract Zero-extends `other` to form a vector of sixteen 16-bit
3346 * floating-point numbers. */
3347static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half8 other) {
3348 simd_half16 result = 0;
3349 result.lo = simd_make_half8(other);
3350 return result;
3351}
3352
3353/*! @abstract Extends `other` to form a vector of sixteen 16-bit floating-
3354 * point numbers. The contents of the newly-created vector lanes are
3355 * unspecified. */
3356static inline SIMD_CFUNC simd_half16 simd_make_half16_undef(simd_half8 other) {
3357 simd_half16 result;
3358 result.lo = simd_make_half8(other);
3359 return result;
3360}
3361
3362/*! @abstract Returns `other` unmodified. This function is a convenience for
3363 * templated and autogenerated code. */
3364static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half16 other) {
3365 return other;
3366}
3367
3368/*! @abstract Truncates `other` to form a vector of sixteen 16-bit floating-
3369 * point numbers. */
3370static inline SIMD_CFUNC simd_half16 simd_make_half16(simd_half32 other) {
3371 return simd_make_half16(other.lo);
3372}
3373
3374/*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two
3375 * 16-bit floating-point numbers. */
3376static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half16 lo, simd_half16 hi) {
3377 simd_half32 result;
3378 result.lo = lo;
3379 result.hi = hi;
3380 return result;
3381}
3382
3383/*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit
3384 * floating-point numbers. */
3385static inline SIMD_CFUNC simd_half32 simd_make_half32(_Float16 other) {
3386 simd_half32 result = 0;
3387 result.x = other;
3388 return result;
3389}
3390
3391/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
3392 * floating-point numbers. The contents of the newly-created vector lanes
3393 * are unspecified. */
3394static inline SIMD_CFUNC simd_half32 simd_make_half32_undef(_Float16 other) {
3395 simd_half32 result;
3396 result.x = other;
3397 return result;
3398}
3399
3400/*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit
3401 * floating-point numbers. */
3402static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half2 other) {
3403 simd_half32 result = 0;
3404 result.xy = other;
3405 return result;
3406}
3407
3408/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
3409 * floating-point numbers. The contents of the newly-created vector lanes
3410 * are unspecified. */
3411static inline SIMD_CFUNC simd_half32 simd_make_half32_undef(simd_half2 other) {
3412 simd_half32 result;
3413 result.xy = other;
3414 return result;
3415}
3416
3417/*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit
3418 * floating-point numbers. */
3419static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half3 other) {
3420 simd_half32 result = 0;
3421 result.xyz = other;
3422 return result;
3423}
3424
3425/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
3426 * floating-point numbers. The contents of the newly-created vector lanes
3427 * are unspecified. */
3428static inline SIMD_CFUNC simd_half32 simd_make_half32_undef(simd_half3 other) {
3429 simd_half32 result;
3430 result.xyz = other;
3431 return result;
3432}
3433
3434/*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit
3435 * floating-point numbers. */
3436static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half4 other) {
3437 simd_half32 result = 0;
3438 result.xyzw = other;
3439 return result;
3440}
3441
3442/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
3443 * floating-point numbers. The contents of the newly-created vector lanes
3444 * are unspecified. */
3445static inline SIMD_CFUNC simd_half32 simd_make_half32_undef(simd_half4 other) {
3446 simd_half32 result;
3447 result.xyzw = other;
3448 return result;
3449}
3450
3451/*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit
3452 * floating-point numbers. */
3453static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half8 other) {
3454 simd_half32 result = 0;
3455 result.lo = simd_make_half16(other);
3456 return result;
3457}
3458
3459/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
3460 * floating-point numbers. The contents of the newly-created vector lanes
3461 * are unspecified. */
3462static inline SIMD_CFUNC simd_half32 simd_make_half32_undef(simd_half8 other) {
3463 simd_half32 result;
3464 result.lo = simd_make_half16(other);
3465 return result;
3466}
3467
3468/*! @abstract Zero-extends `other` to form a vector of thirty-two 16-bit
3469 * floating-point numbers. */
3470static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half16 other) {
3471 simd_half32 result = 0;
3472 result.lo = simd_make_half16(other);
3473 return result;
3474}
3475
3476/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
3477 * floating-point numbers. The contents of the newly-created vector lanes
3478 * are unspecified. */
3479static inline SIMD_CFUNC simd_half32 simd_make_half32_undef(simd_half16 other) {
3480 simd_half32 result;
3481 result.lo = simd_make_half16(other);
3482 return result;
3483}
3484
3485/*! @abstract Returns `other` unmodified. This function is a convenience for
3486 * templated and autogenerated code. */
3487static inline SIMD_CFUNC simd_half32 simd_make_half32(simd_half32 other) {
3488 return other;
3489}
3490
2879/*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed3491/*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed
2880 * (twos-complement) integers. */3492 * (twos-complement) integers. */
2881static inline SIMD_CFUNC simd_int2 simd_make_int2(int x, int y) {3493static inline SIMD_CFUNC simd_int2 simd_make_int2(int x, int y) {
...@@ -5997,6 +6609,166 @@ template <typename typeN> static SIMD_CPPFUNC ushort32 make_ushort32_undef(typeN...@@ -5997,6 +6609,166 @@ template <typename typeN> static SIMD_CPPFUNC ushort32 make_ushort32_undef(typeN
5997 return ::simd_make_ushort32_undef(other);6609 return ::simd_make_ushort32_undef(other);
5998}6610}
59996611
6612/*! @abstract Concatenates `x` and `y` to form a vector of two 16-bit
6613 * floating-point numbers. */
6614static inline SIMD_CPPFUNC half2 make_half2(_Float16 x, _Float16 y) {
6615 return ::simd_make_half2(x, y);
6616}
6617
6618/*! @abstract Truncates or zero-extends `other` to form a vector of two
6619 * 16-bit floating-point numbers. */
6620template <typename typeN> static SIMD_CPPFUNC half2 make_half2(typeN other) {
6621 return ::simd_make_half2(other);
6622}
6623
6624/*! @abstract Extends `other` to form a vector of two 16-bit floating-point
6625 * numbers. The contents of the newly-created vector lanes are unspecified. */
6626template <typename typeN> static SIMD_CPPFUNC half2 make_half2_undef(typeN other) {
6627 return ::simd_make_half2_undef(other);
6628}
6629
6630/*! @abstract Concatenates `x`, `y` and `z` to form a vector of three 16-bit
6631 * floating-point numbers. */
6632static inline SIMD_CPPFUNC half3 make_half3(_Float16 x, _Float16 y, _Float16 z) {
6633 return ::simd_make_half3(x, y, z);
6634}
6635
6636/*! @abstract Concatenates `x` and `yz` to form a vector of three 16-bit
6637 * floating-point numbers. */
6638static inline SIMD_CPPFUNC half3 make_half3(_Float16 x, half2 yz) {
6639 return ::simd_make_half3(x, yz);
6640}
6641
6642/*! @abstract Concatenates `xy` and `z` to form a vector of three 16-bit
6643 * floating-point numbers. */
6644static inline SIMD_CPPFUNC half3 make_half3(half2 xy, _Float16 z) {
6645 return ::simd_make_half3(xy, z);
6646}
6647
6648/*! @abstract Truncates or zero-extends `other` to form a vector of three
6649 * 16-bit floating-point numbers. */
6650template <typename typeN> static SIMD_CPPFUNC half3 make_half3(typeN other) {
6651 return ::simd_make_half3(other);
6652}
6653
6654/*! @abstract Extends `other` to form a vector of three 16-bit floating-
6655 * point numbers. The contents of the newly-created vector lanes are
6656 * unspecified. */
6657template <typename typeN> static SIMD_CPPFUNC half3 make_half3_undef(typeN other) {
6658 return ::simd_make_half3_undef(other);
6659}
6660
6661/*! @abstract Concatenates `x`, `y`, `z` and `w` to form a vector of four
6662 * 16-bit floating-point numbers. */
6663static inline SIMD_CPPFUNC half4 make_half4(_Float16 x, _Float16 y, _Float16 z, _Float16 w) {
6664 return ::simd_make_half4(x, y, z, w);
6665}
6666
6667/*! @abstract Concatenates `x`, `y` and `zw` to form a vector of four 16-bit
6668 * floating-point numbers. */
6669static inline SIMD_CPPFUNC half4 make_half4(_Float16 x, _Float16 y, half2 zw) {
6670 return ::simd_make_half4(x, y, zw);
6671}
6672
6673/*! @abstract Concatenates `x`, `yz` and `w` to form a vector of four 16-bit
6674 * floating-point numbers. */
6675static inline SIMD_CPPFUNC half4 make_half4(_Float16 x, half2 yz, _Float16 w) {
6676 return ::simd_make_half4(x, yz, w);
6677}
6678
6679/*! @abstract Concatenates `xy`, `z` and `w` to form a vector of four 16-bit
6680 * floating-point numbers. */
6681static inline SIMD_CPPFUNC half4 make_half4(half2 xy, _Float16 z, _Float16 w) {
6682 return ::simd_make_half4(xy, z, w);
6683}
6684
6685/*! @abstract Concatenates `x` and `yzw` to form a vector of four 16-bit
6686 * floating-point numbers. */
6687static inline SIMD_CPPFUNC half4 make_half4(_Float16 x, half3 yzw) {
6688 return ::simd_make_half4(x, yzw);
6689}
6690
6691/*! @abstract Concatenates `xy` and `zw` to form a vector of four 16-bit
6692 * floating-point numbers. */
6693static inline SIMD_CPPFUNC half4 make_half4(half2 xy, half2 zw) {
6694 return ::simd_make_half4(xy, zw);
6695}
6696
6697/*! @abstract Concatenates `xyz` and `w` to form a vector of four 16-bit
6698 * floating-point numbers. */
6699static inline SIMD_CPPFUNC half4 make_half4(half3 xyz, _Float16 w) {
6700 return ::simd_make_half4(xyz, w);
6701}
6702
6703/*! @abstract Truncates or zero-extends `other` to form a vector of four
6704 * 16-bit floating-point numbers. */
6705template <typename typeN> static SIMD_CPPFUNC half4 make_half4(typeN other) {
6706 return ::simd_make_half4(other);
6707}
6708
6709/*! @abstract Extends `other` to form a vector of four 16-bit floating-point
6710 * numbers. The contents of the newly-created vector lanes are unspecified. */
6711template <typename typeN> static SIMD_CPPFUNC half4 make_half4_undef(typeN other) {
6712 return ::simd_make_half4_undef(other);
6713}
6714
6715/*! @abstract Concatenates `lo` and `hi` to form a vector of eight 16-bit
6716 * floating-point numbers. */
6717static inline SIMD_CPPFUNC half8 make_half8(half4 lo, half4 hi) {
6718 return ::simd_make_half8(lo, hi);
6719}
6720
6721/*! @abstract Truncates or zero-extends `other` to form a vector of eight
6722 * 16-bit floating-point numbers. */
6723template <typename typeN> static SIMD_CPPFUNC half8 make_half8(typeN other) {
6724 return ::simd_make_half8(other);
6725}
6726
6727/*! @abstract Extends `other` to form a vector of eight 16-bit floating-
6728 * point numbers. The contents of the newly-created vector lanes are
6729 * unspecified. */
6730template <typename typeN> static SIMD_CPPFUNC half8 make_half8_undef(typeN other) {
6731 return ::simd_make_half8_undef(other);
6732}
6733
6734/*! @abstract Concatenates `lo` and `hi` to form a vector of sixteen 16-bit
6735 * floating-point numbers. */
6736static inline SIMD_CPPFUNC half16 make_half16(half8 lo, half8 hi) {
6737 return ::simd_make_half16(lo, hi);
6738}
6739
6740/*! @abstract Truncates or zero-extends `other` to form a vector of sixteen
6741 * 16-bit floating-point numbers. */
6742template <typename typeN> static SIMD_CPPFUNC half16 make_half16(typeN other) {
6743 return ::simd_make_half16(other);
6744}
6745
6746/*! @abstract Extends `other` to form a vector of sixteen 16-bit floating-
6747 * point numbers. The contents of the newly-created vector lanes are
6748 * unspecified. */
6749template <typename typeN> static SIMD_CPPFUNC half16 make_half16_undef(typeN other) {
6750 return ::simd_make_half16_undef(other);
6751}
6752
6753/*! @abstract Concatenates `lo` and `hi` to form a vector of thirty-two
6754 * 16-bit floating-point numbers. */
6755static inline SIMD_CPPFUNC half32 make_half32(half16 lo, half16 hi) {
6756 return ::simd_make_half32(lo, hi);
6757}
6758
6759/*! @abstract Truncates or zero-extends `other` to form a vector of thirty-
6760 * two 16-bit floating-point numbers. */
6761template <typename typeN> static SIMD_CPPFUNC half32 make_half32(typeN other) {
6762 return ::simd_make_half32(other);
6763}
6764
6765/*! @abstract Extends `other` to form a vector of thirty-two 16-bit
6766 * floating-point numbers. The contents of the newly-created vector lanes
6767 * are unspecified. */
6768template <typename typeN> static SIMD_CPPFUNC half32 make_half32_undef(typeN other) {
6769 return ::simd_make_half32_undef(other);
6770}
6771
6000/*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed6772/*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed
6001 * (twos-complement) integers. */6773 * (twos-complement) integers. */
6002static inline SIMD_CPPFUNC int2 make_int2(int x, int y) {6774static inline SIMD_CPPFUNC int2 make_int2(int x, int y) {
...@@ -7208,6 +7980,95 @@ template <> struct get_traits<ushort32>...@@ -7208,6 +7980,95 @@ template <> struct get_traits<ushort32>
7208 using type = Vector<ushort1, 32>;7980 using type = Vector<ushort1, 32>;
7209};7981};
72107982
7983template<> struct Vector<half1, 1> {
7984 static const size_t count = 1;
7985 typedef half1 scalar_t;
7986 typedef half1 type;
7987 typedef short1 mask_t;
7988};
7989
7990template <> struct get_traits<half1>
7991{
7992 using type = Vector<half1, 1>;
7993};
7994
7995template<> struct Vector<half1, 2> {
7996 static const size_t count = 2;
7997 typedef half1 scalar_t;
7998 typedef half2 type;
7999 typedef packed::half2 packed_t;
8000 typedef short2 mask_t;
8001};
8002
8003template <> struct get_traits<half2>
8004{
8005 using type = Vector<half1, 2>;
8006};
8007
8008template<> struct Vector<half1, 3> {
8009 static const size_t count = 3;
8010 typedef half1 scalar_t;
8011 typedef half3 type;
8012 typedef short3 mask_t;
8013};
8014
8015template <> struct get_traits<half3>
8016{
8017 using type = Vector<half1, 3>;
8018};
8019
8020template<> struct Vector<half1, 4> {
8021 static const size_t count = 4;
8022 typedef half1 scalar_t;
8023 typedef half4 type;
8024 typedef packed::half4 packed_t;
8025 typedef short4 mask_t;
8026};
8027
8028template <> struct get_traits<half4>
8029{
8030 using type = Vector<half1, 4>;
8031};
8032
8033template<> struct Vector<half1, 8> {
8034 static const size_t count = 8;
8035 typedef half1 scalar_t;
8036 typedef half8 type;
8037 typedef packed::half8 packed_t;
8038 typedef short8 mask_t;
8039};
8040
8041template <> struct get_traits<half8>
8042{
8043 using type = Vector<half1, 8>;
8044};
8045
8046template<> struct Vector<half1, 16> {
8047 static const size_t count = 16;
8048 typedef half1 scalar_t;
8049 typedef half16 type;
8050 typedef packed::half16 packed_t;
8051 typedef short16 mask_t;
8052};
8053
8054template <> struct get_traits<half16>
8055{
8056 using type = Vector<half1, 16>;
8057};
8058
8059template<> struct Vector<half1, 32> {
8060 static const size_t count = 32;
8061 typedef half1 scalar_t;
8062 typedef half32 type;
8063 typedef packed::half32 packed_t;
8064 typedef short32 mask_t;
8065};
8066
8067template <> struct get_traits<half32>
8068{
8069 using type = Vector<half1, 32>;
8070};
8071
7211template<> struct Vector<int1, 1> {8072template<> struct Vector<int1, 1> {
7212 static const size_t count = 1;8073 static const size_t count = 1;
7213 typedef int1 scalar_t;8074 typedef int1 scalar_t;
...@@ -7691,6 +8552,18 @@ static constexpr typeN make(Args... args)...@@ -7691,6 +8552,18 @@ static constexpr typeN make(Args... args)
7691 return make_ushort16(args...);8552 return make_ushort16(args...);
7692 else if constexpr (std::is_same<typeN, ushort32>::value)8553 else if constexpr (std::is_same<typeN, ushort32>::value)
7693 return make_ushort32(args...);8554 return make_ushort32(args...);
8555 else if constexpr (std::is_same<typeN, half2>::value)
8556 return make_half2(args...);
8557 else if constexpr (std::is_same<typeN, half3>::value)
8558 return make_half3(args...);
8559 else if constexpr (std::is_same<typeN, half4>::value)
8560 return make_half4(args...);
8561 else if constexpr (std::is_same<typeN, half8>::value)
8562 return make_half8(args...);
8563 else if constexpr (std::is_same<typeN, half16>::value)
8564 return make_half16(args...);
8565 else if constexpr (std::is_same<typeN, half32>::value)
8566 return make_half32(args...);
7694 else if constexpr (std::is_same<typeN, int2>::value)8567 else if constexpr (std::is_same<typeN, int2>::value)
7695 return make_int2(args...);8568 return make_int2(args...);
7696 else if constexpr (std::is_same<typeN, int3>::value)8569 else if constexpr (std::is_same<typeN, int3>::value)
...@@ -7812,6 +8685,18 @@ static constexpr typeN make_undef(Args... args)...@@ -7812,6 +8685,18 @@ static constexpr typeN make_undef(Args... args)
7812 return make_ushort16_undef(args...);8685 return make_ushort16_undef(args...);
7813 else if constexpr (std::is_same<typeN, ushort32>::value)8686 else if constexpr (std::is_same<typeN, ushort32>::value)
7814 return make_ushort32_undef(args...);8687 return make_ushort32_undef(args...);
8688 else if constexpr (std::is_same<typeN, half2>::value)
8689 return make_half2_undef(args...);
8690 else if constexpr (std::is_same<typeN, half3>::value)
8691 return make_half3_undef(args...);
8692 else if constexpr (std::is_same<typeN, half4>::value)
8693 return make_half4_undef(args...);
8694 else if constexpr (std::is_same<typeN, half8>::value)
8695 return make_half8_undef(args...);
8696 else if constexpr (std::is_same<typeN, half16>::value)
8697 return make_half16_undef(args...);
8698 else if constexpr (std::is_same<typeN, half32>::value)
8699 return make_half32_undef(args...);
7815 else if constexpr (std::is_same<typeN, int2>::value)8700 else if constexpr (std::is_same<typeN, int2>::value)
7816 return make_int2_undef(args...);8701 return make_int2_undef(args...);
7817 else if constexpr (std::is_same<typeN, int3>::value)8702 else if constexpr (std::is_same<typeN, int3>::value)
lib/libc/include/any-macos-any/simd/vector_types.h+100
...@@ -310,6 +310,55 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned short...@@ -310,6 +310,55 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) unsigned short
310 * simd_packed_ushort32 instead. */310 * simd_packed_ushort32 instead. */
311typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned short simd_ushort32;311typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) unsigned short simd_ushort32;
312312
313/*! @abstract A scalar 16-bit floating-point number. */
314typedef _Float16 simd_half1;
315
316/*! @abstract A vector of two 16-bit floating-point numbers.
317 * @description In C++ and Metal, this type is also available as
318 * simd::half2. The alignment of this type is greater than the alignment of
319 * _Float16; if you need to operate on data buffers that may not be
320 * suitably aligned, you should access them using simd_packed_half2
321 * instead. */
322typedef __attribute__((__ext_vector_type__(2))) _Float16 simd_half2;
323
324/*! @abstract A vector of three 16-bit floating-point numbers.
325 * @description In C++ and Metal, this type is also available as
326 * simd::half3. Note that vectors of this type are padded to have the same
327 * size and alignment as simd_half4. */
328typedef __attribute__((__ext_vector_type__(3))) _Float16 simd_half3;
329
330/*! @abstract A vector of four 16-bit floating-point numbers.
331 * @description In C++ and Metal, this type is also available as
332 * simd::half4. The alignment of this type is greater than the alignment of
333 * _Float16; if you need to operate on data buffers that may not be
334 * suitably aligned, you should access them using simd_packed_half4
335 * instead. */
336typedef __attribute__((__ext_vector_type__(4))) _Float16 simd_half4;
337
338/*! @abstract A vector of eight 16-bit floating-point numbers.
339 * @description In C++ this type is also available as simd::half8. This
340 * type is not available in Metal. The alignment of this type is greater
341 * than the alignment of _Float16; if you need to operate on data buffers
342 * that may not be suitably aligned, you should access them using
343 * simd_packed_half8 instead. */
344typedef __attribute__((__ext_vector_type__(8))) _Float16 simd_half8;
345
346/*! @abstract A vector of sixteen 16-bit floating-point numbers.
347 * @description In C++ this type is also available as simd::half16. This
348 * type is not available in Metal. The alignment of this type is greater
349 * than the alignment of _Float16; if you need to operate on data buffers
350 * that may not be suitably aligned, you should access them using
351 * simd_packed_half16 instead. */
352typedef __attribute__((__ext_vector_type__(16),__aligned__(16))) _Float16 simd_half16;
353
354/*! @abstract A vector of thirty-two 16-bit floating-point numbers.
355 * @description In C++ this type is also available as simd::half32. This
356 * type is not available in Metal. The alignment of this type is greater
357 * than the alignment of _Float16; if you need to operate on data buffers
358 * that may not be suitably aligned, you should access them using
359 * simd_packed_half32 instead. */
360typedef __attribute__((__ext_vector_type__(32),__aligned__(16))) _Float16 simd_half32;
361
313/*! @abstract A scalar 32-bit signed (twos-complement) integer. */362/*! @abstract A scalar 32-bit signed (twos-complement) integer. */
314typedef int simd_int1;363typedef int simd_int1;
315364
...@@ -769,6 +818,57 @@ typedef ::simd_ushort16 ushort16;...@@ -769,6 +818,57 @@ typedef ::simd_ushort16 ushort16;
769 * them using simd::packed_ushort32 instead. */818 * them using simd::packed_ushort32 instead. */
770typedef ::simd_ushort32 ushort32;819typedef ::simd_ushort32 ushort32;
771 820
821 /*! @abstract A scalar 16-bit floating-point number.
822 * @discussion In C and Objective-C, this type is available as
823 * simd_half1. */
824typedef ::simd_half1 half1;
825
826 /*! @abstract A vector of two 16-bit floating-point numbers.
827 * @description In C or Objective-C, this type is available as
828 * simd_half2. The alignment of this type is greater than the alignment
829 * of _Float16; if you need to operate on data buffers that may not be
830 * suitably aligned, you should access them using simd::packed_half2
831 * instead. */
832typedef ::simd_half2 half2;
833
834 /*! @abstract A vector of three 16-bit floating-point numbers.
835 * @description In C or Objective-C, this type is available as
836 * simd_half3. Vectors of this type are padded to have the same size and
837 * alignment as simd_half4. */
838typedef ::simd_half3 half3;
839
840 /*! @abstract A vector of four 16-bit floating-point numbers.
841 * @description In C or Objective-C, this type is available as
842 * simd_half4. The alignment of this type is greater than the alignment
843 * of _Float16; if you need to operate on data buffers that may not be
844 * suitably aligned, you should access them using simd::packed_half4
845 * instead. */
846typedef ::simd_half4 half4;
847
848 /*! @abstract A vector of eight 16-bit floating-point numbers.
849 * @description This type is not available in Metal. In C or Objective-C,
850 * this type is available as simd_half8. The alignment of this type is
851 * greater than the alignment of _Float16; if you need to operate on data
852 * buffers that may not be suitably aligned, you should access them using
853 * simd::packed_half8 instead. */
854typedef ::simd_half8 half8;
855
856 /*! @abstract A vector of sixteen 16-bit floating-point numbers.
857 * @description This type is not available in Metal. In C or Objective-C,
858 * this type is available as simd_half16. The alignment of this type is
859 * greater than the alignment of _Float16; if you need to operate on data
860 * buffers that may not be suitably aligned, you should access them using
861 * simd::packed_half16 instead. */
862typedef ::simd_half16 half16;
863
864 /*! @abstract A vector of thirty-two 16-bit floating-point numbers.
865 * @description This type is not available in Metal. In C or Objective-C,
866 * this type is available as simd_half32. The alignment of this type is
867 * greater than the alignment of _Float16; if you need to operate on data
868 * buffers that may not be suitably aligned, you should access them using
869 * simd::packed_half32 instead. */
870typedef ::simd_half32 half32;
871
772 /*! @abstract A scalar 32-bit signed (twos-complement) integer.872 /*! @abstract A scalar 32-bit signed (twos-complement) integer.
773 * @discussion In C and Objective-C, this type is available as simd_int1. */873 * @discussion In C and Objective-C, this type is available as simd_int1. */
774typedef ::simd_int1 int1;874typedef ::simd_int1 int1;
lib/libc/include/any-macos-any/stdio.h+1-348
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.2 * Copyright (c) 2000, 2005, 2007, 2009, 2010, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
...@@ -58,355 +58,8 @@...@@ -58,355 +58,8 @@
58 * @(#)stdio.h 8.5 (Berkeley) 4/29/9558 * @(#)stdio.h 8.5 (Berkeley) 4/29/95
59 */59 */
6060
61#ifndef _STDIO_H_
62#define _STDIO_H_
63
64#include <_stdio.h>61#include <_stdio.h>
6562
66#include <sys/_types/_seek_set.h>
67
68__BEGIN_DECLS
69extern FILE *__stdinp;
70extern FILE *__stdoutp;
71extern FILE *__stderrp;
72__END_DECLS
73
74#define __SLBF 0x0001 /* line buffered */
75#define __SNBF 0x0002 /* unbuffered */
76#define __SRD 0x0004 /* OK to read */
77#define __SWR 0x0008 /* OK to write */
78 /* RD and WR are never simultaneously asserted */
79#define __SRW 0x0010 /* open for reading & writing */
80#define __SEOF 0x0020 /* found EOF */
81#define __SERR 0x0040 /* found error */
82#define __SMBF 0x0080 /* _buf is from malloc */
83#define __SAPP 0x0100 /* fdopen()ed in append mode */
84#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
85#define __SOPT 0x0400 /* do fseek() optimisation */
86#define __SNPT 0x0800 /* do not do fseek() optimisation */
87#define __SOFF 0x1000 /* set iff _offset is in fact correct */
88#define __SMOD 0x2000 /* true => fgetln modified _p text */
89#define __SALC 0x4000 /* allocate string space dynamically */
90#define __SIGN 0x8000 /* ignore this file in _fwalk */
91
92/*
93 * The following three definitions are for ANSI C, which took them
94 * from System V, which brilliantly took internal interface macros and
95 * made them official arguments to setvbuf(), without renaming them.
96 * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
97 *
98 * Although numbered as their counterparts above, the implementation
99 * does not rely on this.
100 */
101#define _IOFBF 0 /* setvbuf should set fully buffered */
102#define _IOLBF 1 /* setvbuf should set line buffered */
103#define _IONBF 2 /* setvbuf should set unbuffered */
104
105#define BUFSIZ 1024 /* size of buffer used by setbuf */
106#define EOF (-1)
107
108 /* must be == _POSIX_STREAM_MAX <limits.h> */
109#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
110#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
111
112/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
113#ifndef _ANSI_SOURCE
114#define P_tmpdir "/var/tmp/"
115#endif
116#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
117#define TMP_MAX 308915776
118
119#define stdin __stdinp
120#define stdout __stdoutp
121#define stderr __stderrp
122
123#ifdef _DARWIN_UNLIMITED_STREAMS
124#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
125#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it."
126#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
127#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it."
128#endif
129#endif
130
131/* ANSI-C */
132
133__BEGIN_DECLS
134void clearerr(FILE *);
135int fclose(FILE *);
136int feof(FILE *);
137int ferror(FILE *);
138int fflush(FILE *);
139int fgetc(FILE *);
140int fgetpos(FILE * __restrict, fpos_t *);
141char *fgets(char * __restrict, int, FILE *);
142#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
143FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen));
144#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
145FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
146#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
147int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
148int fputc(int, FILE *);
149int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
150size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
151FILE *freopen(const char * __restrict, const char * __restrict,
152 FILE * __restrict) __DARWIN_ALIAS(freopen);
153int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
154int fseek(FILE *, long, int);
155int fsetpos(FILE *, const fpos_t *);
156long ftell(FILE *);
157size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
158int getc(FILE *);
159int getchar(void);
160
161#if !defined(_POSIX_C_SOURCE)
162__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of gets(3), it is highly recommended that you use fgets(3) instead.")
163#endif
164char *gets(char *);
165
166void perror(const char *) __cold;
167int printf(const char * __restrict, ...) __printflike(1, 2);
168int putc(int, FILE *);
169int putchar(int);
170int puts(const char *);
171int remove(const char *);
172int rename (const char *__old, const char *__new);
173void rewind(FILE *);
174int scanf(const char * __restrict, ...) __scanflike(1, 2);
175void setbuf(FILE * __restrict, char * __restrict);
176int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
177
178__swift_unavailable("Use snprintf instead.")
179#if !defined(_POSIX_C_SOURCE)
180__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
181#endif
182int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
183
184int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
185FILE *tmpfile(void);
186
187__swift_unavailable("Use mkstemp(3) instead.")
188#if !defined(_POSIX_C_SOURCE)
189__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
190#endif
191char *tmpnam(char *);
192
193int ungetc(int, FILE *);
194int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
195int vprintf(const char * __restrict, va_list) __printflike(1, 0);
196
197__swift_unavailable("Use vsnprintf instead.")
198#if !defined(_POSIX_C_SOURCE)
199__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
200#endif
201int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
202__END_DECLS
203
204
205
206/* Additional functionality provided by:
207 * POSIX.1-1988
208 */
209
210#if __DARWIN_C_LEVEL >= 198808L
211#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
212
213#include <_ctermid.h>
214
215__BEGIN_DECLS
216
217#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
218FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
219#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
220FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
221#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
222int fileno(FILE *);
223__END_DECLS
224#endif /* __DARWIN_C_LEVEL >= 198808L */
225
226
227/* Additional functionality provided by:
228 * POSIX.2-1992 C Language Binding Option
229 */
230
231#if __DARWIN_C_LEVEL >= 199209L
232__BEGIN_DECLS
233int pclose(FILE *) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
234#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
235FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
236#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
237FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
238#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
239__END_DECLS
240#endif /* __DARWIN_C_LEVEL >= 199209L */
241
242/* Additional functionality provided by:
243 * POSIX.1c-1995,
244 * POSIX.1i-1995,
245 * and the omnibus ISO/IEC 9945-1: 1996
246 */
247
248#if __DARWIN_C_LEVEL >= 199506L
249
250/* Functions internal to the implementation. */
251__BEGIN_DECLS
252int __srget(FILE *);
253int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
254int __swbuf(int, FILE *);
255__END_DECLS
256
257/*
258 * The __sfoo macros are here so that we can
259 * define function versions in the C library.
260 */
261#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
262#if defined(__GNUC__) && defined(__STDC__)
263__header_always_inline int __sputc(int _c, FILE *_p) {
264 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
265 return (*_p->_p++ = _c);
266 else
267 return (__swbuf(_c, _p));
268}
269#else
270/*
271 * This has been tuned to generate reasonable code on the vax using pcc.
272 */
273#define __sputc(c, p) \
274 (--(p)->_w < 0 ? \
275 (p)->_w >= (p)->_lbfsize ? \
276 (*(p)->_p = (c)), *(p)->_p != '\n' ? \
277 (int)*(p)->_p++ : \
278 __swbuf('\n', p) : \
279 __swbuf((int)(c), p) : \
280 (*(p)->_p = (c), (int)*(p)->_p++))
281#endif
282
283#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
284#define __sferror(p) (((p)->_flags & __SERR) != 0)
285#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
286#define __sfileno(p) ((p)->_file)
287
288__BEGIN_DECLS
289void flockfile(FILE *);
290int ftrylockfile(FILE *);
291void funlockfile(FILE *);
292int getc_unlocked(FILE *);
293int getchar_unlocked(void);
294int putc_unlocked(int, FILE *);
295int putchar_unlocked(int);
296
297/* Removed in Issue 6 */
298#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
299int getw(FILE *);
300int putw(int, FILE *);
301#endif
302
303__swift_unavailable("Use mkstemp(3) instead.")
304#if !defined(_POSIX_C_SOURCE)
305__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")
306#endif
307char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
308__END_DECLS
309
310#ifndef lint
311#define getc_unlocked(fp) __sgetc(fp)
312#define putc_unlocked(x, fp) __sputc(x, fp)
313#endif /* lint */
314
315#define getchar_unlocked() getc_unlocked(stdin)
316#define putchar_unlocked(x) putc_unlocked(x, stdout)
317#endif /* __DARWIN_C_LEVEL >= 199506L */
318
319
320
321/* Additional functionality provided by:
322 * POSIX.1-2001
323 * ISO C99
324 */
325
326#if __DARWIN_C_LEVEL >= 200112L
327#include <sys/_types/_off_t.h>
328
329__BEGIN_DECLS
330int fseeko(FILE * __stream, off_t __offset, int __whence);
331off_t ftello(FILE * __stream);
332__END_DECLS
333#endif /* __DARWIN_C_LEVEL >= 200112L */
334
335#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
336__BEGIN_DECLS
337int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
338int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
339int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
340int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
341int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
342__END_DECLS
343#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
344
345
346
347/* Additional functionality provided by:
348 * POSIX.1-2008
349 */
350
351#if __DARWIN_C_LEVEL >= 200809L
352#include <sys/_types/_ssize_t.h>
353
354__BEGIN_DECLS
355int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
356int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
357ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
358ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
359FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
360FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
361__END_DECLS
362#endif /* __DARWIN_C_LEVEL >= 200809L */
363
364
365
366/* Darwin extensions */
367
368#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
369__BEGIN_DECLS
370extern __const int sys_nerr; /* perror(3) external variables */
371extern __const char *__const sys_errlist[];
372
373int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
374char *ctermid_r(char *);
375char *fgetln(FILE *, size_t *);
376__const char *fmtcheck(const char *, const char *) __attribute__((format_arg(2)));
377int fpurge(FILE *);
378void setbuffer(FILE *, char *, int);
379int setlinebuf(FILE *);
380int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
381
382
383/*
384 * Stdio function-access interface.
385 */
386FILE *funopen(const void *,
387 int (* _Nullable)(void *, char *, int),
388 int (* _Nullable)(void *, const char *, int),
389 fpos_t (* _Nullable)(void *, fpos_t, int),
390 int (* _Nullable)(void *));
391__END_DECLS
392#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
393#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
394
395#define feof_unlocked(p) __sfeof(p)
396#define ferror_unlocked(p) __sferror(p)
397#define clearerr_unlocked(p) __sclearerr(p)
398#define fileno_unlocked(p) __sfileno(p)
399
400#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
401
402
403#ifdef _USE_EXTENDED_LOCALES_63#ifdef _USE_EXTENDED_LOCALES_
404#include <xlocale/_stdio.h>64#include <xlocale/_stdio.h>
405#endif /* _USE_EXTENDED_LOCALES_ */65#endif /* _USE_EXTENDED_LOCALES_ */
406
407#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
408/* Security checking functions. */
409#include <secure/_stdio.h>
410#endif
411
412#endif /* _STDIO_H_ */
lib/libc/include/any-macos-any/stdlib.h+2-322
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved.2 * Copyright (c) 2000, 2002 - 2008, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 * 5 *
...@@ -55,328 +55,8 @@...@@ -55,328 +55,8 @@
55 * @(#)stdlib.h 8.5 (Berkeley) 5/19/9555 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
56 */56 */
5757
58#ifndef _STDLIB_H_58#include <_stdlib.h>
59#define _STDLIB_H_
60
61#include <Availability.h>
62#include <sys/cdefs.h>
63
64#include <_types.h>
65#if !defined(_ANSI_SOURCE)
66#include <sys/wait.h>
67#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
68#include <alloca.h>
69#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
70#endif /* !_ANSI_SOURCE */
71
72/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
73 * _GCC_SIZE_T */
74#include <sys/_types/_size_t.h>
75
76#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
77#include <sys/_types/_ct_rune_t.h>
78#include <sys/_types/_rune_t.h>
79#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
80
81#include <sys/_types/_wchar_t.h>
82
83typedef struct {
84 int quot; /* quotient */
85 int rem; /* remainder */
86} div_t;
87
88typedef struct {
89 long quot; /* quotient */
90 long rem; /* remainder */
91} ldiv_t;
92
93#if !__DARWIN_NO_LONG_LONG
94typedef struct {
95 long long quot;
96 long long rem;
97} lldiv_t;
98#endif /* !__DARWIN_NO_LONG_LONG */
99
100#include <sys/_types/_null.h>
101
102#define EXIT_FAILURE 1
103#define EXIT_SUCCESS 0
104
105#define RAND_MAX 0x7fffffff
106
107#ifdef _USE_EXTENDED_LOCALES_
108#include <_xlocale.h>
109#endif /* _USE_EXTENDED_LOCALES_ */
110
111#ifndef MB_CUR_MAX
112#ifdef _USE_EXTENDED_LOCALES_
113#define MB_CUR_MAX (___mb_cur_max())
114#ifndef MB_CUR_MAX_L
115#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
116#endif /* !MB_CUR_MAX_L */
117#else /* !_USE_EXTENDED_LOCALES_ */
118extern int __mb_cur_max;
119#define MB_CUR_MAX __mb_cur_max
120#endif /* _USE_EXTENDED_LOCALES_ */
121#endif /* MB_CUR_MAX */
122
123#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \
124 && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L)
125#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
126#endif
127
128#include <malloc/_malloc.h>
129
130__BEGIN_DECLS
131void abort(void) __cold __dead2;
132int abs(int) __pure2;
133int atexit(void (* _Nonnull)(void));
134double atof(const char *);
135int atoi(const char *);
136long atol(const char *);
137#if !__DARWIN_NO_LONG_LONG
138long long
139 atoll(const char *);
140#endif /* !__DARWIN_NO_LONG_LONG */
141void *bsearch(const void *__key, const void *__base, size_t __nel,
142 size_t __width, int (* _Nonnull __compar)(const void *, const void *));
143/* calloc is now declared in _malloc.h */
144div_t div(int, int) __pure2;
145void exit(int) __dead2;
146/* free is now declared in _malloc.h */
147char *getenv(const char *);
148long labs(long) __pure2;
149ldiv_t ldiv(long, long) __pure2;
150#if !__DARWIN_NO_LONG_LONG
151long long
152 llabs(long long);
153lldiv_t lldiv(long long, long long);
154#endif /* !__DARWIN_NO_LONG_LONG */
155/* malloc is now declared in _malloc.h */
156int mblen(const char *__s, size_t __n);
157size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
158int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
159/* posix_memalign is now declared in _malloc.h */
160void qsort(void *__base, size_t __nel, size_t __width,
161 int (* _Nonnull __compar)(const void *, const void *));
162int rand(void) __swift_unavailable("Use arc4random instead.");
163/* realloc is now declared in _malloc.h */
164void srand(unsigned) __swift_unavailable("Use arc4random instead.");
165double strtod(const char *, char **) __DARWIN_ALIAS(strtod);
166float strtof(const char *, char **) __DARWIN_ALIAS(strtof);
167long strtol(const char *__str, char **__endptr, int __base);
168long double
169 strtold(const char *, char **);
170#if !__DARWIN_NO_LONG_LONG
171long long
172 strtoll(const char *__str, char **__endptr, int __base);
173#endif /* !__DARWIN_NO_LONG_LONG */
174unsigned long
175 strtoul(const char *__str, char **__endptr, int __base);
176#if !__DARWIN_NO_LONG_LONG
177unsigned long long
178 strtoull(const char *__str, char **__endptr, int __base);
179#endif /* !__DARWIN_NO_LONG_LONG */
180
181__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
182__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
183__WATCHOS_PROHIBITED __TVOS_PROHIBITED
184int system(const char *) __DARWIN_ALIAS_C(system);
185
186
187size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
188int wctomb(char *, wchar_t);
189
190#ifndef _ANSI_SOURCE
191void _Exit(int) __dead2;
192long a64l(const char *);
193double drand48(void);
194char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
195double erand48(unsigned short[3]);
196char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
197char *gcvt(double, int, char *); /* LEGACY */
198int getsubopt(char **, char * const *, char **);
199int grantpt(int);
200#if __DARWIN_UNIX03
201char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
202#else /* !__DARWIN_UNIX03 */
203char *initstate(unsigned long, char *, long);
204#endif /* __DARWIN_UNIX03 */
205long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
206char *l64a(long);
207void lcong48(unsigned short[7]);
208long lrand48(void) __swift_unavailable("Use arc4random instead.");
209#if !defined(_POSIX_C_SOURCE)
210__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of mktemp(3), it is highly recommended that you use mkstemp(3) instead.")
211#endif
212char *mktemp(char *);
213int mkstemp(char *);
214long mrand48(void) __swift_unavailable("Use arc4random instead.");
215long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
216int posix_openpt(int);
217char *ptsname(int);
218
219#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
220int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
221#endif
222
223int putenv(char *) __DARWIN_ALIAS(putenv);
224long random(void) __swift_unavailable("Use arc4random instead.");
225int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
226#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
227char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
228#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
229char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
230#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
231unsigned short
232 *seed48(unsigned short[3]);
233int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
234#if __DARWIN_UNIX03
235void setkey(const char *) __DARWIN_ALIAS(setkey);
236#else /* !__DARWIN_UNIX03 */
237int setkey(const char *);
238#endif /* __DARWIN_UNIX03 */
239char *setstate(const char *);
240void srand48(long);
241#if __DARWIN_UNIX03
242void srandom(unsigned);
243#else /* !__DARWIN_UNIX03 */
244void srandom(unsigned long);
245#endif /* __DARWIN_UNIX03 */
246int unlockpt(int);
247#if __DARWIN_UNIX03
248int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
249#else /* !__DARWIN_UNIX03 */
250void unsetenv(const char *);
251#endif /* __DARWIN_UNIX03 */
252#endif /* !_ANSI_SOURCE */
253__END_DECLS
254
255#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
256#include <machine/types.h>
257#include <sys/_types/_dev_t.h>
258#include <sys/_types/_mode_t.h>
259#include <_types/_uint32_t.h>
260
261__BEGIN_DECLS
262uint32_t arc4random(void);
263void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
264 __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
265 __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
266 __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
267 __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
268void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
269void arc4random_stir(void);
270uint32_t
271 arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
272#ifdef __BLOCKS__
273int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
274
275#ifdef __BLOCKS__
276#if __has_attribute(noescape)
277#define __bsearch_noescape __attribute__((__noescape__))
278#else
279#define __bsearch_noescape
280#endif
281#endif /* __BLOCKS__ */
282void *bsearch_b(const void *__key, const void *__base, size_t __nel,
283 size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __bsearch_noescape)
284 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
285#endif /* __BLOCKS__ */
286
287 /* getcap(3) functions */
288char *cgetcap(char *, const char *, int);
289int cgetclose(void);
290int cgetent(char **, char **, const char *);
291int cgetfirst(char **, char **);
292int cgetmatch(const char *, const char *);
293int cgetnext(char **, char **);
294int cgetnum(char *, const char *, long *);
295int cgetset(const char *);
296int cgetstr(char *, const char *, char **);
297int cgetustr(char *, const char *, char **);
298
299int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
300char *devname(dev_t, mode_t);
301char *devname_r(dev_t, mode_t, char *buf, int len);
302char *getbsize(int *, long *);
303int getloadavg(double [], int);
304const char
305 *getprogname(void);
306void setprogname(const char *);
307
308#ifdef __BLOCKS__
309#if __has_attribute(noescape)
310#define __sort_noescape __attribute__((__noescape__))
311#else
312#define __sort_noescape
313#endif
314#endif /* __BLOCKS__ */
315
316int heapsort(void *__base, size_t __nel, size_t __width,
317 int (* _Nonnull __compar)(const void *, const void *));
318#ifdef __BLOCKS__
319int heapsort_b(void *__base, size_t __nel, size_t __width,
320 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
321 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
322#endif /* __BLOCKS__ */
323int mergesort(void *__base, size_t __nel, size_t __width,
324 int (* _Nonnull __compar)(const void *, const void *));
325#ifdef __BLOCKS__
326int mergesort_b(void *__base, size_t __nel, size_t __width,
327 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
328 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
329#endif /* __BLOCKS__ */
330void psort(void *__base, size_t __nel, size_t __width,
331 int (* _Nonnull __compar)(const void *, const void *))
332 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
333#ifdef __BLOCKS__
334void psort_b(void *__base, size_t __nel, size_t __width,
335 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
336 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
337#endif /* __BLOCKS__ */
338void psort_r(void *__base, size_t __nel, size_t __width, void *,
339 int (* _Nonnull __compar)(void *, const void *, const void *))
340 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
341#ifdef __BLOCKS__
342void qsort_b(void *__base, size_t __nel, size_t __width,
343 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
344 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
345#endif /* __BLOCKS__ */
346void qsort_r(void *__base, size_t __nel, size_t __width, void *,
347 int (* _Nonnull __compar)(void *, const void *, const void *));
348int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
349 unsigned __endbyte);
350int rpmatch(const char *)
351 __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
352int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
353 unsigned __endbyte);
354void sranddev(void);
355void srandomdev(void);
356void *reallocf(void *__ptr, size_t __size) __alloc_size(2);
357long long
358 strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
359 __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
360#if !__DARWIN_NO_LONG_LONG
361long long
362 strtoq(const char *__str, char **__endptr, int __base);
363unsigned long long
364 strtouq(const char *__str, char **__endptr, int __base);
365#endif /* !__DARWIN_NO_LONG_LONG */
366extern char *suboptarg; /* getsubopt(3) external variable */
367/* valloc is now declared in _malloc.h */
368__END_DECLS
369#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
370
371__BEGIN_DECLS
372/* Poison the following routines if -fshort-wchar is set */
373#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
374#pragma GCC poison mbstowcs mbtowc wcstombs wctomb
375#endif
376__END_DECLS
37759
378#ifdef _USE_EXTENDED_LOCALES_60#ifdef _USE_EXTENDED_LOCALES_
379#include <xlocale/_stdlib.h>61#include <xlocale/_stdlib.h>
380#endif /* _USE_EXTENDED_LOCALES_ */62#endif /* _USE_EXTENDED_LOCALES_ */
381
382#endif /* _STDLIB_H_ */
lib/libc/include/any-macos-any/string.h+2-137
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.2 * Copyright (c) 2000, 2007, 2010, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 *5 *
...@@ -55,143 +55,8 @@...@@ -55,143 +55,8 @@
55 * @(#)string.h 8.1 (Berkeley) 6/2/9355 * @(#)string.h 8.1 (Berkeley) 6/2/93
56 */56 */
5757
58#ifndef _STRING_H_58#include <_string.h>
59#define _STRING_H_
60
61#include <_types.h>
62#include <sys/cdefs.h>
63#include <Availability.h>
64#include <sys/_types/_size_t.h>
65#include <sys/_types/_null.h>
66
67/* ANSI-C */
68
69__BEGIN_DECLS
70void *memchr(const void *__s, int __c, size_t __n);
71int memcmp(const void *__s1, const void *__s2, size_t __n);
72void *memcpy(void *__dst, const void *__src, size_t __n);
73void *memmove(void *__dst, const void *__src, size_t __len);
74void *memset(void *__b, int __c, size_t __len);
75char *strcat(char *__s1, const char *__s2);
76char *strchr(const char *__s, int __c);
77int strcmp(const char *__s1, const char *__s2);
78int strcoll(const char *__s1, const char *__s2);
79char *strcpy(char *__dst, const char *__src);
80size_t strcspn(const char *__s, const char *__charset);
81char *strerror(int __errnum) __DARWIN_ALIAS(strerror);
82size_t strlen(const char *__s);
83char *strncat(char *__s1, const char *__s2, size_t __n);
84int strncmp(const char *__s1, const char *__s2, size_t __n);
85char *strncpy(char *__dst, const char *__src, size_t __n);
86char *strpbrk(const char *__s, const char *__charset);
87char *strrchr(const char *__s, int __c);
88size_t strspn(const char *__s, const char *__charset);
89char *strstr(const char *__big, const char *__little);
90char *strtok(char *__str, const char *__sep);
91size_t strxfrm(char *__s1, const char *__s2, size_t __n);
92__END_DECLS
93
94
95
96/* Additional functionality provided by:
97 * POSIX.1c-1995,
98 * POSIX.1i-1995,
99 * and the omnibus ISO/IEC 9945-1: 1996
100 */
101
102#if __DARWIN_C_LEVEL >= 199506L
103__BEGIN_DECLS
104char *strtok_r(char *__str, const char *__sep, char **__lasts);
105__END_DECLS
106#endif /* __DARWIN_C_LEVEL >= 199506L */
107
108
109
110/* Additional functionality provided by:
111 * POSIX.1-2001
112 */
113
114#if __DARWIN_C_LEVEL >= 200112L
115__BEGIN_DECLS
116int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen);
117char *strdup(const char *__s1);
118void *memccpy(void *__dst, const void *__src, int __c, size_t __n);
119__END_DECLS
120#endif /* __DARWIN_C_LEVEL >= 200112L */
121
122
123
124/* Additional functionality provided by:
125 * POSIX.1-2008
126 */
127
128#if __DARWIN_C_LEVEL >= 200809L
129__BEGIN_DECLS
130char *stpcpy(char *__dst, const char *__src);
131char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
132char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
133size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
134char *strsignal(int __sig);
135__END_DECLS
136#endif /* __DARWIN_C_LEVEL >= 200809L */
137
138/* C11 Annex K */
139
140#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
141#include <sys/_types/_rsize_t.h>
142#include <sys/_types/_errno_t.h>
143
144__BEGIN_DECLS
145errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
146__END_DECLS
147#endif
148
149/* Darwin extensions */
150
151#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
152#include <sys/_types/_ssize_t.h>
153
154__BEGIN_DECLS
155void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
156void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
157void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
158void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
159
160char *strcasestr(const char *__big, const char *__little);
161char *strnstr(const char *__big, const char *__little, size_t __len);
162size_t strlcat(char *__dst, const char *__source, size_t __size);
163size_t strlcpy(char *__dst, const char *__source, size_t __size);
164void strmode(int __mode, char *__bp);
165char *strsep(char **__stringp, const char *__delim);
166
167/* SUS places swab() in unistd.h. It is listed here for source compatibility */
168void swab(const void * __restrict, void * __restrict, ssize_t);
169
170__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1)
171__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1)
172int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len);
173
174__OSX_AVAILABLE(11.0) __IOS_AVAILABLE(14.0)
175__TVOS_AVAILABLE(14.0) __WATCHOS_AVAILABLE(7.0)
176int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen);
177__END_DECLS
178
179/* Some functions historically defined in string.h were placed in strings.h
180 * by SUS. We are using "strings.h" instead of <strings.h> to avoid an issue
181 * where /Developer/Headers/FlatCarbon/Strings.h could be included instead on
182 * case-insensitive file systems.
183 */
184#include "strings.h"
185#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
186
18759
188#ifdef _USE_EXTENDED_LOCALES_60#ifdef _USE_EXTENDED_LOCALES_
189#include <xlocale/_string.h>61#include <xlocale/_string.h>
190#endif /* _USE_EXTENDED_LOCALES_ */62#endif /* _USE_EXTENDED_LOCALES_ */
191
192#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
193/* Security checking functions. */
194#include <secure/_string.h>
195#endif
196
197#endif /* _STRING_H_ */
lib/libc/include/any-macos-any/strings.h+2-35
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.2 * Copyright (c) 2000, 2007, 2010, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 * 5 *
...@@ -58,44 +58,11 @@...@@ -58,44 +58,11 @@
58#ifndef _STRINGS_H_58#ifndef _STRINGS_H_
59#define _STRINGS_H_59#define _STRINGS_H_
6060
61#include <_types.h>61#include <_strings.h>
6262
63#include <sys/cdefs.h>
64#include <Availability.h>
65#include <sys/_types/_size_t.h>
66
67__BEGIN_DECLS
68/* Removed in Issue 7 */
69#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
70int bcmp(const void *, const void *, size_t) __POSIX_C_DEPRECATED(200112L);
71void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
72void bzero(void *, size_t) __POSIX_C_DEPRECATED(200112L);
73char *index(const char *, int) __POSIX_C_DEPRECATED(200112L);
74char *rindex(const char *, int) __POSIX_C_DEPRECATED(200112L);
75#endif
76
77int ffs(int);
78int strcasecmp(const char *, const char *);
79int strncasecmp(const char *, const char *, size_t);
80__END_DECLS
81
82/* Darwin extensions */
83#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL63#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
84__BEGIN_DECLS
85int ffsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
86int ffsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
87int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
88int flsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
89int flsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
90__END_DECLS
91
92#include <string.h>64#include <string.h>
93#endif65#endif
9466
95#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
96/* Security checking functions. */
97#include <secure/_strings.h>
98#endif
99
100#endif /* _STRINGS_H_ */67#endif /* _STRINGS_H_ */
10168
lib/libc/include/any-macos-any/sys/__endian.h created+108
...@@ -0,0 +1,108 @@
1/*
2 * Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*
30 * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
31 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
32 *
33 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
34 *
35 * This file contains Original Code and/or Modifications of Original Code
36 * as defined in and that are subject to the Apple Public Source License
37 * Version 2.0 (the 'License'). You may not use this file except in
38 * compliance with the License. The rights granted to you under the License
39 * may not be used to create, or enable the creation or redistribution of,
40 * unlawful or unlicensed copies of an Apple operating system, or to
41 * circumvent, violate, or enable the circumvention or violation of, any
42 * terms of an Apple operating system software license agreement.
43 *
44 * Please obtain a copy of the License at
45 * http://www.opensource.apple.com/apsl/ and read it before using this file.
46 *
47 * The Original Code and all software distributed under the License are
48 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
49 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
50 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
51 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
52 * Please see the License for the specific language governing rights and
53 * limitations under the License.
54 *
55 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
56 */
57/*
58 * Copyright (c) 1987, 1991, 1993
59 * The Regents of the University of California. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 * 1. Redistributions of source code must retain the above copyright
65 * notice, this list of conditions and the following disclaimer.
66 * 2. Redistributions in binary form must reproduce the above copyright
67 * notice, this list of conditions and the following disclaimer in the
68 * documentation and/or other materials provided with the distribution.
69 * 3. All advertising materials mentioning features or use of this software
70 * must display the following acknowledgement:
71 * This product includes software developed by the University of
72 * California, Berkeley and its contributors.
73 * 4. Neither the name of the University nor the names of its contributors
74 * may be used to endorse or promote products derived from this software
75 * without specific prior written permission.
76 *
77 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
78 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
79 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
81 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
83 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
85 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87 * SUCH DAMAGE.
88 */
89
90#ifndef _SYS___ENDIAN_H_
91#define _SYS___ENDIAN_H_
92
93/*
94 * Definitions for byte order, according to byte significance from low
95 * address to high.
96 */
97#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
98#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
99#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
100
101#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
102
103#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
104#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
105#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
106
107#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
108#endif /* !_SYS___ENDIAN_H_ */
lib/libc/include/any-macos-any/sys/_endian.h+8-8
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -91,7 +91,7 @@...@@ -91,7 +91,7 @@
91#define _SYS__ENDIAN_H_91#define _SYS__ENDIAN_H_
9292
93#include <sys/cdefs.h>93#include <sys/cdefs.h>
94#include <machine/endian.h>94#include <machine/_endian.h>
9595
96/*96/*
97 * Macros for network/external number representation conversion.97 * Macros for network/external number representation conversion.
...@@ -118,12 +118,12 @@ __END_DECLS...@@ -118,12 +118,12 @@ __END_DECLS
118#define ntohll(x) ((__uint64_t)(x))118#define ntohll(x) ((__uint64_t)(x))
119#define htonll(x) ((__uint64_t)(x))119#define htonll(x) ((__uint64_t)(x))
120120
121#define NTOHL(x) (x)121#define NTOHL(x) (x) = (x)
122#define NTOHS(x) (x)122#define NTOHS(x) (x) = (x)
123#define NTOHLL(x) (x)123#define NTOHLL(x) (x) = (x)
124#define HTONL(x) (x)124#define HTONL(x) (x) = (x)
125#define HTONS(x) (x)125#define HTONS(x) (x) = (x)
126#define HTONLL(x) (x)126#define HTONLL(x) (x) = (x)
127#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */127#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
128128
129#else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */129#else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */
lib/libc/include/any-macos-any/sys/_symbol_aliasing.h+132
...@@ -413,6 +413,18 @@...@@ -413,6 +413,18 @@
413#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_6(x)413#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_6(x)
414#endif414#endif
415415
416#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 150700
417#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_7(x) x
418#else
419#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_7(x)
420#endif
421
422#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 150800
423#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_8(x) x
424#else
425#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_8(x)
426#endif
427
416#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160000428#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160000
417#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_0(x) x429#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_0(x) x
418#else430#else
...@@ -449,12 +461,66 @@...@@ -449,12 +461,66 @@
449#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_5(x)461#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_5(x)
450#endif462#endif
451463
464#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160600
465#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_6(x) x
466#else
467#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_6(x)
468#endif
469
470#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160700
471#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_7(x) x
472#else
473#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_7(x)
474#endif
475
452#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170000476#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170000
453#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_0(x) x477#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_0(x) x
454#else478#else
455#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_0(x)479#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_0(x)
456#endif480#endif
457481
482#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170100
483#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_1(x) x
484#else
485#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_1(x)
486#endif
487
488#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170200
489#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_2(x) x
490#else
491#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_2(x)
492#endif
493
494#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170300
495#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_3(x) x
496#else
497#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_3(x)
498#endif
499
500#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170400
501#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_4(x) x
502#else
503#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_4(x)
504#endif
505
506#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170500
507#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_5(x) x
508#else
509#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_5(x)
510#endif
511
512#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 180000
513#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_0(x) x
514#else
515#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_0(x)
516#endif
517
518#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 180100
519#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_1(x) x
520#else
521#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_18_1(x)
522#endif
523
458#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000524#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
459#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x525#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
460#else526#else
...@@ -731,6 +797,18 @@...@@ -731,6 +797,18 @@
731#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_5(x)797#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_5(x)
732#endif798#endif
733799
800#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 120600
801#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_6(x) x
802#else
803#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_6(x)
804#endif
805
806#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 120700
807#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_7(x) x
808#else
809#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_7(x)
810#endif
811
734#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130000812#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130000
735#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_0(x) x813#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_0(x) x
736#else814#else
...@@ -767,9 +845,63 @@...@@ -767,9 +845,63 @@
767#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_4(x)845#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_4(x)
768#endif846#endif
769847
848#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130500
849#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_5(x) x
850#else
851#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_5(x)
852#endif
853
854#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130600
855#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_6(x) x
856#else
857#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_6(x)
858#endif
859
770#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140000860#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140000
771#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_0(x) x861#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_0(x) x
772#else862#else
773#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_0(x)863#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_0(x)
774#endif864#endif
775865
866#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140100
867#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_1(x) x
868#else
869#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_1(x)
870#endif
871
872#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140200
873#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_2(x) x
874#else
875#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_2(x)
876#endif
877
878#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140300
879#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_3(x) x
880#else
881#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_3(x)
882#endif
883
884#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140400
885#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_4(x) x
886#else
887#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_4(x)
888#endif
889
890#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140500
891#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_5(x) x
892#else
893#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_5(x)
894#endif
895
896#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 150000
897#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_0(x) x
898#else
899#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_0(x)
900#endif
901
902#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 150100
903#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_1(x) x
904#else
905#define __DARWIN_ALIAS_STARTING_MAC___MAC_15_1(x)
906#endif
907
lib/libc/include/any-macos-any/sys/_types.h+16-2
...@@ -32,13 +32,25 @@...@@ -32,13 +32,25 @@
32#include <sys/cdefs.h>32#include <sys/cdefs.h>
33#include <machine/_types.h>33#include <machine/_types.h>
3434
35#if defined(__has_feature) && __has_feature(modules)
36#define USE_CLANG_TYPES 1
37#else
38#define USE_CLANG_TYPES 0
39#endif
40
41#if USE_CLANG_TYPES
42#include <sys/_types/_null.h>
43#endif
44
35/*45/*
36 * Type definitions; takes common type definitions that must be used46 * Type definitions; takes common type definitions that must be used
37 * in multiple header files due to [XSI], removes them from the system47 * in multiple header files due to [XSI], removes them from the system
38 * space, and puts them in the implementation space.48 * space, and puts them in the implementation space.
39 */49 */
4050
41#ifdef __cplusplus51#if USE_CLANG_TYPES
52#define __DARWIN_NULL NULL
53#elif defined(__cplusplus)
42#ifdef __GNUG__54#ifdef __GNUG__
43#define __DARWIN_NULL __null55#define __DARWIN_NULL __null
44#else /* ! __GNUG__ */56#else /* ! __GNUG__ */
...@@ -50,7 +62,7 @@...@@ -50,7 +62,7 @@
50#endif /* __GNUG__ */62#endif /* __GNUG__ */
51#else /* ! __cplusplus */63#else /* ! __cplusplus */
52#define __DARWIN_NULL ((void *)0)64#define __DARWIN_NULL ((void *)0)
53#endif /* __cplusplus */65#endif
5466
55typedef __int64_t __darwin_blkcnt_t; /* total blocks */67typedef __int64_t __darwin_blkcnt_t; /* total blocks */
56typedef __int32_t __darwin_blksize_t; /* preferred block size */68typedef __int32_t __darwin_blksize_t; /* preferred block size */
...@@ -77,6 +89,8 @@ typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */...@@ -77,6 +89,8 @@ typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
77typedef unsigned char __darwin_uuid_t[16];89typedef unsigned char __darwin_uuid_t[16];
78typedef char __darwin_uuid_string_t[37];90typedef char __darwin_uuid_string_t[37];
7991
92#undef USE_CLANG_TYPES
93
80#include <sys/_pthread/_pthread_types.h>94#include <sys/_pthread/_pthread_types.h>
8195
82#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3)96#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3)
lib/libc/include/any-macos-any/sys/_types/_caddr_t.h+1
...@@ -29,3 +29,4 @@...@@ -29,3 +29,4 @@
29#define _CADDR_T29#define _CADDR_T
30typedef char * caddr_t;30typedef char * caddr_t;
31#endif /* _CADDR_T */31#endif /* _CADDR_T */
32
lib/libc/include/any-macos-any/sys/_types/_fd_clr.h+1
...@@ -26,5 +26,6 @@...@@ -26,5 +26,6 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#ifndef FD_CLR28#ifndef FD_CLR
29#include <sys/_types/_fd_def.h>
29#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p)30#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p)
30#endif /* FD_CLR */31#endif /* FD_CLR */
lib/libc/include/any-macos-any/sys/_types/_fd_copy.h+1
...@@ -26,5 +26,6 @@...@@ -26,5 +26,6 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#ifndef FD_COPY28#ifndef FD_COPY
29#include <sys/_types/_fd_def.h>
29#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t)30#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t)
30#endif /* FD_COPY */31#endif /* FD_COPY */
lib/libc/include/any-macos-any/sys/_types/_fd_isset.h+1
...@@ -26,5 +26,6 @@...@@ -26,5 +26,6 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#ifndef FD_ISSET28#ifndef FD_ISSET
29#include <sys/_types/_fd_def.h>
29#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p)30#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p)
30#endif /* FD_ISSET */31#endif /* FD_ISSET */
lib/libc/include/any-macos-any/sys/_types/_fd_set.h+1
...@@ -26,5 +26,6 @@...@@ -26,5 +26,6 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#ifndef FD_SET28#ifndef FD_SET
29#include <sys/_types/_fd_def.h>
29#define FD_SET(n, p) __DARWIN_FD_SET(n, p)30#define FD_SET(n, p) __DARWIN_FD_SET(n, p)
30#endif /* FD_SET */31#endif /* FD_SET */
lib/libc/include/any-macos-any/sys/_types/_fd_setsize.h+1
...@@ -26,5 +26,6 @@...@@ -26,5 +26,6 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#ifndef FD_SETSIZE28#ifndef FD_SETSIZE
29#include <sys/_types/_fd_def.h>
29#define FD_SETSIZE __DARWIN_FD_SETSIZE30#define FD_SETSIZE __DARWIN_FD_SETSIZE
30#endif /* FD_SETSIZE */31#endif /* FD_SETSIZE */
lib/libc/include/any-macos-any/sys/_types/_fd_zero.h+1
...@@ -26,5 +26,6 @@...@@ -26,5 +26,6 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#ifndef FD_ZERO28#ifndef FD_ZERO
29#include <sys/_types/_fd_def.h>
29#define FD_ZERO(p) __DARWIN_FD_ZERO(p)30#define FD_ZERO(p) __DARWIN_FD_ZERO(p)
30#endif /* FD_ZERO */31#endif /* FD_ZERO */
lib/libc/include/any-macos-any/sys/_types/_intptr_t.h+1-1
...@@ -27,7 +27,7 @@...@@ -27,7 +27,7 @@
27 */27 */
28#ifndef _INTPTR_T28#ifndef _INTPTR_T
29#define _INTPTR_T29#define _INTPTR_T
30#include <machine/types.h> /* __darwin_intptr_t */30#include <machine/_types.h> /* __darwin_intptr_t */
3131
32typedef __darwin_intptr_t intptr_t;32typedef __darwin_intptr_t intptr_t;
33#endif /* _INTPTR_T */33#endif /* _INTPTR_T */
lib/libc/include/any-macos-any/sys/_types/_null.h+23
...@@ -25,7 +25,30 @@...@@ -25,7 +25,30 @@
25 *25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#if defined(__has_feature) && __has_feature(modules)
29#define USE_CLANG_STDDEF 1
30#else
31#define USE_CLANG_STDDEF 0
32#endif
33
34#if USE_CLANG_STDDEF
35
36#ifndef __NULL
37#define __NULL
38
39#define __need_NULL
40#include <stddef.h>
41#undef __need_NULL
42
43#endif /* __NULL */
44
45#else
46
28#ifndef NULL47#ifndef NULL
29#include <sys/_types.h> /* __DARWIN_NULL */48#include <sys/_types.h> /* __DARWIN_NULL */
30#define NULL __DARWIN_NULL49#define NULL __DARWIN_NULL
31#endif /* NULL */50#endif /* NULL */
51
52#endif
53
54#undef USE_CLANG_STDDEF
lib/libc/include/any-macos-any/sys/_types/_offsetof.h+23
...@@ -25,6 +25,29 @@...@@ -25,6 +25,29 @@
25 *25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#if defined(__has_feature) && __has_feature(modules)
29#define USE_CLANG_STDDEF 1
30#else
31#define USE_CLANG_STDDEF 0
32#endif
33
34#if USE_CLANG_STDDEF
35
36#ifndef __OFFSETOF
37#define __OFFSETOF
38
39#define __need_offsetof
40#include <stddef.h>
41#undef __need_offsetof
42
43#endif /* __OFFSETOF */
44
45#else
46
28#ifndef offsetof47#ifndef offsetof
29#define offsetof(type, field) __offsetof(type, field)48#define offsetof(type, field) __offsetof(type, field)
30#endif /* offsetof */49#endif /* offsetof */
50
51#endif
52
53#undef USE_CLANG_STDDEF
lib/libc/include/any-macos-any/sys/_types/_ptrdiff_t.h+23
...@@ -26,8 +26,31 @@...@@ -26,8 +26,31 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
2828
29#if defined(__has_feature) && __has_feature(modules)
30#define USE_CLANG_STDDEF 1
31#else
32#define USE_CLANG_STDDEF 0
33#endif
34
35#if USE_CLANG_STDDEF
36
37#ifndef __PTRDIFF_T
38#define __PTRDIFF_T
39
40#define __need_ptrdiff_t
41#include <stddef.h>
42#undef __need_ptrdiff_t
43
44#endif /* __PTRDIFF_T */
45
46#else
47
29#ifndef _PTRDIFF_T48#ifndef _PTRDIFF_T
30#define _PTRDIFF_T49#define _PTRDIFF_T
31#include <machine/types.h> /* __darwin_ptrdiff_t */50#include <machine/types.h> /* __darwin_ptrdiff_t */
32typedef __darwin_ptrdiff_t ptrdiff_t;51typedef __darwin_ptrdiff_t ptrdiff_t;
33#endif /* _PTRDIFF_T */52#endif /* _PTRDIFF_T */
53
54#endif
55
56#undef USE_CLANG_STDDEF
lib/libc/include/any-macos-any/sys/_types/_rsize_t.h+23
...@@ -25,8 +25,31 @@...@@ -25,8 +25,31 @@
25 *25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#if defined(__has_feature) && __has_feature(modules)
29#define USE_CLANG_STDDEF 1
30#else
31#define USE_CLANG_STDDEF 0
32#endif
33
34#if USE_CLANG_STDDEF
35
36#ifndef __RSIZE_T
37#define __RSIZE_T
38
39#define __need_rsize_t
40#include <stddef.h>
41#undef __need_rsize_t
42
43#endif /* __RSIZE_T */
44
45#else
46
28#ifndef _RSIZE_T47#ifndef _RSIZE_T
29#define _RSIZE_T48#define _RSIZE_T
30#include <machine/types.h> /* __darwin_size_t */49#include <machine/types.h> /* __darwin_size_t */
31typedef __darwin_size_t rsize_t;50typedef __darwin_size_t rsize_t;
32#endif /* _RSIZE_T */51#endif /* _RSIZE_T */
52
53#endif
54
55#undef USE_CLANG_STDDEF
lib/libc/include/any-macos-any/sys/_types/_size_t.h+24
...@@ -25,8 +25,32 @@...@@ -25,8 +25,32 @@
25 *25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
28#if defined(__has_feature) && __has_feature(modules)
29#define USE_CLANG_STDDEF 1
30#else
31#define USE_CLANG_STDDEF 0
32#endif
33
34#if USE_CLANG_STDDEF
35
36#ifndef __SIZE_T
37#define __SIZE_T
38
39#define __need_size_t
40#include <stddef.h>
41#undef __need_size_t
42
43#endif /* __SIZE_T */
44
45#else
46
28#ifndef _SIZE_T47#ifndef _SIZE_T
29#define _SIZE_T48#define _SIZE_T
30#include <machine/_types.h> /* __darwin_size_t */49#include <machine/_types.h> /* __darwin_size_t */
31typedef __darwin_size_t size_t;50typedef __darwin_size_t size_t;
32#endif /* _SIZE_T */51#endif /* _SIZE_T */
52
53#endif
54
55
56#undef USE_CLANG_STDDEF
lib/libc/include/any-macos-any/sys/_types/_va_list.h+16
...@@ -28,6 +28,22 @@...@@ -28,6 +28,22 @@
2828
29#ifndef _VA_LIST_T29#ifndef _VA_LIST_T
30#define _VA_LIST_T30#define _VA_LIST_T
31
32#if defined(__has_feature) && __has_feature(modules)
33#define USE_CLANG_STDARG 1
34#else
35#define USE_CLANG_STDARG 0
36#endif
37
38#if USE_CLANG_STDARG
39#define __need_va_list
40#include <stdarg.h>
41#undef __need_va_list
42#else
31#include <machine/types.h> /* __darwin_va_list */43#include <machine/types.h> /* __darwin_va_list */
32typedef __darwin_va_list va_list;44typedef __darwin_va_list va_list;
45#endif
46
47#undef USE_CLANG_STDARG
48
33#endif /* _VA_LIST_T */49#endif /* _VA_LIST_T */
lib/libc/include/any-macos-any/sys/_types/_wchar_t.h+23
...@@ -26,6 +26,25 @@...@@ -26,6 +26,25 @@
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */27 */
2828
29#if defined(__has_feature) && __has_feature(modules)
30#define USE_CLANG_STDDEF 1
31#else
32#define USE_CLANG_STDDEF 0
33#endif
34
35#if USE_CLANG_STDDEF
36
37#ifndef __WCHAR_T
38#define __WCHAR_T
39
40#define __need_wchar_t
41#include <stddef.h>
42#undef __need_wchar_t
43
44#endif /* __WCHAR_T */
45
46#else
47
29/* wchar_t is a built-in type in C++ */48/* wchar_t is a built-in type in C++ */
30#ifndef __cplusplus49#ifndef __cplusplus
31#ifndef _WCHAR_T50#ifndef _WCHAR_T
...@@ -34,3 +53,7 @@...@@ -34,3 +53,7 @@
34typedef __darwin_wchar_t wchar_t;53typedef __darwin_wchar_t wchar_t;
35#endif /* _WCHAR_T */54#endif /* _WCHAR_T */
36#endif /* __cplusplus */55#endif /* __cplusplus */
56
57#endif
58
59#undef USE_CLANG_STDDEF
lib/libc/include/any-macos-any/sys/attr.h+19-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 2000-2018, 2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -249,6 +249,12 @@ typedef struct vol_capabilities_attr {...@@ -249,6 +249,12 @@ typedef struct vol_capabilities_attr {
249 * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed.249 * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed.
250 * Any modifications to volume data or metadata will be detected and may250 * Any modifications to volume data or metadata will be detected and may
251 * render the volume unusable.251 * render the volume unusable.
252 *
253 * VOL_CAP_FMT_CLONE_MAPPING: When set, this volume supports full clone tracking.
254 * See ATTR_CMNEXT_CLONE_REFCNT and ATTR_CMNEXT_CLONEID for more details.
255 * Other features like extended directory statistics, for fast directory sizing,
256 * and attribution tags may be supported as well.
257 * See VOL_CAP_INT_ATTRIBUTION_TAG for more details related to tagging.
252 */258 */
253#define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001259#define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
254#define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002260#define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
...@@ -276,6 +282,7 @@ typedef struct vol_capabilities_attr {...@@ -276,6 +282,7 @@ typedef struct vol_capabilities_attr {
276#define VOL_CAP_FMT_SHARED_SPACE 0x00800000282#define VOL_CAP_FMT_SHARED_SPACE 0x00800000
277#define VOL_CAP_FMT_VOL_GROUPS 0x01000000283#define VOL_CAP_FMT_VOL_GROUPS 0x01000000
278#define VOL_CAP_FMT_SEALED 0x02000000284#define VOL_CAP_FMT_SEALED 0x02000000
285#define VOL_CAP_FMT_CLONE_MAPPING 0x04000000
279286
280/*287/*
281 * VOL_CAP_INT_SEARCHFS: When set, the volume implements the288 * VOL_CAP_INT_SEARCHFS: When set, the volume implements the
...@@ -349,6 +356,13 @@ typedef struct vol_capabilities_attr {...@@ -349,6 +356,13 @@ typedef struct vol_capabilities_attr {
349 *356 *
350 * VOL_CAP_INT_RENAME_SECLUDE: When set, the volume supports a357 * VOL_CAP_INT_RENAME_SECLUDE: When set, the volume supports a
351 * seclude rename operation.358 * seclude rename operation.
359 *
360 * VOL_CAP_INT_ATTRIBUTION_TAG: When set, the volume supports establishing
361 * an owner relationship between a file (excluding small files) and a process
362 * on the first read/write/truncate/clone operation.
363 *
364 * VOL_CAP_INT_PUNCHHOLE: When set, the volume supports the F_PUNCHHOLE
365 * fcntl.
352 */366 */
353#define VOL_CAP_INT_SEARCHFS 0x00000001367#define VOL_CAP_INT_SEARCHFS 0x00000001
354#define VOL_CAP_INT_ATTRLIST 0x00000002368#define VOL_CAP_INT_ATTRLIST 0x00000002
...@@ -371,6 +385,8 @@ typedef struct vol_capabilities_attr {...@@ -371,6 +385,8 @@ typedef struct vol_capabilities_attr {
371#define VOL_CAP_INT_RENAME_EXCL 0x00080000385#define VOL_CAP_INT_RENAME_EXCL 0x00080000
372#define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000386#define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000
373#define VOL_CAP_INT_RENAME_SECLUDE 0x00200000387#define VOL_CAP_INT_RENAME_SECLUDE 0x00200000
388#define VOL_CAP_INT_ATTRIBUTION_TAG 0x00400000
389#define VOL_CAP_INT_PUNCHHOLE 0x00800000
374390
375typedef struct vol_attributes_attr {391typedef struct vol_attributes_attr {
376 attribute_set_t validattr;392 attribute_set_t validattr;
...@@ -597,4 +613,6 @@ struct searchstate {...@@ -597,4 +613,6 @@ struct searchstate {
597#define FST_EOF (-1) /* end-of-file offset */613#define FST_EOF (-1) /* end-of-file offset */
598614
599#endif /* __APPLE_API_UNSTABLE */615#endif /* __APPLE_API_UNSTABLE */
616
617
600#endif /* !_SYS_ATTR_H_ */618#endif /* !_SYS_ATTR_H_ */
lib/libc/include/any-macos-any/sys/cdefs.h+130
...@@ -97,6 +97,9 @@...@@ -97,6 +97,9 @@
97#ifndef __has_attribute97#ifndef __has_attribute
98#define __has_attribute(x) 098#define __has_attribute(x) 0
99#endif99#endif
100#ifndef __has_cpp_attribute
101#define __has_cpp_attribute(x) 0
102#endif
100#ifndef __has_extension103#ifndef __has_extension
101#define __has_extension(x) 0104#define __has_extension(x) 0
102#endif105#endif
...@@ -322,6 +325,19 @@...@@ -322,6 +325,19 @@
322#define __swift_unavailable(_msg)325#define __swift_unavailable(_msg)
323#endif326#endif
324327
328/*
329 * Attributes to support Swift concurrency.
330 */
331#if __has_attribute(__swift_attr__)
332#define __swift_unavailable_from_async(_msg) __attribute__((__swift_attr__("@_unavailableFromAsync(message: \"" _msg "\")")))
333#define __swift_nonisolated __attribute__((__swift_attr__("nonisolated")))
334#define __swift_nonisolated_unsafe __attribute__((__swift_attr__("nonisolated(unsafe)")))
335#else
336#define __swift_unavailable_from_async(_msg)
337#define __swift_nonisolated
338#define __swift_nonisolated_unsafe
339#endif
340
325/*341/*
326 * __abortlike is the attribute to put on functions like abort() that are342 * __abortlike is the attribute to put on functions like abort() that are
327 * typically used to mark assertions. These optimize the codegen343 * typically used to mark assertions. These optimize the codegen
...@@ -478,6 +494,94 @@...@@ -478,6 +494,94 @@
478#endif494#endif
479#endif // __alloc_size495#endif // __alloc_size
480496
497/*
498 * Facilities below assist adoption of -Wunsafe-buffer-usage, an off-by-default
499 * Clang compiler warning that helps the developer minimize unsafe, raw
500 * buffer manipulation in the code that may lead to buffer overflow
501 * vulnerabilities.
502 *
503 * They are primarily designed for modern C++ code where -Wunsafe-buffer-usage
504 * comes with automatic fix-it hints that help the developer transform
505 * their code to use modern C++ containers, which may be made bounds-safe by
506 * linking against a version of the C++ standard library that offers
507 * bounds-checked containers.
508 * They can be used in plain C, but -fbounds-safety is the preferred solution
509 * for plain C (see also <ptrcheck.h>).
510 *
511 * Attribute __unsafe_buffer_usage can be used to label functions that should be
512 * avoided as they may perform or otherwise introduce unsafe buffer
513 * manipulation operations.
514 *
515 * Calls to such functions are flagged by -Wunsafe-buffer-usage, similarly to
516 * how unchecked buffer manipulation operations are flagged when observed
517 * by the compiler directly:
518 *
519 * // An unsafe function that needs to be avoided.
520 * __unsafe_buffer_usage
521 * void foo(int *buf, size_t size);
522 *
523 * // A safe alternative to foo().
524 * void foo(std::span<int> buf);
525 *
526 * void bar(size_t idx) {
527 * int array[5];
528 *
529 * // Direct unsafe buffer manipulation through subscript operator:
530 * array[idx] = 3; // warning [-Wunsafe-buffer-usage]
531 * // Unsafe buffer manipulation through function foo():
532 * foo(array, 5); // warning [-Wunsafe-buffer-usage]
533 * // Checked buffer manipulation, with bounds information automatically
534 * // preserved for the purposes of runtime checks in standard library:
535 * foo(array); // no warning
536 * }
537 *
538 * While annotating a function as __unsafe_buffer_usage has an effect similar
539 * to annotating it as __deprecated, the __unsafe_buffer_usage attribute
540 * should be used whenever the resulting warning needs to be controlled
541 * by the -Wunsafe-buffer-usage flag (which is turned off in codebases that
542 * don't attempt to achieve bounds safety this way) as opposed to -Wdeprecated
543 * (enabled in most codebases).
544 *
545 * The attribute does NOT suppress -Wunsafe-buffer-usage warnings inside
546 * the function's body; it simply introduces new warnings at each call site
547 * to help the developers avoid the function entirely. Most of the time
548 * it does not make sense to annotate a function as __unsafe_buffer_usage
549 * without providing the users with a safe alternative.
550 *
551 * Pragmas __unsafe_buffer_usage_begin and __unsafe_buffer_usage_end
552 * annotate a range of code as intentionally containing unsafe buffer
553 * operations. They suppress -Wunsafe-buffer-usage warnings
554 * for unsafe operations in range:
555 *
556 * __unsafe_buffer_usage_begin
557 * array[idx] = 3; // warning suppressed
558 * foo(array, 5); // warning suppressed
559 * __unsafe_buffer_usage_end
560 *
561 * These pragmas are NOT a way to mass-annotate functions with the attribute
562 * __unsafe_buffer_usage. Functions declared within the pragma range
563 * do NOT get annotated automatically. In some rare situations it makes sense
564 * to do all three: put the attribute on the function, put pragmas inside
565 * the body of the function, and put pragmas around some call sites.
566 */
567#if __has_cpp_attribute(clang::unsafe_buffer_usage)
568#define __has_safe_buffers 1
569#define __unsafe_buffer_usage [[clang::unsafe_buffer_usage]]
570#elif __has_attribute(unsafe_buffer_usage)
571#define __has_safe_buffers 1
572#define __unsafe_buffer_usage __attribute__((__unsafe_buffer_usage__))
573#else
574#define __has_safe_buffers 0
575#define __unsafe_buffer_usage
576#endif
577#if __has_safe_buffers
578#define __unsafe_buffer_usage_begin _Pragma("clang unsafe_buffer_usage begin")
579#define __unsafe_buffer_usage_end _Pragma("clang unsafe_buffer_usage end")
580#else
581#define __unsafe_buffer_usage_begin
582#define __unsafe_buffer_usage_end
583#endif
584
481/*585/*
482 * COMPILATION ENVIRONMENTS -- see compat(5) for additional detail586 * COMPILATION ENVIRONMENTS -- see compat(5) for additional detail
483 *587 *
...@@ -870,7 +974,9 @@...@@ -870,7 +974,9 @@
870#define __single974#define __single
871#define __unsafe_indexable975#define __unsafe_indexable
872#define __counted_by(N)976#define __counted_by(N)
977#define __counted_by_or_null(N)
873#define __sized_by(N)978#define __sized_by(N)
979#define __sized_by_or_null(N)
874#define __ended_by(E)980#define __ended_by(E)
875#define __terminated_by(T)981#define __terminated_by(T)
876#define __null_terminated982#define __null_terminated
...@@ -888,6 +994,8 @@...@@ -888,6 +994,8 @@
888/* __unsafe_forge intrinsics are defined as regular C casts. */994/* __unsafe_forge intrinsics are defined as regular C casts. */
889#define __unsafe_forge_bidi_indexable(T, P, S) ((T)(P))995#define __unsafe_forge_bidi_indexable(T, P, S) ((T)(P))
890#define __unsafe_forge_single(T, P) ((T)(P))996#define __unsafe_forge_single(T, P) ((T)(P))
997#define __unsafe_forge_terminated_by(T, P, E) ((T)(P))
998#define __unsafe_forge_null_terminated(T, P) ((T)(P))
891#define __terminated_by_to_indexable(P) (P)999#define __terminated_by_to_indexable(P) (P)
892#define __unsafe_terminated_by_to_indexable(P) (P)1000#define __unsafe_terminated_by_to_indexable(P) (P)
893#define __null_terminated_to_indexable(P) (P)1001#define __null_terminated_to_indexable(P) (P)
...@@ -900,6 +1008,10 @@...@@ -900,6 +1008,10 @@
9001008
901/* this is a write-once variable; not useful without pointer checks. */1009/* this is a write-once variable; not useful without pointer checks. */
902#define __unsafe_late_const1010#define __unsafe_late_const
1011
1012#define __ptrcheck_unavailable
1013#define __ptrcheck_unavailable_r(REPLACEMENT)
1014
903#endif /* !__has_include(<ptrcheck.h>) */1015#endif /* !__has_include(<ptrcheck.h>) */
9041016
9051017
...@@ -978,4 +1090,22 @@...@@ -978,4 +1090,22 @@
9781090
9791091
9801092
1093#if defined(KERNEL_PRIVATE) && \
1094 __has_attribute(xnu_data_size) && \
1095 __has_attribute(xnu_returns_data_pointer)
1096/*
1097 * Annotate function parameters to specify that they semantically
1098 * represent the size of a data-only backing storage.
1099 */
1100# define __xnu_data_size __attribute__((xnu_data_size))
1101/*
1102 * Annotate function declarations to specify that the pointer they return
1103 * points to a data-only backing storage.
1104 */
1105# define __xnu_returns_data_pointer __attribute__((xnu_returns_data_pointer))
1106#else
1107# define __xnu_data_size
1108# define __xnu_returns_data_pointer
1109#endif
1110
981#endif /* !_CDEFS_H_ */1111#endif /* !_CDEFS_H_ */
lib/libc/include/any-macos-any/sys/clonefile.h+1
...@@ -33,6 +33,7 @@...@@ -33,6 +33,7 @@
33#define CLONE_NOFOLLOW 0x0001 /* Don't follow symbolic links */33#define CLONE_NOFOLLOW 0x0001 /* Don't follow symbolic links */
34#define CLONE_NOOWNERCOPY 0x0002 /* Don't copy ownership information from source */34#define CLONE_NOOWNERCOPY 0x0002 /* Don't copy ownership information from source */
35#define CLONE_ACL 0x0004 /* Copy access control lists from source */35#define CLONE_ACL 0x0004 /* Copy access control lists from source */
36#define CLONE_NOFOLLOW_ANY 0x0008 /* Don't follow any symbolic links in the path */
3637
3738
38#include <sys/cdefs.h>39#include <sys/cdefs.h>
lib/libc/include/any-macos-any/sys/constrained_ctypes.h-15
...@@ -375,21 +375,6 @@...@@ -375,21 +375,6 @@
375 * };375 * };
376 *376 *
377 *377 *
378 * 3.4. Variable-size structures
379 *
380 * Constrained pointer instrumentation depends on knowing the size of the
381 * structures. If the structure contains a variable array, the array needs
382 * to be annotated by `__sized_by' or `__counted_by' attribute:
383 *
384 * Example:
385 *
386 * struct sockaddr {
387 * __uint8_t sa_len;
388 * sa_family_t sa_family;
389 * char sa_data[__counted_by(sa_len - 2)];
390 * };
391 *
392 *
393 * 4. ABI Compatibility Considerations378 * 4. ABI Compatibility Considerations
394 *379 *
395 * The pointer instrumentation process has ABI implications.380 * The pointer instrumentation process has ABI implications.
lib/libc/include/any-macos-any/sys/dirent.h+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.2 * Copyright (c) 2000-2008, 2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
lib/libc/include/any-macos-any/sys/event.h+1-1
...@@ -78,7 +78,7 @@...@@ -78,7 +78,7 @@
78#define EVFILT_VM (-12) /* Virtual memory events */78#define EVFILT_VM (-12) /* Virtual memory events */
79#define EVFILT_EXCEPT (-15) /* Exception events */79#define EVFILT_EXCEPT (-15) /* Exception events */
8080
81#define EVFILT_SYSCOUNT 1781#define EVFILT_SYSCOUNT 18
82#define EVFILT_THREADMARKER EVFILT_SYSCOUNT /* Internal use only */82#define EVFILT_THREADMARKER EVFILT_SYSCOUNT /* Internal use only */
8383
84#pragma pack(4)84#pragma pack(4)
lib/libc/include/any-macos-any/sys/fcntl.h+2
...@@ -338,6 +338,8 @@...@@ -338,6 +338,8 @@
338338
339#define F_ATTRIBUTION_TAG 111 /* Based on flags, query/set/delete a file's attribution tag */339#define F_ATTRIBUTION_TAG 111 /* Based on flags, query/set/delete a file's attribution tag */
340340
341#define F_ADDSIGS_MAIN_BINARY 113 /* add detached signatures for main binary -- development only */
342
341// FS-specific fcntl()'s numbers begin at 0x00010000 and go up343// FS-specific fcntl()'s numbers begin at 0x00010000 and go up
342#define FCNTL_FS_SPECIFIC_BASE 0x00010000344#define FCNTL_FS_SPECIFIC_BASE 0x00010000
343345
lib/libc/include/any-macos-any/sys/mman.h+1
...@@ -211,6 +211,7 @@...@@ -211,6 +211,7 @@
211#define MADV_FREE_REUSE 8 /* caller wants to reuse those pages */211#define MADV_FREE_REUSE 8 /* caller wants to reuse those pages */
212#define MADV_CAN_REUSE 9212#define MADV_CAN_REUSE 9
213#define MADV_PAGEOUT 10 /* page out now (internal only) */213#define MADV_PAGEOUT 10 /* page out now (internal only) */
214#define MADV_ZERO 11 /* zero pages without faulting in additional pages */
214215
215/*216/*
216 * Return bits from mincore217 * Return bits from mincore
lib/libc/include/any-macos-any/sys/mount.h+8-5
...@@ -383,7 +383,8 @@ struct netfs_status {...@@ -383,7 +383,8 @@ struct netfs_status {
383#define VQ_NEARLOWDISK 0x2000 /* Above lowdisk and below desired disk space */383#define VQ_NEARLOWDISK 0x2000 /* Above lowdisk and below desired disk space */
384#define VQ_DESIRED_DISK 0x4000 /* the desired disk space */384#define VQ_DESIRED_DISK 0x4000 /* the desired disk space */
385#define VQ_FREE_SPACE_CHANGE 0x8000 /* free disk space has significantly changed */385#define VQ_FREE_SPACE_CHANGE 0x8000 /* free disk space has significantly changed */
386#define VQ_FLAG10000 0x10000 /* placeholder */386#define VQ_PURGEABLE_SPACE_CHANGE 0x10000 /* purgeable disk space has significantly changed */
387#define VQ_FLAG20000 0x20000 /* placeholder */
387388
388389
389390
...@@ -407,7 +408,7 @@ typedef struct fhandle fhandle_t;...@@ -407,7 +408,7 @@ typedef struct fhandle fhandle_t;
407 * cryptexes. We need to make sure we do not use the reserved values in each for a new authentication type.408 * cryptexes. We need to make sure we do not use the reserved values in each for a new authentication type.
408 */409 */
409// bump up the version for any change that has kext dependency410// bump up the version for any change that has kext dependency
410#define CRYPTEX_AUTH_STRUCT_VERSION 1411#define CRYPTEX_AUTH_STRUCT_VERSION 2
411OS_ENUM(graftdmg_type, uint32_t,412OS_ENUM(graftdmg_type, uint32_t,
412 GRAFTDMG_CRYPTEX_BOOT = 1,413 GRAFTDMG_CRYPTEX_BOOT = 1,
413 GRAFTDMG_CRYPTEX_PREBOOT = 2,414 GRAFTDMG_CRYPTEX_PREBOOT = 2,
...@@ -416,8 +417,9 @@ OS_ENUM(graftdmg_type, uint32_t,...@@ -416,8 +417,9 @@ OS_ENUM(graftdmg_type, uint32_t,
416 // Reserved: CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5,417 // Reserved: CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5,
417 GRAFTDMG_CRYPTEX_PDI_NONCE = 6,418 GRAFTDMG_CRYPTEX_PDI_NONCE = 6,
418 GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,419 GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,
420 GRAFTDMG_CRYPTEX_MOBILE_ASSET = 8,
419 // Update this when a new type is added421 // Update this when a new type is added
420 GRAFTDMG_CRYPTEX_MAX = 7);422 GRAFTDMG_CRYPTEX_MAX = 8);
421423
422OS_ENUM(cryptex_auth_type, uint32_t,424OS_ENUM(cryptex_auth_type, uint32_t,
423 // Reserved: GRAFTDMG_CRYPTEX_BOOT = 1,425 // Reserved: GRAFTDMG_CRYPTEX_BOOT = 1,
...@@ -426,9 +428,10 @@ OS_ENUM(cryptex_auth_type, uint32_t,...@@ -426,9 +428,10 @@ OS_ENUM(cryptex_auth_type, uint32_t,
426 CRYPTEX1_AUTH_ENV_GENERIC = 4,428 CRYPTEX1_AUTH_ENV_GENERIC = 4,
427 CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5,429 CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5,
428 CRYPTEX_AUTH_PDI_NONCE = 6,430 CRYPTEX_AUTH_PDI_NONCE = 6,
429 // Reserved: GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7431 // Reserved: GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,
432 CRYPTEX_AUTH_MOBILE_ASSET = 8,
430 // Update this when a new type is added433 // Update this when a new type is added
431 CRYPTEX_AUTH_MAX = 7);434 CRYPTEX_AUTH_MAX = 8);
432435
433436
434__BEGIN_DECLS437__BEGIN_DECLS
lib/libc/include/any-macos-any/sys/proc_info.h+12
...@@ -232,6 +232,18 @@ struct proc_workqueueinfo {...@@ -232,6 +232,18 @@ struct proc_workqueueinfo {
232#define WQ_EXCEEDED_CONSTRAINED_THREAD_LIMIT 0x1232#define WQ_EXCEEDED_CONSTRAINED_THREAD_LIMIT 0x1
233#define WQ_EXCEEDED_TOTAL_THREAD_LIMIT 0x2233#define WQ_EXCEEDED_TOTAL_THREAD_LIMIT 0x2
234#define WQ_FLAGS_AVAILABLE 0x4234#define WQ_FLAGS_AVAILABLE 0x4
235/*
236 * WQ_EXCEEDED_COOPERATIVE_THREAD_LIMIT is set if wq has scheduled cooperative
237 * threads upto the cooperative thread pool limit and there is still more work
238 * pending in the cooperative pool that require a thread.
239 */
240#define WQ_EXCEEDED_COOPERATIVE_THREAD_LIMIT 0x8
241/*
242 * WQ_EXCEEDED_ACTIVE_CONSTRAINED_THREAD_LIMIT is set when wq has pending thread
243 * requests for the constrained thread pool; but, has failed the allowance check
244 * because of active thread limit.
245 */
246#define WQ_EXCEEDED_ACTIVE_CONSTRAINED_THREAD_LIMIT 0x10
235247
236struct proc_fileinfo {248struct proc_fileinfo {
237 uint32_t fi_openflags;249 uint32_t fi_openflags;
lib/libc/include/any-macos-any/sys/queue.h+24-24
...@@ -118,30 +118,30 @@...@@ -118,30 +118,30 @@
118 * For details on the use of these macros, see the queue(3) manual page.118 * For details on the use of these macros, see the queue(3) manual page.
119 *119 *
120 *120 *
121 * SLIST LIST STAILQ TAILQ CIRCLEQ121 * SLIST LIST STAILQ TAILQ CIRCLEQ
122 * _HEAD + + + + +122 * _HEAD + + + + +
123 * _HEAD_INITIALIZER + + + + -123 * _HEAD_INITIALIZER + + + + -
124 * _ENTRY + + + + +124 * _ENTRY + + + + +
125 * _INIT + + + + +125 * _INIT + + + + +
126 * _EMPTY + + + + +126 * _EMPTY + + + + +
127 * _FIRST + + + + +127 * _FIRST + + + + +
128 * _NEXT + + + + +128 * _NEXT + + + + +
129 * _PREV - - - + +129 * _PREV - - - + +
130 * _LAST - - + + +130 * _LAST - - + + +
131 * _FOREACH + + + + +131 * _FOREACH + + + + +
132 * _FOREACH_SAFE + + + + -132 * _FOREACH_SAFE + + + + -
133 * _FOREACH_REVERSE - - - + -133 * _FOREACH_REVERSE - - - + -
134 * _FOREACH_REVERSE_SAFE - - - + -134 * _FOREACH_REVERSE_SAFE - - - + -
135 * _INSERT_HEAD + + + + +135 * _INSERT_HEAD + + + + +
136 * _INSERT_BEFORE - + - + +136 * _INSERT_BEFORE - + - + +
137 * _INSERT_AFTER + + + + +137 * _INSERT_AFTER + + + + +
138 * _INSERT_TAIL - - + + +138 * _INSERT_TAIL - - + + +
139 * _CONCAT - - + + -139 * _CONCAT - - + + -
140 * _REMOVE_AFTER + - + - -140 * _REMOVE_AFTER + - + - -
141 * _REMOVE_HEAD + - + - -141 * _REMOVE_HEAD + - + - -
142 * _REMOVE_HEAD_UNTIL - - + - -142 * _REMOVE_HEAD_UNTIL - - + - -
143 * _REMOVE + + + + +143 * _REMOVE + + + + +
144 * _SWAP - + + + -144 * _SWAP - + + + -
145 *145 *
146 */146 */
147#ifdef QUEUE_MACRO_DEBUG147#ifdef QUEUE_MACRO_DEBUG
lib/libc/include/any-macos-any/sys/resource.h+10-4
...@@ -104,7 +104,7 @@ typedef __uint64_t rlim_t;...@@ -104,7 +104,7 @@ typedef __uint64_t rlim_t;
104#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL104#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
105#define PRIO_DARWIN_THREAD 3 /* Second argument is always 0 (current thread) */105#define PRIO_DARWIN_THREAD 3 /* Second argument is always 0 (current thread) */
106#define PRIO_DARWIN_PROCESS 4 /* Second argument is a PID */106#define PRIO_DARWIN_PROCESS 4 /* Second argument is a PID */
107107/* Additional private parameters to getpriority()/setpriority() are in resource_private.h */
108108
109/*109/*
110 * Range limitations for the value of the third parameter to setpriority().110 * Range limitations for the value of the third parameter to setpriority().
...@@ -409,7 +409,12 @@ struct rusage_info_v6 {...@@ -409,7 +409,12 @@ struct rusage_info_v6 {
409 uint64_t ri_pcycles;409 uint64_t ri_pcycles;
410 uint64_t ri_energy_nj;410 uint64_t ri_energy_nj;
411 uint64_t ri_penergy_nj;411 uint64_t ri_penergy_nj;
412 uint64_t ri_reserved[14];412 uint64_t ri_secure_time_in_system;
413 uint64_t ri_secure_ptime_in_system;
414 uint64_t ri_neural_footprint;
415 uint64_t ri_lifetime_max_neural_footprint;
416 uint64_t ri_interval_max_neural_footprint;
417 uint64_t ri_reserved[9];
413};418};
414419
415typedef struct rusage_info_v6 rusage_info_current;420typedef struct rusage_info_v6 rusage_info_current;
...@@ -496,7 +501,7 @@ struct proc_rlimit_control_wakeupmon {...@@ -496,7 +501,7 @@ struct proc_rlimit_control_wakeupmon {
496 int32_t wm_rate;501 int32_t wm_rate;
497};502};
498503
499504/* Additional private I/O policies are in resource_private.h */
500505
501/* I/O type */506/* I/O type */
502#define IOPOL_TYPE_DISK 0507#define IOPOL_TYPE_DISK 0
...@@ -527,7 +532,6 @@ struct proc_rlimit_control_wakeupmon {...@@ -527,7 +532,6 @@ struct proc_rlimit_control_wakeupmon {
527#define IOPOL_APPLICATION IOPOL_STANDARD532#define IOPOL_APPLICATION IOPOL_STANDARD
528#define IOPOL_NORMAL IOPOL_IMPORTANT533#define IOPOL_NORMAL IOPOL_IMPORTANT
529534
530
531#define IOPOL_ATIME_UPDATES_DEFAULT 0535#define IOPOL_ATIME_UPDATES_DEFAULT 0
532#define IOPOL_ATIME_UPDATES_OFF 1536#define IOPOL_ATIME_UPDATES_OFF 1
533537
...@@ -576,4 +580,6 @@ int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPH...@@ -576,4 +580,6 @@ int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPH
576int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);580int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);
577__END_DECLS581__END_DECLS
578582
583
584
579#endif /* !_SYS_RESOURCE_H_ */585#endif /* !_SYS_RESOURCE_H_ */
lib/libc/include/any-macos-any/sys/socket.h+5-20
...@@ -78,8 +78,6 @@...@@ -78,8 +78,6 @@
78#include <machine/_param.h>78#include <machine/_param.h>
79#include <net/net_kev.h>79#include <net/net_kev.h>
8080
81
82
83#include <Availability.h>81#include <Availability.h>
8482
85/*83/*
...@@ -189,6 +187,7 @@...@@ -189,6 +187,7 @@
189187
190#define SO_RESOLVER_SIGNATURE 0x1131 /* A signed data blob from the system resolver */188#define SO_RESOLVER_SIGNATURE 0x1131 /* A signed data blob from the system resolver */
191189
190#define SO_BINDTODEVICE 0x1134 /* bind socket to a network device (max valid option length IFNAMSIZ) */
192191
193/* When adding new socket-options, you need to make sure MPTCP supports these as well! */192/* When adding new socket-options, you need to make sure MPTCP supports these as well! */
194193
...@@ -346,7 +345,6 @@ struct so_np_extensions {...@@ -346,7 +345,6 @@ struct so_np_extensions {
346#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */345#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */
347346
348347
349
350#endif348#endif
351#endif349#endif
352350
...@@ -416,11 +414,7 @@ struct so_np_extensions {...@@ -416,11 +414,7 @@ struct so_np_extensions {
416struct sockaddr {414struct sockaddr {
417 __uint8_t sa_len; /* total length */415 __uint8_t sa_len; /* total length */
418 sa_family_t sa_family; /* [XSI] address family */416 sa_family_t sa_family; /* [XSI] address family */
419#if __has_ptrcheck417 char sa_data[14]; /* [XSI] addr value */
420 char sa_data[__counted_by(sa_len - 2)];
421#else
422 char sa_data[14]; /* [XSI] addr value (actually smaller or larger) */
423#endif
424};418};
425__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr, sockaddr);419__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr, sockaddr);
426420
...@@ -530,10 +524,7 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);...@@ -530,10 +524,7 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
530 */524 */
531#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)525#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
532#define NET_MAXID AF_MAX526#define NET_MAXID AF_MAX
533#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
534527
535
536#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
537/*528/*
538 * PF_ROUTE - Routing table529 * PF_ROUTE - Routing table
539 *530 *
...@@ -557,9 +548,6 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);...@@ -557,9 +548,6 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
557#define NET_RT_MAXID 11548#define NET_RT_MAXID 11
558#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */549#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
559550
560
561
562
563/*551/*
564 * Maximum queue length specifiable by listen.552 * Maximum queue length specifiable by listen.
565 */553 */
...@@ -570,17 +558,15 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);...@@ -570,17 +558,15 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
570 * Used value-result for recvmsg, value only for sendmsg.558 * Used value-result for recvmsg, value only for sendmsg.
571 */559 */
572struct msghdr {560struct msghdr {
573 void *msg_name; /* [XSI] optional address */561 void *__sized_by(msg_namelen) msg_name; /* [XSI] optional address */
574 socklen_t msg_namelen; /* [XSI] size of address */562 socklen_t msg_namelen; /* [XSI] size of address */
575 struct iovec *msg_iov; /* [XSI] scatter/gather array */563 struct iovec *msg_iov; /* [XSI] scatter/gather array */
576 int msg_iovlen; /* [XSI] # elements in msg_iov */564 int msg_iovlen; /* [XSI] # elements in msg_iov */
577 void *msg_control; /* [XSI] ancillary data, see below */565 void *__sized_by(msg_controllen) msg_control; /* [XSI] ancillary data, see below */
578 socklen_t msg_controllen; /* [XSI] ancillary data buffer len */566 socklen_t msg_controllen; /* [XSI] ancillary data buffer len */
579 int msg_flags; /* [XSI] flags on received message */567 int msg_flags; /* [XSI] flags on received message */
580};568};
581569
582
583
584#define MSG_OOB 0x1 /* process out-of-band data */570#define MSG_OOB 0x1 /* process out-of-band data */
585#define MSG_PEEK 0x2 /* peek at incoming message */571#define MSG_PEEK 0x2 /* peek at incoming message */
586#define MSG_DONTROUTE 0x4 /* send without using routing tables */572#define MSG_DONTROUTE 0x4 /* send without using routing tables */
...@@ -694,7 +680,6 @@ struct cmsgcred {...@@ -694,7 +680,6 @@ struct cmsgcred {
694#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */680#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
695#define SCM_TIMESTAMP_MONOTONIC 0x04 /* timestamp (uint64_t) */681#define SCM_TIMESTAMP_MONOTONIC 0x04 /* timestamp (uint64_t) */
696682
697
698#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */683#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
699684
700/*685/*
...@@ -718,7 +703,6 @@ struct sf_hdtr {...@@ -718,7 +703,6 @@ struct sf_hdtr {
718703
719#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */704#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
720705
721
722__BEGIN_DECLS706__BEGIN_DECLS
723707
724int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)708int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
...@@ -762,4 +746,5 @@ int disconnectx(int, sae_associd_t, sae_connid_t);...@@ -762,4 +746,5 @@ int disconnectx(int, sae_associd_t, sae_connid_t);
762__END_DECLS746__END_DECLS
763747
764748
749
765#endif /* !_SYS_SOCKET_H_ */750#endif /* !_SYS_SOCKET_H_ */
lib/libc/include/any-macos-any/sys/sockio.h+4-6
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000-2021 Apple Inc. All rights reserved.2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
3 *3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *5 *
...@@ -66,6 +66,7 @@...@@ -66,6 +66,7 @@
6666
67#include <sys/appleapiopts.h>67#include <sys/appleapiopts.h>
6868
69#include <net/if.h>
69#include <sys/ioccom.h>70#include <sys/ioccom.h>
7071
71/* Socket ioctl's. */72/* Socket ioctl's. */
...@@ -77,9 +78,6 @@...@@ -77,9 +78,6 @@
77#define SIOCSPGRP _IOW('s', 8, int) /* set process group */78#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
78#define SIOCGPGRP _IOR('s', 9, int) /* get process group */79#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
7980
80/*
81 * OSIOCGIF* ioctls are deprecated; they are kept for binary compatibility.
82 */
83#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */81#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
84#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */82#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
85#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */83#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
...@@ -140,7 +138,6 @@...@@ -140,7 +138,6 @@
140 */138 */
141#define SIOCGIFXMEDIA _IOWR('i', 72, struct ifmediareq) /* get net extended media */139#define SIOCGIFXMEDIA _IOWR('i', 72, struct ifmediareq) /* get net extended media */
142140
143
144#define SIOCSIFCAP _IOW('i', 90, struct ifreq) /* set IF features */141#define SIOCSIFCAP _IOW('i', 90, struct ifreq) /* set IF features */
145#define SIOCGIFCAP _IOWR('i', 91, struct ifreq) /* get IF features */142#define SIOCGIFCAP _IOWR('i', 91, struct ifreq) /* get IF features */
146143
...@@ -165,7 +162,6 @@...@@ -165,7 +162,6 @@
165#define SIOCSIFASYNCMAP _IOW('i', 125, struct ifreq) /* set ppp asyncmap */162#define SIOCSIFASYNCMAP _IOW('i', 125, struct ifreq) /* set ppp asyncmap */
166163
167164
168
169#define SIOCGIFMAC _IOWR('i', 130, struct ifreq) /* deprecated */165#define SIOCGIFMAC _IOWR('i', 130, struct ifreq) /* deprecated */
170#define SIOCSIFMAC _IOW('i', 131, struct ifreq) /* deprecated */166#define SIOCSIFMAC _IOW('i', 131, struct ifreq) /* deprecated */
171#define SIOCSIFKPI _IOW('i', 134, struct ifreq) /* set interface kext param - root only */167#define SIOCSIFKPI _IOW('i', 134, struct ifreq) /* set interface kext param - root only */
...@@ -178,5 +174,7 @@...@@ -178,5 +174,7 @@
178#define SIOCSIF6LOWPAN _IOW('i', 196, struct ifreq) /* set 6LOWPAN config */174#define SIOCSIF6LOWPAN _IOW('i', 196, struct ifreq) /* set 6LOWPAN config */
179#define SIOCGIF6LOWPAN _IOWR('i', 197, struct ifreq) /* get 6LOWPAN config */175#define SIOCGIF6LOWPAN _IOWR('i', 197, struct ifreq) /* get 6LOWPAN config */
180176
177#define SIOCGIFDIRECTLINK _IOWR('i', 222, struct ifreq) /* get DIRECTLINK */
178
181179
182#endif /* !_SYS_SOCKIO_H_ */180#endif /* !_SYS_SOCKIO_H_ */
lib/libc/include/any-macos-any/sys/sysctl.h+13-9
...@@ -640,13 +640,15 @@ extern struct loadavg averunnable;...@@ -640,13 +640,15 @@ extern struct loadavg averunnable;
640 * In general is is better to use mach's or higher level timing services, but this value640 * In general is is better to use mach's or higher level timing services, but this value
641 * is needed to convert the PPC Time Base registers to real time.641 * is needed to convert the PPC Time Base registers to real time.
642 *642 *
643 * hw.cpufrequency - These values provide the current, min and max cpu frequency. The min and max are for643 * hw.cpufrequency, hw.busfrequency and their min/max versions are deprecated because frequency isn't consistent.
644 * hw.cpufrequency_max - all power management modes. The current frequency is the max frequency in the current mode.
645 * hw.cpufrequency_min - All frequencies are in Hz.
646 *644 *
647 * hw.busfrequency - These values provide the current, min and max bus frequency. The min and max are for645 * hw.cpufrequency - (deprecated) These values provide the current, min and max cpu frequency. The min and max are for
648 * hw.busfrequency_max - all power management modes. The current frequency is the max frequency in the current mode.646 * hw.cpufrequency_max - (deprecated) all power management modes. The current frequency is the max frequency in the current mode.
649 * hw.busfrequency_min - All frequencies are in Hz.647 * hw.cpufrequency_min - (deprecated) All frequencies are in Hz.
648 *
649 * hw.busfrequency - (deprecated) These values provide the current, min and max bus frequency. The min and max are for
650 * hw.busfrequency_max - (deprecated) all power management modes. The current frequency is the max frequency in the current mode.
651 * hw.busfrequency_min - (deprecated) All frequencies are in Hz.
650 *652 *
651 * hw.cputype - These values provide the mach-o cpu type and subtype. A complete list is in <mach/machine.h>653 * hw.cputype - These values provide the mach-o cpu type and subtype. A complete list is in <mach/machine.h>
652 * hw.cpusubtype - These values should be used to determine what processor family the running cpu is from so that654 * hw.cpusubtype - These values should be used to determine what processor family the running cpu is from so that
...@@ -790,9 +792,11 @@ extern struct loadavg averunnable;...@@ -790,9 +792,11 @@ extern struct loadavg averunnable;
790792
791793
792__BEGIN_DECLS794__BEGIN_DECLS
793int sysctl(int *, u_int, void *, size_t *, void *, size_t);795int sysctl(int *, u_int, void *__sized_by(*oldlenp), size_t *oldlenp,
794int sysctlbyname(const char *, void *, size_t *, void *, size_t);796 void *__sized_by(newlen), size_t newlen);
795int sysctlnametomib(const char *, int *, size_t *);797int sysctlbyname(const char *, void *__sized_by(*oldlenp), size_t *oldlenp,
798 void *__sized_by(newlen), size_t newlen);
799int sysctlnametomib(const char *, int *__counted_by(*sizep), size_t *sizep);
796__END_DECLS800__END_DECLS
797801
798802
lib/libc/include/any-macos-any/sys/syslimits.h+4
...@@ -88,6 +88,10 @@...@@ -88,6 +88,10 @@
88#define LINK_MAX 32767 /* max file link count */88#define LINK_MAX 32767 /* max file link count */
89#define MAX_CANON 1024 /* max bytes in term canon input line */89#define MAX_CANON 1024 /* max bytes in term canon input line */
90#define MAX_INPUT 1024 /* max bytes in terminal input */90#define MAX_INPUT 1024 /* max bytes in terminal input */
91/*
92 * NOTE: Many filesystems (including HFS & APFS) may support names longer than `NAME_MAX` bytes.
93 * See manpage for `getdirentries` and `readdir` for details.
94 */
91#define NAME_MAX 255 /* max bytes in a file name */95#define NAME_MAX 255 /* max bytes in a file name */
92#define NGROUPS_MAX 16 /* max supplemental group id's */96#define NGROUPS_MAX 16 /* max supplemental group id's */
93#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)97#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
lib/libc/include/any-macos-any/sys/un.h-1
...@@ -102,5 +102,4 @@ struct sockaddr_un {...@@ -102,5 +102,4 @@ struct sockaddr_un {
102 (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))102 (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
103#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */103#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
104104
105
106#endif /* !_SYS_UN_H_ */105#endif /* !_SYS_UN_H_ */
lib/libc/include/any-macos-any/tgmath.h+60
...@@ -49,6 +49,7 @@ static double _TG_ATTRSp __tg_promote(long);...@@ -49,6 +49,7 @@ static double _TG_ATTRSp __tg_promote(long);
49static double _TG_ATTRSp __tg_promote(unsigned long);49static double _TG_ATTRSp __tg_promote(unsigned long);
50static double _TG_ATTRSp __tg_promote(long long);50static double _TG_ATTRSp __tg_promote(long long);
51static double _TG_ATTRSp __tg_promote(unsigned long long);51static double _TG_ATTRSp __tg_promote(unsigned long long);
52static _Float16 _TG_ATTRSp __tg_promote(_Float16);
52static float _TG_ATTRSp __tg_promote(float);53static float _TG_ATTRSp __tg_promote(float);
53static double _TG_ATTRSp __tg_promote(double);54static double _TG_ATTRSp __tg_promote(double);
54static long double _TG_ATTRSp __tg_promote(long double);55static long double _TG_ATTRSp __tg_promote(long double);
...@@ -502,6 +503,10 @@ static long double _Complex...@@ -502,6 +503,10 @@ static long double _Complex
502503
503// sqrt504// sqrt
504505
506static _Float16
507 _TG_ATTRS
508 __tg_sqrt(_Float16 __x) {return __sqrtf16(__x);}
509
505static float510static float
506 _TG_ATTRS511 _TG_ATTRS
507 __tg_sqrt(float __x) {return sqrtf(__x);}512 __tg_sqrt(float __x) {return sqrtf(__x);}
...@@ -531,6 +536,10 @@ static long double _Complex...@@ -531,6 +536,10 @@ static long double _Complex
531536
532// fabs537// fabs
533538
539static _Float16
540 _TG_ATTRS
541 __tg_fabs(_Float16 __x) {return __fabsf16(__x);}
542
534static float543static float
535 _TG_ATTRS544 _TG_ATTRS
536 __tg_fabs(float __x) {return fabsf(__x);}545 __tg_fabs(float __x) {return fabsf(__x);}
...@@ -595,6 +604,10 @@ static long double...@@ -595,6 +604,10 @@ static long double
595604
596// ceil605// ceil
597606
607static _Float16
608 _TG_ATTRS
609 __tg_ceil(_Float16 __x) {return __ceilf16(__x);}
610
598static float611static float
599 _TG_ATTRS612 _TG_ATTRS
600 __tg_ceil(float __x) {return ceilf(__x);}613 __tg_ceil(float __x) {return ceilf(__x);}
...@@ -612,6 +625,10 @@ static long double...@@ -612,6 +625,10 @@ static long double
612625
613// copysign626// copysign
614627
628static _Float16
629 _TG_ATTRS
630 __tg_copysign(_Float16 __x, _Float16 __y) {return __copysignf16(__x, __y);}
631
615static float632static float
616 _TG_ATTRS633 _TG_ATTRS
617 __tg_copysign(float __x, float __y) {return copysignf(__x, __y);}634 __tg_copysign(float __x, float __y) {return copysignf(__x, __y);}
...@@ -716,6 +733,10 @@ static long double...@@ -716,6 +733,10 @@ static long double
716733
717// floor734// floor
718735
736static _Float16
737 _TG_ATTRS
738 __tg_floor(_Float16 __x) {return __floorf16(__x);}
739
719static float740static float
720 _TG_ATTRS741 _TG_ATTRS
721 __tg_floor(float __x) {return floorf(__x);}742 __tg_floor(float __x) {return floorf(__x);}
...@@ -733,6 +754,11 @@ static long double...@@ -733,6 +754,11 @@ static long double
733754
734// fma755// fma
735756
757static _Float16
758 _TG_ATTRS
759 __tg_fma(_Float16 __x, _Float16 __y, _Float16 __z)
760 {return __fmaf16(__x, __y, __z);}
761
736static float762static float
737 _TG_ATTRS763 _TG_ATTRS
738 __tg_fma(float __x, float __y, float __z)764 __tg_fma(float __x, float __y, float __z)
...@@ -756,6 +782,10 @@ static long double...@@ -756,6 +782,10 @@ static long double
756782
757// fmax783// fmax
758784
785static _Float16
786 _TG_ATTRS
787 __tg_fmax(_Float16 __x, _Float16 __y) {return __fmaxf16(__x, __y);}
788
759static float789static float
760 _TG_ATTRS790 _TG_ATTRS
761 __tg_fmax(float __x, float __y) {return fmaxf(__x, __y);}791 __tg_fmax(float __x, float __y) {return fmaxf(__x, __y);}
...@@ -774,6 +804,10 @@ static long double...@@ -774,6 +804,10 @@ static long double
774804
775// fmin805// fmin
776806
807static _Float16
808 _TG_ATTRS
809 __tg_fmin(_Float16 __x, _Float16 __y) {return __fminf16(__x, __y);}
810
777static float811static float
778 _TG_ATTRS812 _TG_ATTRS
779 __tg_fmin(float __x, float __y) {return fminf(__x, __y);}813 __tg_fmin(float __x, float __y) {return fminf(__x, __y);}
...@@ -827,6 +861,10 @@ static long double...@@ -827,6 +861,10 @@ static long double
827861
828// hypot862// hypot
829863
864static _Float16
865 _TG_ATTRS
866 __tg_hypot(_Float16 __x, _Float16 __y) {return __hypotf16(__x, __y);}
867
830static float868static float
831 _TG_ATTRS869 _TG_ATTRS
832 __tg_hypot(float __x, float __y) {return hypotf(__x, __y);}870 __tg_hypot(float __x, float __y) {return hypotf(__x, __y);}
...@@ -894,6 +932,10 @@ static long double...@@ -894,6 +932,10 @@ static long double
894#undef lgamma932#undef lgamma
895#define lgamma(__x) __tg_lgamma(__tg_promote1((__x))(__x))933#define lgamma(__x) __tg_lgamma(__tg_promote1((__x))(__x))
896934
935/* long long is not part of C90. Make sure you are passing -std=c99 or
936 -std=gnu99 or higher if you need these functions returning long longs */
937#if !(__DARWIN_NO_LONG_LONG)
938
897// llrint939// llrint
898940
899static long long941static long long
...@@ -928,6 +970,8 @@ static long long...@@ -928,6 +970,8 @@ static long long
928#undef llround970#undef llround
929#define llround(__x) __tg_llround(__tg_promote1((__x))(__x))971#define llround(__x) __tg_llround(__tg_promote1((__x))(__x))
930972
973#endif /* !(__DARWIN_NO_LONG_LONG) */
974
931// log10975// log10
932976
933static float977static float
...@@ -1049,6 +1093,10 @@ static long double...@@ -1049,6 +1093,10 @@ static long double
10491093
1050// nextafter1094// nextafter
10511095
1096static _Float16
1097 _TG_ATTRS
1098 __tg_nextafter(_Float16 __x, _Float16 __y) {return __nextafterf16(__x, __y);}
1099
1052static float1100static float
1053 _TG_ATTRS1101 _TG_ATTRS
1054 __tg_nextafter(float __x, float __y) {return nextafterf(__x, __y);}1102 __tg_nextafter(float __x, float __y) {return nextafterf(__x, __y);}
...@@ -1125,6 +1173,10 @@ static long double...@@ -1125,6 +1173,10 @@ static long double
11251173
1126// rint1174// rint
11271175
1176static _Float16
1177 _TG_ATTRS
1178 __tg_rint(_Float16 __x) {return __rintf16(__x);}
1179
1128static float1180static float
1129 _TG_ATTRS1181 _TG_ATTRS
1130 __tg_rint(float __x) {return rintf(__x);}1182 __tg_rint(float __x) {return rintf(__x);}
...@@ -1142,6 +1194,10 @@ static long double...@@ -1142,6 +1194,10 @@ static long double
11421194
1143// round1195// round
11441196
1197static _Float16
1198 _TG_ATTRS
1199 __tg_round(_Float16 __x) {return __roundf16(__x);}
1200
1145static float1201static float
1146 _TG_ATTRS1202 _TG_ATTRS
1147 __tg_round(float __x) {return roundf(__x);}1203 __tg_round(float __x) {return roundf(__x);}
...@@ -1210,6 +1266,10 @@ static long double...@@ -1210,6 +1266,10 @@ static long double
12101266
1211// trunc1267// trunc
12121268
1269static _Float16
1270 _TG_ATTRS
1271 __tg_trunc(_Float16 __x) {return __truncf16(__x);}
1272
1213static float1273static float
1214 _TG_ATTRS1274 _TG_ATTRS
1215 __tg_trunc(float __x) {return truncf(__x);}1275 __tg_trunc(float __x) {return truncf(__x);}
lib/libc/include/any-macos-any/time.h+2-143
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.2 * Copyright (c) 2000, 2023 Apple Computer, Inc. All rights reserved.
3 *3 *
4 * @APPLE_LICENSE_HEADER_START@4 * @APPLE_LICENSE_HEADER_START@
5 * 5 *
...@@ -60,149 +60,8 @@...@@ -60,149 +60,8 @@
60 * @(#)time.h 8.3 (Berkeley) 1/21/9460 * @(#)time.h 8.3 (Berkeley) 1/21/94
61 */61 */
6262
63#ifndef _TIME_H_63#include <_time.h>
64#define _TIME_H_
65
66#include <_types.h>
67#include <sys/cdefs.h>
68#include <Availability.h>
69#include <sys/_types/_clock_t.h>
70#include <sys/_types/_null.h>
71#include <sys/_types/_size_t.h>
72#include <sys/_types/_time_t.h>
73#include <sys/_types/_timespec.h>
74
75struct tm {
76 int tm_sec; /* seconds after the minute [0-60] */
77 int tm_min; /* minutes after the hour [0-59] */
78 int tm_hour; /* hours since midnight [0-23] */
79 int tm_mday; /* day of the month [1-31] */
80 int tm_mon; /* months since January [0-11] */
81 int tm_year; /* years since 1900 */
82 int tm_wday; /* days since Sunday [0-6] */
83 int tm_yday; /* days since January 1 [0-365] */
84 int tm_isdst; /* Daylight Savings Time flag */
85 long tm_gmtoff; /* offset from UTC in seconds */
86 char *tm_zone; /* timezone abbreviation */
87};
88
89#if __DARWIN_UNIX03
90#define CLOCKS_PER_SEC ((clock_t)1000000) /* [XSI] */
91#else /* !__DARWIN_UNIX03 */
92#include <machine/_limits.h> /* Include file containing CLK_TCK. */
93
94#define CLOCKS_PER_SEC ((clock_t)(__DARWIN_CLK_TCK))
95#endif /* __DARWIN_UNIX03 */
96
97#ifndef _ANSI_SOURCE
98extern char *tzname[];
99#endif
100
101extern int getdate_err;
102#if __DARWIN_UNIX03
103extern long timezone __DARWIN_ALIAS(timezone);
104#endif /* __DARWIN_UNIX03 */
105extern int daylight;
106
107__BEGIN_DECLS
108char *asctime(const struct tm *);
109clock_t clock(void) __DARWIN_ALIAS(clock);
110char *ctime(const time_t *);
111double difftime(time_t, time_t);
112struct tm *getdate(const char *);
113struct tm *gmtime(const time_t *);
114struct tm *localtime(const time_t *);
115time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
116size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
117char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
118time_t time(time_t *);
119
120#ifndef _ANSI_SOURCE
121void tzset(void);
122#endif /* not ANSI */
123
124/* [TSF] Thread safe functions */
125char *asctime_r(const struct tm * __restrict, char * __restrict);
126char *ctime_r(const time_t *, char *);
127struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict);
128struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict);
129
130#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
131time_t posix2time(time_t);
132#if !__DARWIN_UNIX03
133char *timezone(int, int);
134#endif /* !__DARWIN_UNIX03 */
135void tzsetwall(void);
136time_t time2posix(time_t);
137time_t timelocal(struct tm * const);
138time_t timegm(struct tm * const);
139#endif /* neither ANSI nor POSIX */
140
141#if !defined(_ANSI_SOURCE)
142int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep);
143#endif
144
145#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0
146#if __DARWIN_C_LEVEL >= 199309L
147#if __has_feature(enumerator_attributes)
148#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
149#else
150#define __CLOCK_AVAILABILITY
151#endif
152
153typedef enum {
154_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0,
155#define CLOCK_REALTIME _CLOCK_REALTIME
156_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6,
157#define CLOCK_MONOTONIC _CLOCK_MONOTONIC
158#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
159_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4,
160#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW
161_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5,
162#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX
163_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8,
164#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW
165_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9,
166#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX
167#endif
168_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12,
169#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID
170_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16
171#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID
172} clockid_t;
173
174__CLOCK_AVAILABILITY
175int clock_getres(clockid_t __clock_id, struct timespec *__res);
176
177__CLOCK_AVAILABILITY
178int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
179
180#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
181__CLOCK_AVAILABILITY
182__uint64_t clock_gettime_nsec_np(clockid_t __clock_id);
183#endif
184
185__OSX_AVAILABLE(10.12) __IOS_PROHIBITED
186__TVOS_PROHIBITED __WATCHOS_PROHIBITED
187int clock_settime(clockid_t __clock_id, const struct timespec *__tp);
188
189#undef __CLOCK_AVAILABILITY
190#endif /* __DARWIN_C_LEVEL */
191#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */
192
193#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
194 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
195 (defined(__cplusplus) && __cplusplus >= 201703L)
196/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */
197#define TIME_UTC 1 /* time elapsed since epoch */
198__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0))
199int timespec_get(struct timespec *ts, int base);
200#endif
201
202__END_DECLS
20364
204#ifdef _USE_EXTENDED_LOCALES_65#ifdef _USE_EXTENDED_LOCALES_
205#include <xlocale/_time.h>66#include <xlocale/_time.h>
206#endif /* _USE_EXTENDED_LOCALES_ */67#endif /* _USE_EXTENDED_LOCALES_ */
207
208#endif /* !_TIME_H_ */
lib/libc/include/any-macos-any/unistd.h-8
...@@ -653,15 +653,7 @@ char *fflagstostr(unsigned long);...@@ -653,15 +653,7 @@ char *fflagstostr(unsigned long);
653int getdomainname(char *, int);653int getdomainname(char *, int);
654int getgrouplist(const char *, int, int *, int *);654int getgrouplist(const char *, int, int *, int *);
655__END_DECLS655__END_DECLS
656#if defined(__has_include)
657#if __has_include(<gethostuuid_private.h>)
658#include <gethostuuid_private.h>
659#else
660#include <gethostuuid.h>656#include <gethostuuid.h>
661#endif
662#else
663#include <gethostuuid.h>
664#endif
665__BEGIN_DECLS657__BEGIN_DECLS
666mode_t getmode(const void *, mode_t);658mode_t getmode(const void *, mode_t);
667int getpeereid(int, uid_t *, gid_t *);659int getpeereid(int, uid_t *, gid_t *);
lib/libc/include/any-macos-any/vis.h+10
...@@ -57,6 +57,7 @@...@@ -57,6 +57,7 @@
57#ifndef _VIS_H_57#ifndef _VIS_H_
58#define _VIS_H_58#define _VIS_H_
5959
60#include <Availability.h>
60#include <_types.h>61#include <_types.h>
61#include <sys/_types/_size_t.h>62#include <sys/_types/_size_t.h>
6263
...@@ -109,31 +110,40 @@...@@ -109,31 +110,40 @@
109#include <sys/cdefs.h>110#include <sys/cdefs.h>
110111
111__BEGIN_DECLS112__BEGIN_DECLS
113
114__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of vis(3), it is highly recommended you use nvis(3) instead.", macos(10.0,14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
112char *vis(char *, int, int, int);115char *vis(char *, int, int, int);
113char *nvis(char *, size_t, int, int, int);116char *nvis(char *, size_t, int, int, int);
114117
118__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of svis(3), it is highly recommended you use snvis(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
115char *svis(char *, int, int, int, const char *);119char *svis(char *, int, int, int, const char *);
116char *snvis(char *, size_t, int, int, int, const char *);120char *snvis(char *, size_t, int, int, int, const char *);
117121
122__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of strvis(3), it is highly recommended you use strnvis(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
118int strvis(char *, const char *, int);123int strvis(char *, const char *, int);
119int stravis(char **, const char *, int);124int stravis(char **, const char *, int);
120int strnvis(char *, size_t, const char *, int);125int strnvis(char *, size_t, const char *, int);
121126
127__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of strsvis(3), it is highly recommended you use strsnvis(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
122int strsvis(char *, const char *, int, const char *);128int strsvis(char *, const char *, int, const char *);
123int strsnvis(char *, size_t, const char *, int, const char *);129int strsnvis(char *, size_t, const char *, int, const char *);
124130
131__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of strvisx(3), it is highly recommended you use strnvisx(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
125int strvisx(char *, const char *, size_t, int);132int strvisx(char *, const char *, size_t, int);
126int strnvisx(char *, size_t, const char *, size_t, int);133int strnvisx(char *, size_t, const char *, size_t, int);
127int strenvisx(char *, size_t, const char *, size_t, int, int *);134int strenvisx(char *, size_t, const char *, size_t, int, int *);
128135
136__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of strsvisx(3), it is highly recommended you use strsnvisx(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
129int strsvisx(char *, const char *, size_t, int, const char *);137int strsvisx(char *, const char *, size_t, int, const char *);
130int strsnvisx(char *, size_t, const char *, size_t, int, const char *);138int strsnvisx(char *, size_t, const char *, size_t, int, const char *);
131int strsenvisx(char *, size_t, const char *, size_t , int, const char *,139int strsenvisx(char *, size_t, const char *, size_t , int, const char *,
132 int *);140 int *);
133141
142__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of strunvis(3), it is highly recommended you use strnunvis(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
134int strunvis(char *, const char *);143int strunvis(char *, const char *);
135int strnunvis(char *, size_t, const char *);144int strnunvis(char *, size_t, const char *);
136145
146__API_DEPRECATED("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of strunvisx(3), it is highly recommended you use strnunvisx(3) instead.", macos(10.0, 14.4), ios(2.0,17.4), watchos(1.0,10.4), tvos(9.0,17.4))
137int strunvisx(char *, const char *, int);147int strunvisx(char *, const char *, int);
138int strnunvisx(char *, size_t, const char *, int);148int strnunvisx(char *, size_t, const char *, int);
139149
lib/libc/include/any-macos-any/wchar.h+1-161
...@@ -64,168 +64,8 @@...@@ -64,168 +64,8 @@
64 * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $64 * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
65 */65 */
6666
67#ifndef _WCHAR_H_67#include <_wchar.h>
68#define _WCHAR_H_
69
70#include <_types.h>
71#include <sys/cdefs.h>
72#include <Availability.h>
73
74#include <sys/_types/_null.h>
75#include <sys/_types/_size_t.h>
76#include <sys/_types/_mbstate_t.h>
77#include <sys/_types/_ct_rune_t.h>
78#include <sys/_types/_rune_t.h>
79#include <sys/_types/_wchar_t.h>
80
81#ifndef WCHAR_MIN
82#define WCHAR_MIN __DARWIN_WCHAR_MIN
83#endif
84
85#ifndef WCHAR_MAX
86#define WCHAR_MAX __DARWIN_WCHAR_MAX
87#endif
88
89#include <stdarg.h>
90#include <stdio.h>
91#include <time.h>
92#include <_wctype.h>
93
94
95/* Initially added in Issue 4 */
96__BEGIN_DECLS
97wint_t btowc(int);
98wint_t fgetwc(FILE *);
99wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);
100wint_t fputwc(wchar_t, FILE *);
101int fputws(const wchar_t * __restrict, FILE * __restrict);
102int fwide(FILE *, int);
103int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
104int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
105wint_t getwc(FILE *);
106wint_t getwchar(void);
107size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
108size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
109 mbstate_t * __restrict);
110int mbsinit(const mbstate_t *);
111size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
112 mbstate_t * __restrict);
113wint_t putwc(wchar_t, FILE *);
114wint_t putwchar(wchar_t);
115int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...);
116int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
117wint_t ungetwc(wint_t, FILE *);
118int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
119 __darwin_va_list);
120int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
121 __darwin_va_list);
122int vwprintf(const wchar_t * __restrict, __darwin_va_list);
123size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
124wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
125wchar_t *wcschr(const wchar_t *, wchar_t);
126int wcscmp(const wchar_t *, const wchar_t *);
127int wcscoll(const wchar_t *, const wchar_t *);
128wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
129size_t wcscspn(const wchar_t *, const wchar_t *);
130size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
131 const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
132size_t wcslen(const wchar_t *);
133wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
134int wcsncmp(const wchar_t *, const wchar_t *, size_t);
135wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
136wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
137wchar_t *wcsrchr(const wchar_t *, wchar_t);
138size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
139 mbstate_t * __restrict);
140size_t wcsspn(const wchar_t *, const wchar_t *);
141wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
142size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
143int wctob(wint_t);
144double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
145wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
146 wchar_t ** __restrict);
147long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
148unsigned long
149 wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
150wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
151int wmemcmp(const wchar_t *, const wchar_t *, size_t);
152wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
153wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
154wchar_t *wmemset(wchar_t *, wchar_t, size_t);
155int wprintf(const wchar_t * __restrict, ...);
156int wscanf(const wchar_t * __restrict, ...);
157int wcswidth(const wchar_t *, size_t);
158int wcwidth(wchar_t);
159__END_DECLS
160
161
162
163/* Additional functionality provided by:
164 * POSIX.1-2001
165 * ISO C99
166 */
167
168#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
169__BEGIN_DECLS
170int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
171 __darwin_va_list);
172int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
173 __darwin_va_list);
174int vwscanf(const wchar_t * __restrict, __darwin_va_list);
175float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
176long double
177 wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
178#if !__DARWIN_NO_LONG_LONG
179long long
180 wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
181unsigned long long
182 wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
183#endif /* !__DARWIN_NO_LONG_LONG */
184__END_DECLS
185#endif
186
187
188
189/* Additional functionality provided by:
190 * POSIX.1-2008
191 */
192
193#if __DARWIN_C_LEVEL >= 200809L
194__BEGIN_DECLS
195size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
196 size_t, mbstate_t * __restrict);
197wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
198wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
199wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
200int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
201int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
202size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
203size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
204 size_t, mbstate_t * __restrict);
205FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
206__END_DECLS
207#endif /* __DARWIN_C_LEVEL >= 200809L */
208
209
210
211/* Darwin extensions */
212
213#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
214__BEGIN_DECLS
215wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
216size_t wcslcat(wchar_t *, const wchar_t *, size_t);
217size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
218__END_DECLS
219#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
220
221
222/* Poison the following routines if -fshort-wchar is set */
223#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
224#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf
225#endif
22668
227#ifdef _USE_EXTENDED_LOCALES_69#ifdef _USE_EXTENDED_LOCALES_
228#include <xlocale/_wchar.h>70#include <xlocale/_wchar.h>
229#endif /* _USE_EXTENDED_LOCALES_ */71#endif /* _USE_EXTENDED_LOCALES_ */
230
231#endif /* !_WCHAR_H_ */
lib/libc/include/any-macos-any/wctype.h-95
...@@ -28,103 +28,8 @@...@@ -28,103 +28,8 @@
28 * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $28 * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
29 */29 */
3030
31#ifndef _WCTYPE_H_
32#define _WCTYPE_H_
33
34#include <sys/cdefs.h>
35#include <_types.h>
36#include <_types/_wctrans_t.h>
37
38#define __DARWIN_WCTYPE_TOP_inline __header_inline
39
40#include <_wctype.h>31#include <_wctype.h>
41#include <ctype.h>
42
43/*
44 * Use inline functions if we are allowed to and the compiler supports them.
45 */
46#if !defined(_DONT_USE_CTYPE_INLINE_) && \
47 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
48
49__DARWIN_WCTYPE_TOP_inline int
50iswblank(wint_t _wc)
51{
52 return (__istype(_wc, _CTYPE_B));
53}
54
55#if !defined(_ANSI_SOURCE)
56__DARWIN_WCTYPE_TOP_inline int
57iswascii(wint_t _wc)
58{
59 return ((_wc & ~0x7F) == 0);
60}
61
62__DARWIN_WCTYPE_TOP_inline int
63iswhexnumber(wint_t _wc)
64{
65 return (__istype(_wc, _CTYPE_X));
66}
67
68__DARWIN_WCTYPE_TOP_inline int
69iswideogram(wint_t _wc)
70{
71 return (__istype(_wc, _CTYPE_I));
72}
73
74__DARWIN_WCTYPE_TOP_inline int
75iswnumber(wint_t _wc)
76{
77 return (__istype(_wc, _CTYPE_D));
78}
79
80__DARWIN_WCTYPE_TOP_inline int
81iswphonogram(wint_t _wc)
82{
83 return (__istype(_wc, _CTYPE_Q));
84}
85
86__DARWIN_WCTYPE_TOP_inline int
87iswrune(wint_t _wc)
88{
89 return (__istype(_wc, 0xFFFFFFF0L));
90}
91
92__DARWIN_WCTYPE_TOP_inline int
93iswspecial(wint_t _wc)
94{
95 return (__istype(_wc, _CTYPE_T));
96}
97#endif /* !_ANSI_SOURCE */
98
99#else /* not using inlines */
100
101__BEGIN_DECLS
102int iswblank(wint_t);
103
104#if !defined(_ANSI_SOURCE)
105wint_t iswascii(wint_t);
106wint_t iswhexnumber(wint_t);
107wint_t iswideogram(wint_t);
108wint_t iswnumber(wint_t);
109wint_t iswphonogram(wint_t);
110wint_t iswrune(wint_t);
111wint_t iswspecial(wint_t);
112#endif
113__END_DECLS
114
115#endif /* using inlines */
116
117__BEGIN_DECLS
118#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
119wint_t nextwctype(wint_t, wctype_t);
120#endif
121wint_t towctrans(wint_t, wctrans_t);
122wctrans_t
123 wctrans(const char *);
124__END_DECLS
12532
126#ifdef _USE_EXTENDED_LOCALES_33#ifdef _USE_EXTENDED_LOCALES_
127#include <xlocale/_wctype.h>34#include <xlocale/_wctype.h>
128#endif /* _USE_EXTENDED_LOCALES_ */35#endif /* _USE_EXTENDED_LOCALES_ */
129
130#endif /* _WCTYPE_H_ */
lib/libc/include/any-macos-any/xlocale.h+3-53
...@@ -21,62 +21,14 @@...@@ -21,62 +21,14 @@
21 * @APPLE_LICENSE_HEADER_END@21 * @APPLE_LICENSE_HEADER_END@
22 */22 */
2323
24#ifndef _XLOCALE_H_
25#define _XLOCALE_H_
26
27#include <sys/cdefs.h>
28
29#ifndef _USE_EXTENDED_LOCALES_
30#define _USE_EXTENDED_LOCALES_
31#endif /* _USE_EXTENDED_LOCALES_ */
32
33#include <_locale.h>
34#include <_xlocale.h>24#include <_xlocale.h>
3525
36#define LC_ALL_MASK ( LC_COLLATE_MASK \
37 | LC_CTYPE_MASK \
38 | LC_MESSAGES_MASK \
39 | LC_MONETARY_MASK \
40 | LC_NUMERIC_MASK \
41 | LC_TIME_MASK )
42#define LC_COLLATE_MASK (1 << 0)
43#define LC_CTYPE_MASK (1 << 1)
44#define LC_MESSAGES_MASK (1 << 2)
45#define LC_MONETARY_MASK (1 << 3)
46#define LC_NUMERIC_MASK (1 << 4)
47#define LC_TIME_MASK (1 << 5)
48
49#define _LC_NUM_MASK 6
50#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
51
52#define LC_GLOBAL_LOCALE ((locale_t)-1)
53#define LC_C_LOCALE ((locale_t)NULL)
54
55#ifdef MB_CUR_MAX
56#undef MB_CUR_MAX
57#define MB_CUR_MAX (___mb_cur_max())
58#ifndef MB_CUR_MAX_L
59#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
60#endif /* !MB_CUR_MAX_L */
61#endif /* MB_CUR_MAX */
62
63__BEGIN_DECLS
64extern const locale_t _c_locale;
65
66locale_t duplocale(locale_t);
67int freelocale(locale_t);
68struct lconv * localeconv_l(locale_t);
69locale_t newlocale(int, __const char *, locale_t);
70__const char * querylocale(int, locale_t);
71locale_t uselocale(locale_t);
72__END_DECLS
73
74#ifdef _CTYPE_H_26#ifdef _CTYPE_H_
75#include <xlocale/_ctype.h>27#include <xlocale/_ctype.h>
76#endif /* _CTYPE_H_ */28#endif /* _CTYPE_H_ */
77#ifdef __WCTYPE_H_29#ifdef ___WCTYPE_H_
78#include <xlocale/__wctype.h>30#include <xlocale/___wctype.h>
79#endif /* __WCTYPE_H_ */31#endif /* ___WCTYPE_H_ */
80#ifdef _INTTYPES_H_32#ifdef _INTTYPES_H_
81#include <xlocale/_inttypes.h>33#include <xlocale/_inttypes.h>
82#endif /* _INTTYPES_H_ */34#endif /* _INTTYPES_H_ */
...@@ -107,5 +59,3 @@ __END_DECLS...@@ -107,5 +59,3 @@ __END_DECLS
107#ifdef _WCTYPE_H_59#ifdef _WCTYPE_H_
108#include <xlocale/_wctype.h>60#include <xlocale/_wctype.h>
109#endif /* _WCTYPE_H_ */61#endif /* _WCTYPE_H_ */
110
111#endif /* _XLOCALE_H_ */
lib/libc/include/any-macos-any/xlocale/___wctype.h created+143
...@@ -0,0 +1,143 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE____WCTYPE_H_
25#define _XLOCALE____WCTYPE_H_
26
27#include <___wctype.h>
28#include <xlocale/_ctype.h>
29
30#if !defined(_DONT_USE_CTYPE_INLINE_) && \
31 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
32
33__DARWIN_WCTYPE_TOP_inline int
34iswalnum_l(wint_t _wc, locale_t _l)
35{
36 return (__istype_l(_wc, _CTYPE_A|_CTYPE_D, _l));
37}
38
39__DARWIN_WCTYPE_TOP_inline int
40iswalpha_l(wint_t _wc, locale_t _l)
41{
42 return (__istype_l(_wc, _CTYPE_A, _l));
43}
44
45__DARWIN_WCTYPE_TOP_inline int
46iswcntrl_l(wint_t _wc, locale_t _l)
47{
48 return (__istype_l(_wc, _CTYPE_C, _l));
49}
50
51__DARWIN_WCTYPE_TOP_inline int
52iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l)
53{
54 return (__istype_l(_wc, _charclass, _l));
55}
56
57__DARWIN_WCTYPE_TOP_inline int
58iswdigit_l(wint_t _wc, locale_t _l)
59{
60 return (__istype_l(_wc, _CTYPE_D, _l));
61}
62
63__DARWIN_WCTYPE_TOP_inline int
64iswgraph_l(wint_t _wc, locale_t _l)
65{
66 return (__istype_l(_wc, _CTYPE_G, _l));
67}
68
69__DARWIN_WCTYPE_TOP_inline int
70iswlower_l(wint_t _wc, locale_t _l)
71{
72 return (__istype_l(_wc, _CTYPE_L, _l));
73}
74
75__DARWIN_WCTYPE_TOP_inline int
76iswprint_l(wint_t _wc, locale_t _l)
77{
78 return (__istype_l(_wc, _CTYPE_R, _l));
79}
80
81__DARWIN_WCTYPE_TOP_inline int
82iswpunct_l(wint_t _wc, locale_t _l)
83{
84 return (__istype_l(_wc, _CTYPE_P, _l));
85}
86
87__DARWIN_WCTYPE_TOP_inline int
88iswspace_l(wint_t _wc, locale_t _l)
89{
90 return (__istype_l(_wc, _CTYPE_S, _l));
91}
92
93__DARWIN_WCTYPE_TOP_inline int
94iswupper_l(wint_t _wc, locale_t _l)
95{
96 return (__istype_l(_wc, _CTYPE_U, _l));
97}
98
99__DARWIN_WCTYPE_TOP_inline int
100iswxdigit_l(wint_t _wc, locale_t _l)
101{
102 return (__istype_l(_wc, _CTYPE_X, _l));
103}
104
105__DARWIN_WCTYPE_TOP_inline wint_t
106towlower_l(wint_t _wc, locale_t _l)
107{
108 return (__tolower_l(_wc, _l));
109}
110
111__DARWIN_WCTYPE_TOP_inline wint_t
112towupper_l(wint_t _wc, locale_t _l)
113{
114 return (__toupper_l(_wc, _l));
115}
116
117#else /* not using inlines */
118
119__BEGIN_DECLS
120int iswalnum_l(wint_t, locale_t);
121int iswalpha_l(wint_t, locale_t);
122int iswcntrl_l(wint_t, locale_t);
123int iswctype_l(wint_t, wctype_t, locale_t);
124int iswdigit_l(wint_t, locale_t);
125int iswgraph_l(wint_t, locale_t);
126int iswlower_l(wint_t, locale_t);
127int iswprint_l(wint_t, locale_t);
128int iswpunct_l(wint_t, locale_t);
129int iswspace_l(wint_t, locale_t);
130int iswupper_l(wint_t, locale_t);
131int iswxdigit_l(wint_t, locale_t);
132wint_t towlower_l(wint_t, locale_t);
133wint_t towupper_l(wint_t, locale_t);
134__END_DECLS
135
136#endif /* using inlines */
137
138__BEGIN_DECLS
139wctype_t
140 wctype_l(const char *, locale_t);
141__END_DECLS
142
143#endif /* _XLOCALE____WCTYPE_H_ */
lib/libc/include/any-macos-any/xlocale/__wctype.h deleted-143
...@@ -1,143 +0,0 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE___WCTYPE_H_
25#define _XLOCALE___WCTYPE_H_
26
27#include <__wctype.h>
28#include <xlocale/_ctype.h>
29
30#if !defined(_DONT_USE_CTYPE_INLINE_) && \
31 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
32
33__DARWIN_WCTYPE_TOP_inline int
34iswalnum_l(wint_t _wc, locale_t _l)
35{
36 return (__istype_l(_wc, _CTYPE_A|_CTYPE_D, _l));
37}
38
39__DARWIN_WCTYPE_TOP_inline int
40iswalpha_l(wint_t _wc, locale_t _l)
41{
42 return (__istype_l(_wc, _CTYPE_A, _l));
43}
44
45__DARWIN_WCTYPE_TOP_inline int
46iswcntrl_l(wint_t _wc, locale_t _l)
47{
48 return (__istype_l(_wc, _CTYPE_C, _l));
49}
50
51__DARWIN_WCTYPE_TOP_inline int
52iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l)
53{
54 return (__istype_l(_wc, _charclass, _l));
55}
56
57__DARWIN_WCTYPE_TOP_inline int
58iswdigit_l(wint_t _wc, locale_t _l)
59{
60 return (__istype_l(_wc, _CTYPE_D, _l));
61}
62
63__DARWIN_WCTYPE_TOP_inline int
64iswgraph_l(wint_t _wc, locale_t _l)
65{
66 return (__istype_l(_wc, _CTYPE_G, _l));
67}
68
69__DARWIN_WCTYPE_TOP_inline int
70iswlower_l(wint_t _wc, locale_t _l)
71{
72 return (__istype_l(_wc, _CTYPE_L, _l));
73}
74
75__DARWIN_WCTYPE_TOP_inline int
76iswprint_l(wint_t _wc, locale_t _l)
77{
78 return (__istype_l(_wc, _CTYPE_R, _l));
79}
80
81__DARWIN_WCTYPE_TOP_inline int
82iswpunct_l(wint_t _wc, locale_t _l)
83{
84 return (__istype_l(_wc, _CTYPE_P, _l));
85}
86
87__DARWIN_WCTYPE_TOP_inline int
88iswspace_l(wint_t _wc, locale_t _l)
89{
90 return (__istype_l(_wc, _CTYPE_S, _l));
91}
92
93__DARWIN_WCTYPE_TOP_inline int
94iswupper_l(wint_t _wc, locale_t _l)
95{
96 return (__istype_l(_wc, _CTYPE_U, _l));
97}
98
99__DARWIN_WCTYPE_TOP_inline int
100iswxdigit_l(wint_t _wc, locale_t _l)
101{
102 return (__istype_l(_wc, _CTYPE_X, _l));
103}
104
105__DARWIN_WCTYPE_TOP_inline wint_t
106towlower_l(wint_t _wc, locale_t _l)
107{
108 return (__tolower_l(_wc, _l));
109}
110
111__DARWIN_WCTYPE_TOP_inline wint_t
112towupper_l(wint_t _wc, locale_t _l)
113{
114 return (__toupper_l(_wc, _l));
115}
116
117#else /* not using inlines */
118
119__BEGIN_DECLS
120int iswalnum_l(wint_t, locale_t);
121int iswalpha_l(wint_t, locale_t);
122int iswcntrl_l(wint_t, locale_t);
123int iswctype_l(wint_t, wctype_t, locale_t);
124int iswdigit_l(wint_t, locale_t);
125int iswgraph_l(wint_t, locale_t);
126int iswlower_l(wint_t, locale_t);
127int iswprint_l(wint_t, locale_t);
128int iswpunct_l(wint_t, locale_t);
129int iswspace_l(wint_t, locale_t);
130int iswupper_l(wint_t, locale_t);
131int iswxdigit_l(wint_t, locale_t);
132wint_t towlower_l(wint_t, locale_t);
133wint_t towupper_l(wint_t, locale_t);
134__END_DECLS
135
136#endif /* using inlines */
137
138__BEGIN_DECLS
139wctype_t
140 wctype_l(const char *, locale_t);
141__END_DECLS
142
143#endif /* _XLOCALE___WCTYPE_H_ */
lib/libc/include/any-macos-any/xlocale/_ctype.h+1-1
...@@ -25,7 +25,7 @@...@@ -25,7 +25,7 @@
25#define _XLOCALE__CTYPE_H_25#define _XLOCALE__CTYPE_H_
2626
27#include <_ctype.h>27#include <_ctype.h>
28#include <_xlocale.h>28#include <__xlocale.h>
2929
30/*30/*
31 * Use inline functions if we are allowed to and the compiler supports them.31 * Use inline functions if we are allowed to and the compiler supports them.
lib/libc/include/any-macos-any/xlocale/_inttypes.h+1-1
...@@ -27,7 +27,7 @@...@@ -27,7 +27,7 @@
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
28#include <stdint.h>28#include <stdint.h>
29#include <stddef.h> /* wchar_t */29#include <stddef.h> /* wchar_t */
30#include <_xlocale.h>30#include <__xlocale.h>
3131
32__BEGIN_DECLS32__BEGIN_DECLS
33intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr,33intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr,
lib/libc/include/any-macos-any/xlocale/_langinfo.h+1-1
...@@ -26,7 +26,7 @@...@@ -26,7 +26,7 @@
2626
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
28#include <_types/_nl_item.h>28#include <_types/_nl_item.h>
29#include <_xlocale.h>29#include <__xlocale.h>
3030
31__BEGIN_DECLS31__BEGIN_DECLS
32char *nl_langinfo_l(nl_item, locale_t);32char *nl_langinfo_l(nl_item, locale_t);
lib/libc/include/any-macos-any/xlocale/_monetary.h+1-1
...@@ -28,7 +28,7 @@...@@ -28,7 +28,7 @@
28#include <_types.h>28#include <_types.h>
29#include <sys/_types/_size_t.h>29#include <sys/_types/_size_t.h>
30#include <sys/_types/_ssize_t.h>30#include <sys/_types/_ssize_t.h>
31#include <_xlocale.h>31#include <__xlocale.h>
3232
33__BEGIN_DECLS33__BEGIN_DECLS
34ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...)34ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...)
lib/libc/include/any-macos-any/xlocale/_regex.h+2-2
...@@ -26,8 +26,8 @@...@@ -26,8 +26,8 @@
2626
27#ifndef _REGEX_H_27#ifndef _REGEX_H_
28#include <_regex.h>28#include <_regex.h>
29#endif // _REGEX_H_29#include <__xlocale.h>
30#include <_xlocale.h>30#endif
3131
32__BEGIN_DECLS32__BEGIN_DECLS
3333
lib/libc/include/any-macos-any/xlocale/_stdio.h+1-1
...@@ -25,7 +25,7 @@...@@ -25,7 +25,7 @@
25#define _XLOCALE__STDIO_H_25#define _XLOCALE__STDIO_H_
2626
27#include <_stdio.h>27#include <_stdio.h>
28#include <_xlocale.h>28#include <__xlocale.h>
2929
30__BEGIN_DECLS30__BEGIN_DECLS
3131
lib/libc/include/any-macos-any/xlocale/_stdlib.h+1-1
...@@ -27,7 +27,7 @@...@@ -27,7 +27,7 @@
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
28#include <sys/_types/_size_t.h>28#include <sys/_types/_size_t.h>
29#include <sys/_types/_wchar_t.h>29#include <sys/_types/_wchar_t.h>
30#include <_xlocale.h>30#include <__xlocale.h>
3131
32__BEGIN_DECLS32__BEGIN_DECLS
33double atof_l(const char *, locale_t);33double atof_l(const char *, locale_t);
lib/libc/include/any-macos-any/xlocale/_string.h+1-1
...@@ -26,7 +26,7 @@...@@ -26,7 +26,7 @@
2626
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
28#include <sys/_types/_size_t.h>28#include <sys/_types/_size_t.h>
29#include <_xlocale.h>29#include <__xlocale.h>
3030
31__BEGIN_DECLS31__BEGIN_DECLS
32int strcoll_l(const char *, const char *, locale_t);32int strcoll_l(const char *, const char *, locale_t);
lib/libc/include/any-macos-any/xlocale/_time.h+1-1
...@@ -27,7 +27,7 @@...@@ -27,7 +27,7 @@
27#include <sys/cdefs.h>27#include <sys/cdefs.h>
28#include <sys/_types/_size_t.h>28#include <sys/_types/_size_t.h>
29#include <_types.h>29#include <_types.h>
30#include <_xlocale.h>30#include <__xlocale.h>
3131
32__BEGIN_DECLS32__BEGIN_DECLS
33size_t strftime_l(char * __restrict, size_t, const char * __restrict,33size_t strftime_l(char * __restrict, size_t, const char * __restrict,
lib/libc/include/any-macos-any/xlocale/_wchar.h+1-1
...@@ -25,7 +25,7 @@...@@ -25,7 +25,7 @@
25#define _XLOCALE__WCHAR_H_25#define _XLOCALE__WCHAR_H_
2626
27#include <_stdio.h>27#include <_stdio.h>
28#include <_xlocale.h>28#include <__xlocale.h>
29#include <sys/_types/_mbstate_t.h>29#include <sys/_types/_mbstate_t.h>
30#include <sys/_types/_wint_t.h>30#include <sys/_types/_wint_t.h>
31#include <stddef.h> /* wchar_t */31#include <stddef.h> /* wchar_t */
lib/libc/include/any-macos-any/xlocale/_wctype.h+1-1
...@@ -24,7 +24,7 @@...@@ -24,7 +24,7 @@
24#ifndef _XLOCALE__WCTYPE_H_24#ifndef _XLOCALE__WCTYPE_H_
25#define _XLOCALE__WCTYPE_H_25#define _XLOCALE__WCTYPE_H_
2626
27#include <__wctype.h>27#include <___wctype.h>
28#include <_types/_wctrans_t.h>28#include <_types/_wctrans_t.h>
29#include <xlocale/_ctype.h>29#include <xlocale/_ctype.h>
3030
lib/libc/include/any-macos-any/xpc/activity.h+56-28
...@@ -33,7 +33,8 @@ __BEGIN_DECLS...@@ -33,7 +33,8 @@ __BEGIN_DECLS
33 * the interval before more aggressive scheduling occurs. The grace period33 * the interval before more aggressive scheduling occurs. The grace period
34 * does not increase the size of the interval.34 * does not increase the size of the interval.
35 */35 */
36__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)36API_AVAILABLE(macos(10.9))
37API_UNAVAILABLE(ios)
37XPC_EXPORT38XPC_EXPORT
38const char * const XPC_ACTIVITY_INTERVAL;39const char * const XPC_ACTIVITY_INTERVAL;
3940
...@@ -41,7 +42,8 @@ const char * const XPC_ACTIVITY_INTERVAL;...@@ -41,7 +42,8 @@ const char * const XPC_ACTIVITY_INTERVAL;
41 * @constant XPC_ACTIVITY_REPEATING42 * @constant XPC_ACTIVITY_REPEATING
42 * A boolean property indicating whether this is a repeating activity.43 * A boolean property indicating whether this is a repeating activity.
43 */44 */
44__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)45API_AVAILABLE(macos(10.9))
46API_UNAVAILABLE(ios)
45XPC_EXPORT47XPC_EXPORT
46const char * const XPC_ACTIVITY_REPEATING;48const char * const XPC_ACTIVITY_REPEATING;
4749
...@@ -50,7 +52,8 @@ const char * const XPC_ACTIVITY_REPEATING;...@@ -50,7 +52,8 @@ const char * const XPC_ACTIVITY_REPEATING;
50 * An integer property indicating the number of seconds to delay before52 * An integer property indicating the number of seconds to delay before
51 * beginning the activity.53 * beginning the activity.
52 */54 */
53__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)55API_AVAILABLE(macos(10.9))
56API_UNAVAILABLE(ios)
54XPC_EXPORT57XPC_EXPORT
55const char * const XPC_ACTIVITY_DELAY;58const char * const XPC_ACTIVITY_DELAY;
5659
...@@ -59,44 +62,54 @@ const char * const XPC_ACTIVITY_DELAY;...@@ -59,44 +62,54 @@ const char * const XPC_ACTIVITY_DELAY;
59 * An integer property indicating the number of seconds to allow as a grace62 * An integer property indicating the number of seconds to allow as a grace
60 * period before the scheduling of the activity becomes more aggressive.63 * period before the scheduling of the activity becomes more aggressive.
61 */64 */
62__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)65API_AVAILABLE(macos(10.9))
66API_UNAVAILABLE(ios)
63XPC_EXPORT67XPC_EXPORT
64const char * const XPC_ACTIVITY_GRACE_PERIOD;68const char * const XPC_ACTIVITY_GRACE_PERIOD;
6569
6670
67__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)71API_AVAILABLE(macos(10.9))
72API_UNAVAILABLE(ios)
68XPC_EXPORT73XPC_EXPORT
69const int64_t XPC_ACTIVITY_INTERVAL_1_MIN;74const int64_t XPC_ACTIVITY_INTERVAL_1_MIN;
7075
71__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)76API_AVAILABLE(macos(10.9))
77API_UNAVAILABLE(ios)
72XPC_EXPORT78XPC_EXPORT
73const int64_t XPC_ACTIVITY_INTERVAL_5_MIN;79const int64_t XPC_ACTIVITY_INTERVAL_5_MIN;
7480
75__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)81API_AVAILABLE(macos(10.9))
82API_UNAVAILABLE(ios)
76XPC_EXPORT83XPC_EXPORT
77const int64_t XPC_ACTIVITY_INTERVAL_15_MIN;84const int64_t XPC_ACTIVITY_INTERVAL_15_MIN;
7885
79__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)86API_AVAILABLE(macos(10.9))
87API_UNAVAILABLE(ios)
80XPC_EXPORT88XPC_EXPORT
81const int64_t XPC_ACTIVITY_INTERVAL_30_MIN;89const int64_t XPC_ACTIVITY_INTERVAL_30_MIN;
8290
83__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)91API_AVAILABLE(macos(10.9))
92API_UNAVAILABLE(ios)
84XPC_EXPORT93XPC_EXPORT
85const int64_t XPC_ACTIVITY_INTERVAL_1_HOUR;94const int64_t XPC_ACTIVITY_INTERVAL_1_HOUR;
8695
87__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)96API_AVAILABLE(macos(10.9))
97API_UNAVAILABLE(ios)
88XPC_EXPORT98XPC_EXPORT
89const int64_t XPC_ACTIVITY_INTERVAL_4_HOURS;99const int64_t XPC_ACTIVITY_INTERVAL_4_HOURS;
90100
91__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)101API_AVAILABLE(macos(10.9))
102API_UNAVAILABLE(ios)
92XPC_EXPORT103XPC_EXPORT
93const int64_t XPC_ACTIVITY_INTERVAL_8_HOURS;104const int64_t XPC_ACTIVITY_INTERVAL_8_HOURS;
94105
95__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)106API_AVAILABLE(macos(10.9))
107API_UNAVAILABLE(ios)
96XPC_EXPORT108XPC_EXPORT
97const int64_t XPC_ACTIVITY_INTERVAL_1_DAY;109const int64_t XPC_ACTIVITY_INTERVAL_1_DAY;
98110
99__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)111API_AVAILABLE(macos(10.9))
112API_UNAVAILABLE(ios)
100XPC_EXPORT113XPC_EXPORT
101const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS;114const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS;
102115
...@@ -104,7 +117,8 @@ const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS;...@@ -104,7 +117,8 @@ const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS;
104 * @constant XPC_ACTIVITY_PRIORITY117 * @constant XPC_ACTIVITY_PRIORITY
105 * A string property indicating the priority of the activity.118 * A string property indicating the priority of the activity.
106 */119 */
107__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)120API_AVAILABLE(macos(10.9))
121API_UNAVAILABLE(ios)
108XPC_EXPORT122XPC_EXPORT
109const char * const XPC_ACTIVITY_PRIORITY;123const char * const XPC_ACTIVITY_PRIORITY;
110124
...@@ -121,7 +135,8 @@ const char * const XPC_ACTIVITY_PRIORITY;...@@ -121,7 +135,8 @@ const char * const XPC_ACTIVITY_PRIORITY;
121 * permitted to run while the device is on battery, or plugged in and the135 * permitted to run while the device is on battery, or plugged in and the
122 * battery level is lower than 30%.136 * battery level is lower than 30%.
123 */137 */
124__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)138API_AVAILABLE(macos(10.9))
139API_UNAVAILABLE(ios)
125XPC_EXPORT140XPC_EXPORT
126const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE;141const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE;
127142
...@@ -138,7 +153,8 @@ const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE;...@@ -138,7 +153,8 @@ const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE;
138 * are only permitted when they are close to their deadline (90% of their time153 * are only permitted when they are close to their deadline (90% of their time
139 * window has elapsed).154 * window has elapsed).
140 */155 */
141__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)156API_AVAILABLE(macos(10.9))
157API_UNAVAILABLE(ios)
142XPC_EXPORT158XPC_EXPORT
143const char * const XPC_ACTIVITY_PRIORITY_UTILITY;159const char * const XPC_ACTIVITY_PRIORITY_UTILITY;
144160
...@@ -148,7 +164,8 @@ const char * const XPC_ACTIVITY_PRIORITY_UTILITY;...@@ -148,7 +164,8 @@ const char * const XPC_ACTIVITY_PRIORITY_UTILITY;
148 * while the computer is on battery power. The default value is false for164 * while the computer is on battery power. The default value is false for
149 * maintenance priority activity and true for utility priority activity.165 * maintenance priority activity and true for utility priority activity.
150 */166 */
151__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)167API_AVAILABLE(macos(10.9))
168API_UNAVAILABLE(ios)
152XPC_EXPORT169XPC_EXPORT
153const char * const XPC_ACTIVITY_ALLOW_BATTERY;170const char * const XPC_ACTIVITY_ALLOW_BATTERY;
154171
...@@ -160,7 +177,8 @@ const char * const XPC_ACTIVITY_ALLOW_BATTERY;...@@ -160,7 +177,8 @@ const char * const XPC_ACTIVITY_ALLOW_BATTERY;
160 * idle despite the fact that the display itself is still powered. Defaults to177 * idle despite the fact that the display itself is still powered. Defaults to
161 * false.178 * false.
162 */179 */
163__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)180API_AVAILABLE(macos(10.9))
181API_UNAVAILABLE(ios)
164XPC_EXPORT182XPC_EXPORT
165const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool183const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool
166184
...@@ -174,7 +192,8 @@ const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool...@@ -174,7 +192,8 @@ const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool
174 * interrupted by system sleep should set this.192 * interrupted by system sleep should set this.
175 * Setting this property can impact battery life.193 * Setting this property can impact battery life.
176 */194 */
177__API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0))195API_AVAILABLE(macos(12.0))
196API_UNAVAILABLE(ios, watchos)
178XPC_EXPORT197XPC_EXPORT
179const char * const XPC_ACTIVITY_PREVENT_DEVICE_SLEEP; // bool198const char * const XPC_ACTIVITY_PREVENT_DEVICE_SLEEP; // bool
180199
...@@ -205,7 +224,8 @@ const char * const XPC_ACTIVITY_REQUIRE_HDD_SPINNING; // bool...@@ -205,7 +224,8 @@ const char * const XPC_ACTIVITY_REQUIRE_HDD_SPINNING; // bool
205 * A type representing the XPC activity object.224 * A type representing the XPC activity object.
206 */225 */
207#define XPC_TYPE_ACTIVITY (&_xpc_type_activity)226#define XPC_TYPE_ACTIVITY (&_xpc_type_activity)
208__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)227API_AVAILABLE(macos(10.9))
228API_UNAVAILABLE(ios)
209XPC_EXPORT229XPC_EXPORT
210XPC_TYPE(_xpc_type_activity);230XPC_TYPE(_xpc_type_activity);
211231
...@@ -241,7 +261,8 @@ typedef void (^xpc_activity_handler_t)(xpc_activity_t activity);...@@ -241,7 +261,8 @@ typedef void (^xpc_activity_handler_t)(xpc_activity_t activity);
241 * activity using the same identifier (for example, an activity taken from a261 * activity using the same identifier (for example, an activity taken from a
242 * launchd property list).262 * launchd property list).
243 */263 */
244__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)264API_AVAILABLE(macos(10.9))
265API_UNAVAILABLE(ios)
245XPC_EXPORT266XPC_EXPORT
246const xpc_object_t XPC_ACTIVITY_CHECK_IN;267const xpc_object_t XPC_ACTIVITY_CHECK_IN;
247268
...@@ -280,7 +301,8 @@ const xpc_object_t XPC_ACTIVITY_CHECK_IN;...@@ -280,7 +301,8 @@ const xpc_object_t XPC_ACTIVITY_CHECK_IN;
280 * The handler block is never invoked reentrantly. It will be invoked on a301 * The handler block is never invoked reentrantly. It will be invoked on a
281 * dispatch queue with an appropriate priority to perform the activity.302 * dispatch queue with an appropriate priority to perform the activity.
282 */303 */
283__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)304API_AVAILABLE(macos(10.9))
305API_UNAVAILABLE(ios)
284XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3306XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
285void307void
286xpc_activity_register(const char *identifier, xpc_object_t criteria,308xpc_activity_register(const char *identifier, xpc_object_t criteria,
...@@ -294,7 +316,8 @@ xpc_activity_register(const char *identifier, xpc_object_t criteria,...@@ -294,7 +316,8 @@ xpc_activity_register(const char *identifier, xpc_object_t criteria,
294 * This will return NULL in cases where the activity has already completed, e.g.316 * This will return NULL in cases where the activity has already completed, e.g.
295 * when checking in to an event that finished and was not rescheduled.317 * when checking in to an event that finished and was not rescheduled.
296 */318 */
297__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)319API_AVAILABLE(macos(10.9))
320API_UNAVAILABLE(ios)
298XPC_EXPORT XPC_WARN_RESULT XPC_RETURNS_RETAINED XPC_NONNULL1321XPC_EXPORT XPC_WARN_RESULT XPC_RETURNS_RETAINED XPC_NONNULL1
299xpc_object_t _Nullable322xpc_object_t _Nullable
300xpc_activity_copy_criteria(xpc_activity_t activity);323xpc_activity_copy_criteria(xpc_activity_t activity);
...@@ -305,7 +328,8 @@ xpc_activity_copy_criteria(xpc_activity_t activity);...@@ -305,7 +328,8 @@ xpc_activity_copy_criteria(xpc_activity_t activity);
305 * @abstract328 * @abstract
306 * Modifies the execution criteria of an activity.329 * Modifies the execution criteria of an activity.
307 */330 */
308__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)331API_AVAILABLE(macos(10.9))
332API_UNAVAILABLE(ios)
309XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2333XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
310void334void
311xpc_activity_set_criteria(xpc_activity_t activity, xpc_object_t criteria);335xpc_activity_set_criteria(xpc_activity_t activity, xpc_object_t criteria);
...@@ -386,7 +410,8 @@ typedef long xpc_activity_state_t;...@@ -386,7 +410,8 @@ typedef long xpc_activity_state_t;
386 * @abstract410 * @abstract
387 * Returns the current state of an activity.411 * Returns the current state of an activity.
388 */412 */
389__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)413API_AVAILABLE(macos(10.9))
414API_UNAVAILABLE(ios)
390XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1415XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
391xpc_activity_state_t416xpc_activity_state_t
392xpc_activity_get_state(xpc_activity_t activity);417xpc_activity_get_state(xpc_activity_t activity);
...@@ -401,7 +426,8 @@ xpc_activity_get_state(xpc_activity_t activity);...@@ -401,7 +426,8 @@ xpc_activity_get_state(xpc_activity_t activity);
401 * Returns true if the state was successfully updated; otherwise, returns426 * Returns true if the state was successfully updated; otherwise, returns
402 * false if the requested state transition is not valid.427 * false if the requested state transition is not valid.
403 */428 */
404__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)429API_AVAILABLE(macos(10.9))
430API_UNAVAILABLE(ios)
405XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1431XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
406bool432bool
407xpc_activity_set_state(xpc_activity_t activity, xpc_activity_state_t state);433xpc_activity_set_state(xpc_activity_t activity, xpc_activity_state_t state);
...@@ -424,7 +450,8 @@ xpc_activity_set_state(xpc_activity_t activity, xpc_activity_state_t state);...@@ -424,7 +450,8 @@ xpc_activity_set_state(xpc_activity_t activity, xpc_activity_state_t state);
424 * @return450 * @return
425 * Returns true if the activity should be deferred.451 * Returns true if the activity should be deferred.
426 */452 */
427__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)453API_AVAILABLE(macos(10.9))
454API_UNAVAILABLE(ios)
428XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1455XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
429bool456bool
430xpc_activity_should_defer(xpc_activity_t activity);457xpc_activity_should_defer(xpc_activity_t activity);
...@@ -447,7 +474,8 @@ xpc_activity_should_defer(xpc_activity_t activity);...@@ -447,7 +474,8 @@ xpc_activity_should_defer(xpc_activity_t activity);
447 * @param identifier474 * @param identifier
448 * The identifier of the activity to unregister.475 * The identifier of the activity to unregister.
449 */476 */
450__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)477API_AVAILABLE(macos(10.9))
478API_UNAVAILABLE(ios)
451XPC_EXPORT XPC_NONNULL1479XPC_EXPORT XPC_NONNULL1
452void480void
453xpc_activity_unregister(const char *identifier);481xpc_activity_unregister(const char *identifier);
lib/libc/include/any-macos-any/xpc/connection.h+214-6
...@@ -89,7 +89,7 @@ const struct _xpc_dictionary_s _xpc_error_termination_imminent;...@@ -89,7 +89,7 @@ const struct _xpc_dictionary_s _xpc_error_termination_imminent;
89 */89 */
90#define XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT \90#define XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT \
91 XPC_GLOBAL_OBJECT(_xpc_error_peer_code_signing_requirement)91 XPC_GLOBAL_OBJECT(_xpc_error_peer_code_signing_requirement)
92__API_AVAILABLE(macos(12.0))92__API_AVAILABLE(macos(12.0), macCatalyst(15.0))
93XPC_EXPORT93XPC_EXPORT
94const struct _xpc_dictionary_s _xpc_error_peer_code_signing_requirement;94const struct _xpc_dictionary_s _xpc_error_peer_code_signing_requirement;
9595
...@@ -198,7 +198,8 @@ xpc_connection_create(const char * _Nullable name,...@@ -198,7 +198,8 @@ xpc_connection_create(const char * _Nullable name,
198 * because the Mach namespace is not queried for the service name until the198 * because the Mach namespace is not queried for the service name until the
199 * connection has been activated. See {@link xpc_connection_activate()}.199 * connection has been activated. See {@link xpc_connection_activate()}.
200 */200 */
201__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)201API_AVAILABLE(macos(10.7), macCatalyst(5.0))
202API_UNAVAILABLE(ios)
202XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1203XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
203xpc_connection_t204xpc_connection_t
204xpc_connection_create_mach_service(const char *name,205xpc_connection_create_mach_service(const char *name,
...@@ -668,7 +669,8 @@ xpc_connection_get_egid(xpc_connection_t connection);...@@ -668,7 +669,8 @@ xpc_connection_get_egid(xpc_connection_t connection);
668 * away, but there are no guarantees as to the timing of this notification's669 * away, but there are no guarantees as to the timing of this notification's
669 * delivery either at the kernel layer or at the XPC layer.670 * delivery either at the kernel layer or at the XPC layer.
670 */671 */
671__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)672API_AVAILABLE(macos(10.7))
673API_UNAVAILABLE(ios)
672XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT674XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
673pid_t675pid_t
674xpc_connection_get_pid(xpc_connection_t connection);676xpc_connection_get_pid(xpc_connection_t connection);
...@@ -683,7 +685,8 @@ xpc_connection_get_pid(xpc_connection_t connection);...@@ -683,7 +685,8 @@ xpc_connection_get_pid(xpc_connection_t connection);
683 * @result685 * @result
684 * The audit session ID of the remote peer at the time the connection was made.686 * The audit session ID of the remote peer at the time the connection was made.
685 */687 */
686__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)688API_AVAILABLE(macos(10.7))
689API_UNAVAILABLE(ios)
687XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT690XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
688au_asid_t691au_asid_t
689xpc_connection_get_asid(xpc_connection_t connection);692xpc_connection_get_asid(xpc_connection_t connection);
...@@ -778,17 +781,222 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection,...@@ -778,17 +781,222 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection,
778 * All messages received on this connection will be checked to ensure they come from a peer who satisfies781 * All messages received on this connection will be checked to ensure they come from a peer who satisfies
779 * the code signing requirement. For a listener connection, requests that do not satisfy the requirement782 * the code signing requirement. For a listener connection, requests that do not satisfy the requirement
780 * are dropped. When a reply is expected on the connection and the peer does not satisfy the requirement783 * are dropped. When a reply is expected on the connection and the peer does not satisfy the requirement
781 * XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT will be delivered instead of the reply.784 * `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT` will be delivered instead of the reply.
782 *785 *
783 * This API is not supported on embedded platforms and will return ENOTSUP. 786 * This API is not supported on embedded platforms and will return ENOTSUP.
784 *787 *
785 * @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements788 * @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements
786 */789 */
787__API_AVAILABLE(macos(12.0))790__API_AVAILABLE(macos(12.0), macCatalyst(15.0))
791API_UNAVAILABLE(ios, tvos, watchos)
788XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT792XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
789int793int
790xpc_connection_set_peer_code_signing_requirement(xpc_connection_t connection, const char *requirement);794xpc_connection_set_peer_code_signing_requirement(xpc_connection_t connection, const char *requirement);
791795
796/*!
797 * @function xpc_connection_set_peer_entitlement_exists_requirement
798 * Requires that the connection peer has the specified entitlement
799 *
800 * @param connection
801 * The connection object which is to be modified
802 *
803 * @param entitlement
804 * The entitlement the peer must have
805 * It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_exists_requirement`
806 *
807 * @result
808 * 0 on success, non-zero on error
809 *
810 * @discussion
811 * This function will return an error promptly if the entitlement requirement is invalid.
812 *
813 * It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
814 * connection. If more complex combinations of requirements are required, use
815 * `xpc_connection_set_peer_lightweight_code_requirement`.
816 *
817 * All messages received on this connection will be checked to ensure that they come from a peer who satisfies the
818 * requirement. For a listener connection, requests that do not satisfy the requirement are dropped. When a reply
819 * is expected on the connection and the peer does not satisfy the requirement `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT`
820 * will be delivered instead of the reply.
821 */
822API_AVAILABLE(macos(14.4), ios(17.4))
823API_UNAVAILABLE(tvos, watchos)
824XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
825int
826xpc_connection_set_peer_entitlement_exists_requirement(xpc_connection_t connection, const char *entitlement);
827
828/*!
829 * @function xpc_connection_set_peer_entitlement_matches_value_requirement
830 * Requires that the connection peer has the specified entitlement with the matching value
831 *
832 * @param connection
833 * The connection object which is to be modified
834 *
835 * @param entitlement
836 * The entitlement the peer must have
837 * It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_matches_value_requirement`
838 *
839 * @param value
840 * The value that the entitlement must match
841 * It is safe to deallocate the value object after calling
842 * `xpc_connection_set_peer_entitlement_matches_value_requirement`.
843 * Valid xpc types for this object are `XPC_TYPE_BOOL`, `XPC_TYPE_STRING` and `XPC_TYPE_INT64`.
844 *
845 * @result
846 * 0 on success, non-zero on error
847 *
848 * @discussion
849 * This function will return an error promptly if the entitlement requirement is invalid.
850 *
851 * It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
852 * connection. If more complex combinations of requirements are required, use
853 * `xpc_connection_set_peer_lightweight_code_requirement`.
854 *
855 * All messages received on this connection will be checked to ensure that they come from a peer who satisfies the
856 * requirement. For a listener connection, requests that do not satisfy the requirement are dropped. When a reply
857 * is expected on the connection and the peer does not satisfy the requirement `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT`
858 * will be delivered instead of the reply.
859 */
860API_AVAILABLE(macos(14.4), ios(17.4))
861API_UNAVAILABLE(tvos, watchos)
862XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
863int
864xpc_connection_set_peer_entitlement_matches_value_requirement(xpc_connection_t connection, const char *entitlement, xpc_object_t value);
865
866/*!
867 * @function xpc_connection_set_peer_team_identity_requirement
868 * Requires that the connection peer has the specified identity and is signed with the same team identifier
869 * as the current process
870 *
871 * @param connection
872 * The connection object which is to be modified
873 *
874 * @param signing_identifier
875 * The optional signing identifier the peer must have
876 * It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`
877 *
878 * @result
879 * 0 on success, non-zero on error
880 *
881 * @discussion
882 * This function will return an error promptly if the identity requirement is invalid.
883 *
884 * The peer process must be signed as either a Testflight app or an App store app,
885 * or be signed by an apple issued development certificate, an enterprise distributed
886 * certificate (embedded only), or a Developer ID certificate (macOS only)
887 *
888 * It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
889 * connection. If more complex combinations of requirements are required, use
890 * `xpc_connection_set_peer_lightweight_code_requirement`.
891 *
892 * All messages received on this connection will be checked to ensure that they come from a peer who satisfies the
893 * requirement. For a listener connection, requests that do not satisfy the requirement are dropped. When a reply
894 * is expected on the connection and the peer does not satisfy the requirement `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT`
895 * will be delivered instead of the reply.
896 */
897API_AVAILABLE(macos(14.4), ios(17.4))
898API_UNAVAILABLE(tvos, watchos)
899XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT
900int
901xpc_connection_set_peer_team_identity_requirement(xpc_connection_t connection, const char * _Nullable signing_identifier);
902
903/*!
904 * @function xpc_connection_set_peer_platform_identity_requirement
905 * Requires that the connection peer has the specified identity and is signed by Apple
906 *
907 * @param connection
908 * The connection object which is to be modified
909 *
910 * @param signing_identifier
911 * The optional signing identifier the peer must have. If not specified, this function ensures that the peer is signed by Apple
912 * It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`
913 *
914 * @result
915 * 0 on success, non-zero on error
916 *
917 * @discussion
918 * This function will return an error promptly if the identity requirement is invalid.
919 *
920 * The peer process must be signed by Apple. Use `xpc_connection_set_peer_identity_requirement` if the peer
921 * is not part of the OS.
922 *
923 * It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
924 * connection. If more complex combinations of requirements are required, use
925 * `xpc_connection_set_peer_lightweight_code_requirement`.
926 *
927 * All messages received on this connection will be checked to ensure that they come from a peer who satisfies the
928 * requirement. For a listener connection, requests that do not satisfy the requirement are dropped. When a reply
929 * is expected on the connection and the peer does not satisfy the requirement `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT`
930 * will be delivered instead of the reply.
931 */
932API_AVAILABLE(macos(14.4), ios(17.4))
933API_UNAVAILABLE(tvos, watchos)
934XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT
935int
936xpc_connection_set_peer_platform_identity_requirement(xpc_connection_t connection, const char * _Nullable signing_identifier);
937
938/*!
939 * @function xpc_connection_set_peer_lightweight_code_requirement
940 * Requires that the connection peer has the specified lightweight code requirement
941 *
942 * @param connection
943 * The connection object which is to be modified
944 *
945 * @param lwcr
946 * The lightweight code requirement the peer must have
947 * It is safe to deallocate the lightweight code requirement object after calling `xpc_connection_set_peer_lightweight_code_requirement`
948 *
949 * @result
950 * 0 on success, non-zero on error
951 *
952 * @discussion
953 * This function will return an error promptly if the lightweight code requirement is invalid.
954 *
955 * The lightweight code requirement must be an `xpc_dictionary_t` equivalent of an LWCR constraint (see
956 * https://developer.apple.com/documentation/security/defining_launch_environment_and_library_constraints
957 * for details on the contents of the dictionary)
958 *
959 * The lightweight code requirement in the example below uses the $or operator to require that an
960 * executable’s either signed with the Team ID 8XCUU22SN2, or is an operating system executable:
961 * ```c
962 * xpc_object_t or_val = xpc_dictionary_create_empty();
963 * xpc_dictionary_set_string(or_val, "team-identifier", "8XCUU22SN2");
964 * xpc_dictionary_set_int64(or_val, "validation-category", 1);
965 *
966 * xpc_object_t lwcr = xpc_dictionary_create_empty();
967 * xpc_dictionary_set_value(lwcr, "$or", or_val);
968 *
969 * xpc_connection_set_peer_lightweight_code_requirement(connection, lwcr);
970 * ```
971 *
972 * It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
973 * connection.
974 *
975 * All messages received on this connection will be checked to ensure that they come from a peer who satisfies the
976 * requirement. For a listener connection, requests that do not satisfy the requirement are dropped. When a reply
977 * is expected on the connection and the peer does not satisfy the requirement `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT`
978 * will be delivered instead of the reply.
979 */
980API_AVAILABLE(macos(14.4), ios(17.4))
981API_UNAVAILABLE(tvos, watchos)
982XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
983int
984xpc_connection_set_peer_lightweight_code_requirement(xpc_connection_t connection, xpc_object_t lwcr);
985
986/*!
987 * @function xpc_connection_copy_invalidation_reason
988 * Returns a description of why the connection was invalidated.
989 *
990 * @param connection
991 * The connection object to inspect
992 *
993 * @result
994 * Null if the connection has not been invalidated, otherwise a description for why the connection was invalidated.
995 */
996API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0))
997XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT
998char * _Nullable
999xpc_connection_copy_invalidation_reason(xpc_connection_t connection);
7921000
793__END_DECLS1001__END_DECLS
794XPC_ASSUME_NONNULL_END1002XPC_ASSUME_NONNULL_END
lib/libc/include/any-macos-any/xpc/listener.h+48-5
...@@ -36,11 +36,19 @@ OS_OBJECT_DECL_CLASS(xpc_listener);...@@ -36,11 +36,19 @@ OS_OBJECT_DECL_CLASS(xpc_listener);
36 * Indicates that the listener should not be activated during its creation. The36 * Indicates that the listener should not be activated during its creation. The
37 * returned listener must be manually activated using37 * returned listener must be manually activated using
38 * {@link xpc_listener_activate} before it can be used.38 * {@link xpc_listener_activate} before it can be used.
39 *
40 * @const XPC_LISTENER_CREATE_FORCE_MACH
41 * Optional key to indicate to the runtime that this listener is for a Mach Service
42 *
43 * @const XPC_LISTENER_CREATE_FORCE_XPCSERVICE
44 * Optional key to indicate to the runtime that this listener is for a XPCService endpoint
39 */45 */
40XPC_SWIFT_NOEXPORT46XPC_SWIFT_NOEXPORT
41XPC_FLAGS_ENUM(xpc_listener_create_flags, uint64_t,47XPC_FLAGS_ENUM(xpc_listener_create_flags, uint64_t,
42 XPC_LISTENER_CREATE_NONE XPC_SWIFT_NAME("none") = 0,48 XPC_LISTENER_CREATE_NONE XPC_SWIFT_NAME("none") = 0,
43 XPC_LISTENER_CREATE_INACTIVE XPC_SWIFT_NAME("inactive") = (1 << 0),49 XPC_LISTENER_CREATE_INACTIVE XPC_SWIFT_NAME("inactive") = (1 << 0),
50 XPC_LISTENER_CREATE_FORCE_MACH XPC_SWIFT_NAME("mach") = ( 1 << 1),
51 XPC_LISTENER_CREATE_FORCE_XPCSERVICE XPC_SWIFT_NAME("xpcservice") = ( 1 << 2),
44);52);
4553
46#pragma mark Handlers54#pragma mark Handlers
...@@ -59,7 +67,8 @@ typedef void (^xpc_listener_incoming_session_handler_t)(xpc_session_t peer);...@@ -59,7 +67,8 @@ typedef void (^xpc_listener_incoming_session_handler_t)(xpc_session_t peer);
59 * should be disposed of with free(3) when done. This will return NULL if a67 * should be disposed of with free(3) when done. This will return NULL if a
60 * string description could not be generated.68 * string description could not be generated.
61 */69 */
62API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0))70API_AVAILABLE(macos(14.0), macCatalyst(17.0))
71API_UNAVAILABLE(ios, tvos, watchos)
63XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_WARN_RESULT72XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_WARN_RESULT
64char * _Nullable73char * _Nullable
65xpc_listener_copy_description(xpc_listener_t listener);74xpc_listener_copy_description(xpc_listener_t listener);
...@@ -107,7 +116,8 @@ xpc_listener_copy_description(xpc_listener_t listener);...@@ -107,7 +116,8 @@ xpc_listener_copy_description(xpc_listener_t listener);
107 * or cancel the session using `xpc_session_cancel`. Failure to take one of116 * or cancel the session using `xpc_session_cancel`. Failure to take one of
108 * these two actions will result in an API misuse crash.117 * these two actions will result in an API misuse crash.
109 */118 */
110API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0))119API_AVAILABLE(macos(14.0), macCatalyst(17.0))
120API_UNAVAILABLE(ios, tvos, watchos)
111XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT121XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
112xpc_listener_t _Nullable122xpc_listener_t _Nullable
113xpc_listener_create(const char * service,123xpc_listener_create(const char * service,
...@@ -136,7 +146,8 @@ xpc_listener_create(const char * service,...@@ -136,7 +146,8 @@ xpc_listener_create(const char * service,
136 * activated. Releasing the last reference on an inactive listener that was146 * activated. Releasing the last reference on an inactive listener that was
137 * created with an xpc_listener_create() is undefined.147 * created with an xpc_listener_create() is undefined.
138 */148 */
139API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0))149API_AVAILABLE(macos(14.0), macCatalyst(17.0))
150API_UNAVAILABLE(ios, tvos, watchos)
140XPC_EXPORT XPC_SWIFT_NOEXPORT151XPC_EXPORT XPC_SWIFT_NOEXPORT
141bool152bool
142xpc_listener_activate(xpc_listener_t listener,153xpc_listener_activate(xpc_listener_t listener,
...@@ -157,7 +168,8 @@ xpc_listener_activate(xpc_listener_t listener,...@@ -157,7 +168,8 @@ xpc_listener_activate(xpc_listener_t listener,
157 * to be explicitly cancelled and the process can safely terminate168 * to be explicitly cancelled and the process can safely terminate
158 * without cancelling the listener.169 * without cancelling the listener.
159 */170 */
160API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0))171API_AVAILABLE(macos(14.0), macCatalyst(17.0))
172API_UNAVAILABLE(ios, tvos, watchos)
161XPC_EXPORT XPC_SWIFT_NOEXPORT173XPC_EXPORT XPC_SWIFT_NOEXPORT
162void174void
163xpc_listener_cancel(xpc_listener_t listener);175xpc_listener_cancel(xpc_listener_t listener);
...@@ -176,11 +188,42 @@ xpc_listener_cancel(xpc_listener_t listener);...@@ -176,11 +188,42 @@ xpc_listener_cancel(xpc_listener_t listener);
176 * @discussion188 * @discussion
177 * The peer session will be cancelled and cannot be used after it has been rejected189 * The peer session will be cancelled and cannot be used after it has been rejected
178 */190 */
179API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0))191API_AVAILABLE(macos(14.0), macCatalyst(17.0))
192API_UNAVAILABLE(ios, tvos, watchos)
180XPC_EXPORT XPC_SWIFT_NOEXPORT193XPC_EXPORT XPC_SWIFT_NOEXPORT
181void194void
182xpc_listener_reject_peer(xpc_session_t peer, const char *reason);195xpc_listener_reject_peer(xpc_session_t peer, const char *reason);
183196
197/*!
198 * @function xpc_listener_set_peer_code_signing_requirement
199 * Requires that the listener peer satisfies a code signing requirement.
200 *
201 * @param listener
202 * The listener object which is to be modified.
203 *
204 * @param requirement
205 * The code signing requirement to be satisfied by the peer
206 * It is safe to deallocate the requirement string after calling `xpc_listener_set_peer_code_signing_requirement`
207 *
208 * @result
209 * 0 on success, non-zero on error
210 *
211 * @discussion
212 * This function will return an error promptly if the code signing requirement string is invalid.
213 *
214 * It is a programming error to call `xpc_listener_set_peer_code_signing_requirement` more than once per listener.
215 *
216 * All messages received on this listener will be checked to ensure they come from a peer who satisfies
217 * the code signing requirement. Requests that do not satisfy the requirement are dropped.
218 *
219 * @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements
220 */
221API_AVAILABLE(macos(14.4))
222API_UNAVAILABLE(ios, tvos, watchos)
223XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
224int
225xpc_listener_set_peer_code_signing_requirement(xpc_listener_t listener, const char *requirement);
226
184__END_DECLS227__END_DECLS
185XPC_ASSUME_NONNULL_END228XPC_ASSUME_NONNULL_END
186229
lib/libc/include/any-macos-any/xpc/session.h+54-2
...@@ -14,6 +14,20 @@...@@ -14,6 +14,20 @@
14XPC_ASSUME_NONNULL_BEGIN14XPC_ASSUME_NONNULL_BEGIN
15__BEGIN_DECLS15__BEGIN_DECLS
1616
17/*!
18 * @define XPC_TYPE_SESSION
19 *
20 * @discussion
21 * Sessions represent a stateful connection between a client and a service. When either end of the connection
22 * disconnects, the entire session will be invalidated. In this case the system will make no attempt to
23 * reestablish the connection or relaunch the service.
24 *
25 * Clients can initiate a session with a service that accepts xpc_connection_t connections but session
26 * semantics will be maintained.
27 *
28 */
29OS_OBJECT_DECL_CLASS(xpc_session);
30
17#pragma mark Constants31#pragma mark Constants
18/*!32/*!
19 * @typedef xpc_session_create_flags_t33 * @typedef xpc_session_create_flags_t
...@@ -94,7 +108,8 @@ xpc_session_copy_description(xpc_session_t session);...@@ -94,7 +108,8 @@ xpc_session_copy_description(xpc_session_t session);
94 * This will fail if the specified XPC service is either not found or is108 * This will fail if the specified XPC service is either not found or is
95 * unavailable.109 * unavailable.
96 */110 */
97API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0))111API_AVAILABLE(macos(13.0), macCatalyst(16.0))
112API_UNAVAILABLE(ios, tvos, watchos)
98XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT113XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
99xpc_session_t _Nullable114xpc_session_t _Nullable
100xpc_session_create_xpc_service(const char *name,115xpc_session_create_xpc_service(const char *name,
...@@ -139,7 +154,8 @@ xpc_session_create_xpc_service(const char *name,...@@ -139,7 +154,8 @@ xpc_session_create_xpc_service(const char *name,
139 * bootstrap or is otherwise unavailable.154 * bootstrap or is otherwise unavailable.
140 *155 *
141 */156 */
142API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0))157API_AVAILABLE(macos(13.0), macCatalyst(16.0))
158API_UNAVAILABLE(ios, tvos, watchos)
143XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT159XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
144xpc_session_t _Nullable160xpc_session_t _Nullable
145xpc_session_create_mach_service(const char *mach_service,161xpc_session_create_mach_service(const char *mach_service,
...@@ -367,6 +383,42 @@ void...@@ -367,6 +383,42 @@ void
367xpc_session_send_message_with_reply_async(xpc_session_t session,383xpc_session_send_message_with_reply_async(xpc_session_t session,
368 xpc_object_t message, xpc_session_reply_handler_t reply_handler);384 xpc_object_t message, xpc_session_reply_handler_t reply_handler);
369385
386/*!
387 * @function xpc_session_set_peer_code_signing_requirement
388 * Requires that the session peer satisfies a code signing requirement.
389 *
390 * @param session
391 * The session object which is to be modified.
392 *
393 * @param requirement
394 * The code signing requirement to be satisfied by the peer
395 * It is safe to deallocate the requirement string after calling `xpc_session_set_peer_code_signing_requirement`
396 *
397 * @result
398 * 0 on success, non-zero on error
399 *
400 * @discussion
401 * This function will return an error promptly if the code signing requirement string is invalid.
402 *
403 * It is a programming error to call `xpc_session_set_peer_code_signing_requirement` more than once per session.
404 *
405 * All messages received on this session will be checked to ensure they come from a peer who satisfies
406 * the code signing requirement. When message or a reply is received on the session and the peer does
407 * not satisfy the requirement the session will be cancelled.
408 *
409 * @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements
410 */
411API_AVAILABLE(macos(14.4))
412API_UNAVAILABLE(ios, tvos, watchos)
413XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
414int
415xpc_session_set_peer_code_signing_requirement(xpc_session_t session, const char *requirement);
416
417/* This is included for compatibility and should not be used in new code */
418#define XPC_TYPE_SESSION (&_xpc_type_session)
419XPC_EXPORT
420XPC_TYPE(_xpc_type_session);
421
370__END_DECLS422__END_DECLS
371XPC_ASSUME_NONNULL_END423XPC_ASSUME_NONNULL_END
372424
lib/libc/include/any-macos-any/xpc/xpc.h+63-21
...@@ -325,23 +325,6 @@ __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)...@@ -325,23 +325,6 @@ __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
325XPC_EXPORT325XPC_EXPORT
326const char * const _xpc_event_key_name;326const char * const _xpc_event_key_name;
327327
328/*!
329 * @define XPC_TYPE_SESSION
330 *
331 * @discussion
332 * Sessions represent a stateful connection between a client and a service. When either end of the connection
333 * disconnects, the entire session will be invalidated. In this case the system will make no attempt to
334 * reestablish the connection or relaunch the service.
335 *
336 * Clients can initiate a session with a service that accepts xpc_connection_t connections but session
337 * semantics will be maintained.
338 *
339 */
340#define XPC_TYPE_SESSION (&_xpc_type_session)
341XPC_EXPORT
342XPC_TYPE(_xpc_type_session);
343XPC_DECL(xpc_session);
344
345/*!328/*!
346 * @define XPC_TYPE_RICH_ERROR329 * @define XPC_TYPE_RICH_ERROR
347 *330 *
...@@ -367,7 +350,9 @@ XPC_ASSUME_NONNULL_END...@@ -367,7 +350,9 @@ XPC_ASSUME_NONNULL_END
367#include <xpc/listener.h>350#include <xpc/listener.h>
368#endif // __BLOCKS__351#endif // __BLOCKS__
369#undef __XPC_INDIRECT__352#undef __XPC_INDIRECT__
353#if __has_include(<launch.h>)
370#include <launch.h>354#include <launch.h>
355#endif // __has_include(<launch.h>)
371#endif // !defined(__XPC_BUILDING_XPC__) || !__XPC_BUILDING_XPC__356#endif // !defined(__XPC_BUILDING_XPC__) || !__XPC_BUILDING_XPC__
372XPC_ASSUME_NONNULL_BEGIN357XPC_ASSUME_NONNULL_BEGIN
373__BEGIN_DECLS358__BEGIN_DECLS
...@@ -2342,6 +2327,32 @@ void...@@ -2342,6 +2327,32 @@ void
2342xpc_dictionary_set_connection(xpc_object_t xdict, const char *key,2327xpc_dictionary_set_connection(xpc_object_t xdict, const char *key,
2343 xpc_connection_t connection);2328 xpc_connection_t connection);
23442329
2330/*!
2331 * @function xpc_dictionary_set_mach_send
2332 *
2333 * @abstract
2334 * Inserts a send right into a dictionary.
2335 *
2336 * @param xdict
2337 * The dictionary which is to be manipulated.
2338 *
2339 * @param key
2340 * The key for which the primitive value shall be set.
2341 *
2342 * @param p
2343 * The port to insert. After calling this method, the XPC object
2344 * corresponding to the primitive value inserted may be safely retrieved
2345 * with {@link xpc_dictionary_copy_mach_send()}.
2346 *
2347 * @discussion
2348 * The XPC runtime sends the port with disposition `MACH_MSG_TYPE_COPY_SEND`
2349 */
2350__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
2351XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
2352void
2353xpc_dictionary_set_mach_send(xpc_object_t xdict, const char *key,
2354 mach_port_t p);
2355
2345#pragma mark Dictionary Primitive Getters2356#pragma mark Dictionary Primitive Getters
2346/*!2357/*!
2347 * @function xpc_dictionary_get_bool2358 * @function xpc_dictionary_get_bool
...@@ -2625,6 +2636,33 @@ XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL...@@ -2625,6 +2636,33 @@ XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
2625xpc_object_t _Nullable2636xpc_object_t _Nullable
2626xpc_dictionary_get_array(xpc_object_t xdict, const char *key);2637xpc_dictionary_get_array(xpc_object_t xdict, const char *key);
26272638
2639/*!
2640 * @function xpc_dictionary_copy_mach_send
2641 *
2642 * @abstract
2643 * Returns a send right to the mach port.
2644 *
2645 * @param xdict
2646 * The dictionary object which is to be examined.
2647 *
2648 * @param key
2649 * The key whose value is to be obtained.
2650 *
2651 * @result
2652 * The object for the specified key within the dictionary. `MACH_PORT_NULL`
2653 * if there is no value associated with the specified key, if the given object
2654 * was not an XPC dictionary, or if the object for the specified key is not a send
2655 * right.
2656 *
2657 * @discussion
2658 * The XPC runtime will copy the send right using `mach_port_mod_refs`
2659 * before returning the port
2660 */
2661__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
2662XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 XPC_NONNULL2
2663mach_port_t
2664xpc_dictionary_copy_mach_send(xpc_object_t xdict, const char *key);
2665
2628#pragma mark Runtime2666#pragma mark Runtime
2629/*!2667/*!
2630 * @function xpc_main2668 * @function xpc_main
...@@ -2637,7 +2675,8 @@ xpc_dictionary_get_array(xpc_object_t xdict, const char *key);...@@ -2637,7 +2675,8 @@ xpc_dictionary_get_array(xpc_object_t xdict, const char *key);
2637 * @param handler2675 * @param handler
2638 * The handler with which to accept new connections.2676 * The handler with which to accept new connections.
2639 */2677 */
2640__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)2678API_AVAILABLE(macos(10.7), macCatalyst(5.0))
2679API_UNAVAILABLE(ios)
2641XPC_EXPORT XPC_NORETURN XPC_NONNULL12680XPC_EXPORT XPC_NORETURN XPC_NONNULL1
2642void2681void
2643xpc_main(xpc_connection_handler_t handler);2682xpc_main(xpc_connection_handler_t handler);
...@@ -2673,7 +2712,8 @@ xpc_main(xpc_connection_handler_t handler);...@@ -2673,7 +2712,8 @@ xpc_main(xpc_connection_handler_t handler);
2673 * connection's event handler, no more messages will be delivered to the2712 * connection's event handler, no more messages will be delivered to the
2674 * connection.2713 * connection.
2675 */2714 */
2676__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)2715API_AVAILABLE(macos(10.7))
2716API_UNAVAILABLE(ios)
2677XPC_TRANSACTION_DEPRECATED2717XPC_TRANSACTION_DEPRECATED
2678XPC_EXPORT2718XPC_EXPORT
2679void2719void
...@@ -2690,7 +2730,8 @@ xpc_transaction_begin(void);...@@ -2690,7 +2730,8 @@ xpc_transaction_begin(void);
2690 * See the discussion for {@link xpc_transaction_begin()} for details regarding2730 * See the discussion for {@link xpc_transaction_begin()} for details regarding
2691 * the XPC runtime's idle-exit policy.2731 * the XPC runtime's idle-exit policy.
2692 */2732 */
2693__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)2733API_AVAILABLE(macos(10.7))
2734API_UNAVAILABLE(ios)
2694XPC_TRANSACTION_DEPRECATED2735XPC_TRANSACTION_DEPRECATED
2695XPC_EXPORT2736XPC_EXPORT
2696void2737void
...@@ -2725,7 +2766,8 @@ xpc_transaction_end(void);...@@ -2725,7 +2766,8 @@ xpc_transaction_end(void);
2725 * between the event handler running and the process exiting.2766 * between the event handler running and the process exiting.
2726 */2767 */
2727#if __BLOCKS__2768#if __BLOCKS__
2728__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)2769API_AVAILABLE(macos(10.7))
2770API_UNAVAILABLE(ios)
2729XPC_EXPORT XPC_NONNULL1 XPC_NONNULL32771XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
2730void2772void
2731xpc_set_event_stream_handler(const char *stream,2773xpc_set_event_stream_handler(const char *stream,