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{"MinimalDisplayName":"14.0"}
1{"MinimalDisplayName":"15.1"}
lib/libc/darwin/libSystem.tbd+815-763
......@@ -1,14 +1,10 @@
11--- !tapi-tbd
22tbd-version: 4
3targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
4 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
3targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
4 arm64e-macos, arm64e-maccatalyst ]
55install-name: '/usr/lib/libSystem.B.dylib'
6current-version: 1336
6current-version: 1351
77reexported-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' ]
128 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
139 arm64e-macos, arm64e-maccatalyst ]
1410 libraries: [ '/usr/lib/system/libcache.dylib', '/usr/lib/system/libcommonCrypto.dylib',
......@@ -21,13 +17,15 @@ reexported-libraries:
2117 '/usr/lib/system/libsystem_collections.dylib', '/usr/lib/system/libsystem_configuration.dylib',
2218 '/usr/lib/system/libsystem_containermanager.dylib', '/usr/lib/system/libsystem_coreservices.dylib',
2319 '/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',
25 '/usr/lib/system/libsystem_info.dylib', '/usr/lib/system/libsystem_m.dylib',
20 '/usr/lib/system/libsystem_dnssd.dylib', '/usr/lib/system/libsystem_eligibility.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',
2623 '/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',
28 '/usr/lib/system/libsystem_secinit.dylib', '/usr/lib/system/libsystem_symptoms.dylib',
29 '/usr/lib/system/libsystem_trace.dylib', '/usr/lib/system/libunwind.dylib',
30 '/usr/lib/system/libxpc.dylib' ]
24 '/usr/lib/system/libsystem_notify.dylib', '/usr/lib/system/libsystem_platform.dylib',
25 '/usr/lib/system/libsystem_pthread.dylib', '/usr/lib/system/libsystem_sandbox.dylib',
26 '/usr/lib/system/libsystem_sanitizers.dylib', '/usr/lib/system/libsystem_secinit.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' ]
3129exports:
3230 - targets: [ x86_64-macos, x86_64-maccatalyst ]
3331 symbols: [ 'R8289209$_close', 'R8289209$_fork', 'R8289209$_fsync', 'R8289209$_getattrlist',
......@@ -48,7 +46,7 @@ tbd-version: 4
4846targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
4947 arm64e-macos, arm64e-maccatalyst ]
5048install-name: '/usr/lib/system/libcache.dylib'
51current-version: 92
49current-version: 95
5250parent-umbrella:
5351 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
5452 arm64e-macos, arm64e-maccatalyst ]
......@@ -91,14 +89,18 @@ exports:
9189 _CCBigNumModExp, _CCBigNumModI, _CCBigNumMul, _CCBigNumMulI,
9290 _CCBigNumMulMod, _CCBigNumRightShift, _CCBigNumSetI, _CCBigNumSetNegative,
9391 _CCBigNumSub, _CCBigNumSubI, _CCBigNumToData, _CCBigNumToDecimalString,
94 _CCBigNumToHexString, _CCBigNumZeroLSBCount, _CCCKGContributorCommit,
95 _CCCKGContributorCreate, _CCCKGContributorDestroy, _CCCKGContributorFinish,
96 _CCCKGGetCommitmentSize, _CCCKGGetOpeningSize, _CCCKGGetShareSize,
97 _CCCKGOwnerCreate, _CCCKGOwnerDestroy, _CCCKGOwnerFinish,
98 _CCCKGOwnerGenerateShare, _CCCalibratePBKDF, _CCCreateBigNum,
99 _CCCrypt, _CCCryptorAddParameter, _CCCryptorChaCha20, _CCCryptorChaCha20Poly1305OneshotDecrypt,
100 _CCCryptorChaCha20Poly1305OneshotEncrypt, _CCCryptorCreate,
101 _CCCryptorCreateFromData, _CCCryptorCreateFromDataWithMode,
92 _CCBigNumToHexString, _CCBigNumZeroLSBCount, _CCCKG2ContributorCommit,
93 _CCCKG2ContributorCreate, _CCCKG2ContributorDestroy, _CCCKG2ContributorFinish,
94 _CCCKG2GetCommitmentSize, _CCCKG2GetOpeningSize, _CCCKG2GetShareSize,
95 _CCCKG2OwnerCreate, _CCCKG2OwnerDestroy, _CCCKG2OwnerFinish,
96 _CCCKG2OwnerGenerateShare, _CCCKG2ParamsP224Sha256Version2,
97 _CCCKGContributorCommit, _CCCKGContributorCreate, _CCCKGContributorDestroy,
98 _CCCKGContributorFinish, _CCCKGGetCommitmentSize, _CCCKGGetOpeningSize,
99 _CCCKGGetShareSize, _CCCKGOwnerCreate, _CCCKGOwnerDestroy,
100 _CCCKGOwnerFinish, _CCCKGOwnerGenerateShare, _CCCalibratePBKDF,
101 _CCCreateBigNum, _CCCrypt, _CCCryptorAddParameter, _CCCryptorChaCha20,
102 _CCCryptorChaCha20Poly1305OneshotDecrypt, _CCCryptorChaCha20Poly1305OneshotEncrypt,
103 _CCCryptorCreate, _CCCryptorCreateFromData, _CCCryptorCreateFromDataWithMode,
102104 _CCCryptorCreateWithMode, _CCCryptorDecryptDataBlock, _CCCryptorEncryptDataBlock,
103105 _CCCryptorFinal, _CCCryptorGCM, _CCCryptorGCMAddAAD, _CCCryptorGCMAddADD,
104106 _CCCryptorGCMAddIV, _CCCryptorGCMDecrypt, _CCCryptorGCMEncrypt,
......@@ -154,7 +156,7 @@ exports:
154156tbd-version: 4
155157targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
156158install-name: '/usr/lib/system/libcompiler_rt.dylib'
157current-version: 103.1
159current-version: 103.3
158160parent-umbrella:
159161 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
160162 umbrella: System
......@@ -397,7 +399,7 @@ tbd-version: 4
397399targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
398400 arm64e-macos, arm64e-maccatalyst ]
399401install-name: '/usr/lib/system/libcorecrypto.dylib'
400current-version: 1608.0.18
402current-version: 1736.40.7
401403parent-umbrella:
402404 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
403405 arm64e-macos, arm64e-maccatalyst ]
......@@ -432,36 +434,10 @@ exports:
432434 _ccapsic_client_generate_match_response, _ccapsic_client_init,
433435 _ccapsic_client_state_sizeof, _ccapsic_server_determine_intersection,
434436 _ccapsic_server_encode_element, _ccapsic_server_init, _ccapsic_server_state_sizeof,
435 _ccbfv_bytes_to_coeffs, _ccbfv_ciphertext_apply_galois, _ccbfv_ciphertext_coeff_compose,
436 _ccbfv_ciphertext_coeff_dcrt_plaintext_mul, _ccbfv_ciphertext_coeff_decompose,
437 _ccbfv_ciphertext_coeff_decompose_nptexts, _ccbfv_ciphertext_coeff_plaintext_mul,
438 _ccbfv_ciphertext_eval_dcrt_plaintext_mul, _ccbfv_ciphertext_eval_plaintext_mul,
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,
437 _ccascon_ascon128a, _ccascon_ascon128a_cmac, _ccascon_ascon128a_cmac_ref,
438 _ccascon_ascon128a_decrypt, _ccascon_ascon128a_encrypt, _ccascon_ascon128a_ref,
439 _ccascon_cmac_init, _ccascon_cmac_process, _ccascon_cmac_tag,
440 _ccascon_cmac_verify, _ccblowfish_cbc_decrypt_mode, _ccblowfish_cbc_encrypt_mode,
465441 _ccblowfish_cfb8_decrypt_mode, _ccblowfish_cfb8_encrypt_mode,
466442 _ccblowfish_cfb_decrypt_mode, _ccblowfish_cfb_encrypt_mode,
467443 _ccblowfish_ctr_crypt_mode, _ccblowfish_ecb_decrypt_mode,
......@@ -486,13 +462,17 @@ exports:
486462 _ccchacha20poly1305_finalize, _ccchacha20poly1305_incnonce,
487463 _ccchacha20poly1305_info, _ccchacha20poly1305_init, _ccchacha20poly1305_reset,
488464 _ccchacha20poly1305_setnonce, _ccchacha20poly1305_verify,
489 _ccckg_contributor_commit, _ccckg_contributor_finish, _ccckg_init,
490 _ccckg_owner_finish, _ccckg_owner_generate_share, _ccckg_sizeof_commitment,
491 _ccckg_sizeof_ctx, _ccckg_sizeof_opening, _ccckg_sizeof_share,
492 _cccmac_final_generate, _cccmac_final_verify, _cccmac_init,
493 _cccmac_one_shot_generate, _cccmac_one_shot_verify, _cccmac_update,
494 _ccctr_block_size, _ccctr_context_size, _ccctr_init, _ccctr_one_shot,
495 _ccctr_update, _cccurve25519, _cccurve25519_make_key_pair,
465 _ccckg2_contributor_commit, _ccckg2_contributor_finish, _ccckg2_ctx_cp,
466 _ccckg2_ctx_di, _ccckg2_init, _ccckg2_owner_finish, _ccckg2_owner_generate_share,
467 _ccckg2_params_p224_sha256_v2, _ccckg2_sizeof_commitment,
468 _ccckg2_sizeof_ctx, _ccckg2_sizeof_opening, _ccckg2_sizeof_share,
469 _ccckg_contributor_commit, _ccckg_contributor_finish, _ccckg_ctx_cp,
470 _ccckg_ctx_di, _ccckg_init, _ccckg_owner_finish, _ccckg_owner_generate_share,
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,
496476 _cccurve25519_make_priv, _cccurve25519_make_pub, _cccurve25519_make_pub_with_rng,
497477 _cccurve25519_with_rng, _cccurve448, _cccurve448_make_key_pair,
498478 _cccurve448_make_priv, _cccurve448_make_pub, _ccder_blob_decode_bitstring,
......@@ -566,9 +546,9 @@ exports:
566546 _ccec_der_import_priv, _ccec_der_import_priv_keytype, _ccec_diversify_min_entropy_len,
567547 _ccec_diversify_priv_twin, _ccec_diversify_pub, _ccec_diversify_pub_twin,
568548 _ccec_export_affine_point, _ccec_export_affine_point_size,
569 _ccec_export_pub, _ccec_extract_rs, _ccec_full_add, _ccec_generate_blinding_keys,
570 _ccec_generate_key, _ccec_generate_key_deterministic, _ccec_generate_key_fips,
571 _ccec_generate_key_legacy, _ccec_generate_scalar_fips_retry,
549 _ccec_export_pub, _ccec_extract_rs, _ccec_full_add, _ccec_full_sub,
550 _ccec_generate_blinding_keys, _ccec_generate_key, _ccec_generate_key_deterministic,
551 _ccec_generate_key_fips, _ccec_generate_key_legacy, _ccec_generate_scalar_fips_retry,
572552 _ccec_get_cp, _ccec_get_fullkey_components, _ccec_get_pubkey_components,
573553 _ccec_import_affine_point, _ccec_import_pub, _ccec_is_compactable_pub,
574554 _ccec_keysize_is_supported, _ccec_make_priv, _ccec_make_pub,
......@@ -596,39 +576,70 @@ exports:
596576 _cced25519_make_pub_with_rng, _cced25519_sign, _cced25519_sign_with_rng,
597577 _cced25519_verify, _cced448_make_key_pair, _cced448_make_pub,
598578 _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,
600581 _ccgcm_context_size, _ccgcm_finalize, _ccgcm_gmac, _ccgcm_inc_iv,
601582 _ccgcm_init, _ccgcm_init_with_iv, _ccgcm_one_shot, _ccgcm_one_shot_legacy,
602583 _ccgcm_reset, _ccgcm_set_iv, _ccgcm_set_iv_legacy, _ccgcm_update,
603584 _cch2c, _cch2c_name, _cch2c_p256_sha256_sae_compat_info, _cch2c_p256_sha256_sswu_ro_info,
604585 _cch2c_p384_sha384_sae_compat_info, _cch2c_p384_sha512_sswu_ro_info,
605 _cch2c_p521_sha512_sswu_ro_info, _cchkdf, _cchkdf_expand,
606 _cchkdf_extract, _cchmac, _cchmac_final, _cchmac_init, _cchmac_update,
607 _cchpke_initiator_encrypt, _cchpke_initiator_export, _cchpke_initiator_seal,
608 _cchpke_initiator_setup, _cchpke_kem_generate_key_pair, _cchpke_params_sizeof_aead_key,
609 _cchpke_params_sizeof_aead_nonce, _cchpke_params_sizeof_aead_tag,
610 _cchpke_params_sizeof_kdf_hash, _cchpke_params_sizeof_kem_enc,
611 _cchpke_params_sizeof_kem_pk, _cchpke_params_sizeof_kem_pk_marshalled,
612 _cchpke_params_sizeof_kem_shared_secret, _cchpke_params_sizeof_kem_sk,
613 _cchpke_params_x25519_AESGCM128_HKDF_SHA256, _cchpke_responder_decrypt,
614 _cchpke_responder_export, _cchpke_responder_open, _cchpke_responder_setup,
615 _cckem_decapsulate, _cckem_encapsulate, _cckem_encapsulated_key_nbytes_ctx,
616 _cckem_encapsulated_key_nbytes_info, _cckem_export_privkey,
617 _cckem_export_pubkey, _cckem_full_ctx_init, _cckem_generate_key,
618 _cckem_import_privkey, _cckem_import_pubkey, _cckem_kyber768,
619 _cckem_privkey_nbytes_ctx, _cckem_privkey_nbytes_info, _cckem_pub_ctx_init,
620 _cckem_pubkey_nbytes_ctx, _cckem_pubkey_nbytes_info, _cckem_public_ctx,
621 _cckem_shared_key_nbytes_ctx, _cckem_shared_key_nbytes_info,
622 _cckem_sizeof_full_ctx, _cckem_sizeof_pub_ctx, _cclr_aes_init,
623 _cclr_block_nbytes, _cclr_decrypt_block, _cclr_encrypt_block,
586 _cch2c_p521_sha512_sswu_ro_info, _cche_bytes_to_coeffs, _cche_ciphertext_apply_galois,
587 _cche_ciphertext_coeff_compose, _cche_ciphertext_coeff_dcrt_plaintext_mul,
588 _cche_ciphertext_coeff_decompose, _cche_ciphertext_coeff_decompose_nptexts,
589 _cche_ciphertext_coeff_plaintext_mul, _cche_ciphertext_correction_factor,
590 _cche_ciphertext_eval_dcrt_plaintext_mul, _cche_ciphertext_eval_plaintext_mul,
591 _cche_ciphertext_fresh_correction_factor, _cche_ciphertext_fresh_npolys,
592 _cche_ciphertext_fwd_ntt, _cche_ciphertext_galois_elt_rotate_rows_left,
593 _cche_ciphertext_galois_elt_rotate_rows_right, _cche_ciphertext_galois_elt_swap_columns,
594 _cche_ciphertext_inv_ntt, _cche_ciphertext_plaintext_add,
595 _cche_ciphertext_sizeof, _cche_coeffs_to_bytes, _cche_crt_compose,
596 _cche_dcrt_plaintext_encode, _cche_dcrt_plaintext_sizeof,
597 _cche_decode_poly_uint64, _cche_decode_simd_int64, _cche_decode_simd_uint64,
598 _cche_decrypt, _cche_deserialize_ciphertext_coeff, _cche_deserialize_ciphertext_eval,
599 _cche_deserialize_seeded_ciphertext_coeff, _cche_deserialize_seeded_ciphertext_eval,
600 _cche_encode_poly_uint64, _cche_encode_simd_int64, _cche_encode_simd_reduced_int64,
601 _cche_encode_simd_uint64, _cche_encrypt_symmetric, _cche_encryption_params_coefficient_moduli,
602 _cche_encryption_params_coefficient_nmoduli, _cche_encryption_params_plaintext_modulus,
603 _cche_encryption_params_polynomial_degree, _cche_galois_key_generate,
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,
624636 _ccmd2_ltc_di, _ccmd4_ltc_di, _ccmd5_di, _ccmd5_ltc_di, _ccmgf,
625637 _ccmode_factory_cbc_decrypt, _ccmode_factory_cbc_encrypt,
626638 _ccmode_factory_ccm_decrypt, _ccmode_factory_ccm_encrypt,
627639 _ccmode_factory_cfb8_decrypt, _ccmode_factory_cfb8_encrypt,
628640 _ccmode_factory_cfb_decrypt, _ccmode_factory_cfb_encrypt,
629641 _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,
631 _ccmode_factory_siv_decrypt, _ccmode_factory_siv_encrypt,
642 _ccmode_factory_ofb_crypt, _ccmode_factory_siv_decrypt, _ccmode_factory_siv_encrypt,
632643 _ccmode_factory_xts_decrypt, _ccmode_factory_xts_encrypt,
633644 _ccn_add, _ccn_add1, _ccn_bitlen, _ccn_cmp, _ccn_cmpn, _ccn_lprint,
634645 _ccn_print, _ccn_read_uint, _ccn_set_bit, _ccn_seti, _ccn_sub,
......@@ -637,26 +648,25 @@ exports:
637648 _ccn_xor, _ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed,
638649 _ccnistkdf_ctr_hmac, _ccnistkdf_ctr_hmac_fixed, _ccofb_block_size,
639650 _ccofb_context_size, _ccofb_init, _ccofb_one_shot, _ccofb_update,
640 _ccoid_equal, _ccoid_payload, _ccoid_size, _ccomac_block_size,
641 _ccomac_context_size, _ccomac_init, _ccomac_one_shot, _ccomac_update,
642 _ccpad_cts1_decrypt, _ccpad_cts1_encrypt, _ccpad_cts2_decrypt,
643 _ccpad_cts2_encrypt, _ccpad_cts3_decrypt, _ccpad_cts3_encrypt,
644 _ccpad_pkcs7_decode, _ccpad_pkcs7_decrypt, _ccpad_pkcs7_ecb_decrypt,
645 _ccpad_pkcs7_ecb_encrypt, _ccpad_pkcs7_encrypt, _ccpad_xts_decrypt,
646 _ccpad_xts_encrypt, _ccpbkdf2_hmac, _ccpoly1305, _ccpoly1305_final,
647 _ccpoly1305_init, _ccpoly1305_update, _ccrc2_cbc_decrypt_mode,
648 _ccrc2_cbc_encrypt_mode, _ccrc2_cfb8_decrypt_mode, _ccrc2_cfb8_encrypt_mode,
649 _ccrc2_cfb_decrypt_mode, _ccrc2_cfb_encrypt_mode, _ccrc2_ctr_crypt_mode,
650 _ccrc2_ecb_decrypt_mode, _ccrc2_ecb_encrypt_mode, _ccrc2_ofb_crypt_mode,
651 _ccrc4, _ccrc4_eay, _ccrmd160_ltc_di, _ccrng, _ccrng_drbg_done,
652 _ccrng_drbg_init, _ccrng_drbg_init_withdrbg, _ccrng_drbg_reseed,
653 _ccrng_ecfips_test_init, _ccrng_pbkdf2_prng_init, _ccrng_prng,
654 _ccrng_rsafips_test_init, _ccrng_rsafips_test_set_next, _ccrng_sequence_init,
655 _ccrng_system_done, _ccrng_system_init, _ccrng_test_done,
656 _ccrng_test_init, _ccrng_trng, _ccrng_uniform, _ccrsa_block_size,
657 _ccrsa_block_start, _ccrsa_ctx_private_zp, _ccrsa_ctx_public,
658 _ccrsa_decrypt_eme_pkcs1v15, _ccrsa_decrypt_oaep, _ccrsa_dump_full_key,
659 _ccrsa_dump_public_key, _ccrsa_eme_pkcs1v15_decode, _ccrsa_eme_pkcs1v15_encode,
651 _ccoid_equal, _ccoid_payload, _ccoid_size, _ccpad_cts1_decrypt,
652 _ccpad_cts1_encrypt, _ccpad_cts2_decrypt, _ccpad_cts2_encrypt,
653 _ccpad_cts3_decrypt, _ccpad_cts3_encrypt, _ccpad_pkcs7_decode,
654 _ccpad_pkcs7_decrypt, _ccpad_pkcs7_ecb_decrypt, _ccpad_pkcs7_ecb_encrypt,
655 _ccpad_pkcs7_encrypt, _ccpad_xts_decrypt, _ccpad_xts_encrypt,
656 _ccpbkdf2_hmac, _ccpoly1305, _ccpoly1305_final, _ccpoly1305_init,
657 _ccpoly1305_update, _ccpost, _ccrc2_cbc_decrypt_mode, _ccrc2_cbc_encrypt_mode,
658 _ccrc2_cfb8_decrypt_mode, _ccrc2_cfb8_encrypt_mode, _ccrc2_cfb_decrypt_mode,
659 _ccrc2_cfb_encrypt_mode, _ccrc2_ctr_crypt_mode, _ccrc2_ecb_decrypt_mode,
660 _ccrc2_ecb_encrypt_mode, _ccrc2_ofb_crypt_mode, _ccrc4, _ccrc4_eay,
661 _ccrmd160_ltc_di, _ccrng, _ccrng_drbg_done, _ccrng_drbg_init,
662 _ccrng_drbg_init_withdrbg, _ccrng_drbg_reseed, _ccrng_ecfips_test_init,
663 _ccrng_pbkdf2_prng_init, _ccrng_prng, _ccrng_rsafips_test_init,
664 _ccrng_rsafips_test_set_next, _ccrng_sequence_init, _ccrng_system_done,
665 _ccrng_system_init, _ccrng_test_done, _ccrng_test_init, _ccrng_trng,
666 _ccrng_uniform, _ccrsa_block_size, _ccrsa_block_start, _ccrsa_ctx_private_zp,
667 _ccrsa_ctx_public, _ccrsa_decrypt_eme_pkcs1v15, _ccrsa_decrypt_oaep,
668 _ccrsa_dump_full_key, _ccrsa_dump_public_key, _ccrsa_eme_pkcs1v15_decode,
669 _ccrsa_eme_pkcs1v15_decode_safe, _ccrsa_eme_pkcs1v15_encode,
660670 _ccrsa_emsa_pkcs1v15_encode, _ccrsa_emsa_pkcs1v15_verify,
661671 _ccrsa_emsa_pss_decode, _ccrsa_emsa_pss_encode, _ccrsa_encrypt_eme_pkcs1v15,
662672 _ccrsa_encrypt_oaep, _ccrsa_export_priv, _ccrsa_export_priv_size,
......@@ -751,14 +761,15 @@ exports:
751761 _ccaes_arm_ecb_decrypt_mode, _ccaes_arm_ecb_encrypt_mode,
752762 _ccaes_arm_ofb_crypt_mode, _ccaes_arm_xts_decrypt_mode, _ccaes_arm_xts_encrypt_mode,
753763 _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,
755 _ccsha512_vng_arm_di ]
764 _ccsha256_vng_arm_di, _ccsha384_vng_arm_di, _ccsha384_vng_arm_hw_di,
765 _ccsha512_256_vng_arm_di, _ccsha512_256_vng_arm_hw_di, _ccsha512_vng_arm_di,
766 _ccsha512_vng_arm_hw_di ]
756767--- !tapi-tbd
757768tbd-version: 4
758769targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
759770 arm64e-macos, arm64e-maccatalyst ]
760771install-name: '/usr/lib/system/libdispatch.dylib'
761current-version: 1462.0.4
772current-version: 1502.0.1
762773parent-umbrella:
763774 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
764775 arm64e-macos, arm64e-maccatalyst ]
......@@ -785,38 +796,40 @@ exports:
785796 __dispatch_runloop_root_queue_perform_4CF, __dispatch_runloop_root_queue_wakeup_4CF,
786797 __dispatch_source_set_runloop_timer_4CF, __dispatch_source_type_data_add,
787798 __dispatch_source_type_data_or, __dispatch_source_type_data_replace,
788 __dispatch_source_type_interval, __dispatch_source_type_mach_recv,
789 __dispatch_source_type_mach_send, __dispatch_source_type_memorypressure,
790 __dispatch_source_type_memorystatus, __dispatch_source_type_nw_channel,
791 __dispatch_source_type_proc, __dispatch_source_type_read,
792 __dispatch_source_type_signal, __dispatch_source_type_sock,
793 __dispatch_source_type_timer, __dispatch_source_type_vfs,
794 __dispatch_source_type_vm, __dispatch_source_type_vnode, __dispatch_source_type_write,
795 __dispatch_source_will_reenable_kevent_4NW, __dispatch_wait_for_enqueuer,
796 __dispatch_workloop_set_observer_hooks_4IOHID, __dispatch_workloop_should_yield_4NW,
797 __firehose_spi_version, __os_object_alloc, __os_object_alloc_realized,
799 __dispatch_source_type_exclaves_notification, __dispatch_source_type_interval,
800 __dispatch_source_type_mach_recv, __dispatch_source_type_mach_send,
801 __dispatch_source_type_memorypressure, __dispatch_source_type_memorystatus,
802 __dispatch_source_type_nw_channel, __dispatch_source_type_proc,
803 __dispatch_source_type_read, __dispatch_source_type_signal,
804 __dispatch_source_type_sock, __dispatch_source_type_timer,
805 __dispatch_source_type_vfs, __dispatch_source_type_vm, __dispatch_source_type_vnode,
806 __dispatch_source_type_write, __dispatch_source_will_reenable_kevent_4NW,
807 __dispatch_wait_for_enqueuer, __dispatch_workloop_set_observer_hooks_4IOHID,
808 __dispatch_workloop_should_yield_4NW, __firehose_spi_version,
809 __os_object_alloc, __os_object_alloc_bridged, __os_object_alloc_realized,
798810 __os_object_dealloc, __os_object_release, __os_object_release_internal,
799811 __os_object_release_internal_n, __os_object_release_without_xref_dispose,
800812 __os_object_retain, __os_object_retain_internal, __os_object_retain_internal_n,
801813 __os_object_retain_with_resurrect, _dispatch_activate, _dispatch_after,
802 _dispatch_after_f, _dispatch_allocator_layout, _dispatch_apply,
803 _dispatch_apply_attr_destroy, _dispatch_apply_attr_init, _dispatch_apply_attr_query,
804 _dispatch_apply_attr_set_parallelism, _dispatch_apply_f, _dispatch_apply_with_attr,
805 _dispatch_apply_with_attr_f, _dispatch_assert_queue, '_dispatch_assert_queue$V2',
806 _dispatch_assert_queue_barrier, _dispatch_assert_queue_not,
807 '_dispatch_assert_queue_not$V2', _dispatch_async, _dispatch_async_and_wait,
808 _dispatch_async_and_wait_f, _dispatch_async_enforce_qos_class_f,
809 _dispatch_async_f, _dispatch_async_swift_job, _dispatch_atfork_child,
810 _dispatch_atfork_parent, _dispatch_atfork_prepare, _dispatch_barrier_async,
811 _dispatch_barrier_async_and_wait, _dispatch_barrier_async_and_wait_f,
812 _dispatch_barrier_async_f, _dispatch_barrier_sync, _dispatch_barrier_sync_f,
813 _dispatch_benchmark, _dispatch_benchmark_f, _dispatch_block_cancel,
814 _dispatch_block_create, _dispatch_block_create_with_qos_class,
815 _dispatch_block_create_with_voucher, _dispatch_block_create_with_voucher_and_qos_class,
816 _dispatch_block_notify, _dispatch_block_perform, _dispatch_block_testcancel,
817 _dispatch_block_wait, _dispatch_channel_async, _dispatch_channel_async_f,
818 _dispatch_channel_cancel, _dispatch_channel_create, _dispatch_channel_drain,
819 _dispatch_channel_drain_f, _dispatch_channel_enqueue, _dispatch_channel_foreach_work_item_peek,
814 _dispatch_after_f, _dispatch_allocator_layout, _dispatch_allow_send_signals,
815 _dispatch_apply, _dispatch_apply_attr_destroy, _dispatch_apply_attr_init,
816 _dispatch_apply_attr_query, _dispatch_apply_attr_set_parallelism,
817 _dispatch_apply_f, _dispatch_apply_with_attr, _dispatch_apply_with_attr_f,
818 _dispatch_assert_queue, '_dispatch_assert_queue$V2', _dispatch_assert_queue_barrier,
819 _dispatch_assert_queue_not, '_dispatch_assert_queue_not$V2',
820 _dispatch_async, _dispatch_async_and_wait, _dispatch_async_and_wait_f,
821 _dispatch_async_enforce_qos_class_f, _dispatch_async_f, _dispatch_async_swift_job,
822 _dispatch_atfork_child, _dispatch_atfork_parent, _dispatch_atfork_prepare,
823 _dispatch_barrier_async, _dispatch_barrier_async_and_wait,
824 _dispatch_barrier_async_and_wait_f, _dispatch_barrier_async_f,
825 _dispatch_barrier_sync, _dispatch_barrier_sync_f, _dispatch_benchmark,
826 _dispatch_benchmark_f, _dispatch_block_cancel, _dispatch_block_create,
827 _dispatch_block_create_with_qos_class, _dispatch_block_create_with_voucher,
828 _dispatch_block_create_with_voucher_and_qos_class, _dispatch_block_notify,
829 _dispatch_block_perform, _dispatch_block_testcancel, _dispatch_block_wait,
830 _dispatch_channel_async, _dispatch_channel_async_f, _dispatch_channel_cancel,
831 _dispatch_channel_create, _dispatch_channel_drain, _dispatch_channel_drain_f,
832 _dispatch_channel_enqueue, _dispatch_channel_foreach_work_item_peek,
820833 _dispatch_channel_foreach_work_item_peek_f, _dispatch_channel_testcancel,
821834 _dispatch_channel_wakeup, _dispatch_data_apply, _dispatch_data_apply_f,
822835 _dispatch_data_copy_region, _dispatch_data_create, _dispatch_data_create_alloc,
......@@ -879,7 +892,8 @@ exports:
879892 _dispatch_workloop_set_autorelease_frequency, _dispatch_workloop_set_cpupercent,
880893 _dispatch_workloop_set_os_workgroup, _dispatch_workloop_set_qos_class,
881894 _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,
883897 _mach_voucher_persona_self, _os_eventlink_activate, _os_eventlink_associate,
884898 _os_eventlink_cancel, _os_eventlink_create, _os_eventlink_create_remote_with_eventlink,
885899 _os_eventlink_create_with_port, _os_eventlink_disassociate,
......@@ -898,18 +912,18 @@ exports:
898912 _os_workgroup_leave, _os_workgroup_leave_self, _os_workgroup_max_parallel_threads,
899913 _os_workgroup_parallel_create, _os_workgroup_set_working_arena,
900914 _os_workgroup_testcancel, _voucher_activity_create_with_data,
901 _voucher_activity_create_with_location, _voucher_activity_flush,
902 _voucher_activity_get_logging_preferences, _voucher_activity_get_metadata_buffer,
903 _voucher_activity_id_allocate, _voucher_activity_initialize_4libtrace,
904 _voucher_activity_should_send_strings, _voucher_activity_trace,
905 _voucher_activity_trace_v, _voucher_activity_trace_v_2, _voucher_adopt,
906 _voucher_copy, _voucher_copy_with_persona_mach_voucher, _voucher_copy_without_importance,
907 _voucher_create_with_mach_msg, _voucher_decrement_importance_count4CF,
908 _voucher_get_activity_id, _voucher_get_activity_id_and_creator,
909 _voucher_get_current_persona, _voucher_get_current_persona_originator_info,
910 _voucher_get_current_persona_proximate_info, _voucher_kvoucher_debug,
911 _voucher_process_can_use_arbitrary_personas, _voucher_release,
912 _voucher_replace_default_voucher, _voucher_retain ]
915 _voucher_activity_create_with_data_2, _voucher_activity_create_with_location,
916 _voucher_activity_flush, _voucher_activity_get_logging_preferences,
917 _voucher_activity_get_metadata_buffer, _voucher_activity_id_allocate,
918 _voucher_activity_initialize_4libtrace, _voucher_activity_should_send_strings,
919 _voucher_activity_trace, _voucher_activity_trace_v, _voucher_activity_trace_v_2,
920 _voucher_adopt, _voucher_copy, _voucher_copy_with_persona_mach_voucher,
921 _voucher_copy_without_importance, _voucher_create_with_mach_msg,
922 _voucher_decrement_importance_count4CF, _voucher_get_activity_id,
923 _voucher_get_activity_id_and_creator, _voucher_get_current_persona,
924 _voucher_get_current_persona_originator_info, _voucher_get_current_persona_proximate_info,
925 _voucher_kvoucher_debug, _voucher_process_can_use_arbitrary_personas,
926 _voucher_release, _voucher_replace_default_voucher, _voucher_retain ]
913927 objc-classes: [ OS_dispatch_channel, OS_dispatch_data, OS_dispatch_disk, OS_dispatch_group,
914928 OS_dispatch_io, OS_dispatch_mach, OS_dispatch_mach_msg, OS_dispatch_object,
915929 OS_dispatch_operation, OS_dispatch_queue, OS_dispatch_queue_attr,
......@@ -933,41 +947,45 @@ exports:
933947 symbols: [ _NSVersionOfLinkTimeLibrary, _NSVersionOfRunTimeLibrary, _NXArgc,
934948 _NXArgv, __NSGetExecutablePath, ___progname, __dyld_atfork_parent,
935949 __dyld_atfork_prepare, __dyld_dlopen_atfork_child, __dyld_dlopen_atfork_parent,
936 __dyld_dlopen_atfork_prepare, __dyld_find_foreign_type_protocol_conformance,
937 __dyld_find_foreign_type_protocol_conformance_on_disk, __dyld_find_protocol_conformance,
938 __dyld_find_protocol_conformance_on_disk, __dyld_find_unwind_sections,
939 __dyld_for_each_objc_class, __dyld_for_each_objc_protocol,
950 __dyld_dlopen_atfork_prepare, __dyld_dlsym_blocked, __dyld_find_foreign_type_protocol_conformance,
951 __dyld_find_foreign_type_protocol_conformance_on_disk, __dyld_find_pointer_hash_table_entry,
952 __dyld_find_protocol_conformance, __dyld_find_protocol_conformance_on_disk,
953 __dyld_find_unwind_sections, __dyld_for_each_objc_class, __dyld_for_each_objc_protocol,
940954 __dyld_for_objc_header_opt_ro, __dyld_for_objc_header_opt_rw,
941955 __dyld_fork_child, __dyld_get_dlopen_image_header, __dyld_get_image_header,
942956 __dyld_get_image_name, __dyld_get_image_slide, __dyld_get_image_uuid,
943957 __dyld_get_image_vmaddr_slide, __dyld_get_objc_selector, __dyld_get_prog_image_header,
944958 __dyld_get_shared_cache_range, __dyld_get_shared_cache_uuid,
945 __dyld_has_fix_for_radar, __dyld_has_preoptimized_swift_protocol_conformances,
946 __dyld_image_count, __dyld_images_for_addresses, __dyld_initializer,
947 __dyld_is_memory_immutable, __dyld_is_objc_constant, __dyld_is_preoptimized_objc_image_loaded,
948 __dyld_launch_mode, __dyld_lookup_section_info, __dyld_missing_symbol_abort,
949 __dyld_objc_class_count, __dyld_objc_notify_register, __dyld_objc_register_callbacks,
950 __dyld_objc_uses_large_shared_cache, __dyld_process_info_create,
951 __dyld_process_info_for_each_image, __dyld_process_info_for_each_segment,
952 __dyld_process_info_get_aot_cache, __dyld_process_info_get_cache,
953 __dyld_process_info_get_platform, __dyld_process_info_get_state,
954 __dyld_process_info_notify, __dyld_process_info_notify_main,
955 __dyld_process_info_notify_release, __dyld_process_info_notify_retain,
956 __dyld_process_info_release, __dyld_process_info_retain, __dyld_pseudodylib_deregister,
959 __dyld_get_swift_prespecialized_data, __dyld_has_fix_for_radar,
960 __dyld_has_preoptimized_swift_protocol_conformances, __dyld_image_count,
961 __dyld_images_for_addresses, __dyld_initializer, __dyld_is_memory_immutable,
962 __dyld_is_objc_constant, __dyld_is_preoptimized_objc_image_loaded,
963 __dyld_is_pseudodylib, __dyld_launch_mode, __dyld_lookup_section_info,
964 __dyld_missing_symbol_abort, __dyld_objc_class_count, __dyld_objc_notify_register,
965 __dyld_objc_register_callbacks, __dyld_objc_uses_large_shared_cache,
966 __dyld_process_info_create, __dyld_process_info_for_each_image,
967 __dyld_process_info_for_each_segment, __dyld_process_info_get_aot_cache,
968 __dyld_process_info_get_cache, __dyld_process_info_get_platform,
969 __dyld_process_info_get_state, __dyld_process_info_notify,
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,
957973 __dyld_pseudodylib_deregister_callbacks, __dyld_pseudodylib_register,
958 __dyld_pseudodylib_register_callbacks, __dyld_register_driverkit_main,
959 __dyld_register_for_bulk_image_loads, __dyld_register_for_image_loads,
960 __dyld_register_func_for_add_image, __dyld_register_func_for_remove_image,
961 __dyld_shared_cache_contains_path, __dyld_shared_cache_is_locally_built,
962 __dyld_shared_cache_optimized, __dyld_shared_cache_real_path,
963 __dyld_swift_optimizations_version, __dyld_visit_objc_classes,
964 __tlv_atexit, __tlv_bootstrap, __tlv_exit, _dladdr, _dlclose,
965 _dlerror, _dlopen, _dlopen_audited, _dlopen_from, _dlopen_preflight,
966 _dlsym, _dyldVersionNumber, _dyldVersionString, _dyld_dynamic_interpose,
967 _dyld_for_each_installed_shared_cache, _dyld_for_each_installed_shared_cache_with_system_path,
968 _dyld_get_active_platform, _dyld_get_base_platform, _dyld_get_image_versions,
969 _dyld_get_min_os_version, _dyld_get_program_min_os_version,
970 _dyld_get_program_sdk_version, _dyld_get_sdk_version, _dyld_has_inserted_or_interposing_libraries,
974 __dyld_pseudodylib_register_callbacks, __dyld_register_dlsym_notifier,
975 __dyld_register_driverkit_main, __dyld_register_for_bulk_image_loads,
976 __dyld_register_for_image_loads, __dyld_register_func_for_add_image,
977 __dyld_register_func_for_remove_image, __dyld_shared_cache_contains_path,
978 __dyld_shared_cache_is_locally_built, __dyld_shared_cache_optimized,
979 __dyld_shared_cache_real_path, __dyld_swift_optimizations_version,
980 __dyld_visit_objc_classes, __tlv_atexit, __tlv_bootstrap,
981 __tlv_exit, _dladdr, _dlclose, _dlerror, _dlopen, _dlopen_audited,
982 _dlopen_from, _dlopen_preflight, _dlsym, _dyldVersionNumber,
983 _dyldVersionString, _dyld_dynamic_interpose, _dyld_for_each_installed_shared_cache,
984 _dyld_for_each_installed_shared_cache_with_system_path, _dyld_get_active_platform,
985 _dyld_get_base_platform, _dyld_get_image_versions, _dyld_get_min_os_version,
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,
971989 _dyld_image_content_for_section, _dyld_image_content_for_segment,
972990 _dyld_image_copy_uuid, _dyld_image_for_each_section_info,
973991 _dyld_image_for_each_segment_info, _dyld_image_get_file_path,
......@@ -987,9 +1005,12 @@ exports:
9871005 _dyld_shared_cache_get_base_address, _dyld_shared_cache_get_mapped_size,
9881006 _dyld_shared_cache_is_mapped_private, _dyld_shared_cache_iterate_text,
9891007 _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,
9911010 _macho_arch_name_for_mach_header, _macho_best_slice, _macho_best_slice_in_fd,
9921011 _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,
9931014 _macho_for_each_slice, _macho_for_each_slice_in_fd, dyld_stub_binder ]
9941015 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
9951016 symbols: [ _NSAddImage, _NSAddLibrary, _NSAddLibraryWithSearching, _NSAddressOfSymbol,
......@@ -1030,7 +1051,7 @@ exports:
10301051tbd-version: 4
10311052targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
10321053install-name: '/usr/lib/system/libmacho.dylib'
1033current-version: 1009
1054current-version: 1021.4
10341055parent-umbrella:
10351056 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
10361057 umbrella: System
......@@ -1077,7 +1098,7 @@ tbd-version: 4
10771098targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
10781099 arm64e-macos, arm64e-maccatalyst ]
10791100install-name: '/usr/lib/system/libquarantine.dylib'
1080current-version: 169
1101current-version: 181.0.7
10811102parent-umbrella:
10821103 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
10831104 arm64e-macos, arm64e-maccatalyst ]
......@@ -1105,24 +1126,25 @@ exports:
11051126 _responsibility_get_uniqueid_responsible_for_pid, _responsibility_init,
11061127 _responsibility_set_pid_responsible_for_pid ]
11071128 - 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,
11091131 _responsibility_identity_get_binary_entitlement_data, _responsibility_identity_get_binary_is_platform,
11101132 _responsibility_identity_get_binary_offset, _responsibility_identity_get_binary_path,
11111133 _responsibility_identity_get_binary_signing_id, _responsibility_identity_get_binary_team_id,
11121134 _responsibility_identity_get_csflags, _responsibility_identity_get_hosted_path,
11131135 _responsibility_identity_get_hosted_team_id, _responsibility_identity_get_persistent_identifier,
11141136 _responsibility_identity_get_platform, _responsibility_identity_get_sdk,
1115 _responsibility_identity_get_user_uuid, _responsibility_identity_release,
1116 _responsibility_set_audittoken_responsible_for_caller, _responsibility_set_audittoken_responsible_for_self,
1117 _responsibility_set_caller_responsible_for_self, _responsibility_set_hosted_path,
1118 _responsibility_set_hosted_team_id, _responsibility_spawnattrs_getdisclaim,
1119 _responsibility_spawnattrs_setdisclaim ]
1137 _responsibility_identity_get_user_uuid, _responsibility_identity_open_binary_fd,
1138 _responsibility_identity_release, _responsibility_set_audittoken_responsible_for_caller,
1139 _responsibility_set_audittoken_responsible_for_self, _responsibility_set_caller_responsible_for_self,
1140 _responsibility_set_hosted_path, _responsibility_set_hosted_team_id,
1141 _responsibility_spawnattrs_getdisclaim, _responsibility_spawnattrs_setdisclaim ]
11201142--- !tapi-tbd
11211143tbd-version: 4
11221144targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
11231145 arm64e-macos, arm64e-maccatalyst ]
11241146install-name: '/usr/lib/system/libremovefile.dylib'
1125current-version: 70
1147current-version: 75
11261148parent-umbrella:
11271149 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
11281150 arm64e-macos, arm64e-maccatalyst ]
......@@ -1140,7 +1162,7 @@ tbd-version: 4
11401162targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
11411163 arm64e-macos, arm64e-maccatalyst ]
11421164install-name: '/usr/lib/system/libsystem_asl.dylib'
1143current-version: 398
1165current-version: 402
11441166parent-umbrella:
11451167 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
11461168 arm64e-macos, arm64e-maccatalyst ]
......@@ -1221,7 +1243,7 @@ tbd-version: 4
12211243targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
12221244 arm64e-macos, arm64e-maccatalyst ]
12231245install-name: '/usr/lib/system/libsystem_blocks.dylib'
1224current-version: 90
1246current-version: 94
12251247parent-umbrella:
12261248 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
12271249 arm64e-macos, arm64e-maccatalyst ]
......@@ -1240,7 +1262,7 @@ tbd-version: 4
12401262targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
12411263 arm64e-macos, arm64e-maccatalyst ]
12421264install-name: '/usr/lib/system/libsystem_c.dylib'
1243current-version: 1583.0.14
1265current-version: 1669.40.2
12441266parent-umbrella:
12451267 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
12461268 arm64e-macos, arm64e-maccatalyst ]
......@@ -1308,48 +1330,49 @@ exports:
13081330 ___tens_D2A, ___tinytens_D2A, ___tolower, ___tolower_l, ___toupper,
13091331 ___toupper_l, ___trailz_D2A, ___ulp_D2A, ___ungetc, ___ungetwc,
13101332 ___vsnprintf_chk, ___vsprintf_chk, ___wcwidth, ___wcwidth_l,
1311 __allocenvstate, __atexit_receipt, __c_locale, __cleanup,
1312 __closeutx, __copyenv, __cthread_init_routine, __deallocenvstate,
1313 __endutxent, __flockfile_debug_stub, __fseeko, __ftello, __fwalk,
1314 __getenvp, __getutxent, __getutxid, __getutxline, __inet_aton_check,
1315 __init_clock_port, __int_to_time, __libc_fork_child, __libc_fork_parent,
1316 __libc_fork_prepare, __libc_initializer, __long_to_time, __mkpath_np,
1317 __mktemp, __openutx, __os_assert_log, __os_assert_log_ctx,
1318 __os_assumes_log, __os_assumes_log_ctx, __os_avoid_tail_call,
1319 __os_crash, __os_crash_callback, __os_crash_fmt, __os_crash_msg,
1320 __os_debug_log, __os_debug_log_error_offset, __os_debug_log_error_str,
1321 __putenvp, __pututxline, __rand48_add, __rand48_mult, __rand48_seed,
1322 __readdir_unlocked, __reclaim_telldir, __seekdir, __setenvp,
1323 __setutxent, __sigaction_nobind, __sigintr, __signal_nobind,
1324 __sigvec_nobind, __sread, __sseek, __subsystem_init, __swrite,
1325 __time32_to_time, __time64_to_time, __time_to_int, __time_to_long,
1326 __time_to_time32, __time_to_time64, __unsetenvp, __utmpxname,
1327 _a64l, _abort, _abort_report_np, _abs, _acl_add_flag_np, _acl_add_perm,
1328 _acl_calc_mask, _acl_clear_flags_np, _acl_clear_perms, _acl_copy_entry,
1329 _acl_copy_ext, _acl_copy_ext_native, _acl_copy_int, _acl_copy_int_native,
1330 _acl_create_entry, _acl_create_entry_np, _acl_delete_def_file,
1331 _acl_delete_entry, _acl_delete_fd_np, _acl_delete_file_np,
1332 _acl_delete_flag_np, _acl_delete_link_np, _acl_delete_perm,
1333 _acl_dup, _acl_free, _acl_from_text, _acl_get_entry, _acl_get_fd,
1334 _acl_get_fd_np, _acl_get_file, _acl_get_flag_np, _acl_get_flagset_np,
1335 _acl_get_link_np, _acl_get_perm_np, _acl_get_permset, _acl_get_permset_mask_np,
1336 _acl_get_qualifier, _acl_get_tag_type, _acl_init, _acl_maximal_permset_mask_np,
1337 _acl_set_fd, _acl_set_fd_np, _acl_set_file, _acl_set_flagset_np,
1338 _acl_set_link_np, _acl_set_permset, _acl_set_permset_mask_np,
1339 _acl_set_qualifier, _acl_set_tag_type, _acl_size, _acl_to_text,
1340 _acl_valid, _acl_valid_fd_np, _acl_valid_file_np, _acl_valid_link,
1341 _addr2ascii, _alarm, _alphasort, _arc4random, _arc4random_addrandom,
1342 _arc4random_buf, _arc4random_stir, _arc4random_uniform, _ascii2addr,
1343 _asctime, _asctime_r, _asprintf, _asprintf_l, _asxprintf,
1344 _asxprintf_exec, _atexit, _atexit_b, _atof, _atof_l, _atoi,
1345 _atoi_l, _atol, _atol_l, _atoll, _atoll_l, _backtrace, _backtrace_async,
1346 _backtrace_from_fp, _backtrace_image_offsets, _backtrace_set_pcs_func,
1347 _backtrace_symbols, _backtrace_symbols_fd, _basename, _basename_r,
1348 _bcopy, _brk, _bsd_signal, _bsearch, _bsearch_b, _btowc, _btowc_l,
1349 _catclose, _catgets, _catopen, _cfgetispeed, _cfgetospeed,
1350 _cfmakeraw, _cfsetispeed, _cfsetospeed, _cfsetspeed, _cgetcap,
1351 _cgetclose, _cgetent, _cgetfirst, _cgetmatch, _cgetnext, _cgetnum,
1352 _cgetset, _cgetstr, _cgetustr, _chmodx_np, _clearerr, _clearerr_unlocked,
1333 ___xlocale_C_collate, __allocenvstate, __atexit_receipt, __c_locale,
1334 __cleanup, __closeutx, __copyenv, __cthread_init_routine,
1335 __deallocenvstate, __endutxent, __flockfile_debug_stub, __fseeko,
1336 __ftello, __fwalk, __getenvp, __getutxent, __getutxid, __getutxline,
1337 __inet_aton_check, __init_clock_port, __int_to_time, __libc_fork_child,
1338 __libc_fork_parent, __libc_fork_prepare, __libc_initializer,
1339 __long_to_time, __mkpath_np, __mktemp, __openutx, __os_assert_log,
1340 __os_assert_log_ctx, __os_assumes_log, __os_assumes_log_ctx,
1341 __os_avoid_tail_call, __os_crash, __os_crash_callback, __os_crash_fmt,
1342 __os_crash_msg, __os_debug_log, __os_debug_log_error_offset,
1343 __os_debug_log_error_str, __putenvp, __pututxline, __rand48_add,
1344 __rand48_mult, __rand48_seed, __readdir_unlocked, __reclaim_telldir,
1345 __seekdir, __setenvp, __setutxent, __sigaction_nobind, __sigintr,
1346 __signal_nobind, __sigvec_nobind, __sread, __sseek, __subsystem_init,
1347 __swrite, __time32_to_time, __time64_to_time, __time_to_int,
1348 __time_to_long, __time_to_time32, __time_to_time64, __unsetenvp,
1349 __utmpxname, _a64l, _abort, _abort_report_np, _abs, _acl_add_flag_np,
1350 _acl_add_perm, _acl_calc_mask, _acl_clear_flags_np, _acl_clear_perms,
1351 _acl_copy_entry, _acl_copy_ext, _acl_copy_ext_native, _acl_copy_int,
1352 _acl_copy_int_native, _acl_create_entry, _acl_create_entry_np,
1353 _acl_delete_def_file, _acl_delete_entry, _acl_delete_fd_np,
1354 _acl_delete_file_np, _acl_delete_flag_np, _acl_delete_link_np,
1355 _acl_delete_perm, _acl_dup, _acl_free, _acl_from_text, _acl_get_entry,
1356 _acl_get_fd, _acl_get_fd_np, _acl_get_file, _acl_get_flag_np,
1357 _acl_get_flagset_np, _acl_get_link_np, _acl_get_perm_np, _acl_get_permset,
1358 _acl_get_permset_mask_np, _acl_get_qualifier, _acl_get_tag_type,
1359 _acl_init, _acl_maximal_permset_mask_np, _acl_set_fd, _acl_set_fd_np,
1360 _acl_set_file, _acl_set_flagset_np, _acl_set_link_np, _acl_set_permset,
1361 _acl_set_permset_mask_np, _acl_set_qualifier, _acl_set_tag_type,
1362 _acl_size, _acl_to_text, _acl_valid, _acl_valid_fd_np, _acl_valid_file_np,
1363 _acl_valid_link, _addr2ascii, _alarm, _alphasort, _arc4random,
1364 _arc4random_addrandom, _arc4random_buf, _arc4random_stir,
1365 _arc4random_uniform, _ascii2addr, _asctime, _asctime_r, _asprintf,
1366 _asprintf_l, _asxprintf, _asxprintf_exec, _at_quick_exit,
1367 _atexit, _atexit_b, _atof, _atof_l, _atoi, _atoi_l, _atol,
1368 _atol_l, _atoll, _atoll_l, _backtrace, _backtrace_async, _backtrace_from_fp,
1369 _backtrace_image_offsets, _backtrace_set_pcs_func, _backtrace_symbols,
1370 _backtrace_symbols_fd, _basename, _basename_r, _bcopy, _brk,
1371 _bsd_signal, _bsearch, _bsearch_b, _btowc, _btowc_l, _catclose,
1372 _catgets, _catopen, _cfgetispeed, _cfgetospeed, _cfmakeraw,
1373 _cfsetispeed, _cfsetospeed, _cfsetspeed, _cgetcap, _cgetclose,
1374 _cgetent, _cgetfirst, _cgetmatch, _cgetnext, _cgetnum, _cgetset,
1375 _cgetstr, _cgetustr, _chmodx_np, _clearerr, _clearerr_unlocked,
13531376 _clock, _clock_getres, _clock_gettime, _clock_gettime_nsec_np,
13541377 _clock_port, _clock_sem, _clock_settime, _closedir, _compat_mode,
13551378 _confstr, _copy_printf_domain, _creat, '_creat$NOCANCEL',
......@@ -1412,23 +1435,23 @@ exports:
14121435 _iswspecial, _iswspecial_l, _iswupper, _iswupper_l, _iswxdigit,
14131436 _iswxdigit_l, _isxdigit, _isxdigit_l, _jrand48, _kOSThermalNotificationPressureLevelName,
14141437 _killpg, _l64a, _labs, _lchflags, _lchmod, _lcong48, _ldiv,
1415 _lfind, _link_addr, _link_ntoa, _llabs, _lldiv, _localeconv,
1416 _localeconv_l, _localtime, _localtime_r, _lockf, '_lockf$NOCANCEL',
1417 _login, _login_tty, _logout, _logwtmp, _lrand48, _lsearch,
1418 _lstatx_np, _lutimes, _mblen, _mblen_l, _mbmb, _mbrlen, _mbrlen_l,
1419 _mbrrune, _mbrtowc, _mbrtowc_l, _mbrune, _mbsinit, _mbsinit_l,
1420 _mbsnrtowcs, _mbsnrtowcs_l, _mbsrtowcs, _mbsrtowcs_l, _mbstowcs,
1421 _mbstowcs_l, _mbtowc, _mbtowc_l, _memmem, _memset_s, _mergesort,
1422 _mergesort_b, _mkdirx_np, _mkdtemp, _mkdtempat_np, _mkfifox_np,
1423 _mkostemp, _mkostemps, _mkostempsat_np, _mkpath_np, _mkpathat_np,
1424 _mkstemp, _mkstemp_dprotected_np, _mkstemps, _mkstempsat_np,
1425 _mktemp, _mktime, _monaddition, _moncontrol, _moncount, _moninit,
1426 _monitor, _monoutput, _monreset, _monstartup, _mpool_close,
1427 _mpool_filter, _mpool_get, _mpool_new, _mpool_open, _mpool_put,
1428 _mpool_sync, _mrand48, _nanosleep, '_nanosleep$NOCANCEL',
1429 _new_printf_comp, _new_printf_domain, _newlocale, _nextwctype,
1430 _nextwctype_l, _nftw, _nice, _nl_langinfo, _nl_langinfo_l,
1431 _nrand48, _nvis, _off32, _off64, _offtime, _open_memstream,
1438 _lfind, _libc_set_introspection_hooks, _link_addr, _link_ntoa,
1439 _llabs, _lldiv, _localeconv, _localeconv_l, _localtime, _localtime_r,
1440 _lockf, '_lockf$NOCANCEL', _login, _login_tty, _logout, _logwtmp,
1441 _lrand48, _lsearch, _lstatx_np, _lutimes, _mblen, _mblen_l,
1442 _mbmb, _mbrlen, _mbrlen_l, _mbrrune, _mbrtowc, _mbrtowc_l,
1443 _mbrune, _mbsinit, _mbsinit_l, _mbsnrtowcs, _mbsnrtowcs_l,
1444 _mbsrtowcs, _mbsrtowcs_l, _mbstowcs, _mbstowcs_l, _mbtowc,
1445 _mbtowc_l, _memmem, _memset_s, _mergesort, _mergesort_b, _mkdirx_np,
1446 _mkdtemp, _mkdtempat_np, _mkfifox_np, _mkostemp, _mkostemps,
1447 _mkostempsat_np, _mkpath_np, _mkpathat_np, _mkstemp, _mkstemp_dprotected_np,
1448 _mkstemps, _mkstempsat_np, _mktemp, _mktime, _monaddition,
1449 _moncontrol, _moncount, _moninit, _monitor, _monoutput, _monreset,
1450 _monstartup, _mpool_close, _mpool_filter, _mpool_get, _mpool_new,
1451 _mpool_open, _mpool_put, _mpool_sync, _mrand48, _nanosleep,
1452 '_nanosleep$NOCANCEL', _new_printf_comp, _new_printf_domain,
1453 _newlocale, _nextwctype, _nextwctype_l, _nftw, _nice, _nl_langinfo,
1454 _nl_langinfo_l, _nrand48, _nvis, _offtime, _open_memstream,
14321455 _open_with_subsystem, _open_wmemstream, _opendev, _opendir,
14331456 _openpty, _openx_np, _optarg, _opterr, _optind, _optopt, _optreset,
14341457 _pause, '_pause$NOCANCEL', _pclose, _perror, _popen, '_popen$DARWIN_EXTSN',
......@@ -1436,27 +1459,26 @@ exports:
14361459 _psignal, _psort, _psort_b, _psort_r, _ptsname, _ptsname_r,
14371460 _putc, _putc_unlocked, _putchar, _putchar_unlocked, _putenv,
14381461 _puts, _pututxline, _putw, _putwc, _putwc_l, _putwchar, _putwchar_l,
1439 _qsort, _qsort_b, _qsort_r, _querylocale, _radixsort, _raise,
1440 _rand, _rand_r, _random, _rb_tree_count, _rb_tree_find_node,
1462 _qsort, _qsort_b, _qsort_r, _querylocale, _quick_exit, _radixsort,
1463 _raise, _rand, _rand_r, _random, _rb_tree_count, _rb_tree_find_node,
14411464 _rb_tree_find_node_geq, _rb_tree_find_node_leq, _rb_tree_init,
14421465 _rb_tree_insert_node, _rb_tree_iterate, _rb_tree_remove_node,
1443 _readdir, _readdir_r, _readpassphrase, _reallocf, _realpath,
1444 '_realpath$DARWIN_EXTSN', _recv, '_recv$NOCANCEL', _regcomp,
1445 _regcomp_l, _regerror, _regexec, _regfree, _register_printf_domain_function,
1446 _register_printf_domain_render_std, _regncomp, _regncomp_l,
1447 _regnexec, _regwcomp, _regwcomp_l, _regwexec, _regwncomp,
1448 _regwncomp_l, _regwnexec, _remove, _remque, _rewind, _rewinddir,
1449 _rindex, _rpmatch, _sbrk, _scandir, _scandir_b, _scanf, _scanf_l,
1450 _seed48, _seekdir, _send, '_send$NOCANCEL', _setbuf, _setbuffer,
1451 _setenv, _sethostid, _sethostname, _setinvalidrune, _setipv4sourcefilter,
1452 _setkey, _setlinebuf, _setlocale, _setlogin, _setmode, _setpgrp,
1453 _setprogname, _setrgid, _setruid, _setrunelocale, _setsourcefilter,
1454 _setstate, _settimeofday, _setttyent, _setusershell, _setutxent,
1455 _setutxent_wtmp, _setvbuf, _sigaction, _sigaddset, _sigaltstack,
1456 _sigblock, _sigdelset, _sigemptyset, _sigfillset, _sighold,
1457 _sigignore, _siginterrupt, _sigismember, _signal, _sigpause,
1458 '_sigpause$NOCANCEL', _sigrelse, _sigset, _sigsetmask, _sigvec,
1459 _skip, _sl_add, _sl_find, _sl_free, _sl_init, _sleep, '_sleep$NOCANCEL',
1466 _readdir, _readdir_r, _readpassphrase, _realpath, '_realpath$DARWIN_EXTSN',
1467 _recv, '_recv$NOCANCEL', _regcomp, _regcomp_l, _regerror,
1468 _regexec, _regfree, _register_printf_domain_function, _register_printf_domain_render_std,
1469 _regncomp, _regncomp_l, _regnexec, _regwcomp, _regwcomp_l,
1470 _regwexec, _regwncomp, _regwncomp_l, _regwnexec, _remove,
1471 _remque, _rewind, _rewinddir, _rindex, _rpmatch, _sbrk, _scandir,
1472 _scandir_b, _scanf, _scanf_l, _seed48, _seekdir, _send, '_send$NOCANCEL',
1473 _setbuf, _setbuffer, _setenv, _sethostid, _sethostname, _setinvalidrune,
1474 _setipv4sourcefilter, _setkey, _setlinebuf, _setlocale, _setlogin,
1475 _setmode, _setpgrp, _setprogname, _setrgid, _setruid, _setrunelocale,
1476 _setsourcefilter, _setstate, _settimeofday, _setttyent, _setusershell,
1477 _setutxent, _setutxent_wtmp, _setvbuf, _sigaction, _sigaddset,
1478 _sigaltstack, _sigblock, _sigdelset, _sigemptyset, _sigfillset,
1479 _sighold, _sigignore, _siginterrupt, _sigismember, _signal,
1480 _sigpause, '_sigpause$NOCANCEL', _sigrelse, _sigset, _sigsetmask,
1481 _sigvec, _sl_add, _sl_find, _sl_free, _sl_init, _sleep, '_sleep$NOCANCEL',
14601482 _snprintf, _snprintf_l, _snvis, _sockatmark, _sprintf, _sprintf_l,
14611483 _sradixsort, _srand, _srand48, _sranddev, _srandom, _srandomdev,
14621484 _sscanf, _sscanf_l, _stat_with_subsystem, _statvfs, _statx_np,
......@@ -1522,6 +1544,7 @@ exports:
15221544 _wmemcmp, _wmemcpy, _wmemmove, _wmemset, _wordexp, _wordfree,
15231545 _wprintf, _wprintf_l, _wscanf, _wscanf_l, _wtmpxname, _xprintf,
15241546 _xprintf_exec ]
1547 weak-symbols: [ __os_debug_log_redirect_func ]
15251548reexports:
15261549 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
15271550 arm64e-macos, arm64e-maccatalyst ]
......@@ -1534,7 +1557,7 @@ tbd-version: 4
15341557targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
15351558 arm64e-macos, arm64e-maccatalyst ]
15361559install-name: '/usr/lib/system/libsystem_collections.dylib'
1537current-version: 1583.0.14
1560current-version: 1669.40.2
15381561parent-umbrella:
15391562 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
15401563 arm64e-macos, arm64e-maccatalyst ]
......@@ -1564,7 +1587,7 @@ tbd-version: 4
15641587targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
15651588 arm64e-macos, arm64e-maccatalyst ]
15661589install-name: '/usr/lib/system/libsystem_configuration.dylib'
1567current-version: 1296.0.1
1590current-version: 1347.40.1
15681591parent-umbrella:
15691592 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
15701593 arm64e-macos, arm64e-maccatalyst ]
......@@ -1600,8 +1623,13 @@ exports:
16001623 arm64e-macos, arm64e-maccatalyst ]
16011624 symbols: [ _CMFSSEAM_DEFAULT, _CONTAINER_NOTIFY_USER_INVALIDATED, _CONTAINER_PERSONA_CURRENT,
16021625 _CONTAINER_PERSONA_PRIMARY, __container_init, __container_query_get_servicing_pid,
1603 __container_references_get_servicing_pid, _container_acquire_sandbox_extension,
1604 _container_audit_token_copy_codesign_hash, _container_audit_token_copy_codesign_identifier,
1626 __container_references_get_servicing_pid, __container_traverse_continuation_create,
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,
16051633 _container_audit_token_copy_entitlement, _container_audit_token_copy_executable_name,
16061634 _container_audit_token_for_pid, _container_audit_token_get_codesign_status,
16071635 _container_audit_token_get_egid, _container_audit_token_get_euid,
......@@ -1615,15 +1643,16 @@ exports:
16151643 _container_client_copy_decoded_from_xpc_object, _container_client_copy_encoded_xpc_object,
16161644 _container_client_copy_entitlement, _container_client_create_from_audit_token,
16171645 _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,
16191648 _container_client_get_pid, _container_client_get_platform,
16201649 _container_client_initializer, _container_client_is_alive,
16211650 _container_client_is_platform_binary, _container_client_is_sandboxed,
16221651 _container_client_is_signature_valid, _container_client_is_signed,
16231652 _container_client_is_test_client, _container_codesign_copy_cdhash,
1624 _container_codesign_copy_cs_identity, _container_codesign_copy_current_identifier,
1625 _container_codesign_get_self_audit_token, _container_codesign_get_status,
1626 _container_copy_client, _container_copy_code_signing_info_for_identifier,
1653 _container_codesign_copy_cs_identity, _container_codesign_copy_cs_team_identifier,
1654 _container_codesign_copy_current_identifier, _container_codesign_get_self_audit_token,
1655 _container_codesign_get_status, _container_copy_client, _container_copy_code_signing_info_for_identifier,
16271656 _container_copy_from_path, _container_copy_info, _container_copy_info_value_for_key,
16281657 _container_copy_object, _container_copy_path, _container_copy_persona_unique_strings,
16291658 _container_copy_sandbox_token, _container_copy_unlocalized_description,
......@@ -1652,8 +1681,8 @@ exports:
16521681 _container_frozenset_create, _container_frozenset_create_from_external_bytes,
16531682 _container_frozenset_destroy, _container_frozenset_enumerate_matches,
16541683 _container_frozenset_get_container_class_of_container_at_index,
1655 _container_frozenset_get_count, _container_frozenset_get_generation,
1656 _container_frozenset_get_identifier_of_container_at_index,
1684 _container_frozenset_get_count, _container_frozenset_get_creator_of_container_at_index,
1685 _container_frozenset_get_generation, _container_frozenset_get_identifier_of_container_at_index,
16571686 _container_frozenset_get_is_new_of_container_at_index, _container_frozenset_get_is_transient_of_container_at_index,
16581687 _container_frozenset_get_path_of_container_at_index, _container_frozenset_get_persona_unique_string_of_container_at_index,
16591688 _container_frozenset_get_stored_string, _container_frozenset_get_uid_of_container_at_index,
......@@ -1664,46 +1693,50 @@ exports:
16641693 _container_fs_item_exists_at, _container_fs_load_plist_at,
16651694 _container_fs_path_at, _container_fs_resolve_dirent_type_at,
16661695 _container_get_all_with_class_for_current_user, _container_get_class,
1667 _container_get_error_description, _container_get_identifier,
1668 _container_get_info, _container_get_info_value_for_key, _container_get_path,
1669 _container_get_persona_unique_string, _container_get_uid,
1670 _container_get_unique_path_component, _container_get_user_managed_assets_relative_path,
1671 _container_group_container_identifiers_for_current_user, _container_internal_get_first_boot_uuid,
1672 _container_invalidate_code_signing_cache, _container_is_equal,
1673 _container_is_new, _container_is_transient, _container_log_client_fault_logging_is_enabled,
1674 _container_log_error, _container_log_error_with_faults, _container_log_ext_error,
1696 _container_get_creator_codesign_identifier, _container_get_error_description,
1697 _container_get_identifier, _container_get_info, _container_get_info_value_for_key,
1698 _container_get_path, _container_get_persona_unique_string,
1699 _container_get_uid, _container_get_unique_path_component,
1700 _container_get_user_managed_assets_relative_path, _container_group_container_identifiers_for_current_user,
1701 _container_internal_get_first_boot_uuid, _container_invalidate_code_signing_cache,
1702 _container_is_equal, _container_is_new, _container_is_transient,
1703 _container_log_client_fault_logging_is_enabled, _container_log_error,
1704 _container_log_error_with_faults, _container_log_ext_error,
16751705 _container_log_ext_error_with_faults, _container_log_handle_for_category,
16761706 _container_log_replication_disable, _container_log_replication_enable_to_uid_relative_path,
16771707 _container_log_replication_prune_for_uid, _container_log_set_client_fault_logging,
16781708 _container_object_copy, _container_object_create, _container_object_create_blank,
1679 _container_object_free, _container_object_get_class, _container_object_get_identifier,
1680 _container_object_get_info, _container_object_get_path, _container_object_get_persona_unique_string,
1709 _container_object_free, _container_object_get_class, _container_object_get_creator_codesign_identifier,
1710 _container_object_get_identifier, _container_object_get_info,
1711 _container_object_get_path, _container_object_get_persona_unique_string,
16811712 _container_object_get_query, _container_object_get_sandbox_token,
16821713 _container_object_get_uid, _container_object_get_unique_path_component,
16831714 _container_object_get_user_managed_assets_relative_path, _container_object_get_uuid,
16841715 _container_object_is_new, _container_object_is_transient,
16851716 _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,
1687 _container_object_set_sandbox_token, _container_object_set_transient,
1688 _container_object_set_unique_path_component, _container_object_set_user_managed_assets_relative_path,
1689 _container_object_set_uuid, _container_object_update_metadata,
1690 _container_operation_complete_background_tasks, _container_operation_delete,
1691 _container_operation_delete_array, _container_operation_delete_reclaim_disk_space,
1692 _container_paths_context_create, _container_paths_context_free,
1693 _container_paths_context_set_class, _container_paths_context_set_flags,
1694 _container_paths_context_set_persona_unique_string, _container_paths_context_set_transient,
1695 _container_paths_context_set_uid, _container_paths_copy_container_at,
1696 _container_paths_copy_container_from_path, _container_paths_copy_container_root_path_for_context,
1697 _container_paths_copy_uid_home_relative, _container_paths_create_uid_home_relative,
1698 _container_paths_enumerate_containers_at, _container_perfect_hash_copyout_external_bytes,
1699 _container_perfect_hash_count, _container_perfect_hash_create,
1700 _container_perfect_hash_create_from_external_bytes, _container_perfect_hash_destroy,
1701 _container_perfect_hash_index_of, _container_perfect_hash_num_indexes,
1702 _container_perform_with_client_context, _container_persona_collect_all_ids,
1703 _container_persona_convert_unique_string_to_persona_uid, _container_persona_foreach,
1704 _container_process_restored_container, _container_pwd_copy_user_home_path,
1705 _container_pwd_for_name, _container_pwd_for_uid, _container_query_copy,
1706 _container_query_count_results, _container_query_create, _container_query_create_from_container,
1717 _container_object_set_class, _container_object_set_creator_codesign_identifier,
1718 _container_object_set_info, _container_object_set_is_new,
1719 _container_object_set_path, _container_object_set_sandbox_token,
1720 _container_object_set_transient, _container_object_set_unique_path_component,
1721 _container_object_set_user_managed_assets_relative_path, _container_object_set_uuid,
1722 _container_object_update_metadata, _container_operation_complete_background_tasks,
1723 _container_operation_delete, _container_operation_delete_array,
1724 _container_operation_delete_reclaim_disk_space, _container_paths_context_create,
1725 _container_paths_context_free, _container_paths_context_set_class,
1726 _container_paths_context_set_flags, _container_paths_context_set_persona_unique_string,
1727 _container_paths_context_set_transient, _container_paths_context_set_uid,
1728 _container_paths_copy_container_at, _container_paths_copy_container_from_path,
1729 _container_paths_copy_container_root_path_for_context, _container_paths_copy_uid_home_relative,
1730 _container_paths_create_uid_home_relative, _container_paths_enumerate_containers_at,
1731 _container_perfect_hash_copyout_external_bytes, _container_perfect_hash_count,
1732 _container_perfect_hash_create, _container_perfect_hash_create_from_external_bytes,
1733 _container_perfect_hash_destroy, _container_perfect_hash_index_of,
1734 _container_perfect_hash_num_indexes, _container_perform_with_client_context,
1735 _container_persona_collect_all_ids, _container_persona_convert_unique_string_to_persona_uid,
1736 _container_persona_foreach, _container_process_restored_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,
17071740 _container_query_free, _container_query_get_last_error, _container_query_get_single_result,
17081741 _container_query_iterate_results_sync, _container_query_iterate_results_with_identifier_sync,
17091742 _container_query_iterate_results_with_subquery_sync, _container_query_operation_set_client,
......@@ -1711,13 +1744,13 @@ exports:
17111744 _container_query_set_class, _container_query_set_group_identifiers,
17121745 _container_query_set_identifiers, _container_query_set_include_other_owners,
17131746 _container_query_set_persona_unique_string, _container_query_set_transient,
1714 _container_query_set_uid, _container_realpath, _container_recreate_structure,
1715 _container_references_get_last_error, _container_regenerate_uuid,
1716 _container_repair_user_data, _container_replace, _container_retry_test,
1717 _container_sandbox_extension_consume, _container_sandbox_extension_revoke,
1718 _container_sandbox_issue_custom_extension, _container_sandbox_issue_extension,
1719 _container_seam_fs_ensure_lazy_loaded, _container_seam_fs_reset,
1720 _container_seam_fs_set_common, _container_serialize_copy_deserialized_reference,
1747 _container_query_set_uid, _container_realpath, _container_realpathat,
1748 _container_recreate_structure, _container_references_get_last_error,
1749 _container_regenerate_uuid, _container_repair_user_data, _container_replace,
1750 _container_retry_test, _container_sandbox_extension_consume,
1751 _container_sandbox_extension_revoke, _container_sandbox_issue_custom_extension,
1752 _container_sandbox_issue_extension, _container_seam_fs_ensure_lazy_loaded,
1753 _container_seam_fs_reset, _container_seam_fs_set_common, _container_serialize_copy_deserialized_reference,
17211754 _container_serialize_copy_serialized_reference, _container_set_code_signing_info_for_identifier,
17221755 _container_set_data_protection_for_current_user, _container_set_info_value,
17231756 _container_set_test_lock, _container_stage_shared_system_content,
......@@ -1726,6 +1759,17 @@ exports:
17261759 _container_string_rom_destroy, _container_string_rom_index_of,
17271760 _container_string_rom_string_at_index, _container_subdirectories_for_class,
17281761 _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,
17291773 _container_update_with_container, _container_user_managed_assets_path,
17301774 _container_user_managed_assets_relative_path, _container_xpc_connection_is_shared,
17311775 _container_xpc_create_connection, _container_xpc_decode_container_object,
......@@ -1773,7 +1817,8 @@ exports:
17731817 __libcoreservices_fork_child, __set_user_dir_suffix, _sysdir_get_next_search_path_enumeration,
17741818 _sysdir_start_search_path_enumeration, _sysdir_start_search_path_enumeration_private ]
17751819 - 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 ]
17771822--- !tapi-tbd
17781823tbd-version: 4
17791824targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -1826,13 +1871,14 @@ parent-umbrella:
18261871exports:
18271872 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18281873 arm64e-macos, arm64e-maccatalyst ]
1829 symbols: [ _DarwinDirectoryRecordStoreApply, _DarwinDirectoryRecordStoreApplyWithFilter ]
1874 symbols: [ _DarwinDirectoryGetGeneration, _DarwinDirectoryRecordStoreApply,
1875 _DarwinDirectoryRecordStoreApplyWithFilter ]
18301876--- !tapi-tbd
18311877tbd-version: 4
18321878targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18331879 arm64e-macos, arm64e-maccatalyst ]
18341880install-name: '/usr/lib/system/libsystem_dnssd.dylib'
1835current-version: 2200.0.8
1881current-version: 2559.40.32
18361882parent-umbrella:
18371883 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18381884 arm64e-macos, arm64e-maccatalyst ]
......@@ -1844,6 +1890,7 @@ exports:
18441890 _DNSServiceAttrSetFailoverPolicy, _DNSServiceAttrSetValidationData,
18451891 _DNSServiceAttrSetValidationPolicy, _DNSServiceAttributeCreate,
18461892 _DNSServiceAttributeDeallocate, _DNSServiceAttributeSetAAAAPolicy,
1893 _DNSServiceAttributeSetHostKeyHash, _DNSServiceAttributeSetResolverOverride,
18471894 _DNSServiceAttributeSetTimestamp, _DNSServiceBrowse, _DNSServiceBrowseEx,
18481895 _DNSServiceConstructFullName, _DNSServiceCreateConnection,
18491896 _DNSServiceCreateDelegateConnection, _DNSServiceEnumerateDomains,
......@@ -1866,10 +1913,27 @@ exports:
18661913 _kDNSServiceAttributeAAAAFallback ]
18671914--- !tapi-tbd
18681915tbd-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
18691933targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18701934 arm64e-macos, arm64e-maccatalyst ]
18711935install-name: '/usr/lib/system/libsystem_featureflags.dylib'
1872current-version: 85
1936current-version: 94
18731937parent-umbrella:
18741938 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18751939 arm64e-macos, arm64e-maccatalyst ]
......@@ -2004,54 +2068,21 @@ exports:
20042068 _yp_next, _yp_order, _yp_unbind, _yperr_string, _ypprot_err ]
20052069--- !tapi-tbd
20062070tbd-version: 4
2007targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
2008 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2071targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2072 arm64e-macos, arm64e-maccatalyst ]
20092073install-name: '/usr/lib/system/libsystem_kernel.dylib'
2010current-version: 10002.1.11
2074current-version: 11215.41.2
20112075parent-umbrella:
2012 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
2013 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2076 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2077 arm64e-macos, arm64e-maccatalyst ]
20142078 umbrella: System
20152079exports:
2016 - targets: [ i386-macos, i386-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 ]
2080 - targets: [ x86_64-macos, x86_64-maccatalyst ]
20502081 symbols: [ '_fstat$INODE64', '_fstatat$INODE64', '_fstatfs$INODE64',
20512082 '_getfsstat$INODE64', _i386_get_ldt, _i386_set_ldt, '_lstat$INODE64',
2052 '_stat$INODE64', '_statfs$INODE64' ]
2053 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
2054 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2083 '_pselect$1050', '_select$1050', '_stat$INODE64', '_statfs$INODE64' ]
2084 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2085 arm64e-macos, arm64e-maccatalyst ]
20552086 symbols: [ _NDR_record, _____sigwait_nocancel, ____kernelVersionNumber,
20562087 ____kernelVersionString, ___abort_with_payload, ___accept,
20572088 ___accept_nocancel, ___access_extended, ___aio_suspend_nocancel,
......@@ -2150,6 +2181,7 @@ exports:
21502181 __kernelrpc_mach_port_special_reply_port_reset_link, __kernelrpc_mach_port_swap_guard,
21512182 __kernelrpc_mach_port_type, __kernelrpc_mach_port_type_trap,
21522183 __kernelrpc_mach_port_unguard, __kernelrpc_mach_port_unguard_trap,
2184 __kernelrpc_mach_ports_lookup3, __kernelrpc_mach_ports_register3,
21532185 __kernelrpc_mach_task_is_self, __kernelrpc_mach_vm_allocate,
21542186 __kernelrpc_mach_vm_allocate_trap, __kernelrpc_mach_vm_deallocate,
21552187 __kernelrpc_mach_vm_deallocate_trap, __kernelrpc_mach_vm_map,
......@@ -2164,43 +2196,52 @@ exports:
21642196 __mach_errors, __mach_fork_child, __mach_snprintf, __mach_vsnprintf,
21652197 __os_alloc_once_table, __os_xbs_chrooted, __register_gethostuuid_callback,
21662198 __thread_set_tsd_base, _abort_with_payload, _abort_with_reason,
2167 _accept, _access, _accessx_np, _acct, _act_get_state, _act_set_state,
2168 _adjtime, _aio_cancel, _aio_error, _aio_fsync, _aio_read,
2169 _aio_return, _aio_suspend, _aio_write, _audit, _audit_session_join,
2170 _audit_session_port, _audit_session_self, _auditctl, _auditon,
2171 _bind, _bootstrap_port, _cerror, _cerror_nocancel, _change_fdguard_np,
2172 _chdir, _chflags, _chmod, _chown, _chroot, _clock_alarm, _clock_alarm_reply,
2199 _accept, '_accept$NOCANCEL', _access, _accessx_np, _acct,
2200 _act_get_state, _act_set_state, _adjtime, _aio_cancel, _aio_error,
2201 _aio_fsync, _aio_read, _aio_return, _aio_suspend, '_aio_suspend$NOCANCEL',
2202 _aio_write, _audit, _audit_session_join, _audit_session_port,
2203 _audit_session_self, _auditctl, _auditon, _bind, _bootstrap_port,
2204 _cerror, _cerror_nocancel, _change_fdguard_np, _chdir, _chflags,
2205 _chmod, _chown, _chroot, _clock_alarm, _clock_alarm_reply,
21732206 _clock_get_attributes, _clock_get_time, _clock_set_attributes,
21742207 _clock_set_time, _clock_sleep, _clock_sleep_trap, _clonefile,
2175 _clonefileat, _close, _coalition_create, _coalition_info_debug_info,
2176 _coalition_info_resource_usage, _coalition_info_set_efficiency,
2177 _coalition_info_set_name, _coalition_ledger_set_logical_writes_limit,
2178 _coalition_reap, _coalition_terminate, _connect, _connectx,
2179 _csops, _csops_audittoken, _csr_check, _csr_get_active_config,
2180 _debug_control_port_for_pid, _debug_syscall_reject, _debug_syscall_reject_config,
2181 _denap_boost_assertion_token, _disconnectx, _dup, _dup2, _errno,
2182 _etap_trace_thread, _exc_server, _exc_server_routine, _exception_raise,
2183 _exception_raise_state, _exception_raise_state_identity, _exchangedata,
2184 _exclaves_boot, _exclaves_endpoint_call, _exclaves_named_buffer_copyin,
2208 _clonefileat, _close, '_close$NOCANCEL', _coalition_create,
2209 _coalition_info_debug_info, _coalition_info_resource_usage,
2210 _coalition_info_set_efficiency, _coalition_info_set_name,
2211 _coalition_ledger_set_logical_writes_limit, _coalition_policy_get,
2212 _coalition_policy_set, _coalition_reap, _coalition_terminate,
2213 _connect, '_connect$NOCANCEL', _connectx, _csops, _csops_audittoken,
2214 _csr_check, _csr_get_active_config, _debug_control_port_for_pid,
2215 _debug_syscall_reject, _debug_syscall_reject_config, _denap_boost_assertion_token,
2216 _disconnectx, _dup, _dup2, _errno, _etap_trace_thread, _exc_server,
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,
21852222 _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,
21862226 _execve, _faccessat, _fchdir, _fchflags, _fchmod, _fchmodat,
2187 _fchown, _fchownat, _fclonefileat, _fcntl, _fdatasync, _ffsctl,
2188 _fgetattrlist, _fgetxattr, _fhopen, _fileport_makefd, _fileport_makeport,
2189 _flistxattr, _flock, _fmount, _fpathconf, _freadlink, _fremovexattr,
2190 _fs_snapshot_create, _fs_snapshot_delete, _fs_snapshot_list,
2191 _fs_snapshot_mount, _fs_snapshot_rename, _fs_snapshot_revert,
2192 _fs_snapshot_root, _fsctl, _fsetattrlist, _fsetxattr, _fsgetpath,
2193 _fsgetpath_ext, _fstat, _fstat64, _fstatat, _fstatat64, _fstatfs,
2194 _fstatfs64, _fsync, _ftruncate, _futimens, _futimes, _getattrlist,
2195 _getattrlistat, _getattrlistbulk, _getaudit, _getaudit_addr,
2196 _getauid, _getdirentries, _getdirentriesattr, _getdtablesize,
2197 _getegid, _getentropy, _geteuid, _getfh, _getfsstat, _getfsstat64,
2198 _getgid, _getgroups, _gethostuuid, _getiopolicy_np, _getitimer,
2199 _getpeername, _getpgid, _getpgrp, _getpid, _getppid, _getpriority,
2200 _getrlimit, _getrusage, _getsgroups_np, _getsid, _getsockname,
2201 _getsockopt, _getuid, _getwgroups_np, _getxattr, _grab_pgo_data,
2202 _graftdmg, _guarded_close_np, _guarded_kqueue_np, _guarded_open_dprotected_np,
2203 _guarded_open_np, _guarded_pwrite_np, _guarded_write_np, _guarded_writev_np,
2227 _fchown, _fchownat, _fclonefileat, _fcntl, '_fcntl$NOCANCEL',
2228 _fdatasync, _ffsctl, _fgetattrlist, _fgetxattr, _fhopen, _fileport_makefd,
2229 _fileport_makeport, _flistxattr, _flock, _fmount, _fpathconf,
2230 _freadlink, _fremovexattr, _fs_snapshot_create, _fs_snapshot_delete,
2231 _fs_snapshot_list, _fs_snapshot_mount, _fs_snapshot_rename,
2232 _fs_snapshot_revert, _fs_snapshot_root, _fsctl, _fsetattrlist,
2233 _fsetxattr, _fsgetpath, _fsgetpath_ext, _fstat, _fstat64,
2234 _fstatat, _fstatat64, _fstatfs, _fstatfs64, _fsync, '_fsync$NOCANCEL',
2235 _ftruncate, _futimens, _futimes, _getattrlist, _getattrlistat,
2236 _getattrlistbulk, _getaudit, _getaudit_addr, _getauid, _getdirentries,
2237 _getdirentriesattr, _getdtablesize, _getegid, _getentropy,
2238 _geteuid, _getfh, _getfsstat, _getfsstat64, _getgid, _getgroups,
2239 _gethostuuid, _getiopolicy_np, _getitimer, _getpeername, _getpgid,
2240 _getpgrp, _getpid, _getppid, _getpriority, _getrlimit, _getrusage,
2241 _getsgroups_np, _getsid, _getsockname, _getsockopt, _getuid,
2242 _getwgroups_np, _getxattr, _grab_pgo_data, _graftdmg, _guarded_close_np,
2243 _guarded_kqueue_np, _guarded_open_dprotected_np, _guarded_open_np,
2244 _guarded_pwrite_np, _guarded_write_np, _guarded_writev_np,
22042245 _host_check_multiuser_mode, _host_create_mach_voucher, _host_create_mach_voucher_trap,
22052246 _host_default_memory_manager, _host_get_UNDServer, _host_get_atm_diagnostic_flag,
22062247 _host_get_boot_info, _host_get_clock_control, _host_get_clock_service,
......@@ -2237,11 +2278,11 @@ exports:
22372278 _mach_init, _mach_make_memory_entry, _mach_make_memory_entry_64,
22382279 _mach_memory_entry_access_tracking, _mach_memory_entry_ownership,
22392280 _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,
2241 _mach_msg_overwrite, _mach_msg_overwrite_trap, _mach_msg_priority_encode,
2242 _mach_msg_priority_is_pthread_priority, _mach_msg_priority_overide_qos,
2243 _mach_msg_priority_qos, _mach_msg_priority_relpri, _mach_msg_receive,
2244 _mach_msg_send, _mach_msg_server, _mach_msg_server_importance,
2281 _mach_memory_object_memory_entry_64, _mach_msg, _mach_msg2_internal,
2282 _mach_msg2_trap, _mach_msg_destroy, _mach_msg_overwrite, _mach_msg_overwrite_trap,
2283 _mach_msg_priority_encode, _mach_msg_priority_is_pthread_priority,
2284 _mach_msg_priority_overide_qos, _mach_msg_priority_qos, _mach_msg_priority_relpri,
2285 _mach_msg_receive, _mach_msg_send, _mach_msg_server, _mach_msg_server_importance,
22452286 _mach_msg_server_once, _mach_msg_trap, _mach_notify_dead_name,
22462287 _mach_notify_no_senders, _mach_notify_port_deleted, _mach_notify_port_destroyed,
22472288 _mach_notify_send_once, _mach_port_allocate, _mach_port_allocate_full,
......@@ -2273,6 +2314,10 @@ exports:
22732314 _mach_vm_msync, _mach_vm_page_info, _mach_vm_page_query, _mach_vm_page_range_query,
22742315 _mach_vm_protect, _mach_vm_purgable_control, _mach_vm_range_create,
22752316 _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,
22762321 _mach_vm_region, _mach_vm_region_recurse, _mach_vm_remap,
22772322 _mach_vm_remap_new, _mach_vm_wire, _mach_vm_write, _mach_voucher_attr_command,
22782323 _mach_voucher_deallocate, _mach_voucher_debug_info, _mach_voucher_extract_all_attr_recipes,
......@@ -2289,21 +2334,22 @@ exports:
22892334 _mk_timer_arm, _mk_timer_arm_leeway, _mk_timer_cancel, _mk_timer_create,
22902335 _mk_timer_destroy, _mkdir, _mkdirat, _mkfifo, _mkfifoat, _mknod,
22912336 _mknodat, _mlock, _mlockall, _mmap, _mount, _mprotect, _mremap_encrypted,
2292 _msg_receive, _msg_rpc, _msg_send, _msgget, _msgrcv, _msgsnd,
2293 _msgsys, _msync, _munlock, _munlockall, _munmap, _necp_client_action,
2294 _necp_match_policy, _necp_open, _necp_session_action, _necp_session_open,
2295 _net_qos_guideline, _netagent_trigger, _netname_check_in,
2296 _netname_check_out, _netname_look_up, _netname_version, _nfsclnt,
2297 _nfssvc, _non_boost_assertion_token, _normal_boost_assertion_token,
2337 _msg_receive, _msg_rpc, _msg_send, _msgctl, _msgget, _msgrcv,
2338 '_msgrcv$NOCANCEL', _msgsnd, '_msgsnd$NOCANCEL', _msgsys,
2339 _msync, '_msync$NOCANCEL', _munlock, _munlockall, _munmap,
2340 _necp_client_action, _necp_match_policy, _necp_open, _necp_session_action,
2341 _necp_session_open, _net_qos_guideline, _netagent_trigger,
2342 _netname_check_in, _netname_check_out, _netname_look_up, _netname_version,
2343 _nfsclnt, _nfssvc, _non_boost_assertion_token, _normal_boost_assertion_token,
22982344 _ntp_adjtime, _ntp_gettime, _objc_bp_assist_cfg_np, _open,
2299 _open_dprotected_np, _openat, '_openat$NOCANCEL', _openat_authenticated_np,
2300 _openat_dprotected_np, _openbyid_np, _os_buflet_get_data_address,
2301 _os_buflet_get_data_length, _os_buflet_get_data_limit, _os_buflet_get_data_offset,
2302 _os_buflet_get_object_address, _os_buflet_get_object_limit,
2303 _os_buflet_set_data_length, _os_buflet_set_data_offset, _os_channel_advance_slot,
2304 _os_channel_attr_clone, _os_channel_attr_create, _os_channel_attr_destroy,
2305 _os_channel_attr_get, _os_channel_attr_get_key, _os_channel_attr_set,
2306 _os_channel_attr_set_key, _os_channel_available_slot_count,
2345 '_open$NOCANCEL', _open_dprotected_np, _openat, '_openat$NOCANCEL',
2346 _openat_authenticated_np, _openat_dprotected_np, _openbyid_np,
2347 _os_buflet_get_data_address, _os_buflet_get_data_length, _os_buflet_get_data_limit,
2348 _os_buflet_get_data_offset, _os_buflet_get_object_address,
2349 _os_buflet_get_object_limit, _os_buflet_set_data_length, _os_buflet_set_data_offset,
2350 _os_channel_advance_slot, _os_channel_attr_clone, _os_channel_attr_create,
2351 _os_channel_attr_destroy, _os_channel_attr_get, _os_channel_attr_get_key,
2352 _os_channel_attr_set, _os_channel_attr_set_key, _os_channel_available_slot_count,
23072353 _os_channel_buflet_alloc, _os_channel_buflet_free, _os_channel_configure_interface_advisory,
23082354 _os_channel_create, _os_channel_create_extended, _os_channel_destroy,
23092355 _os_channel_event_free, _os_channel_event_get_event_data,
......@@ -2359,8 +2405,8 @@ exports:
23592405 _pathconf, _peeloff, _pid_for_task, _pid_hibernate, _pid_resume,
23602406 _pid_shutdown_networking, _pid_shutdown_sockets, _pid_suspend,
23612407 _pipe, _pivot_root, _pkt_subtype_assert_fail, _pkt_type_assert_fail,
2362 _poll, _port_obj_init, _port_obj_table, _port_obj_table_size,
2363 _posix_madvise, _posix_spawn, _posix_spawn_file_actions_add_fileportdup2_np,
2408 _poll, '_poll$NOCANCEL', _port_obj_init, _port_obj_table,
2409 _port_obj_table_size, _posix_madvise, _posix_spawn, _posix_spawn_file_actions_add_fileportdup2_np,
23642410 _posix_spawn_file_actions_addchdir_np, _posix_spawn_file_actions_addclose,
23652411 _posix_spawn_file_actions_adddup2, _posix_spawn_file_actions_addfchdir_np,
23662412 _posix_spawn_file_actions_addinherit_np, _posix_spawn_file_actions_addopen,
......@@ -2378,14 +2424,15 @@ exports:
23782424 _posix_spawnattr_set_csm_np, _posix_spawnattr_set_darwin_role_np,
23792425 _posix_spawnattr_set_filedesclimit_ext, _posix_spawnattr_set_gid_np,
23802426 _posix_spawnattr_set_groups_np, _posix_spawnattr_set_importancewatch_port_np,
2381 _posix_spawnattr_set_jetsam_ttr_np, _posix_spawnattr_set_launch_type_np,
2382 _posix_spawnattr_set_login_np, _posix_spawnattr_set_max_addr_np,
2383 _posix_spawnattr_set_persona_gid_np, _posix_spawnattr_set_persona_groups_np,
2384 _posix_spawnattr_set_persona_np, _posix_spawnattr_set_persona_uid_np,
2385 _posix_spawnattr_set_platform_np, _posix_spawnattr_set_portlimits_ext,
2386 _posix_spawnattr_set_ptrauth_task_port_np, _posix_spawnattr_set_qos_clamp_np,
2387 _posix_spawnattr_set_registered_ports_np, _posix_spawnattr_set_subsystem_root_path_np,
2388 _posix_spawnattr_set_threadlimit_ext, _posix_spawnattr_set_uid_np,
2427 _posix_spawnattr_set_jetsam_ttr_np, _posix_spawnattr_set_kqworklooplimit_ext,
2428 _posix_spawnattr_set_launch_type_np, _posix_spawnattr_set_login_np,
2429 _posix_spawnattr_set_max_addr_np, _posix_spawnattr_set_persona_gid_np,
2430 _posix_spawnattr_set_persona_groups_np, _posix_spawnattr_set_persona_np,
2431 _posix_spawnattr_set_persona_uid_np, _posix_spawnattr_set_platform_np,
2432 _posix_spawnattr_set_portlimits_ext, _posix_spawnattr_set_ptrauth_task_port_np,
2433 _posix_spawnattr_set_qos_clamp_np, _posix_spawnattr_set_registered_ports_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,
23892436 _posix_spawnattr_setarchpref_np, _posix_spawnattr_setauditsessionport_np,
23902437 _posix_spawnattr_setbinpref_np, _posix_spawnattr_setcoalition_np,
23912438 _posix_spawnattr_setcpumonitor, _posix_spawnattr_setcpumonitor_default,
......@@ -2395,7 +2442,7 @@ exports:
23952442 _posix_spawnattr_setpcontrol_np, _posix_spawnattr_setpgroup,
23962443 _posix_spawnattr_setprocesstype_np, _posix_spawnattr_setsigdefault,
23972444 _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,
23992446 _proc_clear_delayidlesleep, _proc_clear_dirty, _proc_clear_vmpressure,
24002447 _proc_current_thread_schedinfo, _proc_denap_assertion_begin_with_msg,
24012448 _proc_denap_assertion_complete, _proc_disable_apptype, _proc_disable_cpumon,
......@@ -2414,39 +2461,44 @@ exports:
24142461 _proc_set_no_smt, _proc_set_owner_vmpressure, _proc_set_wakemon_defaults,
24152462 _proc_set_wakemon_params, _proc_setcpu_percentage, _proc_setpcontrol,
24162463 _proc_setthread_cpupercent, _proc_setthread_csm, _proc_setthread_no_smt,
2417 _proc_suppress, _proc_terminate, _proc_terminate_all_rsr,
2418 _proc_trace_log, _proc_track_dirty, _proc_udata_info, _proc_uuid_policy,
2419 _processor_assign, _processor_control, _processor_exit, _processor_get_assignment,
2420 _processor_info, _processor_set_create, _processor_set_default,
2421 _processor_set_destroy, _processor_set_info, _processor_set_max_priority,
2422 _processor_set_policy_control, _processor_set_policy_disable,
2423 _processor_set_policy_enable, _processor_set_stack_usage,
2424 _processor_set_statistics, _processor_set_tasks, _processor_set_tasks_with_flavor,
2425 _processor_set_threads, _processor_start, _pselect, '_pselect$DARWIN_EXTSN',
2426 '_pselect$DARWIN_EXTSN$NOCANCEL', _pthread_getugid_np, _pthread_setugid_np,
2427 _ptrace, _pwrite, _pwritev, '_pwritev$NOCANCEL', _quota, _quotactl,
2428 _read, _readlink, _readlinkat, _readv, _reboot, _reboot_np,
2429 _record_system_event_as_kernel, _recvfrom, _recvmsg, _recvmsg_x,
2430 _register_uexc_handler, _removexattr, _rename, _rename_ext,
2431 _renameat, _renameatx_np, _renamex_np, _revoke, _rmdir, _searchfs,
2432 _select, '_select$DARWIN_EXTSN', '_select$DARWIN_EXTSN$NOCANCEL',
2433 _sem_close, _sem_destroy, _sem_getvalue, _sem_init, _sem_open,
2434 _sem_post, _sem_trywait, _sem_unlink, _sem_wait, _semaphore_create,
2435 _semaphore_destroy, _semaphore_signal, _semaphore_signal_all,
2436 _semaphore_signal_all_trap, _semaphore_signal_thread, _semaphore_signal_thread_trap,
2437 _semaphore_signal_trap, _semaphore_timedwait, _semaphore_timedwait_signal,
2438 _semaphore_timedwait_signal_trap, _semaphore_timedwait_trap,
2439 _semaphore_wait, _semaphore_wait_signal, _semaphore_wait_signal_trap,
2440 _semaphore_wait_trap, _semget, _semop, _semsys, _sendfile,
2441 _sendmsg, _sendmsg_x, _sendto, _setattrlist, _setattrlistat,
2464 _proc_signal_delegate, _proc_signal_with_audittoken, _proc_suppress,
2465 _proc_terminate, _proc_terminate_all_rsr, _proc_terminate_delegate,
2466 _proc_terminate_with_audittoken, _proc_trace_log, _proc_track_dirty,
2467 _proc_udata_info, _proc_uuid_policy, _processor_assign, _processor_control,
2468 _processor_exit, _processor_get_assignment, _processor_info,
2469 _processor_set_create, _processor_set_default, _processor_set_destroy,
2470 _processor_set_info, _processor_set_max_priority, _processor_set_policy_control,
2471 _processor_set_policy_disable, _processor_set_policy_enable,
2472 _processor_set_stack_usage, _processor_set_statistics, _processor_set_tasks,
2473 _processor_set_tasks_with_flavor, _processor_set_threads,
2474 _processor_start, _pselect, '_pselect$DARWIN_EXTSN', '_pselect$DARWIN_EXTSN$NOCANCEL',
2475 '_pselect$NOCANCEL', _pthread_getugid_np, _pthread_setugid_np,
2476 _ptrace, _pwrite, '_pwrite$NOCANCEL', _pwritev, '_pwritev$NOCANCEL',
2477 _quota, _quotactl, _read, '_read$NOCANCEL', _readlink, _readlinkat,
2478 _readv, '_readv$NOCANCEL', _reboot, _reboot_np, _record_system_event_as_kernel,
2479 _recvfrom, '_recvfrom$NOCANCEL', _recvmsg, '_recvmsg$NOCANCEL',
2480 _recvmsg_x, _register_uexc_handler, _removexattr, _rename,
2481 _rename_ext, _renameat, _renameatx_np, _renamex_np, _revoke,
2482 _rmdir, _searchfs, _select, '_select$DARWIN_EXTSN', '_select$DARWIN_EXTSN$NOCANCEL',
2483 '_select$NOCANCEL', _sem_close, _sem_destroy, _sem_getvalue,
2484 _sem_init, _sem_open, _sem_post, _sem_trywait, _sem_unlink,
2485 _sem_wait, '_sem_wait$NOCANCEL', _semaphore_create, _semaphore_destroy,
2486 _semaphore_signal, _semaphore_signal_all, _semaphore_signal_all_trap,
2487 _semaphore_signal_thread, _semaphore_signal_thread_trap, _semaphore_signal_trap,
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,
24422493 _setaudit, _setaudit_addr, _setauid, _setegid, _seteuid, _setgid,
24432494 _setgroups, _setiopolicy_np, _setitimer, _setpgid, _setpriority,
2444 _setprivexec, _setquota, _setrlimit, _setsgroups_np, _setsid,
2445 _setsockopt, _setuid, _setwgroups_np, _setxattr, _sfi_get_class_offtime,
2446 _sfi_process_get_flags, _sfi_process_set_flags, _sfi_set_class_offtime,
2447 _shm_open, _shm_unlink, _shmat, _shmdt, _shmget, _shmsys,
2448 _shutdown, _sigpending, _sigprocmask, _sigsuspend, _socket,
2449 _socket_delegate, _socketpair, _stackshot_capture_with_config,
2495 _setprivexec, _setquota, _setregid, _setreuid, _setrlimit,
2496 _setsgroups_np, _setsid, _setsockopt, _setuid, _setwgroups_np,
2497 _setxattr, _sfi_get_class_offtime, _sfi_process_get_flags,
2498 _sfi_process_set_flags, _sfi_set_class_offtime, _shm_open,
2499 _shm_unlink, _shmat, _shmctl, _shmdt, _shmget, _shmsys, _shutdown,
2500 _sigpending, _sigprocmask, _sigsuspend, '_sigsuspend$NOCANCEL',
2501 _socket, _socket_delegate, _socketpair, _stackshot_capture_with_config,
24502502 _stackshot_config_create, _stackshot_config_dealloc, _stackshot_config_dealloc_buffer,
24512503 _stackshot_config_get_stackshot_buffer, _stackshot_config_get_stackshot_size,
24522504 _stackshot_config_set_delta_timestamp, _stackshot_config_set_flags,
......@@ -2454,12 +2506,12 @@ exports:
24542506 _stackshot_config_set_size_hint, _stat, _stat64, _statfs,
24552507 _statfs64, _swapon, _swtch, _swtch_pri, _symlink, _symlinkat,
24562508 _sync, _syscall, _syscall_thread_switch, _system_get_sfi_window,
2457 _system_override, _system_set_sfi_window, _task_assign, _task_assign_default,
2458 _task_create, _task_create_identity_token, _task_dyld_process_info_notify_deregister,
2459 _task_dyld_process_info_notify_get, _task_dyld_process_info_notify_register,
2460 _task_for_pid, _task_generate_corpse, _task_get_assignment,
2461 _task_get_dyld_image_infos, _task_get_emulation_vector, _task_get_exc_guard_behavior,
2462 _task_get_exception_ports, _task_get_exception_ports_info,
2509 _system_override, _system_set_sfi_window, _system_version_compat_mode,
2510 _task_assign, _task_assign_default, _task_create, _task_create_identity_token,
2511 _task_dyld_process_info_notify_deregister, _task_dyld_process_info_notify_get,
2512 _task_dyld_process_info_notify_register, _task_for_pid, _task_generate_corpse,
2513 _task_get_assignment, _task_get_dyld_image_infos, _task_get_emulation_vector,
2514 _task_get_exc_guard_behavior, _task_get_exception_ports, _task_get_exception_ports_info,
24632515 _task_get_mach_voucher, _task_get_special_port, _task_get_state,
24642516 _task_identity_token_get_task_port, _task_info, _task_inspect,
24652517 _task_inspect_for_pid, _task_map_corpse_info, _task_map_corpse_info_64,
......@@ -2467,20 +2519,22 @@ exports:
24672519 _task_policy_get, _task_policy_set, _task_purgable_info, _task_read_for_pid,
24682520 _task_register_dyld_get_process_state, _task_register_dyld_image_infos,
24692521 _task_register_dyld_set_dyld_state, _task_register_dyld_shared_cache_image_info,
2470 _task_restartable_ranges_register, _task_restartable_ranges_synchronize,
2471 _task_resume, _task_resume2, _task_sample, _task_self_, _task_self_trap,
2472 _task_set_corpse_forking_behavior, _task_set_emulation, _task_set_emulation_vector,
2473 _task_set_exc_guard_behavior, _task_set_exception_ports, _task_set_info,
2474 _task_set_mach_voucher, _task_set_phys_footprint_limit, _task_set_policy,
2475 _task_set_port_space, _task_set_ras_pc, _task_set_special_port,
2476 _task_set_state, _task_suspend, _task_suspend2, _task_swap_exception_ports,
2522 _task_register_hardened_exception_handler, _task_restartable_ranges_register,
2523 _task_restartable_ranges_synchronize, _task_resume, _task_resume2,
2524 _task_sample, _task_self_, _task_self_trap, _task_set_corpse_forking_behavior,
2525 _task_set_emulation, _task_set_emulation_vector, _task_set_exc_guard_behavior,
2526 _task_set_exception_ports, _task_set_info, _task_set_mach_voucher,
2527 _task_set_phys_footprint_limit, _task_set_policy, _task_set_port_space,
2528 _task_set_ras_pc, _task_set_special_port, _task_set_state,
2529 _task_suspend, _task_suspend2, _task_swap_exception_ports,
24772530 _task_swap_mach_voucher, _task_terminate, _task_test_async_upcall_propagation,
24782531 _task_test_sync_upcall, _task_threads, _task_unregister_dyld_image_infos,
24792532 _task_zone_info, _terminate_with_payload, _terminate_with_reason,
2480 _thread_abort, _thread_abort_safely, _thread_assign, _thread_assign_default,
2481 _thread_convert_thread_state, _thread_create, _thread_create_running,
2482 _thread_depress_abort, _thread_destruct_special_reply_port,
2483 _thread_get_assignment, _thread_get_exception_ports, _thread_get_exception_ports_info,
2533 _thread_abort, _thread_abort_safely, _thread_adopt_exception_handler,
2534 _thread_assign, _thread_assign_default, _thread_convert_thread_state,
2535 _thread_create, _thread_create_running, _thread_depress_abort,
2536 _thread_destruct_special_reply_port, _thread_get_assignment,
2537 _thread_get_exception_ports, _thread_get_exception_ports_info,
24842538 _thread_get_mach_voucher, _thread_get_register_pointer_values,
24852539 _thread_get_special_port, _thread_get_special_reply_port,
24862540 _thread_get_state, _thread_info, _thread_policy, _thread_policy_get,
......@@ -2499,35 +2553,19 @@ exports:
24992553 _vm_read_overwrite, _vm_region_64, _vm_region_recurse_64,
25002554 _vm_remap, _vm_remap_new, _vm_wire, _vm_write, _voucher_mach_msg_adopt,
25012555 _voucher_mach_msg_clear, _voucher_mach_msg_revert, _voucher_mach_msg_set,
2502 _vprintf_stderr_func, _wait4, _waitid, _work_interval_copy_port,
2503 _work_interval_create, _work_interval_destroy, _work_interval_get_flags_from_port,
2504 _work_interval_instance_alloc, _work_interval_instance_clear,
2505 _work_interval_instance_finish, _work_interval_instance_free,
2506 _work_interval_instance_get_complexity, _work_interval_instance_get_deadline,
2507 _work_interval_instance_get_finish, _work_interval_instance_get_id,
2508 _work_interval_instance_get_start, _work_interval_instance_get_telemetry_data,
2509 _work_interval_instance_set_complexity, _work_interval_instance_set_deadline,
2510 _work_interval_instance_set_finish, _work_interval_instance_set_start,
2511 _work_interval_instance_start, _work_interval_instance_update,
2512 _work_interval_join, _work_interval_join_port, _work_interval_leave,
2513 _work_interval_notify, _work_interval_notify_simple, _write,
2514 _writev ]
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' ]
2556 _vprintf_stderr_func, _wait4, _waitid, '_waitid$NOCANCEL',
2557 _work_interval_copy_port, _work_interval_create, _work_interval_destroy,
2558 _work_interval_get_flags_from_port, _work_interval_instance_alloc,
2559 _work_interval_instance_clear, _work_interval_instance_finish,
2560 _work_interval_instance_free, _work_interval_instance_get_complexity,
2561 _work_interval_instance_get_deadline, _work_interval_instance_get_finish,
2562 _work_interval_instance_get_id, _work_interval_instance_get_start,
2563 _work_interval_instance_get_telemetry_data, _work_interval_instance_set_complexity,
2564 _work_interval_instance_set_deadline, _work_interval_instance_set_finish,
2565 _work_interval_instance_set_start, _work_interval_instance_start,
2566 _work_interval_instance_update, _work_interval_join, _work_interval_join_port,
2567 _work_interval_leave, _work_interval_notify, _work_interval_notify_simple,
2568 _write, '_write$NOCANCEL', _writev, '_writev$NOCANCEL' ]
25312569 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
25322570 symbols: [ ___fstat, ___fstatat, ___fstatfs, ___getfsstat, ___lstat,
25332571 ___stat, ___statfs, __current_pid, _mach_absolute_time_kernel,
......@@ -2537,7 +2575,7 @@ tbd-version: 4
25372575targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
25382576 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
25392577install-name: '/usr/lib/system/libsystem_m.dylib'
2540current-version: 3252
2578current-version: 3289
25412579parent-umbrella:
25422580 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
25432581 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
......@@ -2583,21 +2621,24 @@ exports:
25832621 __simd_tgamma_f8 ]
25842622 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
25852623 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2586 symbols: [ __FE_DFL_ENV, ___Libm_version, ___cos_d2, ___cos_f4, ___cospi,
2587 ___cospif, ___exp10, ___exp10f, ___fegetfltrounds, ___fpclassifyd,
2588 ___fpclassifyf, ___fpclassifyl, ___inline_isfinited, ___inline_isfinitef,
2589 ___inline_isfinitel, ___inline_isinfd, ___inline_isinff, ___inline_isinfl,
2590 ___inline_isnand, ___inline_isnanf, ___inline_isnanl, ___inline_isnormald,
2591 ___inline_isnormalf, ___inline_isnormall, ___inline_signbitd,
2592 ___inline_signbitf, ___inline_signbitl, ___invert_d2, ___invert_d3,
2593 ___invert_d4, ___invert_f2, ___invert_f3, ___invert_f4, ___isfinited,
2594 ___isfinitef, ___isfinitel, ___isinfd, ___isinff, ___isinfl,
2595 ___isnand, ___isnanf, ___isnanl, ___isnormald, ___isnormalf,
2596 ___isnormall, ___math_errhandling, ___signbitd, ___signbitf,
2597 ___signbitl, ___sin_d2, ___sin_f4, ___sincos, ___sincos_stret,
2598 ___sincosf, ___sincosf_stret, ___sincospi, ___sincospi_stret,
2599 ___sincospif, ___sincospif_stret, ___sinpi, ___sinpif, ___tanpi,
2600 ___tanpif, __simd_acos_d2, __simd_acos_f4, __simd_acosh_d2,
2624 symbols: [ __FE_DFL_ENV, ___Libm_version, ___ceilf16, ___copysignf16,
2625 ___cos_d2, ___cos_f4, ___cospi, ___cospif, ___exp10, ___exp10f,
2626 ___fabsf16, ___fegetfltrounds, ___floorf16, ___fmaf16, ___fmaxf16,
2627 ___fminf16, ___fpclassifyd, ___fpclassifyf, ___fpclassifyl,
2628 ___hypotf16, ___inline_isfinited, ___inline_isfinitef, ___inline_isfinitel,
2629 ___inline_isinfd, ___inline_isinff, ___inline_isinfl, ___inline_isnand,
2630 ___inline_isnanf, ___inline_isnanl, ___inline_isnormald, ___inline_isnormalf,
2631 ___inline_isnormall, ___inline_signbitd, ___inline_signbitf,
2632 ___inline_signbitl, ___invert_d2, ___invert_d3, ___invert_d4,
2633 ___invert_f2, ___invert_f3, ___invert_f4, ___invert_h2, ___invert_h3,
2634 ___invert_h4, ___isfinited, ___isfinitef, ___isfinitel, ___isinfd,
2635 ___isinff, ___isinfl, ___isnand, ___isnanf, ___isnanl, ___isnormald,
2636 ___isnormalf, ___isnormall, ___math_errhandling, ___nextafterf16,
2637 ___rintf16, ___roundf16, ___signbitd, ___signbitf, ___signbitl,
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,
26012642 __simd_acosh_f4, __simd_asin_d2, __simd_asin_f4, __simd_asinh_d2,
26022643 __simd_asinh_f4, __simd_atan2_d2, __simd_atan2_f4, __simd_atan_d2,
26032644 __simd_atan_f4, __simd_atanh_d2, __simd_atanh_f4, __simd_cbrt_d2,
......@@ -2608,13 +2649,15 @@ exports:
26082649 __simd_exp_f4, __simd_expm1_d2, __simd_expm1_f4, __simd_fma_d2,
26092650 __simd_fma_f4, __simd_fmod_d2, __simd_fmod_f4, __simd_hypot_d2,
26102651 __simd_hypot_f4, __simd_incircle_pd2, __simd_incircle_pf2,
2611 __simd_insphere_pd3, __simd_insphere_pf3, __simd_lgamma_d2,
2612 __simd_lgamma_f4, __simd_log10_d2, __simd_log10_f4, __simd_log1p_d2,
2613 __simd_log1p_f4, __simd_log2_d2, __simd_log2_f4, __simd_log_d2,
2614 __simd_log_f4, __simd_nextafter_d2, __simd_nextafter_f4, __simd_orient_pd2,
2615 __simd_orient_pd3, __simd_orient_pf2, __simd_orient_pf3, __simd_orient_vd2,
2616 __simd_orient_vd3, __simd_orient_vf2, __simd_orient_vf3, __simd_pow_d2,
2617 __simd_pow_f4, __simd_remainder_d2, __simd_remainder_f4, __simd_round_d2,
2652 __simd_incircle_ph2, __simd_insphere_pd3, __simd_insphere_pf3,
2653 __simd_insphere_ph3, __simd_lgamma_d2, __simd_lgamma_f4, __simd_log10_d2,
2654 __simd_log10_f4, __simd_log1p_d2, __simd_log1p_f4, __simd_log2_d2,
2655 __simd_log2_f4, __simd_log_d2, __simd_log_f4, __simd_nextafter_d2,
2656 __simd_nextafter_f4, __simd_orient_pd2, __simd_orient_pd3,
2657 __simd_orient_pf2, __simd_orient_pf3, __simd_orient_ph2, __simd_orient_ph3,
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,
26182661 __simd_round_f4, __simd_sin_d2, __simd_sin_f4, __simd_sincos_d2,
26192662 __simd_sincos_f4, __simd_sincospi_d2, __simd_sincospi_f4,
26202663 __simd_sinh_d2, __simd_sinh_f4, __simd_sinpi_d2, __simd_sinpi_f4,
......@@ -2649,7 +2692,8 @@ exports:
26492692 _log2f, _log2l, _logb, _logbf, _logbl, _logf, _logl, _lrint,
26502693 _lrintf, _lrintl, _lround, _lroundf, _lroundl, _matrix_identity_double2x2,
26512694 _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,
26532697 _modff, _modfl, _nan, _nanf, _nanl, _nearbyint, _nearbyintf,
26542698 _nearbyintl, _nextafter, _nextafterf, _nextafterl, _nexttoward,
26552699 _nexttowardf, _nexttowardl, _pow, _powf, _powl, _remainder,
......@@ -2753,7 +2797,7 @@ tbd-version: 4
27532797targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
27542798 arm64e-macos, arm64e-maccatalyst ]
27552799install-name: '/usr/lib/system/libsystem_malloc.dylib'
2756current-version: 474.0.13
2800current-version: 646.40.3
27572801parent-umbrella:
27582802 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
27592803 arm64e-macos, arm64e-maccatalyst ]
......@@ -2761,15 +2805,7 @@ parent-umbrella:
27612805exports:
27622806 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
27632807 arm64e-macos, arm64e-maccatalyst ]
2764 symbols: [ ___mach_stack_logging_copy_uniquing_table, ___mach_stack_logging_enumerate_records,
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,
2808 symbols: [ ___mach_stack_logging_shared_memory_address, ___malloc_init,
27732809 ___malloc_late_init, __malloc_fork_child, __malloc_fork_parent,
27742810 __malloc_fork_prepare, __malloc_no_asl_log, __os_cpu_number_override,
27752811 _aligned_alloc, _calloc, _free, _mag_set_thread_index, _malloc,
......@@ -2777,11 +2813,11 @@ exports:
27772813 _malloc_claimed_address, _malloc_create_legacy_default_zone,
27782814 _malloc_create_zone, _malloc_debug, _malloc_default_purgeable_zone,
27792815 _malloc_default_zone, _malloc_destroy_zone, _malloc_engaged_nano,
2780 _malloc_enter_process_memory_limit_warn_mode, _malloc_error,
2781 _malloc_freezedry, _malloc_get_all_zones, _malloc_get_thread_options,
2782 _malloc_get_zone_name, _malloc_good_size, _malloc_jumpstart,
2783 _malloc_logger, _malloc_make_nonpurgeable, _malloc_make_purgeable,
2784 _malloc_memory_event_handler, _malloc_memorypressure_mask_default_4libdispatch,
2816 _malloc_engaged_secure_allocator, _malloc_enter_process_memory_limit_warn_mode,
2817 _malloc_error, _malloc_freezedry, _malloc_get_all_zones, _malloc_get_thread_options,
2818 _malloc_get_wrapped_zone, _malloc_get_zone_name, _malloc_good_size,
2819 _malloc_jumpstart, _malloc_logger, _malloc_make_nonpurgeable,
2820 _malloc_make_purgeable, _malloc_memory_event_handler, _malloc_memorypressure_mask_default_4libdispatch,
27852821 _malloc_memorypressure_mask_msl_4libdispatch, _malloc_num_zones,
27862822 _malloc_num_zones_allocated, _malloc_printf, _malloc_register_stack_logger,
27872823 _malloc_sanitizer_get_functions, _malloc_sanitizer_is_enabled,
......@@ -2790,24 +2826,27 @@ exports:
27902826 _malloc_type_aligned_alloc, _malloc_type_calloc, _malloc_type_free,
27912827 _malloc_type_malloc, _malloc_type_posix_memalign, _malloc_type_realloc,
27922828 _malloc_type_valloc, _malloc_type_zone_calloc, _malloc_type_zone_free,
2793 _malloc_type_zone_malloc, _malloc_type_zone_memalign, _malloc_type_zone_realloc,
2794 _malloc_type_zone_valloc, _malloc_zero_on_free_disable, _malloc_zone_batch_free,
2795 _malloc_zone_batch_malloc, _malloc_zone_calloc, _malloc_zone_check,
2796 _malloc_zone_claimed_address, _malloc_zone_disable_discharge_checking,
2797 _malloc_zone_discharge, _malloc_zone_enable_discharge_checking,
2798 _malloc_zone_enumerate_discharged_pointers, _malloc_zone_free,
2799 _malloc_zone_from_ptr, _malloc_zone_log, _malloc_zone_malloc,
2829 _malloc_type_zone_malloc, _malloc_type_zone_malloc_with_options_internal,
2830 _malloc_type_zone_malloc_with_options_np, _malloc_type_zone_memalign,
2831 _malloc_type_zone_realloc, _malloc_type_zone_valloc, _malloc_variant_is_debug_4test,
2832 _malloc_zero_on_free_disable, _malloc_zone_batch_free, _malloc_zone_batch_malloc,
2833 _malloc_zone_calloc, _malloc_zone_check, _malloc_zone_claimed_address,
2834 _malloc_zone_disable_discharge_checking, _malloc_zone_discharge,
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,
28002838 _malloc_zone_memalign, _malloc_zone_pressure_relief, _malloc_zone_print,
28012839 _malloc_zone_print_ptr_info, _malloc_zone_realloc, _malloc_zone_register,
28022840 _malloc_zone_statistics, _malloc_zone_unregister, _malloc_zone_valloc,
2803 _malloc_zones, _mstats, _pgm_diagnose_fault_from_crash_reporter,
2804 _pgm_extract_report_from_corpse, _posix_memalign, _realloc,
2805 '_reallocarray$DARWIN_EXTSN', '_reallocarrayf$DARWIN_EXTSN',
2806 _sanitizer_diagnose_fault_from_crash_reporter, _scalable_zone_info,
2807 _scalable_zone_statistics, _set_malloc_singlethreaded, _stack_logging_enable_logging,
2808 _szone_check_counter, _szone_check_modulo, _szone_check_start,
2809 _tiny_print_region_free_list, _turn_off_stack_logging, _turn_on_stack_logging,
2810 _valloc, _vfree, _xzm_ptr_lookup_4test, _zeroify_scalable_zone ]
2841 _malloc_zones, _mstats, _pgm_extract_report_from_corpse, _posix_memalign,
2842 _realloc, '_reallocarray$DARWIN_EXTSN', '_reallocarrayf$DARWIN_EXTSN',
2843 _reallocf, _sanitizer_diagnose_fault_from_crash_reporter,
2844 _scalable_zone_info, _scalable_zone_statistics, _set_malloc_singlethreaded,
2845 _stack_logging_enable_logging, _szone_check_counter, _szone_check_modulo,
2846 _szone_check_start, _tiny_print_region_free_list, _turn_off_stack_logging,
2847 _turn_on_stack_logging, _valloc, _vfree, _xzm_malloc_zone_introspect,
2848 _xzm_ptr_lookup_4test, _xzm_type_choose_ptr_bucket_4test,
2849 _zeroify_scalable_zone ]
28112850--- !tapi-tbd
28122851tbd-version: 4
28132852targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -2821,9 +2860,10 @@ exports:
28212860 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
28222861 arm64e-macos, arm64e-maccatalyst ]
28232862 symbols: [ _NEHelperCacheAddRedirectedAddress, _NEHelperCacheClearRedirectedAddresses,
2824 _NEHelperCacheClearUUIDs, _NEHelperCacheCopyAppUUIDMapping,
2825 _NEHelperCacheCopyAppUUIDMappingExtended, _NEHelperCacheCopyAppUUIDMappingForUIDExtended,
2826 _NEHelperCacheCopySigningIdentifierMapping, _NEHelperCacheSetDomainDictionaries,
2863 _NEHelperCacheClearUUIDs, _NEHelperCacheClearUUIDsForBundleID,
2864 _NEHelperCacheCopyAppUUIDMapping, _NEHelperCacheCopyAppUUIDMappingExtended,
2865 _NEHelperCacheCopyAppUUIDMappingForUIDExtended, _NEHelperCacheCopySigningIdentifierMapping,
2866 _NEHelperCachePopulateUUIDsForConfiguration, _NEHelperCacheSetDomainDictionaries,
28272867 _NEHelperCacheSetMatchDomains, _NEHelperCacheSetRoutes, _NEHelperCopyAggregatePathRules,
28282868 _NEHelperCopyAppInfo, _NEHelperCopyCurrentNetworkAsync, _NEHelperCopyCurrentNetworkInfo,
28292869 _NEHelperCopyDataForCertificate, _NEHelperCopyPerAppDomains,
......@@ -2856,9 +2896,9 @@ exports:
28562896 _ne_session_disable_restrictions, _ne_session_dns_proxy_configs_present,
28572897 _ne_session_dns_settings_configs_present, _ne_session_establish_ipc,
28582898 _ne_session_fallback_advisory, _ne_session_fallback_default,
2859 _ne_session_get_config_id_from_network_agent, _ne_session_get_configuration_id,
2860 _ne_session_get_info, _ne_session_get_info2, _ne_session_get_status,
2861 _ne_session_info_type_to_string, _ne_session_initialize_necp_drop_all,
2899 _ne_session_get_boot_session_uuid, _ne_session_get_config_id_from_network_agent,
2900 _ne_session_get_configuration_id, _ne_session_get_info, _ne_session_get_info2,
2901 _ne_session_get_status, _ne_session_info_type_to_string, _ne_session_initialize_necp_drop_all,
28622902 _ne_session_is_always_on_vpn_enabled, _ne_session_is_safeboot,
28632903 _ne_session_local_communication_configs_present, _ne_session_local_communication_send_info,
28642904 _ne_session_manager_get_pid, _ne_session_manager_has_active_sessions,
......@@ -2873,18 +2913,18 @@ exports:
28732913 _ne_session_release, _ne_session_retain, _ne_session_send_barrier,
28742914 _ne_session_service_copy_cached_match_domains, _ne_session_service_get_dns_service_id,
28752915 _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,
2877 _ne_session_set_socket_attributes, _ne_session_set_socket_context_attribute,
2878 _ne_session_set_socket_tracker_attributes, _ne_session_should_disable_nexus,
2879 _ne_session_start, _ne_session_start_on_behalf_of, _ne_session_start_with_options,
2880 _ne_session_status_to_string, _ne_session_stop, _ne_session_stop_all_with_plugin_type,
2881 _ne_session_stop_reason_to_string, _ne_session_type_to_string,
2882 _ne_session_use_as_system_vpn, _ne_session_vod_evaluate_connection_present,
2883 _ne_session_vpn_include_all_networks_configs_present, _ne_socket_set_attribution,
2884 _ne_socket_set_domains, _ne_socket_set_is_app_initiated, _ne_socket_set_website_attribution,
2885 _ne_tracker_build_cache, _ne_tracker_build_trie, _ne_tracker_check_info_changed,
2886 _ne_tracker_check_is_hostname_blocked, _ne_tracker_check_tcc,
2887 _ne_tracker_clear_cache, _ne_tracker_context_can_block_request,
2916 _ne_session_service_matches_address_for_interface, _ne_session_set_device_communication_exception,
2917 _ne_session_set_event_handler, _ne_session_set_socket_attributes,
2918 _ne_session_set_socket_context_attribute, _ne_session_set_socket_tracker_attributes,
2919 _ne_session_should_disable_nexus, _ne_session_start, _ne_session_start_on_behalf_of,
2920 _ne_session_start_with_options, _ne_session_status_to_string,
2921 _ne_session_stop, _ne_session_stop_all_with_plugin_type, _ne_session_stop_reason_to_string,
2922 _ne_session_type_to_string, _ne_session_use_as_system_vpn,
2923 _ne_session_vod_evaluate_connection_present, _ne_session_vpn_include_all_networks_configs_present,
2924 _ne_socket_set_attribution, _ne_socket_set_domains, _ne_socket_set_is_app_initiated,
2925 _ne_socket_set_website_attribution, _ne_tracker_build_cache,
2926 _ne_tracker_build_trie, _ne_tracker_check_info_changed, _ne_tracker_check_is_hostname_blocked,
2927 _ne_tracker_check_tcc, _ne_tracker_clear_cache, _ne_tracker_context_can_block_request,
28882928 _ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner,
28892929 _ne_tracker_context_is_from_app_list, _ne_tracker_context_is_from_web_list,
28902930 _ne_tracker_copy_current_stacktrace, _ne_tracker_create_xcode_issue,
......@@ -2901,7 +2941,7 @@ tbd-version: 4
29012941targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
29022942 arm64e-macos, arm64e-maccatalyst ]
29032943install-name: '/usr/lib/system/libsystem_notify.dylib'
2904current-version: 317
2944current-version: 327.0.5
29052945parent-umbrella:
29062946 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
29072947 arm64e-macos, arm64e-maccatalyst ]
......@@ -2918,21 +2958,23 @@ exports:
29182958 _notify_simple_post, _notify_suspend, _notify_suspend_pid ]
29192959--- !tapi-tbd
29202960tbd-version: 4
2921targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
2922 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2961targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2962 arm64e-macos, arm64e-maccatalyst ]
29232963install-name: '/usr/lib/system/libsystem_platform.dylib'
2924current-version: 306.0.1
2964current-version: 340
29252965parent-umbrella:
2926 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
2927 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2966 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2967 arm64e-macos, arm64e-maccatalyst ]
29282968 umbrella: System
29292969exports:
2930 - targets: [ i386-macos, i386-maccatalyst ]
2931 symbols: [ _MKGetTimeBaseInfo, _udiv10 ]
2932 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst ]
2933 symbols: [ __sigtramp, _longjmperror ]
2934 - targets: [ i386-macos, i386-maccatalyst, x86_64-macos, x86_64-maccatalyst,
2935 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
2970 - targets: [ x86_64-macos, x86_64-maccatalyst ]
2971 symbols: [ '_OSAtomicFifoDequeue$VARIANT$PFZ', '_OSAtomicFifoDequeue$VARIANT$UnfairLock',
2972 '_OSAtomicFifoEnqueue$VARIANT$PFZ', '_OSAtomicFifoEnqueue$VARIANT$UnfairLock',
2973 ___no_overread_variant_setup, __sigtramp, _bzero_sse_np, _longjmperror,
2974 _memmove_sse_np, _memset_pattern16_sse_np, _memset_pattern4_sse_np,
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 ]
29362978 symbols: [ _OSAtomicAdd32, _OSAtomicAdd32Barrier, _OSAtomicAdd64, _OSAtomicAdd64Barrier,
29372979 _OSAtomicAnd32, _OSAtomicAnd32Barrier, _OSAtomicAnd32Orig,
29382980 _OSAtomicAnd32OrigBarrier, _OSAtomicCompareAndSwap32, _OSAtomicCompareAndSwap32Barrier,
......@@ -2975,9 +3017,12 @@ exports:
29753017 __spin_lock, __spin_lock_try, __spin_unlock, _ffs, _ffsl,
29763018 _ffsll, _fls, _flsl, _flsll, _getcontext, _longjmp, _makecontext,
29773019 _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,
29793023 _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,
29813026 _os_unfair_lock_unlock, _os_unfair_lock_unlock_no_tsd, _os_unfair_recursive_lock_lock_with_options,
29823027 _os_unfair_recursive_lock_owned, _os_unfair_recursive_lock_trylock,
29833028 _os_unfair_recursive_lock_tryunlock4objc, _os_unfair_recursive_lock_unlock,
......@@ -2985,39 +3030,21 @@ exports:
29853030 _setjmp, _siglongjmp, _sigsetjmp, _spin_lock, _spin_lock_try,
29863031 _spin_unlock, _swapcontext, _sys_cache_control, _sys_dcache_flush,
29873032 _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 ]
29943033 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
29953034 symbols: [ __ctx_done ]
29963035--- !tapi-tbd
29973036tbd-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,
29993038 arm64e-macos, arm64e-maccatalyst ]
30003039install-name: '/usr/lib/system/libsystem_pthread.dylib'
3001current-version: 519
3040current-version: 535
30023041parent-umbrella:
3003 - targets: [ i386-macos, x86_64-macos, x86_64-maccatalyst, arm64-macos,
3004 arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
3042 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3043 arm64e-macos, arm64e-maccatalyst ]
30053044 umbrella: System
30063045exports:
3007 - targets: [ i386-macos ]
3008 symbols: [ '_pthread_cancel$UNIX2003', '_pthread_cond_init$UNIX2003',
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 ]
3046 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
3047 arm64e-macos, arm64e-maccatalyst ]
30213048 symbols: [ ____chkstk_darwin, ___is_threaded, ___pthread_init, ___pthread_late_init,
30223049 ___pthread_workqueue_setkill, ___unix_conforming, __pthread_atfork_child,
30233050 __pthread_atfork_child_handlers, __pthread_atfork_parent,
......@@ -3033,8 +3060,8 @@ exports:
30333060 __pthread_set_properties_self, __pthread_set_self, __pthread_setspecific_static,
30343061 __pthread_start, __pthread_tsd_shared_cache_first, __pthread_tsd_shared_cache_last,
30353062 __pthread_workloop_create, __pthread_workloop_destroy, __pthread_workqueue_add_cooperativethreads,
3036 __pthread_workqueue_addthreads, __pthread_workqueue_asynchronous_override_add,
3037 __pthread_workqueue_asynchronous_override_reset_all_self,
3063 __pthread_workqueue_addthreads, __pthread_workqueue_allow_send_signals,
3064 __pthread_workqueue_asynchronous_override_add, __pthread_workqueue_asynchronous_override_reset_all_self,
30383065 __pthread_workqueue_asynchronous_override_reset_self, __pthread_workqueue_init,
30393066 __pthread_workqueue_init_with_kevent, __pthread_workqueue_init_with_workloop,
30403067 __pthread_workqueue_override_reset, __pthread_workqueue_override_start_direct,
......@@ -3051,13 +3078,14 @@ exports:
30513078 _pthread_attr_setdetachstate, _pthread_attr_setguardsize,
30523079 _pthread_attr_setinheritsched, _pthread_attr_setschedparam,
30533080 _pthread_attr_setschedpolicy, _pthread_attr_setscope, _pthread_attr_setstack,
3054 _pthread_attr_setstackaddr, _pthread_attr_setstacksize, _pthread_cancel,
3055 _pthread_chdir_np, _pthread_cond_broadcast, _pthread_cond_destroy,
3056 _pthread_cond_init, _pthread_cond_signal, _pthread_cond_signal_thread_np,
3057 _pthread_cond_timedwait, _pthread_cond_timedwait_relative_np,
3058 _pthread_cond_wait, _pthread_condattr_destroy, _pthread_condattr_getpshared,
3059 _pthread_condattr_init, _pthread_condattr_setpshared, _pthread_cpu_number_np,
3060 _pthread_create, _pthread_create_from_mach_thread, _pthread_create_suspended_np,
3081 _pthread_attr_setstackaddr, _pthread_attr_setstacksize, _pthread_attr_setworkinterval_np,
3082 _pthread_cancel, _pthread_chdir_np, _pthread_cond_broadcast,
3083 _pthread_cond_destroy, _pthread_cond_init, _pthread_cond_signal,
3084 _pthread_cond_signal_thread_np, _pthread_cond_timedwait, '_pthread_cond_timedwait$NOCANCEL',
3085 _pthread_cond_timedwait_relative_np, _pthread_cond_wait, '_pthread_cond_wait$NOCANCEL',
3086 _pthread_condattr_destroy, _pthread_condattr_getpshared, _pthread_condattr_init,
3087 _pthread_condattr_setpshared, _pthread_cpu_number_np, _pthread_create,
3088 _pthread_create_from_mach_thread, _pthread_create_suspended_np,
30613089 _pthread_create_with_workgroup_np, _pthread_current_stack_contains_np,
30623090 _pthread_dependency_fulfill_np, _pthread_dependency_init_np,
30633091 _pthread_dependency_wait_np, _pthread_detach, _pthread_equal,
......@@ -3067,7 +3095,9 @@ exports:
30673095 _pthread_getspecific, _pthread_install_workgroup_functions_np,
30683096 _pthread_introspection_getspecific_np, _pthread_introspection_hook_install,
30693097 _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,
30713101 _pthread_kill, _pthread_layout_offsets, _pthread_mach_thread_np,
30723102 _pthread_main_np, _pthread_main_thread_np, _pthread_mutex_destroy,
30733103 _pthread_mutex_getprioceiling, _pthread_mutex_init, _pthread_mutex_lock,
......@@ -3094,22 +3124,16 @@ exports:
30943124 _pthread_workqueue_addthreads_np, _pthread_workqueue_setdispatch_np,
30953125 _pthread_workqueue_setdispatchoffset_np, _pthread_workqueue_setup,
30963126 _pthread_yield_np, _qos_class_main, _qos_class_self, _sched_get_priority_max,
3097 _sched_get_priority_min, _sched_yield, _sigwait, _start_wqthread,
3098 _thread_chkstk_darwin, _thread_start ]
3099 - targets: [ i386-macos, x86_64-macos, arm64-macos, arm64e-macos ]
3100 symbols: [ __pthread_mutex_enable_legacy_mode, _pthread_jit_write_freeze_callbacks_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' ]
3127 _sched_get_priority_min, _sched_yield, _sigwait, '_sigwait$NOCANCEL',
3128 _start_wqthread, _thread_chkstk_darwin, _thread_start ]
3129 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
3130 symbols: [ __pthread_mutex_enable_legacy_mode, _pthread_jit_write_protect_np ]
31073131--- !tapi-tbd
31083132tbd-version: 4
31093133targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
31103134 arm64e-macos, arm64e-maccatalyst ]
31113135install-name: '/usr/lib/system/libsystem_sandbox.dylib'
3112current-version: 2169.0.12
3136current-version: 2401.40.25
31133137parent-umbrella:
31143138 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
31153139 arm64e-macos, arm64e-maccatalyst ]
......@@ -3121,13 +3145,14 @@ exports:
31213145 _APP_SANDBOX_READ_WRITE, _IOS_SANDBOX_APPLICATION_GROUP, _IOS_SANDBOX_CONTAINER,
31223146 _SANDBOX_CHECK_ALLOW_APPROVAL, _SANDBOX_CHECK_CANONICAL, _SANDBOX_CHECK_NOFOLLOW,
31233147 _SANDBOX_CHECK_NO_APPROVAL, _SANDBOX_CHECK_NO_REPORT, _SANDBOX_CHECK_POSIX_READABLE,
3124 _SANDBOX_EXTENSION_CANONICAL, _SANDBOX_EXTENSION_DEFAULT,
3125 _SANDBOX_EXTENSION_MAGIC, _SANDBOX_EXTENSION_NOFOLLOW, _SANDBOX_EXTENSION_NO_REPORT,
3148 _SANDBOX_CHECK_POSIX_WRITEABLE, _SANDBOX_EXTENSION_CANONICAL,
3149 _SANDBOX_EXTENSION_DEFAULT, _SANDBOX_EXTENSION_MAGIC, _SANDBOX_EXTENSION_NOFOLLOW,
3150 _SANDBOX_EXTENSION_NOFOLLOW_ANY, _SANDBOX_EXTENSION_NO_REPORT,
31263151 _SANDBOX_EXTENSION_NO_STORAGE_CLASS, _SANDBOX_EXTENSION_PREFIXMATCH,
3127 _SANDBOX_EXTENSION_UNRESOLVED, __amkrtemp, __sandbox_in_a_container,
3128 __sandbox_register_app_bundle_0, __sandbox_register_app_bundle_1,
3129 _kSBXProfileNoInternet, _kSBXProfileNoNetwork, _kSBXProfileNoWrite,
3130 _kSBXProfileNoWriteExceptTemporary, _kSBXProfilePureComputation,
3152 _SANDBOX_EXTENSION_UNRESOLVED, __amkrtemp, __sandbox_enter_notify_libxpc,
3153 __sandbox_in_a_container, __sandbox_register_app_bundle_0,
3154 __sandbox_register_app_bundle_1, _kSBXProfileNoInternet, _kSBXProfileNoNetwork,
3155 _kSBXProfileNoWrite, _kSBXProfileNoWriteExceptTemporary, _kSBXProfilePureComputation,
31313156 _kSandboxAppBundleAnySigningId, _kSandboxAppBundlePlatformTeamId,
31323157 _kSandboxAppContainerAnySigningId, _kSandboxAppContainerPlatformTeamId,
31333158 _rootless_allows_task_for_pid, _rootless_check_datavault_flag,
......@@ -3139,14 +3164,17 @@ exports:
31393164 _rootless_remove_datavault_in_favor_of_static_storage_class,
31403165 _rootless_remove_restricted_in_favor_of_static_storage_class,
31413166 _rootless_restricted_environment, _rootless_suspend, _rootless_trusted_by_self_token,
3142 _rootless_verify_trusted_by_self_token, _sandbox_builtin_query,
3143 _sandbox_check, _sandbox_check_bulk, _sandbox_check_by_audit_token,
3144 _sandbox_check_by_reference, _sandbox_check_by_uniqueid, _sandbox_check_message_filter_integer,
3145 _sandbox_check_message_filter_string, _sandbox_check_protected_app_container,
3167 _rootless_verify_trusted_by_self_token, _sandbox_apply_bytecode,
3168 _sandbox_builtin_query, _sandbox_check, _sandbox_check_bulk,
3169 _sandbox_check_by_audit_token, _sandbox_check_by_reference,
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,
31463173 _sandbox_consume_extension, _sandbox_consume_fs_extension,
31473174 _sandbox_consume_mach_extension, _sandbox_container_path_for_audit_token,
3148 _sandbox_container_path_for_pid, _sandbox_enable_root_translation,
3149 _sandbox_enable_state_flag, _sandbox_extension_consume, _sandbox_extension_issue_file,
3175 _sandbox_container_path_for_pid, _sandbox_enable_local_state_flag,
3176 _sandbox_enable_root_translation, _sandbox_enable_state_flag,
3177 _sandbox_extension_consume, _sandbox_extension_issue_file,
31503178 _sandbox_extension_issue_file_to_process, _sandbox_extension_issue_file_to_process_by_pid,
31513179 _sandbox_extension_issue_file_to_self, _sandbox_extension_issue_generic,
31523180 _sandbox_extension_issue_generic_to_process, _sandbox_extension_issue_generic_to_process_by_pid,
......@@ -3155,10 +3183,11 @@ exports:
31553183 _sandbox_extension_issue_iokit_user_client_class, _sandbox_extension_issue_mach,
31563184 _sandbox_extension_issue_mach_to_process, _sandbox_extension_issue_mach_to_process_by_pid,
31573185 _sandbox_extension_issue_posix_ipc, _sandbox_extension_issue_related_file_to_process,
3158 _sandbox_extension_reap, _sandbox_extension_release, _sandbox_extension_release_file,
3159 _sandbox_extension_update_file, _sandbox_extension_update_file_by_fileid,
3160 _sandbox_free_error, _sandbox_get_container_expected, _sandbox_init,
3161 _sandbox_init_from_pid, _sandbox_init_with_extensions, _sandbox_init_with_parameters,
3186 _sandbox_extension_reap, _sandbox_extension_release, _sandbox_extension_release_and_detect_last_reference,
3187 _sandbox_extension_release_file, _sandbox_extension_update_file,
3188 _sandbox_extension_update_file_by_fileid, _sandbox_free_error,
3189 _sandbox_get_container_expected, _sandbox_init, _sandbox_init_from_pid,
3190 _sandbox_init_with_extensions, _sandbox_init_with_parameters,
31623191 _sandbox_issue_extension, _sandbox_issue_fs_extension, _sandbox_issue_fs_rw_extension,
31633192 _sandbox_issue_mach_extension, _sandbox_message_filter_query,
31643193 _sandbox_message_filter_release, _sandbox_message_filter_retain,
......@@ -3185,10 +3214,42 @@ exports:
31853214 _rootless_manifest_parse, _rootless_preflight ]
31863215--- !tapi-tbd
31873216tbd-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
31883249targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
31893250 arm64e-macos, arm64e-maccatalyst ]
31903251install-name: '/usr/lib/system/libsystem_secinit.dylib'
3191current-version: 139
3252current-version: 153.0.6
31923253parent-umbrella:
31933254 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
31943255 arm64e-macos, arm64e-maccatalyst ]
......@@ -3221,7 +3282,7 @@ tbd-version: 4
32213282targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
32223283 arm64e-macos, arm64e-maccatalyst ]
32233284install-name: '/usr/lib/system/libsystem_trace.dylib'
3224current-version: 1481.0.12
3285current-version: 1612.40.4
32253286parent-umbrella:
32263287 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
32273288 arm64e-macos, arm64e-maccatalyst ]
......@@ -3238,8 +3299,9 @@ exports:
32383299 __os_log_get_nscf_formatter, __os_log_impl, __os_log_internal,
32393300 __os_log_pack_fill, __os_log_pack_size, __os_log_preferences_compute,
32403301 __os_log_preferences_copy_cache, __os_log_preferences_load,
3241 __os_log_preferences_load_sysprefs, __os_log_release, __os_log_send_and_compose_impl,
3242 __os_log_set_nscf_formatter, __os_signpost_emit_impl, __os_signpost_emit_unreliably_with_name_impl,
3302 __os_log_preferences_load_sysprefs, __os_log_preferences_merge,
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,
32433305 __os_signpost_emit_with_name_impl, __os_signpost_pack_fill,
32443306 __os_signpost_pack_send, __os_state_request_for_pidlist, __os_trace_app_cryptex_sysprefsdir_path,
32453307 __os_trace_atm_diagnostic_config, __os_trace_basesystem_storage_available,
......@@ -3247,8 +3309,9 @@ exports:
32473309 __os_trace_get_boot_uuid, __os_trace_get_image_info, __os_trace_get_mode_for_pid,
32483310 __os_trace_get_times_now, __os_trace_getxattr_at, __os_trace_intprefsdir_path,
32493311 __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,
3251 __os_trace_memdup, __os_trace_mmap, __os_trace_mmap_at, __os_trace_mmap_offset,
3312 __os_trace_lazy_init_completed_4swift, __os_trace_log_simple,
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,
32523315 __os_trace_mode_match_4tests, __os_trace_os_cryptex_sysprefsdir_path,
32533316 __os_trace_prefs_latest_version_4tests, __os_trace_prefsdir_path,
32543317 __os_trace_read_file_at, __os_trace_read_plist_at, __os_trace_realloc,
......@@ -3278,58 +3341,23 @@ exports:
32783341 _os_log_set_hook, _os_log_set_hook_with_params, _os_log_set_test_callback,
32793342 _os_log_shim_enabled, _os_log_shim_legacy_logging_enabled,
32803343 _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,
3282 _os_signpost_id_make_with_pointer, _os_signpost_set_introspection_hook_4Perf,
3283 _os_state_add_handler, _os_state_remove_handler, _os_trace_debug_enabled,
3284 _os_trace_get_mode, _os_trace_get_type, _os_trace_info_enabled,
3285 _os_trace_set_mode ]
3344 _os_log_with_args, _os_set_logging_unreliable_for_current_thread,
3345 _os_signpost_enabled, _os_signpost_id_generate, _os_signpost_id_make_with_pointer,
3346 _os_signpost_set_introspection_hook_4Perf, _os_state_add_handler,
3347 _os_state_remove_handler, _os_trace_debug_enabled, _os_trace_get_mode,
3348 _os_trace_get_type, _os_trace_info_enabled, _os_trace_set_mode ]
32863349 objc-classes: [ OS_os_log ]
32873350--- !tapi-tbd
32883351tbd-version: 4
32893352targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
32903353 arm64e-macos, arm64e-maccatalyst ]
32913354install-name: '/usr/lib/system/libunwind.dylib'
3292current-version: 1600.112
3355current-version: 1800.85
32933356parent-umbrella:
32943357 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
32953358 arm64e-macos, arm64e-maccatalyst ]
32963359 umbrella: System
32973360exports:
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 ]
33333361 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33343362 arm64e-macos, arm64e-maccatalyst ]
33353363 symbols: [ __Unwind_Backtrace, __Unwind_DeleteException, __Unwind_FindEnclosingFunction,
......@@ -3347,12 +3375,14 @@ exports:
33473375 _unw_init_local, _unw_is_fpreg, _unw_is_signal_frame, _unw_iterate_dwarf_unwind_cache,
33483376 _unw_local_addr_space, _unw_regname, _unw_resume, _unw_set_fpreg,
33493377 _unw_set_reg, _unw_step ]
3378 - targets: [ arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
3379 symbols: [ ___unw_is_pointer_auth_enabled ]
33503380--- !tapi-tbd
33513381tbd-version: 4
33523382targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33533383 arm64e-macos, arm64e-maccatalyst ]
33543384install-name: '/usr/lib/system/libxpc.dylib'
3355current-version: 2679.0.25
3385current-version: 2866.40.11
33563386parent-umbrella:
33573387 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33583388 arm64e-macos, arm64e-maccatalyst ]
......@@ -3397,15 +3427,16 @@ exports:
33973427 _XPC_ACTIVITY_USES_DUET_POWER_BUDGETING, _XPC_COALITION_INFO_KEY_BUNDLE_IDENTIFIER,
33983428 _XPC_COALITION_INFO_KEY_CID, _XPC_COALITION_INFO_KEY_NAME,
33993429 _XPC_COALITION_INFO_KEY_RESOURCE_USAGE_BLOB, ___xpc_connection_set_logging,
3400 __availability_version_check, __launch_job_routine, __launch_job_routine_async,
3401 __launch_msg2, __launch_server_test_routine, __launch_service_stats_copy_4ppse_impl,
3430 __availability_version_check, __launch_job_query_routine,
3431 __launch_job_routine, __launch_job_routine_async, __launch_msg2,
3432 __launch_server_test_routine, __launch_service_stats_copy_4ppse_impl,
34023433 __launch_service_stats_copy_impl, __libxpc_initializer, __spawn_via_launchd,
34033434 __system_ios_support_version_copy_string_sysctl, __system_version_copy_string_plist,
34043435 __system_version_copy_string_sysctl, __system_version_fallback,
3405 __system_version_parse_string, __vproc_get_last_exit_status,
3406 __vproc_grab_subset, __vproc_kickstart_by_label, __vproc_log,
3407 __vproc_log_error, __vproc_logv, __vproc_pid_is_managed, __vproc_post_fork_ping,
3408 __vproc_send_signal_by_label, __vproc_set_global_on_demand,
3436 __system_version_parse_string, __system_version_plist_path,
3437 __vproc_get_last_exit_status, __vproc_grab_subset, __vproc_kickstart_by_label,
3438 __vproc_log, __vproc_log_error, __vproc_logv, __vproc_pid_is_managed,
3439 __vproc_post_fork_ping, __vproc_send_signal_by_label, __vproc_set_global_on_demand,
34093440 __vproc_standby_begin, __vproc_standby_count, __vproc_standby_end,
34103441 __vproc_standby_timeout, __vproc_transaction_begin, __vproc_transaction_count,
34113442 __vproc_transaction_count_for_pid, __vproc_transaction_end,
......@@ -3419,19 +3450,22 @@ exports:
34193450 __xpc_connection_set_event_handler_f, __xpc_data_set_value,
34203451 __xpc_dictionary_create_reply_with_port, __xpc_dictionary_extract_mach_send,
34213452 __xpc_dictionary_extract_reply_msg_id, __xpc_dictionary_extract_reply_port,
3422 __xpc_dictionary_get_reply_msg_id, __xpc_dictionary_set_remote_connection,
3423 __xpc_dictionary_set_reply_msg_id, __xpc_domain_routine, __xpc_double_set_value,
3424 __xpc_error_connection_interrupted, __xpc_error_connection_invalid,
3425 __xpc_error_key_description, __xpc_error_peer_code_signing_requirement,
3426 __xpc_error_termination_imminent, __xpc_event_key_name, __xpc_event_key_stream_name,
3427 __xpc_fd_get_port, __xpc_int64_set_value, __xpc_payload_create_from_mach_msg,
3453 __xpc_dictionary_get_reply_msg_id, __xpc_dictionary_get_transaction,
3454 __xpc_dictionary_set_remote_connection, __xpc_dictionary_set_reply_msg_id,
3455 __xpc_domain_routine, __xpc_double_set_value, __xpc_error_connection_interrupted,
3456 __xpc_error_connection_invalid, __xpc_error_key_description,
3457 __xpc_error_peer_code_signing_requirement, __xpc_error_termination_imminent,
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,
34283460 __xpc_pipe_handle_mig, __xpc_pipe_interface_routine, __xpc_pipe_interface_routine_async,
34293461 __xpc_pipe_interface_simpleroutine, __xpc_runtime_get_entitlements_data,
34303462 __xpc_runtime_get_self_entitlements, __xpc_runtime_is_app_sandboxed,
3431 __xpc_service_last_xref_cancel, __xpc_service_routine, __xpc_shmem_get_mach_port,
3432 __xpc_spawnattr_binprefs_pack, __xpc_spawnattr_binprefs_size,
3433 __xpc_spawnattr_binprefs_unpack, __xpc_spawnattr_pack_bytes,
3434 __xpc_spawnattr_pack_string, __xpc_spawnattr_pack_string_fragment,
3463 __xpc_runtime_process_has_entered_sandbox, __xpc_service_last_xref_cancel,
3464 __xpc_service_routine, __xpc_session_create_from_connection_4SWIFT,
3465 __xpc_session_extract_connection_4SWIFT, __xpc_session_get_peer_audit_token_4SWIFT,
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,
34353469 __xpc_spawnattr_unpack_bytes, __xpc_spawnattr_unpack_string,
34363470 __xpc_spawnattr_unpack_strings, __xpc_string_set_value, __xpc_type_activity,
34373471 __xpc_type_array, __xpc_type_base, __xpc_type_bool, __xpc_type_bundle,
......@@ -3442,13 +3476,20 @@ exports:
34423476 __xpc_type_null, __xpc_type_pipe, __xpc_type_pointer, __xpc_type_rich_error,
34433477 __xpc_type_serializer, __xpc_type_service, __xpc_type_service_instance,
34443478 __xpc_type_session, __xpc_type_shmem, __xpc_type_string, __xpc_type_uint64,
3445 __xpc_type_uuid, __xpc_vtables, _bootstrap_check_in, _bootstrap_check_in2,
3446 _bootstrap_check_in3, _bootstrap_create_server, _bootstrap_create_service,
3447 _bootstrap_get_root, _bootstrap_info, _bootstrap_init, _bootstrap_look_up,
3448 _bootstrap_look_up2, _bootstrap_look_up3, _bootstrap_look_up_per_user,
3449 _bootstrap_lookup_children, _bootstrap_parent, _bootstrap_register,
3450 _bootstrap_register2, _bootstrap_status, _bootstrap_strerror,
3451 _bootstrap_subset, _bootstrap_unprivileged, _create_and_switch_to_per_session_launchd,
3479 __xpc_type_uuid, __xpc_vtables, _amfi_developer_mode_resolved,
3480 _amfi_developer_mode_status, _amfi_interface_authorize_local_signing,
3481 _amfi_interface_cdhash_in_trustcache, _amfi_interface_get_local_signing_private_key,
3482 _amfi_interface_get_local_signing_public_key, _amfi_interface_query_bootarg_state,
3483 _amfi_interface_set_local_signing_public_key, _amfi_launch_constraint_matches_process,
3484 _amfi_launch_constraint_set_spawnattr, _amfi_restricted_execution_mode_enable,
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,
34523493 _launch_activate_socket, _launch_active_user_login, _launch_active_user_logout,
34533494 _launch_active_user_switch, _launch_add_external_service,
34543495 _launch_bootout_user_service_4coresim, _launch_copy_busy_extension_instances,
......@@ -3474,27 +3515,28 @@ exports:
34743515 _launch_extension_property_path, _launch_extension_property_pid,
34753516 _launch_extension_property_version, _launch_extension_property_xpc_bundle,
34763517 _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,
3478 _launch_perfcheck_property_endpoint_active, _launch_perfcheck_property_endpoint_event,
3479 _launch_perfcheck_property_endpoint_name, _launch_perfcheck_property_endpoint_needs_activation,
3480 _launch_perfcheck_property_endpoints, _launch_remove_external_service,
3481 _launch_service_instance_copy_uuids, _launch_service_instance_create,
3482 _launch_service_instance_remove, _launch_service_stats_disable,
3483 _launch_service_stats_disable_4ppse, _launch_service_stats_enable,
3484 _launch_service_stats_enable_4ppse, _launch_service_stats_is_enabled,
3485 _launch_service_stats_is_enabled_4ppse, _launch_set_service_enabled,
3486 _launch_set_system_service_enabled, _launch_socket_service_check_in,
3518 _launch_job_query_get_additional_job_properties, _launch_load_mounted_jetsam_properties,
3519 _launch_msg, _launch_path_for_user_service_4coresim, _launch_perfcheck_property_endpoint_active,
3520 _launch_perfcheck_property_endpoint_event, _launch_perfcheck_property_endpoint_name,
3521 _launch_perfcheck_property_endpoint_needs_activation, _launch_perfcheck_property_endpoints,
3522 _launch_remove_external_service, _launch_service_instance_copy_uuids,
3523 _launch_service_instance_create, _launch_service_instance_remove,
3524 _launch_service_stats_disable, _launch_service_stats_disable_4ppse,
3525 _launch_service_stats_enable, _launch_service_stats_enable_4ppse,
3526 _launch_service_stats_is_enabled, _launch_service_stats_is_enabled_4ppse,
3527 _launch_set_service_enabled, _launch_set_system_service_enabled,
3528 _launch_socket_service_check_in, _launch_userspace_reboot_with_purpose,
34873529 _launch_version_for_user_service_4coresim, _launch_wait, _launchd_close,
34883530 _launchd_fdopen, _launchd_getfd, _launchd_msg_recv, _launchd_msg_send,
34893531 _load_launchd_jobs_at_loginwindow_prompt, _mpm_uncork_fork,
34903532 _mpm_wait, _os_system_version_get_current_version, _os_system_version_get_ios_support_version,
34913533 _os_system_version_sim_get_current_host_version, _os_transaction_copy_description,
3492 _os_transaction_create, _os_transaction_get_description, _os_transaction_get_timestamp,
3493 _os_transaction_needs_more_time, _place_hold_on_real_loginwindow,
3494 _reboot2, _reboot3, _vproc_release, _vproc_retain, _vproc_standby_begin,
3495 _vproc_standby_end, _vproc_swap_complex, _vproc_swap_integer,
3496 _vproc_swap_string, _vproc_transaction_begin, _vproc_transaction_end,
3497 _vprocmgr_lookup_vproc, _xpc_activity_add_eligibility_changed_handler,
3534 _os_transaction_create, _os_transaction_get_description, _os_transaction_get_ra,
3535 _os_transaction_get_timestamp, _os_transaction_needs_more_time,
3536 _place_hold_on_real_loginwindow, _reboot2, _reboot3, _vproc_release,
3537 _vproc_retain, _vproc_standby_begin, _vproc_standby_end, _vproc_swap_complex,
3538 _vproc_swap_integer, _vproc_swap_string, _vproc_transaction_begin,
3539 _vproc_transaction_end, _vprocmgr_lookup_vproc, _xpc_activity_add_eligibility_changed_handler,
34983540 _xpc_activity_copy_criteria, _xpc_activity_copy_dispatch_queue,
34993541 _xpc_activity_copy_identifier, _xpc_activity_debug, _xpc_activity_defer_until_network_change,
35003542 _xpc_activity_defer_until_percentage, _xpc_activity_get_percentage,
......@@ -3548,10 +3590,13 @@ exports:
35483590 _xpc_connection_set_instance, _xpc_connection_set_instance_binpref,
35493591 _xpc_connection_set_legacy, _xpc_connection_set_non_launching,
35503592 _xpc_connection_set_oneshot_instance, _xpc_connection_set_peer_code_signing_requirement,
3551 _xpc_connection_set_privileged, _xpc_connection_set_qos_class_fallback,
3552 _xpc_connection_set_qos_class_floor, _xpc_connection_set_target_queue,
3553 _xpc_connection_set_target_uid, _xpc_connection_set_target_user_session_uid,
3554 _xpc_connection_suspend, _xpc_copy, _xpc_copy_bootstrap, _xpc_copy_clean_description,
3593 _xpc_connection_set_peer_entitlement_exists_requirement, _xpc_connection_set_peer_entitlement_matches_value_requirement,
3594 _xpc_connection_set_peer_lightweight_code_requirement, _xpc_connection_set_peer_platform_identity_requirement,
3595 _xpc_connection_set_peer_team_identity_requirement, _xpc_connection_set_privileged,
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,
35553600 _xpc_copy_code_signing_identity_for_token, _xpc_copy_debug_description,
35563601 _xpc_copy_description, _xpc_copy_domain, _xpc_copy_entitlement_for_self,
35573602 _xpc_copy_entitlement_for_token, _xpc_copy_entitlements_data_for_token,
......@@ -3587,31 +3632,36 @@ exports:
35873632 _xpc_dictionary_set_string, _xpc_dictionary_set_uint64, _xpc_dictionary_set_uuid,
35883633 _xpc_dictionary_set_value, _xpc_double_create, _xpc_double_get_value,
35893634 _xpc_endpoint_compare, _xpc_endpoint_copy_listener_port_4sim,
3590 _xpc_endpoint_create, _xpc_endpoint_create_bs_named, _xpc_endpoint_create_bs_service,
3591 _xpc_endpoint_create_mach_port_4sim, _xpc_endpoint_get_bs_job_handle,
3592 _xpc_equal, _xpc_event_publisher_activate, _xpc_event_publisher_copy_event,
3593 _xpc_event_publisher_create, _xpc_event_publisher_fire, _xpc_event_publisher_fire_noboost,
3635 _xpc_endpoint_create, _xpc_endpoint_create_bs_from_port, _xpc_endpoint_create_bs_named,
3636 _xpc_endpoint_create_bs_service, _xpc_endpoint_create_mach_port_4sim,
3637 _xpc_endpoint_get_bs_job_handle, _xpc_equal, _xpc_event_publisher_activate,
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,
35943641 _xpc_event_publisher_fire_with_reply, _xpc_event_publisher_fire_with_reply_sync,
35953642 _xpc_event_publisher_get_subscriber_asid, _xpc_event_publisher_set_error_handler,
35963643 _xpc_event_publisher_set_event, _xpc_event_publisher_set_handler,
35973644 _xpc_event_publisher_set_initial_load_completed_handler_4remoted,
3598 _xpc_event_publisher_set_subscriber_keepalive, _xpc_event_stream_check_in,
3599 _xpc_event_stream_check_in2, _xpc_exit_reason_get_label, _xpc_extension_type_init,
3600 _xpc_fd_create, _xpc_fd_dup, _xpc_file_transfer_cancel, _xpc_file_transfer_copy_io,
3601 _xpc_file_transfer_create_with_fd, _xpc_file_transfer_create_with_path,
3602 _xpc_file_transfer_get_size, _xpc_file_transfer_get_transfer_id,
3603 _xpc_file_transfer_send_finished, _xpc_file_transfer_set_transport_writing_callbacks,
3604 _xpc_file_transfer_write_finished, _xpc_file_transfer_write_to_fd,
3605 _xpc_file_transfer_write_to_path, _xpc_generate_audit_token,
3606 _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC, _xpc_get_event_name,
3607 _xpc_get_instance, _xpc_get_type, _xpc_handle_service, _xpc_handle_subservice,
3645 _xpc_event_publisher_set_subscriber_keepalive, _xpc_event_publisher_set_throttling,
3646 _xpc_event_stream_check_in, _xpc_event_stream_check_in2, _xpc_exit_reason_get_label,
3647 _xpc_extension_type_init, _xpc_fd_create, _xpc_fd_dup, _xpc_file_transfer_cancel,
3648 _xpc_file_transfer_copy_io, _xpc_file_transfer_create_with_fd,
3649 _xpc_file_transfer_create_with_path, _xpc_file_transfer_get_size,
3650 _xpc_file_transfer_get_transfer_id, _xpc_file_transfer_send_finished,
3651 _xpc_file_transfer_set_transport_writing_callbacks, _xpc_file_transfer_write_finished,
3652 _xpc_file_transfer_write_to_fd, _xpc_file_transfer_write_to_path,
3653 _xpc_generate_audit_token, _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC,
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,
36083657 _xpc_hash, _xpc_impersonate_user, _xpc_init_services, _xpc_inspect_copy_description,
36093658 _xpc_inspect_copy_description_local, _xpc_inspect_copy_short_description,
36103659 _xpc_inspect_copy_short_description_local, _xpc_install_remote_hooks,
36113660 _xpc_int64_create, _xpc_int64_get_value, _xpc_is_kind_of_xpc_object4NSXPC,
3612 _xpc_is_system_session, _xpc_listener_activate, _xpc_listener_cancel,
3613 _xpc_listener_copy_description, _xpc_listener_create, _xpc_listener_create_anonymous,
3614 _xpc_listener_create_endpoint, _xpc_listener_reject_peer,
3661 _xpc_is_system_session, _xpc_is_xpcservice, _xpc_listener_activate,
3662 _xpc_listener_cancel, _xpc_listener_copy_description, _xpc_listener_create,
3663 _xpc_listener_create_anonymous, _xpc_listener_create_endpoint,
3664 _xpc_listener_reject_peer, _xpc_listener_set_peer_code_signing_requirement,
36153665 _xpc_mach_recv_create, _xpc_mach_recv_extract_right, _xpc_mach_send_copy_right,
36163666 _xpc_mach_send_create, _xpc_mach_send_create_with_disposition,
36173667 _xpc_mach_send_get_right, _xpc_mach_send_once_create, _xpc_mach_send_once_extract_right,
......@@ -3622,9 +3672,10 @@ exports:
36223672 _xpc_pipe_routine_async, _xpc_pipe_routine_forward, _xpc_pipe_routine_reply,
36233673 _xpc_pipe_routine_with_flags, _xpc_pipe_simpleroutine, _xpc_pipe_try_receive,
36243674 _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,
3626 _xpc_rich_error_copy_description, _xpc_service_attach, _xpc_service_attach_with_flags,
3627 _xpc_service_create, _xpc_service_create_from_specifier, _xpc_service_get_rendezvous_token,
3675 _xpc_receive_mach_msg_validate_hdr, _xpc_receive_remote_msg,
3676 _xpc_release, _xpc_retain, _xpc_rich_error_can_retry, _xpc_rich_error_copy_description,
3677 _xpc_service_attach, _xpc_service_attach_with_flags, _xpc_service_create,
3678 _xpc_service_create_from_specifier, _xpc_service_get_rendezvous_token,
36283679 _xpc_service_instance_dup2, _xpc_service_instance_get_context,
36293680 _xpc_service_instance_get_host_pid, _xpc_service_instance_get_pid,
36303681 _xpc_service_instance_get_type, _xpc_service_instance_is_configurable,
......@@ -3639,7 +3690,8 @@ exports:
36393690 _xpc_session_create_xpc_endpoint, _xpc_session_create_xpc_service,
36403691 _xpc_session_send_message, _xpc_session_send_message_with_reply_async,
36413692 _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,
36433695 _xpc_session_set_target_user_session_uid, _xpc_set_event,
36443696 _xpc_set_event_state, _xpc_set_event_stream_handler, _xpc_set_event_with_flags,
36453697 _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 @@
218218 #ifdef KERNEL
219219 #include <libkern/libkern.h>
220220 #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));
222222 #elif TARGET_OS_DRIVERKIT
223223 #include <os/log.h>
224224 #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));
226226 #else
227227 #include <stdio.h>
228228 #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));
230230 #endif
231231#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 @@
361375 #define __Check_noErr(errorCode) \
362376 do \
363377 { \
364 long evalOnceErrorCode = (errorCode); \
378 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
365379 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
366380 { \
367381 DEBUG_ASSERT_MESSAGE( \
......@@ -397,7 +411,7 @@
397411 #define __Check_noErr_String(errorCode, message) \
398412 do \
399413 { \
400 long evalOnceErrorCode = (errorCode); \
414 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
401415 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
402416 { \
403417 DEBUG_ASSERT_MESSAGE( \
......@@ -523,7 +537,7 @@
523537 #define __Verify_noErr(errorCode) \
524538 do \
525539 { \
526 long evalOnceErrorCode = (errorCode); \
540 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
527541 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
528542 { \
529543 DEBUG_ASSERT_MESSAGE( \
......@@ -565,7 +579,7 @@
565579 #define __Verify_noErr_String(errorCode, message) \
566580 do \
567581 { \
568 long evalOnceErrorCode = (errorCode); \
582 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
569583 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
570584 { \
571585 DEBUG_ASSERT_MESSAGE( \
......@@ -605,7 +619,7 @@
605619 #else
606620 #define __Verify_noErr_Action(errorCode, action) \
607621 do { \
608 long evalOnceErrorCode = (errorCode); \
622 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
609623 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) { \
610624 DEBUG_ASSERT_MESSAGE( \
611625 DEBUG_ASSERT_COMPONENT_NAME_STRING, \
......@@ -970,7 +984,7 @@
970984 #define __Require_noErr(errorCode, exceptionLabel) \
971985 do \
972986 { \
973 long evalOnceErrorCode = (errorCode); \
987 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
974988 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
975989 { \
976990 DEBUG_ASSERT_MESSAGE( \
......@@ -1022,7 +1036,7 @@
10221036 #define __Require_noErr_Action(errorCode, exceptionLabel, action) \
10231037 do \
10241038 { \
1025 long evalOnceErrorCode = (errorCode); \
1039 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
10261040 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
10271041 { \
10281042 DEBUG_ASSERT_MESSAGE( \
......@@ -1131,7 +1145,7 @@
11311145 #define __Require_noErr_String(errorCode, exceptionLabel, message) \
11321146 do \
11331147 { \
1134 long evalOnceErrorCode = (errorCode); \
1148 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
11351149 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
11361150 { \
11371151 DEBUG_ASSERT_MESSAGE( \
......@@ -1186,7 +1200,7 @@
11861200 #define __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) \
11871201 do \
11881202 { \
1189 long evalOnceErrorCode = (errorCode); \
1203 DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
11901204 if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
11911205 { \
11921206 DEBUG_ASSERT_MESSAGE( \
lib/libc/include/any-macos-any/Availability.h+31-10
......@@ -159,13 +159,26 @@
159159#define __API_TO_BE_DEPRECATED_DRIVERKIT 100000
160160#endif
161161
162#ifndef __API_TO_BE_DEPRECATED_XROS
163#define __API_TO_BE_DEPRECATED_XROS 100000
162#ifndef __API_TO_BE_DEPRECATED_VISIONOS
163#define __API_TO_BE_DEPRECATED_VISIONOS 100000
164164#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
167176#include <AvailabilityVersions.h>
168177#include <AvailabilityInternal.h>
178#include <AvailabilityInternalLegacy.h>
179#if __has_include(<AvailabilityInternalPrivate.h>)
180 #include <AvailabilityInternalPrivate.h>
181#endif
169182
170183#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
171184 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
......@@ -419,9 +432,9 @@
419432 * __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
420433 * __API_AVAILABLE(driverkit(19.0))
421434 */
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__)
425438 #define __API_AVAILABLE_END _Pragma("clang attribute pop")
426439
427440 /*
......@@ -440,13 +453,13 @@
440453 * __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
441454 * __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
442455 */
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__)
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__)
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__)
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__)
447460 #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__)
450463 #define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
451464
452465 /*
......@@ -457,9 +470,9 @@
457470 * __API_UNAVAILABLE(macos)
458471 * __API_UNAVAILABLE(watchos, tvos)
459472 */
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__)
461474
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__)
463476 #define __API_UNAVAILABLE_END _Pragma("clang attribute pop")
464477 #endif /* __has_attribute(availability) */
465478#endif /* #if defined(__has_feature) && defined(__has_attribute) */
......@@ -524,6 +537,14 @@
524537 #define __SPI_AVAILABLE(...)
525538#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
527548#ifndef __SPI_DEPRECATED
528549 #define __SPI_DEPRECATED(...)
529550#endif
lib/libc/include/any-macos-any/AvailabilityInternal.h+79-59
......@@ -30,19 +30,17 @@
3030#ifndef __AVAILABILITY_INTERNAL__
3131#define __AVAILABILITY_INTERNAL__
3232
33#if __has_include(<AvailabilityInternalPrivate.h>)
34 #include <AvailabilityInternalPrivate.h>
35#endif
33#include <AvailabilityVersions.h>
3634
3735#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
3836 #if defined(__has_builtin) && __has_builtin(__is_target_os)
3937 #if __is_target_os(macos)
4038 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
41 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
39 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
4240 #endif
4341 #elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
4442 #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
45 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
43 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
4644 #endif /* __has_builtin(__is_target_os) && __is_target_os(macos) */
4745#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
4846
......@@ -50,11 +48,11 @@
5048 #if defined(__has_builtin) && __has_builtin(__is_target_os)
5149 #if __is_target_os(ios)
5250 #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
53 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_0
51 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
5452 #endif
5553 #elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
5654 #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
57 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_0
55 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
5856 #endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */
5957#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
6058
......@@ -62,13 +60,13 @@
6260 #if defined(__has_builtin) && __has_builtin(__is_target_os)
6361 #if __is_target_os(watchos)
6462 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
65 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_0
63 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
6664 /* for compatibility with existing code. New code should use platform specific checks */
6765 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
6866 #endif
6967 #elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
7068 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
71 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_0
69 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
7270 /* for compatibility with existing code. New code should use platform specific checks */
7371 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
7472 #endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */
......@@ -78,13 +76,13 @@
7876 #if defined(__has_builtin) && __has_builtin(__is_target_os)
7977 #if __is_target_os(tvos)
8078 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
81 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_0
79 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
8280 /* for compatibility with existing code. New code should use platform specific checks */
8381 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
8482 #endif
8583 #elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
8684 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
87 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_0
85 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
8886 /* for compatibility with existing code. New code should use platform specific checks */
8987 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
9088 #endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */
......@@ -94,7 +92,7 @@
9492 #if defined(__has_builtin) && __has_builtin(__is_target_os)
9593 #if __is_target_os(bridgeos)
9694 #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
97 #define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_8_0
95 #define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_9_1
9896 /* for compatibility with existing code. New code should use platform specific checks */
9997 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_0
10098 #endif
......@@ -105,22 +103,45 @@
105103 #if defined(__has_builtin) && __has_builtin(__is_target_os)
106104 #if __is_target_os(driverkit)
107105 #define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
108 #define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_23_0
106 #define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_24_1
109107 #endif
110108 #endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */
111109#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */
112110
113#ifndef __XR_OS_VERSION_MIN_REQUIRED
111#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
114125 #if defined(__has_builtin) && __has_builtin(__is_target_os)
115126 #if __is_target_os(xros)
116 #define __XR_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
117 #define __XR_OS_VERSION_MAX_ALLOWED __XROS_1_0
127 #define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
128 // 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
118136 /* for compatibility with existing code. New code should use platform specific checks */
119 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_0
137 #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
120138 #endif
121 #endif /* __has_builtin(__is_target_os) && __is_target_os(xros) */
122#endif /* __XR_OS_VERSION_MIN_REQUIRED */
139 #endif /* __has_builtin(__is_target_os) && __is_target_os(visionos) */
140#endif /* __VISION_OS_VERSION_MIN_REQUIRED */
123141
142#ifndef __OPEN_SOURCE__
143
144#endif /* __OPEN_SOURCE__ */
124145
125146#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
126147 /* make sure a default max version is set */
......@@ -150,43 +171,42 @@
150171#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
151172#define __AVAILABILITY_INTERNAL_REGULAR
152173
153#include <AvailabilityInternalLegacy.h>
154
155174#if defined(__has_feature) && defined(__has_attribute)
156175 #if __has_attribute(availability)
157176 #define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
158 #define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
159177 #define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y
178 #define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
160179 #define __API_AVAILABLE_PLATFORM_macosx(x) macos,introduced=x
161 #define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
162180 #define __API_DEPRECATED_PLATFORM_macosx(x,y) macos,introduced=x,deprecated=y
181 #define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
163182 #define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x
164 #define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
165183 #define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y
184 #define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
166185 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
167 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
168186 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
169 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
170187 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
188 #define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
171189 #define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
190 #define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
172191 #define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x
173 #define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
174192 #define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y
193 #define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
175194 #define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x
176 #define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
177195 #define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y
196 #define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
178197
179198
180199
181200 #define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x
182 #define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
183201 #define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y
184 #define __API_AVAILABLE_PLATFORM_xros(x) xros,introduced=x
185 #define __API_UNAVAILABLE_PLATFORM_xros xros,unavailable
186 #define __API_DEPRECATED_PLATFORM_xros(x,y) xros,introduced=x,deprecated=y
187 #define __API_AVAILABLE_PLATFORM_visionos(x) xros,introduced=x
188 #define __API_UNAVAILABLE_PLATFORM_visionos xros,unavailable
189 #define __API_DEPRECATED_PLATFORM_visionos(x,y) xros,introduced=x,deprecated=y
202 #define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
203 #define __API_AVAILABLE_PLATFORM_visionos(x) visionos,introduced=x
204 #define __API_DEPRECATED_PLATFORM_visionos(x,y) visionos,introduced=x,deprecated=y
205 #define __API_UNAVAILABLE_PLATFORM_visionos visionos,unavailable
206 #define __API_AVAILABLE_PLATFORM_xros(x) visionos,introduced=x
207 #define __API_DEPRECATED_PLATFORM_xros(x,y) visionos,introduced=x,deprecated=y
208 #define __API_UNAVAILABLE_PLATFORM_xros visionos,unavailable
209
190210 #endif /* __has_attribute(availability) */
191211#endif /* defined(__has_feature) && defined(__has_attribute) */
192212
......@@ -218,7 +238,8 @@
218238 #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)
219239 #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)
220240 #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,...) NAME
241 #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
222243
223244 #define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
224245
......@@ -230,7 +251,8 @@
230251 #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)
231252 #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)
232253 #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,...) NAME
254 #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
235257
236258
......@@ -244,7 +266,8 @@
244266 #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)
245267 #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)
246268 #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,...) NAME
269 #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
249272 #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 @@
256279 #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)
257280 #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)
258281 #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,...) NAME
282 #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
261285 #if __has_feature(attribute_availability_with_replacement)
262286 #define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))
......@@ -272,7 +296,8 @@
272296 #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)
273297 #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)
274298 #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,...) NAME
299 #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
277302 #if __has_feature(attribute_availability_with_replacement)
278303 #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 @@
280305 #define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
281306 #endif
282307
283 #define __API_DEPRECATED_BEGIN_REP0(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)
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)
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)
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)
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)
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)
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)
291 #define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
308 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN0(msg,arg0) __API_R_BEGIN(msg,arg0)
309 #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)
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)
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)
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)
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)
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)
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)
316 #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
293319 /*
294320 * API Unavailability
......@@ -309,7 +335,8 @@
309335 #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)
310336 #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)
311337 #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,...) NAME
338 #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
314341 #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 @@
321348 #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)
322349 #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)
323350 #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,...) NAME
351 #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
326354 #endif /* __has_attribute(availability) */
327355#endif /* #if defined(__has_feature) && defined(__has_attribute) */
......@@ -346,12 +374,4 @@
346374 #define __swift_compiler_version_at_least(...) 1
347375#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
357377#endif /* __AVAILABILITY_INTERNAL__ */
lib/libc/include/any-macos-any/AvailabilityInternalLegacy.h+2
......@@ -31,6 +31,8 @@
3131#ifndef __AVAILABILITY_INTERNAL_LEGACY__
3232#define __AVAILABILITY_INTERNAL_LEGACY__
3333
34#include <AvailabilityInternal.h>
35
3436#if defined(__has_builtin)
3537 #if __has_builtin(__is_target_arch)
3638 #if __has_builtin(__is_target_vendor)
lib/libc/include/any-macos-any/AvailabilityVersions.h+78-2
......@@ -70,13 +70,24 @@
7070#define __MAC_12_3 120300
7171#define __MAC_12_4 120400
7272#define __MAC_12_5 120500
73#define __MAC_12_6 120600
74#define __MAC_12_7 120700
7375#define __MAC_13_0 130000
7476#define __MAC_13_1 130100
7577#define __MAC_13_1 130100
7678#define __MAC_13_2 130200
7779#define __MAC_13_3 130300
7880#define __MAC_13_4 130400
81#define __MAC_13_5 130500
82#define __MAC_13_6 130600
7983#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
8091/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
8192
8293#define __IPHONE_2_0 20000
......@@ -143,13 +154,24 @@
143154#define __IPHONE_15_4 150400
144155#define __IPHONE_15_5 150500
145156#define __IPHONE_15_6 150600
157#define __IPHONE_15_7 150700
158#define __IPHONE_15_8 150800
146159#define __IPHONE_16_0 160000
147160#define __IPHONE_16_1 160100
148161#define __IPHONE_16_2 160200
149162#define __IPHONE_16_3 160300
150163#define __IPHONE_16_4 160400
151164#define __IPHONE_16_5 160500
165#define __IPHONE_16_6 160600
166#define __IPHONE_16_7 160700
152167#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
153175/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
154176
155177#define __WATCHOS_1_0 10000
......@@ -185,13 +207,22 @@
185207#define __WATCHOS_8_5 80500
186208#define __WATCHOS_8_6 80600
187209#define __WATCHOS_8_7 80700
210#define __WATCHOS_8_8 80800
188211#define __WATCHOS_9_0 90000
189212#define __WATCHOS_9_1 90100
190213#define __WATCHOS_9_2 90200
191214#define __WATCHOS_9_3 90300
192215#define __WATCHOS_9_4 90400
193216#define __WATCHOS_9_5 90500
217#define __WATCHOS_9_6 90600
194218#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
195226/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
196227
197228#define __TVOS_9_0 90000
......@@ -235,7 +266,15 @@
235266#define __TVOS_16_3 160300
236267#define __TVOS_16_4 160400
237268#define __TVOS_16_5 160500
269#define __TVOS_16_6 160600
238270#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
239278/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
240279
241280#define __BRIDGEOS_2_0 20000
......@@ -258,7 +297,15 @@
258297#define __BRIDGEOS_7_2 70200
259298#define __BRIDGEOS_7_3 70300
260299#define __BRIDGEOS_7_4 70400
300#define __BRIDGEOS_7_6 70600
261301#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
264311#define __DRIVERKIT_19_0 190000
......@@ -267,13 +314,31 @@
267314#define __DRIVERKIT_22_0 220000
268315#define __DRIVERKIT_22_4 220400
269316#define __DRIVERKIT_22_5 220500
317#define __DRIVERKIT_22_6 220600
270318#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
271326/* __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 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 */
328#define __VISIONOS_1_0 10000
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
277342/*
278343 * Set up standard Mac OS X versions
279344 */
......@@ -326,13 +391,24 @@
326391#define MAC_OS_VERSION_12_3 __MAC_12_3
327392#define MAC_OS_VERSION_12_4 __MAC_12_4
328393#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
329396#define MAC_OS_VERSION_13_0 __MAC_13_0
330397#define MAC_OS_VERSION_13_1 __MAC_13_1
331398#define MAC_OS_VERSION_13_1 __MAC_13_1
332399#define MAC_OS_VERSION_13_2 __MAC_13_2
333400#define MAC_OS_VERSION_13_3 __MAC_13_3
334401#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
335404#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
337413#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 @@
3737#ifndef __MACTYPES__
3838#define __MACTYPES__
3939
40#ifndef __CONDITIONALMACROS__
40#if __has_include(<ConditionalMacros.h>)
4141#include <ConditionalMacros.h>
4242#endif
4343
44#include <TargetConditionals.h>
45
4446#include <stdbool.h>
4547
4648#include <sys/types.h>
......@@ -153,7 +155,7 @@ typedef struct UnsignedWide UnsignedWide;
153155
154156#endif
155157
156#if TYPE_LONGLONG
158#if TYPE_LONGLONG || 0
157159/*
158160 Note: wide and UnsignedWide must always be structs for source code
159161 compatibility. On the other hand UInt64 and SInt64 can be
......@@ -178,7 +180,7 @@ typedef struct UnsignedWide UnsignedWide;
178180
179181typedef wide SInt64;
180182typedef UnsignedWide UInt64;
181#endif /* TYPE_LONGLONG */
183#endif
182184
183185/********************************************************************************
184186
......@@ -307,6 +309,8 @@ typedef ResType * ResTypePtr;
307309
308310*********************************************************************************/
309311typedef unsigned char Boolean;
312
313#if !0
310314/********************************************************************************
311315
312316 Function Pointer Types
......@@ -330,6 +334,8 @@ typedef ProcPtr UniversalProcPtr;
330334
331335typedef ProcPtr * ProcHandle;
332336typedef UniversalProcPtr * UniversalProcHandle;
337#endif
338
333339/********************************************************************************
334340
335341 RefCon Types
......@@ -691,6 +697,8 @@ typedef UnsignedWide * UnsignedWidePtr;
691697typedef Float80 extended80;
692698typedef Float96 extended96;
693699typedef SInt8 VHSelect;
700
701#if !0
694702/*********************************************************************************
695703
696704 Debugger functions
......@@ -718,7 +726,7 @@ Debugger(void) __OSX_AVAILABLE_BU
718726 */
719727extern void
720728DebugStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
721
729#endif
722730
723731/*
724732 * debugstr()
lib/libc/include/any-macos-any/TargetConditionals.h+289-399
......@@ -51,49 +51,56 @@
5151 * TARGET_CPU_MIPS - Compiler is generating MIPS instructions
5252 * TARGET_CPU_SPARC - Compiler is generating Sparc instructions
5353 * TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
54 *
55 *
54 */
55
56
57
58/*
5659 * TARGET_OS_*
60 *
5761 * These conditionals specify in which Operating System the generated code will
5862 * run. Indention is used to show which conditionals are evolutionary subclasses.
5963 *
6064 * 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.
6266 *
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
6382 *
64 * TARGET_OS_WIN32 - Generated code will run under WIN32 API
65 * TARGET_OS_WINDOWS - Generated code will run under Windows
66 * TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
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
83 * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
84 * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
85 * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
7886 *
79 * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
80 * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
81 * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
82 *
83 * +---------------------------------------------------------------------------+
84 * | TARGET_OS_MAC |
85 * | +-----+ +-------------------------------------------------+ +-----------+ |
86 * | | | | TARGET_OS_IPHONE | | | |
87 * | | | | +-----------------+ +----+ +-------+ +--------+ | | | |
88 * | | | | | IOS | | | | | | | | | | |
89 * | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | | DRIVERKIT | |
90 * | | | | | | MACCATALYST | | | | | | | | | | | |
91 * | | | | | +-------------+ | | | | | | | | | | |
92 * | | | | +-----------------+ +----+ +-------+ +--------+ | | | |
93 * | +-----+ +-------------------------------------------------+ +-----------+ |
94 * +---------------------------------------------------------------------------+
87 * +--------------------------------------------------------------------------------------+
88 * | TARGET_OS_MAC |
89 * | +-----+ +------------------------------------------------------------+ +-----------+ |
90 * | | | | TARGET_OS_IPHONE | | | |
91 * | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | |
92 * | | | | | IOS | | | | | | | | | | | | |
93 * | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | VISION | | | DRIVERKIT | |
94 * | | | | | | MACCATALYST | | | | | | | | | | | | | |
95 * | | | | | +-------------+ | | | | | | | | | | | | |
96 * | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | |
97 * | +-----+ +------------------------------------------------------------+ +-----------+ |
98 * +--------------------------------------------------------------------------------------+
99 */
95100
101/*
96102 * TARGET_RT_*
103 *
97104 * These conditionals specify in which runtime the generated code will
98105 * run. This is needed when the OS and CPU support more than one runtime
99106 * (e.g. Mac OS X supports CFM and mach-o).
......@@ -105,7 +112,7 @@
105112 * TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used
106113 */
107114
108 /*
115/*
109116 * TARGET_OS conditionals can be enabled via clang preprocessor extensions:
110117 *
111118 * __is_target_arch
......@@ -130,6 +137,7 @@
130137 * It is disabled by default.
131138 */
132139
140#if !defined(__has_extension) || !__has_extension(define_target_os_macros)
133141#if defined(__has_builtin)
134142 #if __has_builtin(__is_target_arch)
135143 #if __has_builtin(__is_target_vendor)
......@@ -141,26 +149,15 @@
141149 /* "-target=arm64e-apple-ios12-macabi" */
142150 #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)
143151 #define TARGET_OS_MAC 1
144 #define TARGET_OS_OSX 0
145152 #define TARGET_OS_IPHONE 1
146153 #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
153154 #define TARGET_OS_MACCATALYST 1
154155 #define TARGET_OS_MACCATALYST 1
155
156 #define TARGET_OS_VISION 0
157
158
159156 #ifndef TARGET_OS_UIKITFORMAC
160157 #define TARGET_OS_UIKITFORMAC 1
161158 #endif
162 #define TARGET_OS_DRIVERKIT 0
163 #define DYNAMIC_TARGETS_ENABLED 1
159 #define TARGET_OS_UNIX 0
160 #define DYNAMIC_TARGETS_ENABLED 1
164161 #endif
165162
166163 /* "-target=x86_64-apple-ios12-simulator" */
......@@ -168,131 +165,42 @@
168165 /* "-target=arm64e-apple-ios12-simulator" */
169166 #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)
170167 #define TARGET_OS_MAC 1
171 #define TARGET_OS_OSX 0
172168 #define TARGET_OS_IPHONE 1
173169 #define TARGET_OS_IOS 1
174 #define TARGET_OS_WATCH 0
175
176 #define TARGET_OS_TV 0
177170 #define TARGET_OS_SIMULATOR 1
178 #define TARGET_OS_EMBEDDED 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
171 #define TARGET_OS_UNIX 0
190172 #define DYNAMIC_TARGETS_ENABLED 1
191173 #endif
192174
193175
194176
195 /* "-target=arm64e-apple-xros1.0" */
196 #if (__is_target_arch(arm64e) || __is_target_arch(arm64)) && __is_target_vendor(apple) && __is_target_os(xros)
177 /* "-target=arm64e-apple-xros1.0[-simulator]" */
178 #if __is_target_vendor(apple) && __is_target_os(xros)
197179 #define TARGET_OS_MAC 1
198 #define TARGET_OS_OSX 0
199180 #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 1
211
212
213 #ifndef TARGET_OS_UIKITFORMAC
214 #define TARGET_OS_UIKITFORMAC 0
182 #if __is_target_environment(simulator)
183 #define TARGET_OS_SIMULATOR 1
184 #else
185 #define TARGET_OS_EMBEDDED 1
215186 #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
235187 #define TARGET_OS_VISION 1
236
237
238 #ifndef TARGET_OS_UIKITFORMAC
239 #define TARGET_OS_UIKITFORMAC 0
240 #endif
241 #define TARGET_OS_DRIVERKIT 0
188 #define TARGET_OS_UNIX 0
242189 #define DYNAMIC_TARGETS_ENABLED 1
243190 #endif
244191
245192
246
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
193 #if (__is_target_vendor(apple) && __is_target_environment(exclavecore))
254194
255 #define TARGET_OS_TV 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
195 #define TARGET_OS_UNIX 0
269196 #define DYNAMIC_TARGETS_ENABLED 1
270197 #endif
271198
272199
273
274 //FIXME: Workaround for rdar://100536146
275 #if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVEKIT__) && __APPLE_EXCLAVEKIT__)
200 #if (__is_target_vendor(apple) && __is_target_environment(exclavekit))
276201 #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
291202
292 #ifndef TARGET_OS_UIKITFORMAC
293 #define TARGET_OS_UIKITFORMAC 0
294 #endif
295 #define TARGET_OS_DRIVERKIT 0
203 #define TARGET_OS_UNIX 0
296204 #define DYNAMIC_TARGETS_ENABLED 1
297205 #endif
298206
......@@ -301,25 +209,8 @@
301209 /* "-target=arm64e-apple-driverkit19.0" */
302210 #if __is_target_vendor(apple) && __is_target_os(driverkit)
303211 #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
322212 #define TARGET_OS_DRIVERKIT 1
213 #define TARGET_OS_UNIX 0
323214 #define DYNAMIC_TARGETS_ENABLED 1
324215 #endif
325216
......@@ -329,186 +220,83 @@
329220 #endif /* #if __has_builtin(__is_target_arch) */
330221#endif /* #if defined(__has_builtin) */
331222
332
333223#ifndef DYNAMIC_TARGETS_ENABLED
334 #define DYNAMIC_TARGETS_ENABLED 0
224 #define DYNAMIC_TARGETS_ENABLED 0
335225#endif /* DYNAMIC_TARGETS_ENABLED */
336226
337227/*
338228 * gcc based compiler used on Mac OS X
339229 */
340230#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
346231 #if !DYNAMIC_TARGETS_ENABLED
347232 #define TARGET_OS_MAC 1
348233 #define TARGET_OS_OSX 1
349234 #define TARGET_OS_IPHONE 0
235
350236 #define TARGET_OS_IOS 0
237
351238 #define TARGET_OS_WATCH 0
352239
353240 #define TARGET_OS_TV 0
354241 #define TARGET_OS_MACCATALYST 0
355242 #define TARGET_OS_MACCATALYST 0
356
357
358
359 #define TARGET_OS_VISION 0
360243 #ifndef TARGET_OS_UIKITFORMAC
361244 #define TARGET_OS_UIKITFORMAC 0
362245 #endif
363246 #define TARGET_OS_SIMULATOR 0
364247 #define TARGET_OS_EMBEDDED 0
365 #define TARGET_OS_RTKIT 0
366 #define TARGET_OS_DRIVERKIT 0
248 #define TARGET_OS_UNIX 0
367249 #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))
373 #if defined(__ppc__)
374 #define TARGET_CPU_PPC 1
375 #define TARGET_CPU_PPC64 0
376 #define TARGET_CPU_68K 0
377 #define TARGET_CPU_X86 0
378 #define TARGET_CPU_X86_64 0
379 #define TARGET_CPU_ARM 0
380 #define TARGET_CPU_ARM64 0
381 #define TARGET_CPU_MIPS 0
382 #define TARGET_CPU_SPARC 0
383 #define TARGET_CPU_ALPHA 0
384 #define TARGET_RT_LITTLE_ENDIAN 0
385 #define TARGET_RT_BIG_ENDIAN 1
386 #define TARGET_RT_64_BIT 0
387 #ifdef __MACOS_CLASSIC__
388 #define TARGET_RT_MAC_CFM 1
389 #define TARGET_RT_MAC_MACHO 0
390 #else
391 #define TARGET_RT_MAC_CFM 0
392 #define TARGET_RT_MAC_MACHO 1
393 #endif
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
251/*
252 * CodeWarrior compiler from Metrowerks/Motorola
253 */
254#elif defined(__MWERKS__)
255 #define TARGET_OS_MAC 1
256
257/*
258 * unknown compiler
259 */
260#else
261 #define TARGET_OS_MAC 1
262#endif
263#endif /* !defined(__has_extension) || !__has_extension(define_target_os_macros) */
264
265// This has to always be defined in the header due to limitations in define_target_os_macros
266#define TARGET_OS_RTKIT 0
267
268/*
269 * gcc based compiler used on Mac OS X
270 */
271#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
272 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
439273 #define TARGET_RT_LITTLE_ENDIAN 1
440274 #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__
441280 #define TARGET_RT_64_BIT 1
442 #elif defined(__arm__)
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
281 #else
457282 #define TARGET_RT_64_BIT 0
458 #elif defined(__arm64__)
459 #define TARGET_CPU_PPC 0
460 #define TARGET_CPU_PPC64 0
461 #define TARGET_CPU_68K 0
462 #define TARGET_CPU_X86 0
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
283 #endif
284 #if defined(__ppc__) && __MACOS_CLASSIC__
285 #define TARGET_RT_MAC_CFM 1
286 #define TARGET_RT_MAC_MACHO 0
287 #else
469288 #define TARGET_RT_MAC_CFM 0
470289 #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
480290 #endif
481291
482
483
484292/*
485293 * CodeWarrior compiler from Metrowerks/Motorola
486294 */
487295#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
494296 #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
502297 #define TARGET_RT_LITTLE_ENDIAN 0
503298 #define TARGET_RT_BIG_ENDIAN 1
504299 #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
512300 #define TARGET_RT_LITTLE_ENDIAN 1
513301 #define TARGET_RT_BIG_ENDIAN 0
514302 #else
......@@ -527,98 +315,6 @@
527315 * unknown compiler
528316 */
529317#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
622318 #if TARGET_CPU_PPC || TARGET_CPU_PPC64
623319 #define TARGET_RT_BIG_ENDIAN 1
624320 #define TARGET_RT_LITTLE_ENDIAN 0
......@@ -638,7 +334,201 @@
638334 #define TARGET_RT_MAC_MACHO 0
639335 #define TARGET_RT_MAC_CFM 1
640336 #endif
641
642337#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
644534#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/*
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 */
231/*-
242 * Copyright (c)1999 Citrus Project,
253 * All rights reserved.
......@@ -48,27 +26,18 @@
4826 */
4927
5028/*
51 * Common header for _wctype.h and xlocale/__wctype.h
29 * 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 *);
5237 */
5338
54#ifndef ___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>
39#include <___wctype.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 @@
6363 * @(#)ctype.h 8.4 (Berkeley) 1/21/94
6464 */
6565
66#ifndef __CTYPE_H_
66#ifndef _CTYPE_H_
67#define _CTYPE_H_
6768#define __CTYPE_H_
6869
6970#include <sys/cdefs.h>
......@@ -118,6 +119,7 @@
118119
119120#define __DARWIN_CTYPE_TOP_inline __header_inline
120121
122
121123/*
122124 * Use inline functions if we are allowed to and the compiler supports them.
123125 */
......@@ -380,8 +382,4 @@ __END_DECLS
380382
381383#endif /* using inlines */
382384
383#ifdef _USE_EXTENDED_LOCALES_
384#include <xlocale/_ctype.h>
385#endif /* _USE_EXTENDED_LOCALES_ */
386
387385#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 @@
9090 * Common header for regex.h and xlocale/_regex.h
9191 */
9292
93#ifndef __REGEX_H_
93#ifndef _REGEX_H_
94#define _REGEX_H_
9495#define __REGEX_H_
9596
9697#include <_types.h>
......@@ -118,4 +119,123 @@ typedef struct {
118119 regoff_t rm_eo; /* end of match */
119120} 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 @@
11/*
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.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -62,7 +62,8 @@
6262 * Common header for stdio.h and xlocale/_stdio.h
6363 */
6464
65#ifndef __STDIO_H_
65#ifndef _STDIO_H_
66#define _STDIO_H_
6667#define __STDIO_H_
6768
6869#include <sys/cdefs.h>
......@@ -77,6 +78,7 @@
7778#include <sys/_types/_null.h>
7879
7980#include <sys/stdio.h>
81#include <_printf.h>
8082
8183typedef __darwin_off_t fpos_t;
8284
......@@ -156,4 +158,345 @@ typedef struct __sFILE {
156158 fpos_t _offset; /* current lseek offset (see WARNING) */
157159} 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 @@
2323 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2424 * SUCH DAMAGE.
2525 *
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 $
2629 */
2730
28/*
29 * 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 *);
37 */
31#ifndef _WCTYPE_H_
32#define _WCTYPE_H_
3833
39#ifndef __WCTYPE_H_
40#define __WCTYPE_H_
34#include <sys/cdefs.h>
35#include <_types.h>
36#include <_types/_wctrans_t.h>
37
38#define __DARWIN_WCTYPE_TOP_inline __header_inline
4139
4240#include <__wctype.h>
41#include <ctype.h>
4342
4443/*
4544 * Use inline functions if we are allowed to and the compiler supports them.
......@@ -48,117 +47,80 @@
4847 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
4948
5049__DARWIN_WCTYPE_TOP_inline int
51iswalnum(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)
50iswblank(wint_t _wc)
7651{
77 return (__isctype(_wc, _CTYPE_D));
52 return (__istype(_wc, _CTYPE_B));
7853}
7954
55#if !defined(_ANSI_SOURCE)
8056__DARWIN_WCTYPE_TOP_inline int
81iswgraph(wint_t _wc)
57iswascii(wint_t _wc)
8258{
83 return (__istype(_wc, _CTYPE_G));
59 return ((_wc & ~0x7F) == 0);
8460}
8561
8662__DARWIN_WCTYPE_TOP_inline int
87iswlower(wint_t _wc)
63iswhexnumber(wint_t _wc)
8864{
89 return (__istype(_wc, _CTYPE_L));
65 return (__istype(_wc, _CTYPE_X));
9066}
9167
9268__DARWIN_WCTYPE_TOP_inline int
93iswprint(wint_t _wc)
69iswideogram(wint_t _wc)
9470{
95 return (__istype(_wc, _CTYPE_R));
71 return (__istype(_wc, _CTYPE_I));
9672}
9773
9874__DARWIN_WCTYPE_TOP_inline int
99iswpunct(wint_t _wc)
75iswnumber(wint_t _wc)
10076{
101 return (__istype(_wc, _CTYPE_P));
77 return (__istype(_wc, _CTYPE_D));
10278}
10379
10480__DARWIN_WCTYPE_TOP_inline int
105iswspace(wint_t _wc)
81iswphonogram(wint_t _wc)
10682{
107 return (__istype(_wc, _CTYPE_S));
83 return (__istype(_wc, _CTYPE_Q));
10884}
10985
11086__DARWIN_WCTYPE_TOP_inline int
111iswupper(wint_t _wc)
87iswrune(wint_t _wc)
11288{
113 return (__istype(_wc, _CTYPE_U));
89 return (__istype(_wc, 0xFFFFFFF0L));
11490}
11591
11692__DARWIN_WCTYPE_TOP_inline int
117iswxdigit(wint_t _wc)
93iswspecial(wint_t _wc)
11894{
119 return (__isctype(_wc, _CTYPE_X));
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));
95 return (__istype(_wc, _CTYPE_T));
13296}
97#endif /* !_ANSI_SOURCE */
13398
13499#else /* not using inlines */
135100
136101__BEGIN_DECLS
137int iswalnum(wint_t);
138int iswalpha(wint_t);
139int iswcntrl(wint_t);
140int iswctype(wint_t, wctype_t);
141int iswdigit(wint_t);
142int iswgraph(wint_t);
143int iswlower(wint_t);
144int iswprint(wint_t);
145int iswpunct(wint_t);
146int iswspace(wint_t);
147int iswupper(wint_t);
148int iswxdigit(wint_t);
149wint_t towlower(wint_t);
150wint_t towupper(wint_t);
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
151113__END_DECLS
152114
153115#endif /* using inlines */
154116
155117__BEGIN_DECLS
156wctype_t
157 wctype(const char *);
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 *);
158124__END_DECLS
159125
160#ifdef _USE_EXTENDED_LOCALES_
161#include <xlocale/__wctype.h>
162#endif /* _USE_EXTENDED_LOCALES_ */
163
164#endif /* __WCTYPE_H_ */
126#endif /* _WCTYPE_H_ */
lib/libc/include/any-macos-any/_xlocale.h+36-7
......@@ -21,17 +21,46 @@
2121 * @APPLE_LICENSE_HEADER_END@
2222 */
2323
24#ifndef __XLOCALE_H_
25#define __XLOCALE_H_
24#ifndef _XLOCALE_H_
25#define _XLOCALE_H_
2626
2727#include <sys/cdefs.h>
2828
29struct _xlocale; /* forward reference */
30typedef struct _xlocale * locale_t;
29#ifndef _USE_EXTENDED_LOCALES_
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
3255__BEGIN_DECLS
33int ___mb_cur_max(void);
34int ___mb_cur_max_l(locale_t);
56extern const locale_t _c_locale;
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);
3564__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 @@
66
77#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
922/*
1023 * This header file contains integer types. It's intended to also contain
1124 * flotaing point and other arithmetic types, as needed, later.
......@@ -58,7 +71,9 @@ typedef union {
5871
5972typedef __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__)
6277typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
6378#elif defined(__LP64__)
6479typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
......@@ -66,19 +81,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
6681typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
6782#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__)
7087typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
7188#else
7289typedef unsigned long __darwin_size_t; /* sizeof() */
7390#endif
7491
75#if (__GNUC__ > 2)
92#if USE_CLANG_TYPES
93typedef va_list __darwin_va_list; /* va_list */
94#elif (__GNUC__ > 2)
7695typedef __builtin_va_list __darwin_va_list; /* va_list */
7796#else
7897typedef void * __darwin_va_list; /* va_list */
7998#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__)
82103typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
83104#else
84105typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
......@@ -97,6 +118,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
97118typedef long __darwin_ssize_t; /* byte count or error */
98119typedef long __darwin_time_t; /* time() */
99120
121#undef USE_CLANG_TYPES
122
100123#endif /* defined (__arm__) || defined (__arm64__) */
101124
102125#endif /* _BSD_ARM__TYPES_H_ */
lib/libc/include/any-macos-any/arm/endian.h+1-17
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
33 */
44/*
55 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
......@@ -56,24 +56,8 @@
5656#define _QUAD_HIGHWORD 1
5757#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
6959#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
7761#include <sys/_endian.h>
7862
7963#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 @@
4444#include <sys/cdefs.h>
4545#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
4753#undef MB_LEN_MAX
4854#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
4955
......@@ -59,7 +65,7 @@
5965#include_next <limits.h>
6066#endif /* __has_include_next */
6167
62#else
68#elif !USE_CLANG_LIMITS
6369
6470#define CHAR_BIT 8 /* number of bits in a char */
6571
......@@ -102,7 +108,7 @@
102108#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
103109#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
107113#if !defined(_ANSI_SOURCE)
108114#ifdef __LP64__
......@@ -123,6 +129,8 @@
123129#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
124130#endif /* !_ANSI_SOURCE */
125131
132#undef USE_CLANG_LIMITS
133
126134#endif /* defined (__arm__) || defined (__arm64__) */
127135
128136#endif /* _ARM_LIMITS_H_ */
lib/libc/include/any-macos-any/arm/types.h+1
......@@ -91,6 +91,7 @@ typedef int32_t user_time_t;
9191typedef int64_t user_off_t;
9292#endif
9393
94
9495#define USER_ADDR_NULL ((user_addr_t) 0)
9596#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 @@
5050 */
5151
5252#undef assert
53#undef __assert
5453
5554#ifdef NDEBUG
5655#define assert(e) ((void)0)
5756#else
5857
58#include <_assert.h>
59
5960#ifdef __FILE_NAME__
6061#define __ASSERT_FILE_NAME __FILE_NAME__
6162#else /* __FILE_NAME__ */
......@@ -64,36 +65,11 @@
6465
6566#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
7468#define assert(e) \
7569 ((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
7971#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
9773#if __DARWIN_UNIX03
9874#define assert(e) \
9975 (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
......@@ -105,13 +81,4 @@ __END_DECLS
10581#endif /* __GNUC__ */
10682#endif /* NDEBUG */
10783
108#ifndef _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_ */
84#include <_static_assert.h>
lib/libc/include/any-macos-any/copyfile.h+5-1
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2004-2021 Apple, Inc. All rights reserved.
2 * Copyright (c) 2004-2023 Apple, Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -79,6 +79,10 @@ typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *__uns
7979#define COPYFILE_STATE_DST_BSIZE 12
8080#define COPYFILE_STATE_BSIZE 13
8181#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
8488#define COPYFILE_DISABLE_VAR "COPYFILE_DISABLE"
lib/libc/include/any-macos-any/ctype.h-5
......@@ -63,13 +63,8 @@
6363 * @(#)ctype.h 8.4 (Berkeley) 1/21/94
6464 */
6565
66#ifndef _CTYPE_H_
67#define _CTYPE_H_
68
6966#include <_ctype.h>
7067
7168#ifdef _USE_EXTENDED_LOCALES_
7269#include <xlocale/_ctype.h>
7370#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);
9999 * Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc.,
100100 * will have no effect when used with queues of this type.
101101 */
102API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
103102DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue);
104103
105104/*!
......@@ -169,7 +168,6 @@ DISPATCH_DECL_SERIAL_EXECUTOR_SWIFT(dispatch_queue_serial, DispatchSerialQueue);
169168 * dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will
170169 * have no effect when used on the main queue.
171170 */
172API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
173171DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial);
174172
175173/*!
......@@ -1738,6 +1736,69 @@ dispatch_assert_queue_not(dispatch_queue_t queue)
17381736#define dispatch_assert_queue_not_debug(q) dispatch_assert_queue_not(q)
17391737#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
17411802__END_DECLS
17421803
17431804DISPATCH_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,
145145 * The worker thread will be a member of the specified os_workgroup_t while executing
146146 * work items submitted to the workloop.
147147 *
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 *
148152 * @param workloop
149153 * The dispatch workloop to modify.
150154 *
lib/libc/include/any-macos-any/float.h+11
......@@ -22,6 +22,15 @@
2222#ifndef __FLOAT_H
2323#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
2534/* Undefine anything that we'll be redefining below. */
2635#undef FLT_EVAL_METHOD
2736#undef FLT_ROUNDS
......@@ -137,4 +146,6 @@
137146# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
138147#endif
139148
149#endif /* !__has_feature(modules) */
150
140151#endif /* __FLOAT_H */
lib/libc/include/any-macos-any/hfs/hfs_format.h+10-5
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -37,7 +37,7 @@
3737 *
3838 * This file describes the on-disk format for HFS and HFS Plus volumes.
3939 *
40 * Note: Starting 10.9, definition of struct HFSUniStr255 exists in hfs_unitstr.h
40 * Note: Starting with MacOS 10.9, definition of struct HFSUniStr255 exists in hfs_unistr.h
4141 *
4242 */
4343
......@@ -373,10 +373,12 @@ enum {
373373 kHFSFastDevCandidateMask = 0x0400,
374374
375375 kHFSAutoCandidateBit = 0x000b, /* this item was automatically marked as a fast-dev candidate by the kernel */
376 kHFSAutoCandidateMask = 0x0800
376 kHFSAutoCandidateMask = 0x0800,
377377
378 // There are only 4 flag bits remaining: 0x1000, 0x2000, 0x4000, 0x8000
378 kHFSCatExpandedTimesBit = 0x000c, /* this item has expanded timestamps */
379 kHFSCatExpandedTimesMask = 0x1000
379380
381 // There are only 3 flag bits remaining: 0x2000, 0x4000, 0x8000
380382};
381383
382384
......@@ -600,6 +602,7 @@ enum {
600602 */
601603 kHFSUnusedNodeFixBit = 31, /* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */
602604 kHFSContentProtectionBit = 30, /* Volume has per-file content protection */
605 kHFSExpandedTimesBit = 29, /* Volume has expanded / non-MacOS native timestamps */
603606
604607 /*** Keep these in sync with the bits above ! ****/
605608 kHFSVolumeHardwareLockMask = 0x00000080,
......@@ -614,6 +617,7 @@ enum {
614617
615618 /* Bits 16-31 are allocated from high to low */
616619
620 kHFSExpandedTimesMask = 0x20000000,
617621 kHFSContentProtectionMask = 0x40000000,
618622 kHFSUnusedNodeFixMask = 0x80000000,
619623
......@@ -621,7 +625,8 @@ enum {
621625};
622626
623627enum {
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 */
625630};
626631
627632/* 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 @@
3030
3131#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
3346/*
3447 * This header file contains integer types. It's intended to also contain
3548 * flotaing point and other arithmetic types, as needed, later.
......@@ -82,7 +95,9 @@ typedef union {
8295
8396typedef __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__)
86101typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
87102#elif defined(__LP64__)
88103typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
......@@ -90,19 +105,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
90105typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
91106#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__)
94111typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
95112#else
96113typedef unsigned long __darwin_size_t; /* sizeof() */
97114#endif
98115
99#if (__GNUC__ > 2)
116#if USE_CLANG_TYPES
117typedef va_list __darwin_va_list; /* va_list */
118#elif (__GNUC__ > 2)
100119typedef __builtin_va_list __darwin_va_list; /* va_list */
101120#else
102121typedef void * __darwin_va_list; /* va_list */
103122#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__)
106127typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
107128#else
108129typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
......@@ -121,6 +142,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
121142typedef long __darwin_ssize_t; /* byte count or error */
122143typedef long __darwin_time_t; /* time() */
123144
145#undef USE_CLANG_TYPES
146
124147#endif /* defined (__i386__) || defined (__x86_64__) */
125148
126149#endif /* _BSD_I386__TYPES_H_ */
lib/libc/include/any-macos-any/i386/endian.h+1-17
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 2000-2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -80,24 +80,8 @@
8080#define _QUAD_HIGHWORD 1
8181#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
9383#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
10185#include <sys/_endian.h>
10286
10387#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 @@
4141#include <sys/cdefs.h>
4242#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
4450#undef MB_LEN_MAX
4551#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
4652
......@@ -56,7 +62,7 @@
5662#include_next <limits.h>
5763#endif /* __has_include_next */
5864
59#else
65#elif !USE_CLANG_LIMITS
6066
6167#define CHAR_BIT 8 /* number of bits in a char */
6268
......@@ -99,7 +105,7 @@
99105#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
100106#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
104110#if !defined(_ANSI_SOURCE)
105111#ifdef __LP64__
......@@ -120,6 +126,8 @@
120126#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
121127#endif /* !_ANSI_SOURCE */
122128
129#undef USE_CLANG_LIMITS
130
123131#endif /* defined (__i386__) || defined (__x86_64__) */
124132
125133#endif /* _I386_LIMITS_H_ */
lib/libc/include/any-macos-any/i386/types.h+2
......@@ -104,6 +104,8 @@ typedef int64_t user_long_t;
104104typedef u_int64_t user_ulong_t;
105105typedef int64_t user_time_t;
106106typedef int64_t user_off_t;
107
108
107109#define USER_ADDR_NULL ((user_addr_t) 0)
108110#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 @@
11/*
2 * Copyright (c) 2000-2004, 2013 Apple Inc. All rights reserved.
2 * Copyright (c) 2000-2004, 2013, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -28,270 +28,8 @@
2828 * and their ilk.
2929 */
3030
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
31#include <_inttypes.h>
28032
28133#ifdef _USE_EXTENDED_LOCALES_
28234#include <xlocale/_inttypes.h>
28335#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 @@
2626 * $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $
2727 */
2828
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
29#include <_langinfo.h>
11530
11631#ifdef _USE_EXTENDED_LOCALES_
11732#include <xlocale/_langinfo.h>
11833#endif /* _USE_EXTENDED_LOCALES_ */
119
120#endif /* !_LANGINFO_H_ */
lib/libc/include/any-macos-any/libkern/OSAtomic.h+4
......@@ -40,6 +40,10 @@
4040
4141#include <sys/cdefs.h>
4242
43#if __has_include(<libkern/OSAtomicPrivate.h>)
44#include <libkern/OSAtomicPrivate.h>
45#endif
46
4347#include "OSAtomicDeprecated.h"
4448#include "OSSpinLockDeprecated.h"
4549#include "OSAtomicQueue.h"
lib/libc/include/any-macos-any/libkern/OSAtomicDeprecated.h+1
......@@ -36,6 +36,7 @@
3636 */
3737
3838#include <Availability.h>
39#include <TargetConditionals.h>
3940
4041#if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED)
4142
lib/libc/include/any-macos-any/libkern/OSThermalNotification.h+1
......@@ -26,6 +26,7 @@
2626
2727#include <sys/cdefs.h>
2828#include <Availability.h>
29#include <TargetConditionals.h>
2930
3031/*
3132** OSThermalNotification.h
lib/libc/include/any-macos-any/libkern/_OSByteOrder.h+18-26
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 2006-2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -29,14 +29,6 @@
2929#ifndef _OS__OSBYTEORDER_H
3030#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
4032#include <sys/_types.h>
4133
4234/* Macros for swapping constant values in the preprocessing stage. */
......@@ -62,22 +54,12 @@
6254
6355#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
7557#if defined(__i386__) || defined(__x86_64__)
7658#include <libkern/i386/_OSByteOrder.h>
7759#endif
7860
7961#if defined (__arm__) || defined(__arm64__)
80#include <libkern/arm/OSByteOrder.h>
62#include <libkern/arm/_OSByteOrder.h>
8163#endif
8264
8365
......@@ -94,28 +76,38 @@
9476
9577#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
9789__DARWIN_OS_INLINE
98uint16_t
90__uint16_t
9991_OSSwapInt16(
100 uint16_t data
92 __uint16_t data
10193 )
10294{
10395 return __DARWIN_OSSwapConstInt16(data);
10496}
10597
10698__DARWIN_OS_INLINE
107uint32_t
99__uint32_t
108100_OSSwapInt32(
109 uint32_t data
101 __uint32_t data
110102 )
111103{
112104 return __DARWIN_OSSwapConstInt32(data);
113105}
114106
115107__DARWIN_OS_INLINE
116uint64_t
108__uint64_t
117109_OSSwapInt64(
118 uint64_t data
110 __uint64_t data
119111 )
120112{
121113 return __DARWIN_OSSwapConstInt64(data);
lib/libc/include/any-macos-any/libkern/arm/OSByteOrder.h+43-64
......@@ -1,64 +1,41 @@
11/*
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@
327 */
428
529#ifndef _OS_OSBYTEORDERARM_H
630#define _OS_OSBYTEORDERARM_H
731
32#if defined (__arm__) || defined(__arm64__)
33
834#include <stdint.h>
35#include <libkern/arm/_OSByteOrder.h>
36#include <sys/_types/_os_inline.h>
937#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
6239/* Functions for byte reversed loads. */
6340
6441struct _OSUnalignedU16 {
......@@ -74,7 +51,7 @@ struct _OSUnalignedU64 {
7451} __attribute__((__packed__));
7552
7653#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
77__DARWIN_OS_INLINE
54OS_INLINE
7855uint16_t
7956_OSReadSwapInt16(
8057 const volatile void * _base,
......@@ -84,7 +61,7 @@ _OSReadSwapInt16(
8461 return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
8562}
8663#else
87__DARWIN_OS_INLINE
64OS_INLINE
8865uint16_t
8966OSReadSwapInt16(
9067 const volatile void * _base,
......@@ -96,7 +73,7 @@ OSReadSwapInt16(
9673#endif
9774
9875#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
99__DARWIN_OS_INLINE
76OS_INLINE
10077uint32_t
10178_OSReadSwapInt32(
10279 const volatile void * _base,
......@@ -106,7 +83,7 @@ _OSReadSwapInt32(
10683 return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
10784}
10885#else
109__DARWIN_OS_INLINE
86OS_INLINE
11087uint32_t
11188OSReadSwapInt32(
11289 const volatile void * _base,
......@@ -118,7 +95,7 @@ OSReadSwapInt32(
11895#endif
11996
12097#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
121__DARWIN_OS_INLINE
98OS_INLINE
12299uint64_t
123100_OSReadSwapInt64(
124101 const volatile void * _base,
......@@ -128,7 +105,7 @@ _OSReadSwapInt64(
128105 return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
129106}
130107#else
131__DARWIN_OS_INLINE
108OS_INLINE
132109uint64_t
133110OSReadSwapInt64(
134111 const volatile void * _base,
......@@ -142,7 +119,7 @@ OSReadSwapInt64(
142119/* Functions for byte reversed stores. */
143120
144121#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
145__DARWIN_OS_INLINE
122OS_INLINE
146123void
147124_OSWriteSwapInt16(
148125 volatile void * _base,
......@@ -153,7 +130,7 @@ _OSWriteSwapInt16(
153130 ((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
154131}
155132#else
156__DARWIN_OS_INLINE
133OS_INLINE
157134void
158135OSWriteSwapInt16(
159136 volatile void * _base,
......@@ -166,7 +143,7 @@ OSWriteSwapInt16(
166143#endif
167144
168145#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
169__DARWIN_OS_INLINE
146OS_INLINE
170147void
171148_OSWriteSwapInt32(
172149 volatile void * _base,
......@@ -177,7 +154,7 @@ _OSWriteSwapInt32(
177154 ((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
178155}
179156#else
180__DARWIN_OS_INLINE
157OS_INLINE
181158void
182159OSWriteSwapInt32(
183160 volatile void * _base,
......@@ -190,7 +167,7 @@ OSWriteSwapInt32(
190167#endif
191168
192169#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
193__DARWIN_OS_INLINE
170OS_INLINE
194171void
195172_OSWriteSwapInt64(
196173 volatile void * _base,
......@@ -201,7 +178,7 @@ _OSWriteSwapInt64(
201178 ((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
202179}
203180#else
204__DARWIN_OS_INLINE
181OS_INLINE
205182void
206183OSWriteSwapInt64(
207184 volatile void * _base,
......@@ -213,4 +190,6 @@ OSWriteSwapInt64(
213190}
214191#endif
215192
193#endif /* defined (__arm__) || defined(__arm64__) */
194
216195#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 @@
11/*
2 * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 1999-2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -29,6 +29,8 @@
2929#ifndef _OS_OSBYTEORDERI386_H
3030#define _OS_OSBYTEORDERI386_H
3131
32#if defined(__i386__) || defined(__x86_64__)
33
3234#include <stdint.h>
3335#include <libkern/i386/_OSByteOrder.h>
3436#include <sys/_types/_os_inline.h>
......@@ -109,4 +111,6 @@ OSWriteSwapInt64(
109111 *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
110112}
111113
114#endif /* defined(__i386__) || defined(__x86_64__) */
115
112116#endif /* ! _OS_OSBYTEORDERI386_H */
lib/libc/include/any-macos-any/libkern/i386/_OSByteOrder.h+7-1
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2006-2012 Apple Inc. All rights reserved.
2 * Copyright (c) 2006-2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -29,6 +29,10 @@
2929#ifndef _OS__OSBYTEORDERI386_H
3030#define _OS__OSBYTEORDERI386_H
3131
32#if defined(__i386__) || defined(__x86_64__)
33
34#include <sys/_types.h>
35
3236#if !defined(__DARWIN_OS_INLINE)
3337# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
3438# define __DARWIN_OS_INLINE static inline
......@@ -101,4 +105,6 @@ _OSSwapInt64(
101105#error Unknown architecture
102106#endif
103107
108#endif /* defined(__i386__) || defined(__x86_64__) */
109
104110#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);
129129
130130int proc_terminate(pid_t pid, int *sig);
131131int 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
133137/*
134138 * 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));
164168
165169int 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
171171__END_DECLS
172172
173173#endif /*_LIBPROC_H_ */
lib/libc/include/any-macos-any/mach-o/compact_unwind_encoding.h+40-40
......@@ -108,7 +108,7 @@ enum {
108108// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
109109// Each entry contains which register to restore.
110110// 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
112112// constant stack size. To return, a constant (encoded in the compact
113113// unwind encoding) is added to the ESP. Then the return is done by
114114// popping the stack into the pc.
......@@ -119,16 +119,16 @@ enum {
119119// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION contains which registers were
120120// saved and their order.
121121// 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
123123// 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
125// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
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
126126// encoding contains the offset to the nnnnnnnn value in the function in
127// UNWIND_X86_FRAMELESS_STACK_SIZE.
127// UNWIND_X86_FRAMELESS_STACK_SIZE.
128128// UNWIND_X86_MODE_DWARF:
129129// No compact unwind encoding is available. Instead the low 24-bits of the
130130// 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
132132// linker in final linked images which have only DWARF unwind info for a
133133// function.
134134//
......@@ -233,36 +233,36 @@ enum {
233233// For x86_64 there are four modes for the compact unwind encoding:
234234// UNWIND_X86_64_MODE_RBP_FRAME:
235235// 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
237// EPB value, then RBP is restored by popping off the stack, and the return
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
238238// is done by popping the stack once more into the pc.
239239// 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
241241// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
242242// 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.
244244// UNWIND_X86_64_MODE_STACK_IMMD:
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
247// unwind encoding) is added to the RSP. Then the return is done by
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
247// unwind encoding) is added to the RSP. Then the return is done by
248248// popping the stack into the pc.
249249// All non-volatile registers that need to be restored must have been saved
250250// on the stack immediately after the return address. The stack_size/8 is
251251// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
252252// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
253253// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION contains which registers were
254// saved and their order.
254// saved and their order.
255255// 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
257257// 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
259// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
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
260260// 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.
262262// UNWIND_X86_64_MODE_DWARF:
263263// No compact unwind encoding is available. Instead the low 24-bits of the
264264// 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
266266// linker in final linked images which have only DWARF unwind info for a
267267// function.
268268//
......@@ -307,20 +307,20 @@ enum {
307307// This is a standard arm64 prolog where FP/LR are immediately pushed on the
308308// stack, then SP is copied to FP. If there are any non-volatile registers
309309// 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
311311// and four D pairs can be saved, but the memory layout must be in register
312// number order.
312// number order.
313313// 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
315315// remains in LR throughout the function. If any non-volatile registers
316316// are saved, they must be pushed onto the stack before any stack space is
317317// 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
319319// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
320320// UNWIND_ARM64_MODE_DWARF:
321321// No compact unwind encoding is available. Instead the low 24-bits of the
322322// 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
324324// linker in final linked images which have only DWARF unwind info for a
325325// function.
326326//
......@@ -393,19 +393,19 @@ enum {
393393
394394//
395395// 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
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.
399// This section is a table, initially with one row per function (that needs
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.
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
400400// unwind info). The table columns and some conceptual entries are:
401401//
402402// range-start pointer to start of function/range
403// range-length
404// compact-unwind-encoding 32-bit encoding
403// range-length
404// compact-unwind-encoding 32-bit encoding
405405// personality-function or zero if no personality function
406406// lsda or zero if no LSDA data
407407//
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.
409409//
410410// In x86_64 assembly, these entry would look like:
411411//
......@@ -428,23 +428,23 @@ enum {
428428// .quad except_tab1
429429//
430430//
431// Notes: There is no need for any labels in the the __compact_unwind section.
432// The use of the .set directive is to force the evaluation of the
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
433433// range-length at assembly time, instead of generating relocations.
434434//
435// To support future compiler optimizations where which non-volatile registers
435// To support future compiler optimizations where which non-volatile registers
436436// are saved changes within a function (e.g. delay saving non-volatiles until
437437// 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
439// different compact unwind encodings that correspond to the non-volatiles
438// function, each with a different (non-overlapping) range and each with
439// different compact unwind encodings that correspond to the non-volatiles
440440// saved at that range of the function.
441441//
442442// 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.
444444// The runtime will use which ever is available.
445445//
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.
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.
448448
449449
450450
......@@ -458,7 +458,7 @@ enum {
458458//
459459// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
460460// 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.
462462//
463463
464464#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 {
234234 the platforms macOS, macCatalyst,
235235 iOSSimulator, tvOSSimulator and
236236 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
238243#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit
239244 is set, the dylib is part of the dyld
240245 shared cache, rather than loose in
......@@ -670,7 +675,7 @@ struct fvmlib_command {
670675};
671676
672677/*
673 * Dynamicly linked shared libraries are identified by two things. The
678 * Dynamically linked shared libraries are identified by two things. The
674679 * pathname (the name of the library as found for execution), and the
675680 * compatibility version number. The pathname must match and the compatibility
676681 * number in the user of the library must be greater than or equal to the
......@@ -699,6 +704,30 @@ struct dylib_command {
699704 struct dylib dylib; /* the library identification */
700705};
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
702731/*
703732 * A dynamically linked shared library may be a subframework of an umbrella
704733 * framework. If so it will be linked with "-umbrella umbrella_name" where
......@@ -1287,6 +1316,8 @@ struct build_tool_version {
12871316#define PLATFORM_TVOSSIMULATOR 8
12881317#define PLATFORM_WATCHOSSIMULATOR 9
12891318#define PLATFORM_DRIVERKIT 10
1319#define PLATFORM_VISIONOS 11
1320#define PLATFORM_VISIONOSSIMULATOR 12
12901321
12911322#ifndef __OPEN_SOURCE__
12921323
......@@ -1299,6 +1330,10 @@ struct build_tool_version {
12991330
13001331#endif /* __OPEN_SOURCE__ */
13011332
1333#ifndef __OPEN_SOURCE__
1334
1335#endif /* __OPEN_SOURCE__ */
1336
13021337/* Known values for the tool field above. */
13031338#define TOOL_CLANG 1
13041339#define TOOL_SWIFT 2
lib/libc/include/any-macos-any/mach-o/nlist.h+1-1
......@@ -202,7 +202,7 @@ struct nlist_64 {
202202/*
203203 * To simplify stripping of objects that use are used with the dynamic link
204204 * 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).
206206 * With this marking strip knows not to strip these symbols.
207207 */
208208#define REFERENCED_DYNAMICALLY 0x0010
lib/libc/include/any-macos-any/mach/arm/_structs.h+42
......@@ -62,6 +62,12 @@ _STRUCT_ARM_EXCEPTION_STATE64
6262 __uint32_t __esr; /* Exception syndrome */
6363 __uint32_t __exception; /* number of arm exception taken */
6464};
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};
6571#else /* !__DARWIN_UNIX03 */
6672#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
6773_STRUCT_ARM_EXCEPTION_STATE64
......@@ -70,6 +76,12 @@ _STRUCT_ARM_EXCEPTION_STATE64
7076 __uint32_t esr; /* Exception syndrome */
7177 __uint32_t exception; /* number of arm exception taken */
7278};
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};
7385#endif /* __DARWIN_UNIX03 */
7486
7587#if __DARWIN_UNIX03
......@@ -241,6 +253,12 @@ _STRUCT_ARM_THREAD_STATE64
241253 ptrauth_key_function_pointer, 0)) : __f); \
242254 __tsp->__opaque_flags &= \
243255 ~__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; })
244262/* Return lr field of arm_thread_state64_t as a data pointer value */
245263#define __darwin_arm_thread_state64_get_lr(ts) \
246264 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
......@@ -295,6 +313,12 @@ _STRUCT_ARM_THREAD_STATE64
295313 ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
296314 ptrauth_key_function_pointer, 0)) : __f); __tsp->__opaque_flags &= \
297315 ~__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; })
298322/* Return sp field of arm_thread_state64_t as a data pointer value */
299323#define __darwin_arm_thread_state64_get_sp(ts) \
300324 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
......@@ -368,6 +392,9 @@ _STRUCT_ARM_THREAD_STATE64
368392/* Set pc field of arm_thread_state64_t to a function pointer */
369393#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
370394 ((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))
371398/* Return lr field of arm_thread_state64_t as a data pointer value */
372399#define __darwin_arm_thread_state64_get_lr(ts) \
373400 ((uintptr_t)((ts).__opaque_lr))
......@@ -377,6 +404,9 @@ _STRUCT_ARM_THREAD_STATE64
377404/* Set lr field of arm_thread_state64_t to a function pointer */
378405#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
379406 ((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))
380410/* Return sp field of arm_thread_state64_t as a data pointer value */
381411#define __darwin_arm_thread_state64_get_sp(ts) \
382412 ((uintptr_t)((ts).__opaque_sp))
......@@ -405,6 +435,9 @@ _STRUCT_ARM_THREAD_STATE64
405435/* Set pc field of arm_thread_state64_t to a function pointer */
406436#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
407437 ((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))
408441/* Return lr field of arm_thread_state64_t as a data pointer value */
409442#define __darwin_arm_thread_state64_get_lr(ts) \
410443 ((ts).__lr)
......@@ -414,6 +447,9 @@ _STRUCT_ARM_THREAD_STATE64
414447/* Set lr field of arm_thread_state64_t to a function pointer */
415448#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
416449 ((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))
417453/* Return sp field of arm_thread_state64_t as a data pointer value */
418454#define __darwin_arm_thread_state64_get_sp(ts) \
419455 ((ts).__sp)
......@@ -441,6 +477,9 @@ _STRUCT_ARM_THREAD_STATE64
441477/* Set pc field of arm_thread_state64_t to a function pointer */
442478#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
443479 ((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))
444483/* Return lr field of arm_thread_state64_t as a data pointer value */
445484#define __darwin_arm_thread_state64_get_lr(ts) \
446485 ((ts).lr)
......@@ -450,6 +489,9 @@ _STRUCT_ARM_THREAD_STATE64
450489/* Set lr field of arm_thread_state64_t to a function pointer */
451490#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
452491 ((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))
453495/* Return sp field of arm_thread_state64_t as a data pointer value */
454496#define __darwin_arm_thread_state64_get_sp(ts) \
455497 ((ts).sp)
lib/libc/include/any-macos-any/mach/arm/exception.h+2
......@@ -47,6 +47,7 @@
4747 */
4848
4949#define EXC_ARM_UNDEFINED 1 /* Undefined */
50#define EXC_ARM_SME_DISALLOWED 2 /* Current thread state prohibits use of SME resources */
5051
5152/*
5253 * EXC_ARITHMETIC
......@@ -71,6 +72,7 @@
7172#define EXC_ARM_SWP 0x104 /* SWP instruction */
7273#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
7374
75
7476/*
7577 * EXC_BREAKPOINT
7678 */
lib/libc/include/any-macos-any/mach/arm/thread_status.h+14
......@@ -60,6 +60,7 @@
6060#define ARM_EXCEPTION_STATE64 7
6161// ARM_THREAD_STATE_LAST 8 /* legacy */
6262#define ARM_THREAD_STATE32 9
63#define ARM_EXCEPTION_STATE64_V2 10
6364
6465
6566/* API */
......@@ -73,6 +74,8 @@
7374#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
7679#ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID
7780#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0
7881#endif
......@@ -91,6 +94,7 @@
9194 (x == ARM_THREAD_STATE32) || \
9295 (x == ARM_THREAD_STATE64) || \
9396 (x == ARM_EXCEPTION_STATE64) || \
97 (x == ARM_EXCEPTION_STATE64_V2) || \
9498 (x == ARM_NEON_STATE) || \
9599 (x == ARM_NEON_STATE64) || \
96100 (x == ARM_DEBUG_STATE32) || \
......@@ -123,6 +127,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
123127/* Set pc field of arm_thread_state64_t to a function pointer */
124128#define arm_thread_state64_set_pc_fptr(ts, fptr) \
125129 __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)
126133/* Return lr field of arm_thread_state64_t as a data pointer value */
127134#define arm_thread_state64_get_lr(ts) \
128135 __darwin_arm_thread_state64_get_lr(ts)
......@@ -134,6 +141,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
134141/* Set lr field of arm_thread_state64_t to a function pointer */
135142#define arm_thread_state64_set_lr_fptr(ts, fptr) \
136143 __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)
137147/* Return sp field of arm_thread_state64_t as a data pointer value */
138148#define arm_thread_state64_get_sp(ts) \
139149 __darwin_arm_thread_state64_get_sp(ts)
......@@ -182,6 +192,7 @@ typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
182192typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
183193typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
184194typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;
195typedef _STRUCT_ARM_EXCEPTION_STATE64_V2 arm_exception_state64_v2_t;
185196
186197typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;
187198typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;
......@@ -209,6 +220,9 @@ typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
209220#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
210221 (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
212226#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
213227 (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 @@
8787#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL
8888#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
9095#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)
9196#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 @@
5050 */
5151typedef int alarm_type_t; /* alarm time type */
5252typedef int sleep_type_t; /* sleep time type */
53typedef int clock_id_t; /* clock identification type */
53typedef int clock_id_t; /* clock identification type */
5454typedef int clock_flavor_t; /* clock flavor type */
5555typedef int *clock_attr_t; /* clock attribute type */
5656typedef int clock_res_t; /* clock resolution type */
......@@ -60,7 +60,7 @@ typedef int clock_res_t; /* clock resolution type */
6060 */
6161struct mach_timespec {
6262 unsigned int tv_sec; /* seconds */
63 clock_res_t tv_nsec; /* nanoseconds */
63 clock_res_t tv_nsec; /* nanoseconds */
6464};
6565typedef struct mach_timespec mach_timespec_t;
6666
......@@ -86,39 +86,39 @@ typedef struct mach_timespec mach_timespec_t;
8686#define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */
8787#define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */
8888
89#define BAD_MACH_TIMESPEC(t) \
89#define BAD_MACH_TIMESPEC(t) \
9090 ((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)
9191
9292/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */
93#define CMP_MACH_TIMESPEC(t1, t2) \
94 ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
95 ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
93#define CMP_MACH_TIMESPEC(t1, t2) \
94 ((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
95 ((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
9696 (t1)->tv_nsec - (t2)->tv_nsec))
9797
9898/* t1 += t2 */
99#define ADD_MACH_TIMESPEC(t1, t2) \
100 do { \
101 if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
102 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \
103 (t1)->tv_sec += 1; \
104 } \
105 (t1)->tv_sec += (t2)->tv_sec; \
99#define ADD_MACH_TIMESPEC(t1, t2) \
100 do { \
101 if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
102 (t1)->tv_nsec -= (long) NSEC_PER_SEC; \
103 (t1)->tv_sec += 1; \
104 } \
105 (t1)->tv_sec += (t2)->tv_sec; \
106106 } while (0)
107107
108108/* t1 -= t2 */
109#define SUB_MACH_TIMESPEC(t1, t2) \
110 do { \
111 if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
112 (t1)->tv_nsec += (long) NSEC_PER_SEC; \
113 (t1)->tv_sec -= 1; \
114 } \
115 (t1)->tv_sec -= (t2)->tv_sec; \
109#define SUB_MACH_TIMESPEC(t1, t2) \
110 do { \
111 if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
112 (t1)->tv_nsec += (long) NSEC_PER_SEC; \
113 (t1)->tv_sec -= 1; \
114 } \
115 (t1)->tv_sec -= (t2)->tv_sec; \
116116 } while (0)
117117
118118/*
119119 * Alarm parameter defines.
120120 */
121#define ALRMTYPE 0xff /* type (8-bit field) */
121#define ALRMTYPE 0xff /* type (8-bit field) */
122122#define TIME_ABSOLUTE 0x00 /* absolute time */
123123#define TIME_RELATIVE 0x01 /* relative time */
124124
lib/libc/include/any-macos-any/mach/error.h+3
......@@ -99,6 +99,9 @@
9999#define err_ipc err_system(0x3) /* old ipc errors */
100100#define err_mach_ipc err_system(0x4) /* mach-ipc errors */
101101#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 */
102105#define err_local err_system(0x3e) /* user defined errors */
103106#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 @@
126126 * and thread identity.
127127 */
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
129134#define MACH_EXCEPTION_BACKTRACE_PREFERRED 0x20000000
130135/* 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;
184184#define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */
185185
186186
187
187188struct host_load_info {
188189 integer_t avenrun[3]; /* scaled by LOAD_SCALE */
189190 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 @@
110110#define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT)
111111#define HOST_IOCOMPRESSIONSTATS_PORT (25 + HOST_MAX_SPECIAL_KERNEL_PORT)
112112#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_PORT
116#define HOST_MAX_SPECIAL_PORT HOST_DOUBLEAGENTD_PORT
115117/* MAX = last since rdar://59872249 */
116118
117119/* obsolete name */
......@@ -288,6 +290,18 @@
288290#define host_set_memory_error_port(host, port) \
289291 (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
291305/* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences.
292306 * All lookups go through send_resource_violation()
293307 */
lib/libc/include/any-macos-any/mach/i386/thread_status.h+1
......@@ -125,6 +125,7 @@
125125#define x86_THREAD_FULL_STATE64 23
126126#define x86_INSTRUCTION_STATE 24
127127#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
129130/*
130131 * 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;
118118#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
119119#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
120120/* skip ((cpu_type_t) 19) */
121/* skip ((cpu_type_t) 20 */
122/* skip ((cpu_type_t) 21 */
123/* skip ((cpu_type_t) 22 */
124/* skip ((cpu_type_t) 23 */
121/* skip ((cpu_type_t) 20) */
122/* skip ((cpu_type_t) 21) */
123/* skip ((cpu_type_t) 22) */
124/* skip ((cpu_type_t) 23) */
125/* skip ((cpu_type_t) 24) */
125126
126127/*
127128 * Machine subtypes (these are defined here, instead of in a machine
......@@ -349,6 +350,7 @@ typedef integer_t cpu_threadtype_t;
349350#define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0)
350351#define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1)
351352
353
352354#endif /* !__ASSEMBLER__ */
353355
354356/*
......@@ -396,7 +398,13 @@ typedef integer_t cpu_threadtype_t;
396398#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
397399#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d
398400#define CPUFAMILY_ARM_EVEREST_SAWTOOTH 0x8765edea
401#define CPUFAMILY_ARM_IBIZA 0xfa33415e
402#define CPUFAMILY_ARM_PALMA 0x72015832
399403#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
401409/* Described in rdar://64125549 */
402410#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;
279279 & 0xFF000000) | ((flags) & 0xFFFFFF));
280280
281281/* leave room for vm_prot bits (0xFF ?) */
282#define MAP_MEM_PROT_MASK 0xFF
282283#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */
283284#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */
284285#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 @@
7171#ifndef _MACH_MESSAGE_H_
7272#define _MACH_MESSAGE_H_
7373
74#include <stddef.h>
7475#include <stdint.h>
7576#include <machine/limits.h>
77#include <machine/types.h> /* user_addr_t */
7678#include <mach/port.h>
7779#include <mach/boolean.h>
7880#include <mach/kern_return.h>
......@@ -81,6 +83,9 @@
8183#include <sys/cdefs.h>
8284#include <sys/appleapiopts.h>
8385#include <Availability.h>
86#if __has_feature(ptrauth_calls)
87#include <ptrauth.h>
88#endif
8489
8590/*
8691 * The timeout mechanism uses mach_msg_timeout_t values,
......@@ -281,6 +286,8 @@ typedef unsigned int mach_msg_descriptor_type_t;
281286
282287#define MACH_MSG_DESCRIPTOR_MAX MACH_MSG_GUARDED_PORT_DESCRIPTOR
283288
289#define __ipc_desc_sign(d)
290
284291#pragma pack(push, 4)
285292
286293typedef struct {
......@@ -292,7 +299,6 @@ typedef struct {
292299
293300typedef struct {
294301 mach_port_t name;
295// Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes
296302 mach_msg_size_t pad1;
297303 unsigned int pad2 : 16;
298304 mach_msg_type_name_t disposition : 8;
......@@ -319,7 +325,7 @@ typedef struct {
319325} mach_msg_ool_descriptor64_t;
320326
321327typedef struct {
322 void* address;
328 void *address;
323329#if !defined(__LP64__)
324330 mach_msg_size_t size;
325331#endif
......@@ -351,7 +357,7 @@ typedef struct {
351357} mach_msg_ool_ports_descriptor64_t;
352358
353359typedef struct {
354 void* address;
360 void *address;
355361#if !defined(__LP64__)
356362 mach_msg_size_t count;
357363#endif
......@@ -398,7 +404,7 @@ typedef struct {
398404 * appropriate in LP64 mode because not all descriptors
399405 * are of the same size in that environment.
400406 */
401typedef union{
407typedef union {
402408 mach_msg_port_descriptor_t port;
403409 mach_msg_ool_descriptor_t out_of_line;
404410 mach_msg_ool_ports_descriptor_t ool_ports;
......@@ -667,6 +673,10 @@ typedef natural_t mach_msg_type_number_t;
667673 (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
668674 ((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
670680#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
671681 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
672682 ((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;
195195#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) /* obsolete right */
196196#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
199202typedef natural_t mach_port_type_t;
200203typedef mach_port_type_t *mach_port_type_array_t;
201204
202#define MACH_PORT_TYPE(right) \
203 ((mach_port_type_t)(((mach_port_type_t) 1) \
204 << ((right) + ((mach_port_right_t) 16))))
205#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
206#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
207#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
208#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
209#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
210#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
211#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */
212
205#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
206#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
207#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
208#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
209#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
210#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
211#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */
212/* Dummy type bits that mach_port_type/mach_port_names can return. */
213#define MACH_PORT_TYPE_DNREQUEST 0x80000000
214#define MACH_PORT_TYPE_SPREQUEST 0x40000000
215#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
213216
214217/* Convenient combinations. */
215218
216219#define MACH_PORT_TYPE_SEND_RECEIVE \
217 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
220 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
218221#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)
220223#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)
222225#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)
224227#define MACH_PORT_TYPE_ALL_RIGHTS \
225 (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
228 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
232229
233230/* User-references for capabilities. */
234231
......@@ -368,7 +365,7 @@ typedef struct mach_service_port_info * mach_service_port_info_t;
368365#define MPO_REPLY_PORT 0x1000 /* Designate port as a reply port. */
369366#define MPO_ENFORCE_REPLY_PORT_SEMANTICS 0x2000 /* When talking to this port, local port of mach msg needs to follow reply port semantics.*/
370367#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
374371/*
......@@ -404,6 +401,7 @@ enum mach_port_guard_exception_codes {
404401 kGUARD_EXC_INVALID_OPTIONS = 3,
405402 kGUARD_EXC_SET_CONTEXT = 4,
406403 kGUARD_EXC_THREAD_SET_STATE = 5,
404 kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE= 6,
407405 kGUARD_EXC_UNGUARDED = 1u << 3,
408406 kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
409407 kGUARD_EXC_IMMOVABLE = 1u << 5,
......@@ -427,7 +425,6 @@ enum mach_port_guard_exception_codes {
427425 kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
428426 kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
429427 kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 1u << 23,
430 kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE = 1u << 24,
431428};
432429
433430#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;
5252#endif /* AUTOTEST */
5353
5454#ifndef task_MSG_COUNT
55#define task_MSG_COUNT 65
55#define task_MSG_COUNT 66
5656#endif /* task_MSG_COUNT */
5757
5858#include <Availability.h>
......@@ -933,6 +933,23 @@ kern_return_t task_map_kcdata_object_64
933933 mach_vm_size_t *kcd_size
934934);
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
936953__END_DECLS
937954
938955/********************** Caution **************************/
......@@ -1035,7 +1052,7 @@ __END_DECLS
10351052 NDR_record_t NDR;
10361053 task_flavor_t flavor;
10371054 mach_msg_type_number_t task_info_inCnt;
1038 integer_t task_info_in[90];
1055 integer_t task_info_in[94];
10391056 } __Request__task_set_info_t __attribute__((unused));
10401057#ifdef __MigPackStructs
10411058#pragma pack(pop)
......@@ -1773,6 +1790,25 @@ __END_DECLS
17731790#ifdef __MigPackStructs
17741791#pragma pack(pop)
17751792#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
17761812#endif /* !__Request__task_subsystem__defined */
17771813
17781814/* union of all requests */
......@@ -1843,6 +1879,7 @@ union __RequestUnion__task_subsystem {
18431879 __Request__task_set_corpse_forking_behavior_t Request_task_set_corpse_forking_behavior;
18441880 __Request__task_test_async_upcall_propagation_t Request_task_test_async_upcall_propagation;
18451881 __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;
18461883};
18471884#endif /* !__RequestUnion__task_subsystem__defined */
18481885/* typedefs for all replies */
......@@ -1928,7 +1965,7 @@ union __RequestUnion__task_subsystem {
19281965 NDR_record_t NDR;
19291966 kern_return_t RetCode;
19301967 mach_msg_type_number_t task_info_outCnt;
1931 integer_t task_info_out[90];
1968 integer_t task_info_out[94];
19321969 } __Reply__task_info_t __attribute__((unused));
19331970#ifdef __MigPackStructs
19341971#pragma pack(pop)
......@@ -2692,6 +2729,18 @@ union __RequestUnion__task_subsystem {
26922729#ifdef __MigPackStructs
26932730#pragma pack(pop)
26942731#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
26952744#endif /* !__Reply__task_subsystem__defined */
26962745
26972746/* union of all replies */
......@@ -2762,6 +2811,7 @@ union __ReplyUnion__task_subsystem {
27622811 __Reply__task_set_corpse_forking_behavior_t Reply_task_set_corpse_forking_behavior;
27632812 __Reply__task_test_async_upcall_propagation_t Reply_task_test_async_upcall_propagation;
27642813 __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;
27652815};
27662816#endif /* !__RequestUnion__task_subsystem__defined */
27672817
......@@ -2829,7 +2879,8 @@ union __ReplyUnion__task_subsystem {
28292879 { "task_test_sync_upcall", 3461 },\
28302880 { "task_set_corpse_forking_behavior", 3462 },\
28312881 { "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 }
28332884#endif
28342885
28352886#ifdef __AfterMigUserHeader
lib/libc/include/any-macos-any/mach/task_info.h+10-1
......@@ -403,12 +403,21 @@ struct task_vm_info {
403403
404404 /* added for rev6 */
405405 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;
406410};
407411typedef struct task_vm_info task_vm_info_data_t;
408412typedef struct task_vm_info *task_vm_info_t;
409413#define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \
410414 (sizeof (task_vm_info_data_t) / sizeof (natural_t)))
411#define TASK_VM_INFO_REV6_COUNT TASK_VM_INFO_COUNT
415/*
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))
412421#define TASK_VM_INFO_REV5_COUNT /* doesn't include ledger swapins */ \
413422 ((mach_msg_type_number_t) (TASK_VM_INFO_REV6_COUNT - 2))
414423#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;
5252#endif /* AUTOTEST */
5353
5454#ifndef thread_act_MSG_COUNT
55#define thread_act_MSG_COUNT 31
55#define thread_act_MSG_COUNT 32
5656#endif /* thread_act_MSG_COUNT */
5757
5858#include <Availability.h>
......@@ -493,6 +493,22 @@ kern_return_t thread_get_exception_ports_info
493493 exception_flavor_array_t old_flavors
494494);
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
496512__END_DECLS
497513
498514/********************** Caution **************************/
......@@ -905,6 +921,24 @@ __END_DECLS
905921#ifdef __MigPackStructs
906922#pragma pack(pop)
907923#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
908942#endif /* !__Request__thread_act_subsystem__defined */
909943
910944/* union of all requests */
......@@ -942,6 +976,7 @@ union __RequestUnion__thread_act_subsystem {
942976 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
943977 __Request__thread_convert_thread_state_t Request_thread_convert_thread_state;
944978 __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;
945980};
946981#endif /* !__RequestUnion__thread_act_subsystem__defined */
947982/* typedefs for all replies */
......@@ -1346,6 +1381,18 @@ union __RequestUnion__thread_act_subsystem {
13461381#ifdef __MigPackStructs
13471382#pragma pack(pop)
13481383#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
13491396#endif /* !__Reply__thread_act_subsystem__defined */
13501397
13511398/* union of all replies */
......@@ -1383,6 +1430,7 @@ union __ReplyUnion__thread_act_subsystem {
13831430 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
13841431 __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;
13851432 __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;
13861434};
13871435#endif /* !__RequestUnion__thread_act_subsystem__defined */
13881436
......@@ -1417,7 +1465,8 @@ union __ReplyUnion__thread_act_subsystem {
14171465 { "thread_set_mach_voucher", 3626 },\
14181466 { "thread_swap_mach_voucher", 3627 },\
14191467 { "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 }
14211470#endif
14221471
14231472#ifdef __AfterMigUserHeader
lib/libc/include/any-macos-any/mach/vm_behavior.h+1
......@@ -75,5 +75,6 @@ typedef int vm_behavior_t;
7575#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
7676#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
7777#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
7980#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;
7171typedef int vm_region_flavor_t;
7272typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];
7373
74
7475#define VM_REGION_BASIC_INFO_64 9
7576struct vm_region_basic_info_64 {
7677 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 {
352352#define VM_LEDGER_TAG_UNCHANGED ((int)-1)
353353
354354/* individual bits: */
355#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
355#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
356356#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
360362#define VM_MEMORY_MALLOC 1
361363#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 @@
11/*
2 * Copyright (c) 2018 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 2018-2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -32,29 +32,40 @@
3232
3333#include <Availability.h>
3434#include <sys/cdefs.h>
35#include <_types.h>
35#if __has_include(<sys/_types/_size_t.h>)
3636#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
3743#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
3844#include <malloc/_malloc_type.h>
3945#else
4046#define _MALLOC_TYPED(override, type_param_pos)
4147#endif
4248
49#include <malloc/_ptrcheck.h>
50__ptrcheck_abi_assume_single()
51
4352__BEGIN_DECLS
4453
45void *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);
47void free(void *);
48void *realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_realloc, 2);
54void * __sized_by_or_null(__size) malloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_malloc, 1);
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);
56void free(void * __unsafe_indexable);
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);
4959#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);
5161#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) || \
5363 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
5464 (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);
5666#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
5970__END_DECLS
6071
lib/libc/include/any-macos-any/malloc/_malloc_type.h+29-25
......@@ -24,55 +24,59 @@
2424#ifndef _MALLOC_UNDERSCORE_MALLOC_TYPE_H_
2525#define _MALLOC_UNDERSCORE_MALLOC_TYPE_H_
2626
27/* !!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!
28 * Typed Memory Operations and malloc_type_* functions constitute a private,
29 * unstable interface. Don't use it, don't depend on it.
30 * !!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!
31 */
27#include <malloc/_ptrcheck.h>
28__ptrcheck_abi_assume_single()
29
30typedef unsigned long long malloc_type_id_t;
3231
3332#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.
3635#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
3843#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
4247__BEGIN_DECLS
4348
4449/* <malloc/_malloc.h> */
4550
46typedef unsigned long long malloc_type_id_t;
47
48_MALLOC_TYPE_AVAILABILITY void *malloc_type_malloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
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);
50_MALLOC_TYPE_AVAILABILITY void malloc_type_free(void *ptr, malloc_type_id_t type_id);
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);
52_MALLOC_TYPE_AVAILABILITY void *malloc_type_valloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
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);
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)*/;
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);
52_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);
53_MALLOC_TYPE_AVAILABILITY void malloc_type_free(void * __unsafe_indexable ptr, malloc_type_id_t type_id);
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);
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);
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);
57/* rdar://120689514 */
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)*/;
5559
5660
5761/* <malloc/malloc.h> */
5862
5963typedef 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);
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);
63_MALLOC_TYPE_AVAILABILITY void malloc_type_zone_free(malloc_zone_t *zone, void *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);
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);
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);
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);
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);
67_MALLOC_TYPE_AVAILABILITY void malloc_type_zone_free(malloc_zone_t *zone, void * __unsafe_indexable ptr, malloc_type_id_t type_id);
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);
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);
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
6872__END_DECLS
6973
7074/* Rewrite enablement */
7175#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))))
7377#define _MALLOC_TYPED(override, type_param_pos) __attribute__((typed_memory_operation(override, type_param_pos)))
7478#define _MALLOC_TYPE_ENABLED 1
75#endif
79#endif
7680#endif /* defined(__has_feature) && __has_feature(typed_memory_operations) */
7781
7882#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 @@
11/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 1999-2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -24,15 +24,13 @@
2424#ifndef _MALLOC_MALLOC_H_
2525#define _MALLOC_MALLOC_H_
2626
27#include <stddef.h>
28#include <mach/mach_types.h>
29#include <sys/cdefs.h>
27#include <TargetConditionals.h>
28#include <malloc/_platform.h>
3029#include <Availability.h>
31#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
32#include <malloc/_malloc_type.h>
33#else
34#define _MALLOC_TYPED(override, type_param_pos)
35#endif
30#include <os/availability.h>
31
32#include <malloc/_ptrcheck.h>
33__ptrcheck_abi_assume_single()
3634
3735#if __has_feature(ptrauth_calls)
3836#include <ptrauth.h>
......@@ -41,19 +39,19 @@
4139// the zone can be copied). Process-independent because the zone structure may
4240// be in the shared library cache.
4341#define MALLOC_ZONE_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
44 FALSE, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn
42 0, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn
4543
4644// Introspection function pointer, address- and type-diversified.
4745// Process-independent because the malloc_introspection_t structure that contains
4846// these pointers may be in the shared library cache.
4947#define MALLOC_INTROSPECT_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
50 TRUE, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn
48 1, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn
5149
5250// Pointer to the introspection pointer table, type-diversified but not
5351// address-diversified (because the zone can be copied).
5452// Process-independent because the table pointer may be in the shared library cache.
5553#define MALLOC_INTROSPECT_TBL_PTR(ptr) __ptrauth(ptrauth_key_process_independent_data,\
56 FALSE, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr
54 0, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr
5755
5856#endif // __has_feature(ptrauth_calls)
5957
......@@ -66,155 +64,393 @@
6664__BEGIN_DECLS
6765/********* 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 */
6971typedef struct _malloc_zone_t {
70 /* Only zone implementors should depend on the layout of this structure;
71 Regular callers should use the access functions below */
72 void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */
73 void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */
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 */
75 void *(* MALLOC_ZONE_FN_PTR(malloc))(struct _malloc_zone_t *zone, size_t size);
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 */
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 */
78 void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone, void *ptr);
79 void *(* MALLOC_ZONE_FN_PTR(realloc))(struct _malloc_zone_t *zone, void *ptr, size_t size);
80 void (* MALLOC_ZONE_FN_PTR(destroy))(struct _malloc_zone_t *zone); /* zone is destroyed and all memory reclaimed */
81 const char *zone_name;
82
83 /* Optional batch callbacks; these may be NULL */
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) */
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 */
86
87 struct malloc_introspection_t * MALLOC_INTROSPECT_TBL_PTR(introspect);
88 unsigned version;
89
90 /* aligned memory allocation. The callback may be NULL. Present in version >= 5. */
91 void *(* MALLOC_ZONE_FN_PTR(memalign))(struct _malloc_zone_t *zone, size_t alignment, size_t size);
92
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.*/
94 void (* MALLOC_ZONE_FN_PTR(free_definite_size))(struct _malloc_zone_t *zone, void *ptr, size_t size);
95
96 /* Empty out caches in the face of memory pressure. The callback may be NULL. Present in version >= 8. */
97 size_t (* MALLOC_ZONE_FN_PTR(pressure_relief))(struct _malloc_zone_t *zone, size_t goal);
72 void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */
73 void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */
74
75 /*
76 * Returns the size of a block or 0 if not in this zone; must be fast,
77 * especially for negative answers.
78 */
79 size_t (* MALLOC_ZONE_FN_PTR(size))(struct _malloc_zone_t *zone,
80 const void * __unsafe_indexable ptr);
81
82 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc))(
83 struct _malloc_zone_t *zone, size_t size);
84
85 /* Same as malloc, but block returned is set to zero */
86 void * __sized_by_or_null(num_items * size) (* MALLOC_ZONE_FN_PTR(calloc))(
87 struct _malloc_zone_t *zone, size_t num_items, size_t size);
88
89 /* Same as malloc, but block returned is guaranteed to be page-aligned */
90 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(valloc))(
91 struct _malloc_zone_t *zone, size_t size);
92
93 void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone,
94 void * __unsafe_indexable ptr);
95
96 void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(realloc))(
97 struct _malloc_zone_t *zone, void * __unsafe_indexable ptr,
98 size_t size);
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
99107 /*
100 * Checks whether an address might belong to the zone. May be NULL. Present in version >= 10.
101 * False positives are allowed (e.g. the pointer was freed, or it's in zone space that has
102 * not yet been allocated. False negatives are not allowed.
108 * Given a size, returns pointers capable of holding that size; returns the
109 * number of pointers allocated (maybe 0 or less than num_requested)
103110 */
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_free
107 * if it turns out not to belong to us */
108 void (* MALLOC_ZONE_FN_PTR(try_free_default))(struct _malloc_zone_t *zone, void *ptr);
179 void * __sized_by_or_null(count * size) (* MALLOC_ZONE_FN_PTR(malloc_type_calloc))(
180 struct _malloc_zone_t *zone, size_t count, size_t size,
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);
109195} 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
111337/********* Creation and destruction ************/
112338
113339extern malloc_zone_t *malloc_default_zone(void);
114 /* The initial zone */
340 /* The initial zone */
115341
342#if !0 && !0
116343extern 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
119346extern 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
122350/********* 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);
125 /* Allocates a new pointer of size size; zone must be non-NULL */
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);
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);
128 /* Allocates a new pointer of size num_items * size; block is cleared; zone must be non-NULL */
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);
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);
131 /* Allocates a new pointer of size size; zone must be non-NULL; Pointer is guaranteed to be page-aligned and block is cleared */
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);
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);
134 /* Frees pointer in zone; zone must be non-NULL */
361extern void malloc_zone_free(malloc_zone_t *zone, void * __unsafe_indexable ptr);
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);
137 /* Enlarges block if necessary; zone must be non-NULL */
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);
365 /* Enlarges block if necessary; zone must be non-NULL */
138366
139extern malloc_zone_t *malloc_zone_from_ptr(const void *ptr);
140 /* 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. */
367extern malloc_zone_t *malloc_zone_from_ptr(const void * __unsafe_indexable ptr);
368 /* Returns the zone for a pointer, or NULL if not in any zone.
369 The ptr must have been returned from a malloc or realloc call. */
142370
143extern size_t malloc_size(const void *ptr);
144 /* Returns size of given ptr, including any padding inserted by the allocator */
371extern size_t malloc_size(const void * __unsafe_indexable ptr);
372 /* Returns size of given ptr, including any padding inserted by the allocator */
145373
146374extern 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);
150 /*
151 * 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 *).
153 * zone must be non-NULL.
154 */
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);
378 /*
379 * Allocates a new pointer of size size whose address is an exact multiple of alignment.
380 * alignment must be a power of two and at least as large as sizeof(void *).
381 * zone must be non-NULL.
382 */
155383
156384/********* Batch methods ************/
157385
158extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t size, void **results, unsigned num_requested);
159 /* Allocates num blocks of the same size; Returns the number truly allocated (may be 0) */
386#if !0 && !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);
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 */
390extern void malloc_zone_batch_free(malloc_zone_t *zone, void * __unsafe_indexable * __counted_by(num) to_be_freed, unsigned num);
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
164394/********* Functions for libcache ************/
165395
396#if !0 && !0
166397extern 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);
170 /* Make an allocation from the purgeable zone purgeable if possible. */
400extern void malloc_make_purgeable(void * __unsafe_indexable ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
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);
173 /* Makes an allocation from the purgeable zone nonpurgeable.
174 * Returns zero if the contents were not purged since the last
175 * call to malloc_make_purgeable, else returns non-zero. */
403extern int malloc_make_nonpurgeable(void * __unsafe_indexable ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
404 /* Makes an allocation from the purgeable zone nonpurgeable.
405 * Returns zero if the contents were not purged since the last
406 * call to malloc_make_purgeable, else returns non-zero. */
407#endif
176408
177409/********* Functions for zone implementors ************/
178410
411#if !0 && !0
179412extern void malloc_zone_register(malloc_zone_t *zone);
180 /* 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. See
182 * malloc_create_zone for creating additional malloc zones with the
183 * default allocation and free behavior. */
413 /* Registers a custom malloc zone; Should typically be called after a
414 * malloc_zone_t has been filled in with custom methods by a client. See
415 * malloc_create_zone for creating additional malloc zones with the
416 * default allocation and free behavior. */
184417
185418extern void malloc_zone_unregister(malloc_zone_t *zone);
186 /* De-registers a zone
187 Should typically be called before calling the zone destruction routine */
419 /* De-registers a zone
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);
190 /* Sets the name of a zone */
423extern void malloc_set_zone_name(malloc_zone_t *zone, const char * __null_terminated name);
424 /* Sets the name of a zone */
191425
192426extern 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
195430size_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
197 * 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".
199 * 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.
201 */
431 /* malloc_zone_pressure_relief() advises the malloc subsystem that the process is under memory pressure and
432 * that the subsystem should make its best effort towards releasing (i.e. munmap()-ing) "goal" bytes from "zone".
433 * If "goal" is passed as zero, the malloc subsystem will attempt to achieve maximal pressure relief in "zone".
434 * If "zone" is passed as NULL, all zones are examined for pressure relief opportunities.
435 * malloc_zone_pressure_relief() returns the number of bytes released.
436 */
437#endif
202438
203439typedef struct {
204 vm_address_t address;
205 vm_size_t size;
440 vm_address_t address;
441 vm_size_t size;
206442} vm_range_t;
207443
208444typedef struct malloc_statistics_t {
209 unsigned blocks_in_use;
210 size_t size_in_use;
211 size_t max_size_in_use; /* high water mark of touched memory */
212 size_t size_allocated; /* reserved in memory */
445 unsigned blocks_in_use;
446 size_t size_in_use;
447 size_t max_size_in_use; /* high water mark of touched memory */
448 size_t size_allocated; /* reserved in memory */
213449} 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);
216 /* 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) */
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);
452 /* given a task, "reads" the memory at the given address and size
453 local_memory: set to a contiguous chunk of memory; validity of local_memory is assumed to be limited (until next call) */
218454
219455#define MALLOC_PTR_IN_USE_RANGE_TYPE 1 /* for allocated pointers */
220456#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
222458#define MALLOC_ZONE_SPECIFIC_FLAGS 0xff00 /* bits reserved for zone-specific purposes */
223459
224460typedef 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
227463/* 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
230466typedef struct malloc_introspection_t {
231467 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 */
232468 size_t (* MALLOC_INTROSPECT_FN_PTR(good_size))(malloc_zone_t *zone, size_t size);
233469 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 */
235 void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void *address); /* Enables logging of activity */
470 void (* MALLOC_INTROSPECT_FN_PTR(print))(malloc_zone_t *zone, boolean_t verbose); /* Prints zone */
471 void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void * __unsafe_indexable address); /* Enables logging of activity */
236472 void (* MALLOC_INTROSPECT_FN_PTR(force_lock))(malloc_zone_t *zone); /* Forces locking zone */
237473 void (* MALLOC_INTROSPECT_FN_PTR(force_unlock))(malloc_zone_t *zone); /* Forces unlocking zone */
238474 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. */
242478 boolean_t (* MALLOC_INTROSPECT_FN_PTR(enable_discharge_checking))(malloc_zone_t *zone);
243479 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);
245481#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));
247483 #else
248 void *enumerate_unavailable_without_blocks;
484 void *enumerate_unavailable_without_blocks;
249485#endif /* __BLOCKS__ */
250486 void (* MALLOC_INTROSPECT_FN_PTR(reinit_lock))(malloc_zone_t *zone); /* Reinitialize zone locks, called only from atfork_child handler. Present in version >= 9. */
251487 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. */
252488 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. */
254490} malloc_introspection_t;
255491
256492// The value of "level" when passed to print_task() that corresponds to
257493// verbose passed to print()
258494#define MALLOC_VERBOSE_PRINT_LEVEL 2
259495
260extern void malloc_printf(const char *format, ...);
261 /* Convenience for logging errors and warnings;
262 No allocation is performed during execution of this function;
263 Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)
264 */
496#if !0 && !0
497extern void malloc_printf(const char * __null_terminated format, ...) __printflike(1,2);
498 /* Convenience for logging errors and warnings;
499 No allocation is performed during execution of this function;
500 Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)
501 */
502#endif
265503
266504/********* 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);
269 /* Fills addresses and count with the addresses of the zones in task;
270 Note that the validity of the addresses returned correspond to the validity of the memory returned by reader */
506#if !0 && !0
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);
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
272512/********* Debug helpers ************/
273513
274extern void malloc_zone_print_ptr_info(void *ptr);
275 /* print to stdout if this pointer is in the malloc heap, free status, and size */
514extern void malloc_zone_print_ptr_info(void * __unsafe_indexable ptr);
515 /* print to stdout if this pointer is in the malloc heap, free status, and size */
276516
277517extern 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
280520extern 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
283524extern 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);
287 /* Controls logging of all activity; if !zone, for all zones;
288 If address==0 nothing is logged;
289 If address==-1 all activity is logged;
290 Else only the activity regarding address is logged */
527extern void malloc_zone_log(malloc_zone_t *zone, void * __unsafe_indexable address);
528 /* Controls logging of all activity; if !zone, for all zones;
529 If address==0 nothing is logged;
530 If address==-1 all activity is logged;
531 Else only the activity regarding address is logged */
532#endif
291533
292534struct mstats {
293 size_t bytes_total;
294 size_t chunks_used;
295 size_t bytes_used;
296 size_t chunks_free;
297 size_t bytes_free;
535 size_t bytes_total;
536 size_t chunks_used;
537 size_t bytes_used;
538 size_t chunks_free;
539 size_t bytes_free;
298540};
299541
542#if !0 && !0
300543extern struct mstats mstats(void);
301544
302545extern 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
305548extern void malloc_zone_disable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
306549/* 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);
309/* 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().
311 If discharge checking is off for the zone this function is a no-op. */
312
551extern void malloc_zone_discharge(malloc_zone_t *zone, void * __unsafe_indexable memory) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
552 /* Register memory that the programmer expects to be freed soon.
553 zone may be NULL in which case the zone is determined using malloc_zone_from_ptr().
554 If discharge checking is off for the zone this function is a no-op. */
555#endif
556
557#if !0 && !0
313558#ifdef __BLOCKS__
314559extern 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.
316 info is used to provide zone defined information about the memory block.
317 If zone is NULL then the enumeration covers all zones. */
560 /* Calls report_discharged for each block that was registered using malloc_zone_discharge() but has not yet been freed.
561 info is used to provide zone defined information about the memory block.
562 If zone is NULL then the enumeration covers all zones. */
318563#else
319564extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
320565#endif /* __BLOCKS__ */
566#endif
321567
322568/********* Zone version summary ************/
323569// Version 0, but optional:
......@@ -347,6 +593,14 @@ extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void
347593// - malloc_zone_t::try_free_default
348594// Version 14:
349595// 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
351605// These functions are optional and calling them requires two checks:
352606// * 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
7979#define FP_SUBNORMAL 5
8080#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__
8383/* On these architectures, fma(), fmaf( ), and fmal( ) are generally about as
8484 fast as (or faster than) separate multiply and add of the same operands. */
8585# define FP_FAST_FMA 1
......@@ -564,12 +564,12 @@ __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios,
564564 * Reentrant variants of lgamma[fl] *
565565 ******************************************************************************/
566566
567#ifdef _REENTRANT
567#if defined(_REENTRANT) || defined(__swift__)
568568/* Reentrant variants of the lgamma[fl] functions. */
569569extern float lgammaf_r(float, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
570570extern double lgamma_r(double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
571571extern long double lgammal_r(long double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
572#endif /* _REENTRANT */
572#endif /* _REENTRANT || __swift__ */
573573
574574/******************************************************************************
575575 * Apple extensions to the C standard *
......@@ -610,6 +610,21 @@ extern double __sinpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
610610extern float __tanpif(float) __API_AVAILABLE(macos(10.9), ios(7.0));
611611extern 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
613628#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || \
614629 (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)
615630/* __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 @@
2626 * $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $
2727 */
2828
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
29#include <_monetary.h>
4030
4131#ifdef _USE_EXTENDED_LOCALES_
4232#include <xlocale/_monetary.h>
4333#endif /* _USE_EXTENDED_LOCALES_ */
44
45#endif /* !_MONETARY_H_ */
lib/libc/include/any-macos-any/net/if.h+7
......@@ -72,6 +72,9 @@
7272
7373#include <net/if_var.h>
7474#include <net/net_kev.h>
75#if __has_ptrcheck
76#include <netinet/in.h>
77#endif
7578#include <sys/types.h>
7679#include <sys/socket.h>
7780
......@@ -139,6 +142,7 @@ struct if_clonereq {
139142#define IFCAP_SW_TIMESTAMP 0x01000 /* Time stamping in software */
140143#define IFCAP_CSUM_PARTIAL 0x02000 /* can offload partial checksum */
141144#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
143147#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
144148#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)
......@@ -315,6 +319,7 @@ struct ifreq {
315319 u_int32_t ifru_route_refcnt;
316320 int ifru_cap[2];
317321 u_int32_t ifru_functional_type;
322 u_int32_t ifru_peer_egress_functional_type;
318323#define IFRTYPE_FUNCTIONAL_UNKNOWN 0
319324#define IFRTYPE_FUNCTIONAL_LOOPBACK 1
320325#define IFRTYPE_FUNCTIONAL_WIRED 2
......@@ -325,6 +330,8 @@ struct ifreq {
325330#define IFRTYPE_FUNCTIONAL_COMPANIONLINK 7
326331#define IFRTYPE_FUNCTIONAL_MANAGEMENT 8
327332#define IFRTYPE_FUNCTIONAL_LAST 8
333 u_int8_t ifru_is_directlink;
334 u_int8_t ifru_is_vpn;
328335 } ifr_ifru;
329336#define ifr_addr ifr_ifru.ifru_addr /* address */
330337#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 @@
6565#define _NET_IF_DL_H_
6666#include <sys/appleapiopts.h>
6767
68#include <sys/_types.h> /* __offsetof() */
6869#include <sys/types.h>
6970
7071
......@@ -89,12 +90,6 @@
8990/*
9091 * Structure of a Link-Level sockaddr:
9192 */
92#if __has_ptrcheck
93#define DLIL_SDLDATACOUNT __counted_by(sdl_len - 8)
94#else
95#define DLIL_SDLDATACOUNT 12
96#endif
97
9893struct sockaddr_dl {
9994 u_char sdl_len; /* Total length of sockaddr */
10095 u_char sdl_family; /* AF_LINK */
......@@ -103,7 +98,7 @@ struct sockaddr_dl {
10398 u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
10499 u_char sdl_alen; /* link level address length */
105100 u_char sdl_slen; /* link layer selector length */
106 char sdl_data[DLIL_SDLDATACOUNT];
101 char sdl_data[12];
107102 /* minimum work area, can be larger;
108103 * contains both if name and ll address */
109104#ifndef __APPLE__
......@@ -113,7 +108,7 @@ struct sockaddr_dl {
113108#endif
114109};
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 {
8383 u_int32_t rmx_rtt; /* estimated round trip time */
8484 u_int32_t rmx_rttvar; /* estimated rtt variance */
8585 u_int32_t rmx_pksent; /* packets sent using this route */
86 u_int32_t rmx_state; /* route state */
87 u_int32_t rmx_filler[3]; /* will be used for TCP's peer-MSS cache */
86 u_int32_t rmx_filler[4]; /* will be used for TCP's peer-MSS cache */
8887};
8988
9089/*
......@@ -102,9 +101,7 @@ struct rt_metrics {
102101#define RTF_DELCLONE 0x80 /* delete cloned route */
103102#define RTF_CLONING 0x100 /* generate new routes on use */
104103#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
105#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward
106 * compatibility */
107#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */
104#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
108105#define RTF_STATIC 0x800 /* manually added */
109106#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
110107#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */
......@@ -129,12 +126,6 @@ struct rt_metrics {
129126 /* 0x80000000 unassigned */
130127
131128#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
139130#define IS_DIRECT_HOSTROUTE(rt) \
140131 (((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST)
......@@ -143,10 +134,16 @@ struct rt_metrics {
143134 (((rt)->rt_flags & (RTF_CLONING | RTF_PRCLONING | RTF_HOST | RTF_LLINFO |\
144135 RTF_WASCLONED | RTF_GATEWAY)) ==\
145136 (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
146143/*
147144 * Routing statistics.
148145 */
149struct rtstat {
146struct rtstat {
150147 short rts_badredirect; /* bogus redirect calls */
151148 short rts_dynamic; /* routes created by redirects */
152149 short rts_newgateway; /* routes modified by redirects */
......@@ -188,6 +185,10 @@ struct rt_msghdr2 {
188185 struct rt_metrics rtm_rmx; /* metrics themselves */
189186};
190187
188struct rt_msghdr_prelude {
189 u_short rtm_msglen; /* to skip over non-understood messages */
190};
191
191192#define RTM_VERSION 5 /* Up the ante and ignore older versions */
192193
193194/*
lib/libc/include/any-macos-any/objc/NSObjCRuntime.h+1
......@@ -6,6 +6,7 @@
66#define _OBJC_NSOBJCRUNTIME_H_
77
88#include <TargetConditionals.h>
9#include <limits.h>
910#include <objc/objc.h>
1011
1112#if __LP64__ || NS_BUILD_32_LIKE_64
lib/libc/include/any-macos-any/objc/objc-api.h+6
......@@ -301,4 +301,10 @@
301301# endif
302302#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
304310#endif
lib/libc/include/any-macos-any/objc/objc.h+7
......@@ -46,6 +46,13 @@ struct objc_object {
4646typedef struct objc_object *id;
4747#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
4956/// An opaque type that represents a method selector.
5057typedef 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;
5454
5555#endif
5656
57#ifdef __OBJC__
58@class Protocol;
59#else
60typedef struct objc_object Protocol;
61#endif
62
6357/// Defines a method
6458struct objc_method_description {
6559 SEL _Nullable name; /**< The name of the method */
......@@ -367,6 +361,7 @@ objc_copyClassList(unsigned int * _Nullable outCount)
367361 *
368362 */
369363#define OBJC_DYNAMIC_CLASSES ((const void *)-1)
364#ifdef __BLOCKS__
370365OBJC_EXPORT void
371366objc_enumerateClasses(const void * _Nullable image,
372367 const char * _Nullable namePrefix,
......@@ -375,7 +370,9 @@ objc_enumerateClasses(const void * _Nullable image,
375370 void (^ _Nonnull block)(Class _Nonnull aClass, BOOL * _Nonnull stop)
376371 OBJC_NOESCAPE)
377372 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
380377/* Working with Classes */
381378
......@@ -1480,34 +1477,6 @@ objc_copyClassNamesForImage(const char * _Nonnull image,
14801477
14811478/* 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
15111480/**
15121481 * Returns a Boolean value that indicates whether two selectors are equal.
15131482 *
lib/libc/include/any-macos-any/os/availability.h+26-10
......@@ -65,11 +65,19 @@
6565#define API_TO_BE_DEPRECATED_DRIVERKIT 100000
6666#endif
6767
68#ifndef API_TO_BE_DEPRECATED_XROS
69#define API_TO_BE_DEPRECATED_XROS 100000
68#ifndef API_TO_BE_DEPRECATEDC_VISIONOS
69#define API_TO_BE_DEPRECATED_VISIONOS 100000
7070#endif
7171
72#ifndef __OPEN_SOURCE__
73
74#endif /* __OPEN_SOURCE__ */
75
7276#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 @@
9098 * API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
9199 */
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__)
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__)
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__)
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__)
95103 #define API_AVAILABLE_END _Pragma("clang attribute pop")
96104
97105 /*
......@@ -111,13 +119,13 @@
111119 * API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
112120 */
113121
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__)
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__)
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__)
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__)
118126 #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__)
121129 #define API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
122130
123131 /*
......@@ -129,9 +137,9 @@
129137 * API_UNAVAILABLE(watchos, tvos)
130138 */
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__)
135143 #define API_UNAVAILABLE_END _Pragma("clang attribute pop")
136144 #endif /* __has_attribute(availability) */
137145#endif /* #if defined(__has_feature) && defined(__has_attribute) */
......@@ -200,6 +208,14 @@
200208 #define SPI_AVAILABLE(...)
201209#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
203219#ifndef SPI_DEPRECATED
204220 #define SPI_DEPRECATED(...)
205221#endif
lib/libc/include/any-macos-any/os/base.h+4
......@@ -246,8 +246,12 @@
246246#if __has_attribute(__swift_attr__)
247247#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg) \
248248 __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)")))
249251#else
250252#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg)
253#define OS_SWIFT_NONISOLATED
254#define OS_SWIFT_NONISOLATED_UNSAFE
251255#endif
252256
253257#if __has_attribute(swift_private)
lib/libc/include/any-macos-any/os/lock.h+41
......@@ -195,6 +195,47 @@ OS_UNFAIR_LOCK_AVAILABILITY
195195OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
196196void 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
198239__END_DECLS
199240
200241OS_ASSUME_NONNULL_END
lib/libc/include/any-macos-any/pthread.h+6-6
......@@ -587,8 +587,8 @@ __API_AVAILABLE(macos(11.0))
587587__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
588588void pthread_jit_write_protect_np(int enabled);
589589
590__API_AVAILABLE(macos(11.0))
591__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
590__API_AVAILABLE(macos(11.0), ios(17.4))
591__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
592592int pthread_jit_write_protect_supported_np(void);
593593
594594/*!
......@@ -691,8 +691,8 @@ typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx);
691691 * abort(3), the latter being encumbered by various conformance requirements) or
692692 * return a result indicating failure.
693693 */
694__API_AVAILABLE(macos(11.4))
695__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
694__API_AVAILABLE(macos(11.4), ios(17.4))
695__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
696696__SWIFT_UNAVAILABLE_MSG("This interface cannot be safely used from Swift")
697697int pthread_jit_write_with_callback_np(
698698 pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx);
......@@ -722,8 +722,8 @@ int pthread_jit_write_with_callback_np(
722722 * this function, as this allows the runtime to automatically freeze the set of
723723 * allowed callbacks early in process initialization.
724724 */
725__API_AVAILABLE(macos(12.1))
726__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
725__API_AVAILABLE(macos(12.1), ios(17.4))
726__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
727727void pthread_jit_write_freeze_callbacks_np(void);
728728
729729/*!
lib/libc/include/any-macos-any/regex.h-124
......@@ -86,132 +86,8 @@
8686 * @(#)regex.h 8.2 (Berkeley) 1/3/94
8787 */
8888
89#ifndef _REGEX_H_
90#define _REGEX_H_
91
9289#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
21391#ifdef _USE_EXTENDED_LOCALES_
21492#include <xlocale/_regex.h>
21593#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 {
8080
8181 __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);
8282 int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
83 __darwin_rune_t __invalid_rune;
83 __darwin_rune_t __invalid_rune; /* Deprecated */
8484
8585 __uint32_t __runetype[_CACHED_RUNES];
8686 __darwin_rune_t __maplower[_CACHED_RUNES];
lib/libc/include/any-macos-any/secure/_common.h+2
......@@ -24,6 +24,8 @@
2424#ifndef _SECURE__COMMON_H_
2525#define _SECURE__COMMON_H_
2626
27#include <_types.h>
28
2729#undef _USE_FORTIFY_LEVEL
2830#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
2931# if _FORTIFY_SOURCE > 1
lib/libc/include/any-macos-any/secure/_stdio.h+1-1
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2007, 2010 Apple Inc. All rights reserved.
2 * Copyright (c) 2007, 2010, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
lib/libc/include/any-macos-any/secure/_string.h+1-1
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2007,2017 Apple Inc. All rights reserved.
2 * Copyright (c) 2007,2017,2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
lib/libc/include/any-macos-any/secure/_strings.h+2-2
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2017 Apple Inc. All rights reserved.
2 * Copyright (c) 2017, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -21,7 +21,7 @@
2121 * @APPLE_LICENSE_HEADER_END@
2222 */
2323
24#ifndef _STRINGS_H_
24#ifndef __STRINGS_H_
2525# error "Never use <secure/_strings.h> directly; include <strings.h> instead."
2626#endif
2727
lib/libc/include/any-macos-any/simd/base.h+14-5
......@@ -32,6 +32,7 @@
3232# endif
3333
3434# if SIMD_COMPILER_HAS_REQUIRED_FEATURES
35# define SIMD_CURRENT_LIBRARY_VERSION 6
3536# if __has_include(<TargetConditionals.h>) && __has_include(<Availability.h>)
3637# include <TargetConditionals.h>
3738# include <Availability.h>
......@@ -43,19 +44,27 @@
4344 * do not work; these functions are simply unavailable when targeting older
4445 * versions of the library. */
4546# if TARGET_OS_RTKIT
46# define SIMD_LIBRARY_VERSION 5
47# 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
4756# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_13_0 || \
4857 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_16_0 || \
4958 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_9_0 || \
5059 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_16_0 || \
51 __BRIDGE_OS_VERSION_MIN_REQUIRED >= 70000 || \
60 __BRIDGE_OS_VERSION_MIN_REQUIRED >= __BRIDGEOS_7_0 || \
5261 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_22_0
5362# define SIMD_LIBRARY_VERSION 5
5463# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_12_0 || \
5564 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_15_0 || \
5665 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_8_0 || \
5766 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_15_0 || \
58 __BRIDGE_OS_VERSION_MIN_REQUIRED >= 60000 || \
67 __BRIDGE_OS_VERSION_MIN_REQUIRED >= __BRIDGEOS_6_0 || \
5968 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_21_0
6069# define SIMD_LIBRARY_VERSION 4
6170# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 || \
......@@ -76,14 +85,14 @@
7685# define SIMD_LIBRARY_VERSION 0
7786# endif
7887# else /* !__has_include(<TargetContidionals.h>) && __has_include(<Availability.h>) */
79# define SIMD_LIBRARY_VERSION 5
88# define SIMD_LIBRARY_VERSION SIMD_CURRENT_LIBRARY_VERSION
8089# define __API_AVAILABLE(...) /* Nothing */
8190# endif
8291
8392/* The simd types interoperate with the native simd intrinsic types for each
8493 * architecture; the headers that define those types and operations are
8594 * automatically included with simd.h */
86# if defined __ARM_NEON__
95# if defined __ARM_NEON
8796# include <arm_neon.h>
8897# elif defined __i386__ || defined __x86_64__
8998# 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);
158158/*! @abstract The elementwise absolute value of x. */
159159static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x);
160160/*! @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. */
161173static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x);
162174/*! @abstract The elementwise absolute value of x. */
163175static 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
250262/*! @abstract The elementwise maximum of x and y. */
251263static inline SIMD_CFUNC simd_ushort32 simd_max(simd_ushort32 x, simd_ushort32 y);
252264/*! @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. */
253279static inline SIMD_CFUNC simd_int2 simd_max(simd_int2 x, simd_int2 y);
254280/*! @abstract The elementwise maximum of x and y. */
255281static 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
364390/*! @abstract The elementwise minimum of x and y. */
365391static inline SIMD_CFUNC simd_ushort32 simd_min(simd_ushort32 x, simd_ushort32 y);
366392/*! @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. */
367407static inline SIMD_CFUNC simd_int2 simd_min(simd_int2 x, simd_int2 y);
368408/*! @abstract The elementwise minimum of x and y. */
369409static 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
530570 * @discussion Note that if you want to clamp all lanes to the same range,
531571 * you can use a scalar value for min and max. */
532572static 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);
533601/*! @abstract x clamped to the range [min, max].
534602 * @discussion Note that if you want to clamp all lanes to the same range,
535603 * 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
650718 * @discussion Deprecated. Use simd_clamp(x,min,max) instead. */
651719#define vector_clamp simd_clamp
652720
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);
653735/*! @abstract -1 if x is negative, +1 if x is positive, and 0 otherwise. */
654736static inline SIMD_CFUNC float simd_sign(float x);
655737/*! @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);
676758 * @discussion Deprecated. Use simd_sign(x) instead. */
677759#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);
679782/*! @abstract Linearly interpolates between x and y, taking the value x when
680783 * t=0 and y when t=1 */
681784static 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
715818#define vector_mix simd_mix
716819#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);
718856/*! @abstract A good approximation to 1/x.
719857 * @discussion If x is very close to the limits of representation, the
720858 * 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);
774912 * @discussion Deprecated. Use simd_precise_recip(x) instead. */
775913#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);
777950/*! @abstract A fast approximation to 1/x.
778951 * @discussion If x is very close to the limits of representation, the
779952 * 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);
8331006 * @discussion Deprecated. Use simd_fast_recip(x) instead. */
8341007#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);
8361051/*! @abstract An approximation to 1/x.
8371052 * @discussion If x is very close to the limits of representation, the
8381053 * result may overflow or underflow. This function maps to
......@@ -903,6 +1118,34 @@ static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x);
9031118 * @discussion Deprecated. Use simd_recip(x) instead. */
9041119#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);
9061149/*! @abstract A good approximation to 1/sqrt(x).
9071150 * @discussion This function is accurate to a few units in the last place
9081151 * (ULPs). */
......@@ -951,6 +1194,34 @@ static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x);
9511194 * @discussion Deprecated. Use simd_precise_rsqrt(x) instead. */
9521195#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);
9541225/*! @abstract A fast approximation to 1/sqrt(x).
9551226 * @discussion This function is accurate to at least 11 bits for float and
9561227 * 22 bits for double. */
......@@ -999,6 +1270,34 @@ static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x);
9991270 * @discussion Deprecated. Use simd_fast_rsqrt(x) instead. */
10001271#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);
10021301/*! @abstract An approximation to 1/sqrt(x).
10031302 * @discussion This function maps to simd_fast_recip(x) if -ffast-math is
10041303 * specified, and to simd_precise_recip(x) otherwise. */
......@@ -1047,6 +1346,34 @@ static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x);
10471346 * @discussion Deprecated. Use simd_rsqrt(x) instead. */
10481347#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);
10501377/*! @abstract The "fractional part" of x, lying in the range [0, 1).
10511378 * @discussion floor(x) + fract(x) is *approximately* equal to x. If x is
10521379 * 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);
10951422 * @discussion Deprecated. Use simd_fract(x) instead. */
10961423#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);
10981453/*! @abstract 0 if x < edge, and 1 otherwise.
10991454 * @discussion Use a scalar value for edge if you want to apply the same
11001455 * threshold to all lanes. */
......@@ -1143,6 +1498,34 @@ static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8
11431498 * @discussion Deprecated. Use simd_step(edge, x) instead. */
11441499#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);
11461529/*! @abstract Interpolates smoothly between 0 at edge0 and 1 at edge1
11471530 * @discussion You can use a scalar value for edge0 and edge1 if you want
11481531 * to clamp all lanes at the same points. */
......@@ -1295,6 +1678,30 @@ static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort16 x);
12951678 * @discussion This computation may overflow; especial for 8-bit types you
12961679 * may need to convert to a wider type before reducing. */
12971680static 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);
12981705/*! @abstract Sum of elements in x.
12991706 * @discussion This computation may overflow; especial for 8-bit types you
13001707 * 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);
14601867/*! @abstract Minimum of elements in x. */
14611868static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort32 x);
14621869/*! @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. */
14631882static inline SIMD_CFUNC int simd_reduce_min(simd_int2 x);
14641883/*! @abstract Minimum of elements in x. */
14651884static 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);
15701989/*! @abstract Maximum of elements in x. */
15711990static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort32 x);
15721991/*! @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. */
15732004static inline SIMD_CFUNC int simd_reduce_max(simd_int2 x);
15742005/*! @abstract Maximum of elements in x. */
15752006static 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)
17572188static inline SIMD_CFUNC simd_bool simd_equal(simd_ushort32 x, simd_ushort32 y) {
17582189 return simd_all(x == y);
17592190}
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}
17602221/*! @abstract True if and only if each lane of x is equal to the
17612222 * corresponding lane of y. */
17622223static 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) {
19692430}
19702431
19712432static inline SIMD_CFUNC simd_char8 simd_abs(simd_char8 x) {
1972#if defined __arm__ || defined __arm64__
2433#if defined __arm__ || defined __arm64__ || defined __aarch64__
19732434 return vabs_s8(x);
19742435#else
19752436 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) {
19772438}
19782439
19792440static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x) {
1980#if defined __arm__ || defined __arm64__
2441#if defined __arm__ || defined __arm64__ || defined __aarch64__
19812442 return vabsq_s8(x);
19822443#elif defined __SSE4_1__
19832444 return (simd_char16) _mm_abs_epi8((__m128i)x);
......@@ -2011,7 +2472,7 @@ static inline SIMD_CFUNC simd_short3 simd_abs(simd_short3 x) {
20112472}
20122473
20132474static inline SIMD_CFUNC simd_short4 simd_abs(simd_short4 x) {
2014#if defined __arm__ || defined __arm64__
2475#if defined __arm__ || defined __arm64__ || defined __aarch64__
20152476 return vabs_s16(x);
20162477#else
20172478 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) {
20192480}
20202481
20212482static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x) {
2022#if defined __arm__ || defined __arm64__
2483#if defined __arm__ || defined __arm64__ || defined __aarch64__
20232484 return vabsq_s16(x);
20242485#elif defined __SSE4_1__
20252486 return (simd_short8) _mm_abs_epi16((__m128i)x);
......@@ -2044,8 +2505,32 @@ static inline SIMD_CFUNC simd_short32 simd_abs(simd_short32 x) {
20442505#endif
20452506}
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
20472532static inline SIMD_CFUNC simd_int2 simd_abs(simd_int2 x) {
2048#if defined __arm__ || defined __arm64__
2533#if defined __arm__ || defined __arm64__ || defined __aarch64__
20492534 return vabs_s32(x);
20502535#else
20512536 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) {
20572542}
20582543
20592544static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x) {
2060#if defined __arm__ || defined __arm64__
2545#if defined __arm__ || defined __arm64__ || defined __aarch64__
20612546 return vabsq_s32(x);
20622547#elif defined __SSE4_1__
20632548 return (simd_int4) _mm_abs_epi32((__m128i)x);
......@@ -2103,7 +2588,7 @@ static inline SIMD_CFUNC simd_float16 simd_abs(simd_float16 x) {
21032588}
21042589
21052590static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x) {
2106#if defined __arm64__
2591#if defined __arm64__ || defined __aarch64__
21072592 return vabsq_s64(x);
21082593#elif defined __AVX512VL__
21092594 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) {
21612646}
21622647
21632648static 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__
21652650 return vmin_s8(x, y);
21662651#else
21672652 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) {
21702655}
21712656
21722657static 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__
21742659 return vminq_s8(x, y);
21752660#elif defined __SSE4_1__
21762661 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) {
22082693}
22092694
22102695static 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__
22122697 return vmin_u8(x, y);
22132698#else
22142699 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) {
22172702}
22182703
22192704static 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__
22212706 return vminq_u8(x, y);
22222707#elif defined __SSE4_1__
22232708 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) {
22512736}
22522737
22532738static 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__
22552740 return vmin_s16(x, y);
22562741#else
22572742 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) {
22602745}
22612746
22622747static 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__
22642749 return vminq_s16(x, y);
22652750#elif defined __SSE4_1__
22662751 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) {
22942779}
22952780
22962781static 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__
22982783 return vmin_u16(x, y);
22992784#else
23002785 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) {
23032788}
23042789
23052790static 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__
23072792 return vminq_u16(x, y);
23082793#elif defined __SSE4_1__
23092794 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
23282813#endif
23292814}
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
23312844static 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__
23332846 return vmin_s32(x, y);
23342847#else
23352848 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) {
23422855}
23432856
23442857static 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__
23462859 return vminq_s32(x, y);
23472860#elif defined __SSE4_1__
23482861 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) {
23682881}
23692882
23702883static 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__
23722885 return vmin_u32(x, y);
23732886#else
23742887 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) {
23812894}
23822895
23832896static 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__
23852898 return vminq_u32(x, y);
23862899#elif defined __SSE4_1__
23872900 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) {
25193032}
25203033
25213034static 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__
25233036 return vmax_s8(x, y);
25243037#else
25253038 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) {
25283041}
25293042
25303043static 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__
25323045 return vmaxq_s8(x, y);
25333046#elif defined __SSE4_1__
25343047 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) {
25663079}
25673080
25683081static 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__
25703083 return vmax_u8(x, y);
25713084#else
25723085 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) {
25753088}
25763089
25773090static 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__
25793092 return vmaxq_u8(x, y);
25803093#elif defined __SSE4_1__
25813094 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) {
26093122}
26103123
26113124static 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__
26133126 return vmax_s16(x, y);
26143127#else
26153128 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) {
26183131}
26193132
26203133static 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__
26223135 return vmaxq_s16(x, y);
26233136#elif defined __SSE4_1__
26243137 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) {
26523165}
26533166
26543167static 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__
26563169 return vmax_u16(x, y);
26573170#else
26583171 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) {
26613174}
26623175
26633176static 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__
26653178 return vmaxq_u16(x, y);
26663179#elif defined __SSE4_1__
26673180 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
26863199#endif
26873200}
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
26893230static 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__
26913232 return vmax_s32(x, y);
26923233#else
26933234 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) {
27003241}
27013242
27023243static 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__
27043245 return vmaxq_s32(x, y);
27053246#elif defined __SSE4_1__
27063247 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) {
27263267}
27273268
27283269static 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__
27303271 return vmax_u32(x, y);
27313272#else
27323273 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) {
27393280}
27403281
27413282static 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__
27433284 return vmaxq_u32(x, y);
27443285#elif defined __SSE4_1__
27453286 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
29683509 return simd_min(simd_max(x, min), max);
29693510}
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
29713540static inline SIMD_CFUNC simd_int2 simd_clamp(simd_int2 x, simd_int2 min, simd_int2 max) {
29723541 return simd_min(simd_max(x, min), max);
29733542}
......@@ -3084,9 +3653,37 @@ static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 mi
30843653 return simd_min(simd_max(x, min), max);
30853654}
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
30883685static 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);
30903687}
30913688
30923689static 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) {
31293726 return simd_bitselect(__tg_copysign(1,x), 0, x == 0 | x != x);
31303727}
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
31323757static inline SIMD_CFUNC float simd_mix(float x, float y, float t) {
31333758 return x + t*(y - x);
31343759}
......@@ -3168,11 +3793,67 @@ static inline SIMD_CFUNC simd_double3 simd_mix(simd_double3 x, simd_double3 y, s
31683793static inline SIMD_CFUNC simd_double4 simd_mix(simd_double4 x, simd_double4 y, simd_double4 t) {
31693794 return x + t*(y - x);
31703795}
3171
3172static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t) {
3173 return x + t*(y - x);
3796
3797static inline SIMD_CFUNC simd_double8 simd_mix(simd_double8 x, simd_double8 y, simd_double8 t) {
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
31743855}
3175
3856
31763857static inline SIMD_CFUNC float simd_recip(float x) {
31773858#if __FAST_MATH__
31783859 return simd_fast_recip(x);
......@@ -3261,13 +3942,55 @@ static inline SIMD_CFUNC simd_double8 simd_recip(simd_double8 x) {
32613942#endif
32623943}
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
32643987static inline SIMD_CFUNC float simd_fast_recip(float x) {
32653988#if defined __AVX512VL__
32663989 simd_float4 x4 = simd_make_float4(x);
32673990 return ((simd_float4)_mm_rcp14_ss(x4, x4)).x;
32683991#elif defined __SSE__
32693992 return ((simd_float4)_mm_rcp_ss(simd_make_float4(x))).x;
3270#elif defined __ARM_NEON__
3993#elif defined __ARM_NEON
32713994 return simd_fast_recip(simd_make_float2_undef(x)).x;
32723995#else
32733996 return simd_precise_recip(x);
......@@ -3277,7 +4000,7 @@ static inline SIMD_CFUNC float simd_fast_recip(float x) {
32774000static inline SIMD_CFUNC simd_float2 simd_fast_recip(simd_float2 x) {
32784001#if defined __SSE__
32794002 return simd_make_float2(simd_fast_recip(simd_make_float4_undef(x)));
3280#elif defined __ARM_NEON__
4003#elif defined __ARM_NEON
32814004 simd_float2 r = vrecpe_f32(x);
32824005 return r * vrecps_f32(x, r);
32834006#else
......@@ -3294,7 +4017,7 @@ static inline SIMD_CFUNC simd_float4 simd_fast_recip(simd_float4 x) {
32944017 return _mm_rcp14_ps(x);
32954018#elif defined __SSE__
32964019 return _mm_rcp_ps(x);
3297#elif defined __ARM_NEON__
4020#elif defined __ARM_NEON
32984021 simd_float4 r = vrecpeq_f32(x);
32994022 return r * vrecpsq_f32(x, r);
33004023#else
......@@ -3340,11 +4063,53 @@ static inline SIMD_CFUNC simd_double8 simd_fast_recip(simd_double8 x) {
33404063 return simd_precise_recip(x);
33414064}
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
33434108static inline SIMD_CFUNC float simd_precise_recip(float x) {
33444109#if defined __SSE__
33454110 float r = simd_fast_recip(x);
33464111 return r*(2 - (x == 0 ? -INFINITY : x)*r);
3347#elif defined __ARM_NEON__
4112#elif defined __ARM_NEON
33484113 return simd_precise_recip(simd_make_float2_undef(x)).x;
33494114#else
33504115 return 1/x;
......@@ -3354,7 +4119,7 @@ static inline SIMD_CFUNC float simd_precise_recip(float x) {
33544119static inline SIMD_CFUNC simd_float2 simd_precise_recip(simd_float2 x) {
33554120#if defined __SSE__
33564121 return simd_make_float2(simd_precise_recip(simd_make_float4_undef(x)));
3357#elif defined __ARM_NEON__
4122#elif defined __ARM_NEON
33584123 simd_float2 r = simd_fast_recip(x);
33594124 return r*vrecps_f32(x, r);
33604125#else
......@@ -3370,7 +4135,7 @@ static inline SIMD_CFUNC simd_float4 simd_precise_recip(simd_float4 x) {
33704135#if defined __SSE__
33714136 simd_float4 r = simd_fast_recip(x);
33724137 return r*(2 - simd_bitselect(x, -INFINITY, x == 0)*r);
3373#elif defined __ARM_NEON__
4138#elif defined __ARM_NEON
33744139 simd_float4 r = simd_fast_recip(x);
33754140 return r*vrecpsq_f32(x, r);
33764141#else
......@@ -3416,6 +4181,62 @@ static inline SIMD_CFUNC simd_double8 simd_precise_recip(simd_double8 x) {
34164181 return 1/x;
34174182}
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
34194240static inline SIMD_CFUNC float simd_rsqrt(float x) {
34204241#if __FAST_MATH__
34214242 return simd_fast_rsqrt(x);
......@@ -3504,13 +4325,55 @@ static inline SIMD_CFUNC simd_double8 simd_rsqrt(simd_double8 x) {
35044325#endif
35054326}
35064327
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
35074370static inline SIMD_CFUNC float simd_fast_rsqrt(float x) {
35084371#if defined __AVX512VL__
35094372 simd_float4 x4 = simd_make_float4(x);
35104373 return ((simd_float4)_mm_rsqrt14_ss(x4, x4)).x;
35114374#elif defined __SSE__
35124375 return ((simd_float4)_mm_rsqrt_ss(simd_make_float4(x))).x;
3513#elif defined __ARM_NEON__
4376#elif defined __ARM_NEON
35144377 return simd_fast_rsqrt(simd_make_float2_undef(x)).x;
35154378#else
35164379 return simd_precise_rsqrt(x);
......@@ -3520,7 +4383,7 @@ static inline SIMD_CFUNC float simd_fast_rsqrt(float x) {
35204383static inline SIMD_CFUNC simd_float2 simd_fast_rsqrt(simd_float2 x) {
35214384#if defined __SSE__
35224385 return simd_make_float2(simd_fast_rsqrt(simd_make_float4_undef(x)));
3523#elif defined __ARM_NEON__
4386#elif defined __ARM_NEON
35244387 simd_float2 r = vrsqrte_f32(x);
35254388 return r * vrsqrts_f32(x, r*r);
35264389#else
......@@ -3537,7 +4400,7 @@ static inline SIMD_CFUNC simd_float4 simd_fast_rsqrt(simd_float4 x) {
35374400 return _mm_rsqrt14_ps(x);
35384401#elif defined __SSE__
35394402 return _mm_rsqrt_ps(x);
3540#elif defined __ARM_NEON__
4403#elif defined __ARM_NEON
35414404 simd_float4 r = vrsqrteq_f32(x);
35424405 return r * vrsqrtsq_f32(x, r*r);
35434406#else
......@@ -3583,21 +4446,63 @@ static inline SIMD_CFUNC simd_double8 simd_fast_rsqrt(simd_double8 x) {
35834446 return simd_precise_rsqrt(x);
35844447}
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
35864491static inline SIMD_CFUNC float simd_precise_rsqrt(float x) {
35874492#if defined __SSE__
35884493 float r = simd_fast_rsqrt(x);
35894494 return r*(1.5f - 0.5f*(r == INFINITY ? -INFINITY : x)*r*r);
3590#elif defined __ARM_NEON__
4495#elif defined __ARM_NEON
35914496 return simd_precise_rsqrt(simd_make_float2_undef(x)).x;
35924497#else
3593 return 1/sqrt(x);
4498 return 1/sqrtf(x);
35944499#endif
35954500}
35964501
35974502static inline SIMD_CFUNC simd_float2 simd_precise_rsqrt(simd_float2 x) {
35984503#if defined __SSE__
35994504 return simd_make_float2(simd_precise_rsqrt(simd_make_float4_undef(x)));
3600#elif defined __ARM_NEON__
4505#elif defined __ARM_NEON
36014506 simd_float2 r = simd_fast_rsqrt(x);
36024507 return r*vrsqrts_f32(x, r*r);
36034508#else
......@@ -3613,7 +4518,7 @@ static inline SIMD_CFUNC simd_float4 simd_precise_rsqrt(simd_float4 x) {
36134518#if defined __SSE__
36144519 simd_float4 r = simd_fast_rsqrt(x);
36154520 return r*(1.5 - 0.5*simd_bitselect(x, -INFINITY, r == INFINITY)*r*r);
3616#elif defined __ARM_NEON__
4521#elif defined __ARM_NEON
36174522 simd_float4 r = simd_fast_rsqrt(x);
36184523 return r*vrsqrtsq_f32(x, r*r);
36194524#else
......@@ -3659,8 +4564,36 @@ static inline SIMD_CFUNC simd_double8 simd_precise_rsqrt(simd_double8 x) {
36594564 return 1/__tg_sqrt(x);
36604565}
36614566
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
36624595static 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);
36644597}
36654598
36664599static 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) {
37034636 return __tg_fmin(x - __tg_floor(x), 0x1.fffffffffffffp-1);
37044637}
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
37064667static inline SIMD_CFUNC float simd_step(float edge, float x) {
37074668 return !(x < edge);
37084669}
......@@ -3747,6 +4708,41 @@ static inline SIMD_CFUNC simd_double8 simd_step(simd_double8 edge, simd_double8
37474708 return simd_bitselect((simd_double8)1, 0, x < edge);
37484709}
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
37504746static inline SIMD_CFUNC float simd_smoothstep(float edge0, float edge1, float x) {
37514747 float t = simd_clamp((x - edge0)/(edge1 - edge0), 0, 1);
37524748 return t*t*(3 - 2*t);
......@@ -3906,6 +4902,30 @@ static inline SIMD_CFUNC unsigned short simd_reduce_add(simd_ushort32 x) {
39064902 return simd_reduce_add(x.lo + x.hi);
39074903}
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
39094929static inline SIMD_CFUNC int simd_reduce_add(simd_int2 x) {
39104930 return x.x + x.y;
39114931}
......@@ -4032,7 +5052,7 @@ static inline SIMD_CFUNC char simd_reduce_min(simd_char8 x) {
40325052}
40335053
40345054static inline SIMD_CFUNC char simd_reduce_min(simd_char16 x) {
4035#if defined __arm64__
5055#if defined __arm64__ || defined __aarch64__
40365056 return vminvq_s8(x);
40375057#else
40385058 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) {
40655085}
40665086
40675087static inline SIMD_CFUNC unsigned char simd_reduce_min(simd_uchar16 x) {
4068#if defined __arm64__
5088#if defined __arm64__ || defined __aarch64__
40695089 return vminvq_u8(x);
40705090#else
40715091 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) {
40945114}
40955115
40965116static inline SIMD_CFUNC short simd_reduce_min(simd_short8 x) {
4097#if defined __arm64__
5117#if defined __arm64__ || defined __aarch64__
40985118 return vminvq_s16(x);
40995119#else
41005120 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) {
41235143}
41245144
41255145static inline SIMD_CFUNC unsigned short simd_reduce_min(simd_ushort8 x) {
4126#if defined __arm64__
5146#if defined __arm64__ || defined __aarch64__
41275147 return vminvq_u16(x);
41285148#else
41295149 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) {
41485168}
41495169
41505170static inline SIMD_CFUNC int simd_reduce_min(simd_int4 x) {
4151#if defined __arm64__
5171#if defined __arm64__ || defined __aarch64__
41525172 return vminvq_s32(x);
41535173#else
41545174 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) {
41735193}
41745194
41755195static inline SIMD_CFUNC unsigned int simd_reduce_min(simd_uint4 x) {
4176#if defined __arm64__
5196#if defined __arm64__ || defined __aarch64__
41775197 return vminvq_u32(x);
41785198#else
41795199 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) {
42225242 return simd_reduce_min(simd_min(x.lo, x.hi));
42235243}
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
42255269static inline SIMD_CFUNC float simd_reduce_min(simd_float2 x) {
42265270 return fmin(x.x, x.y);
42275271}
......@@ -4231,7 +5275,7 @@ static inline SIMD_CFUNC float simd_reduce_min(simd_float3 x) {
42315275}
42325276
42335277static inline SIMD_CFUNC float simd_reduce_min(simd_float4 x) {
4234#if defined __arm64__
5278#if defined __arm64__ || defined __aarch64__
42355279 return vminvq_f32(x);
42365280#else
42375281 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) {
42475291}
42485292
42495293static inline SIMD_CFUNC double simd_reduce_min(simd_double2 x) {
4250#if defined __arm64__
5294#if defined __arm64__ || defined __aarch64__
42515295 return vminvq_f64(x);
42525296#else
42535297 return fmin(x.x, x.y);
......@@ -4284,7 +5328,7 @@ static inline SIMD_CFUNC char simd_reduce_max(simd_char8 x) {
42845328}
42855329
42865330static inline SIMD_CFUNC char simd_reduce_max(simd_char16 x) {
4287#if defined __arm64__
5331#if defined __arm64__ || defined __aarch64__
42885332 return vmaxvq_s8(x);
42895333#else
42905334 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) {
43175361}
43185362
43195363static inline SIMD_CFUNC unsigned char simd_reduce_max(simd_uchar16 x) {
4320#if defined __arm64__
5364#if defined __arm64__ || defined __aarch64__
43215365 return vmaxvq_u8(x);
43225366#else
43235367 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) {
43465390}
43475391
43485392static inline SIMD_CFUNC short simd_reduce_max(simd_short8 x) {
4349#if defined __arm64__
5393#if defined __arm64__ || defined __aarch64__
43505394 return vmaxvq_s16(x);
43515395#else
43525396 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) {
43755419}
43765420
43775421static inline SIMD_CFUNC unsigned short simd_reduce_max(simd_ushort8 x) {
4378#if defined __arm64__
5422#if defined __arm64__ || defined __aarch64__
43795423 return vmaxvq_u16(x);
43805424#else
43815425 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) {
44005444}
44015445
44025446static inline SIMD_CFUNC int simd_reduce_max(simd_int4 x) {
4403#if defined __arm64__
5447#if defined __arm64__ || defined __aarch64__
44045448 return vmaxvq_s32(x);
44055449#else
44065450 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) {
44255469}
44265470
44275471static inline SIMD_CFUNC unsigned int simd_reduce_max(simd_uint4 x) {
4428#if defined __arm64__
5472#if defined __arm64__ || defined __aarch64__
44295473 return vmaxvq_u32(x);
44305474#else
44315475 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) {
44745518 return simd_reduce_max(simd_max(x.lo, x.hi));
44755519}
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
44775545static inline SIMD_CFUNC float simd_reduce_max(simd_float2 x) {
44785546 return fmax(x.x, x.y);
44795547}
......@@ -4483,7 +5551,7 @@ static inline SIMD_CFUNC float simd_reduce_max(simd_float3 x) {
44835551}
44845552
44855553static inline SIMD_CFUNC float simd_reduce_max(simd_float4 x) {
4486#if defined __arm64__
5554#if defined __arm64__ || defined __aarch64__
44875555 return vmaxvq_f32(x);
44885556#else
44895557 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) {
44995567}
45005568
45015569static inline SIMD_CFUNC double simd_reduce_max(simd_double2 x) {
4502#if defined __arm64__
5570#if defined __arm64__ || defined __aarch64__
45035571 return vmaxvq_f64(x);
45045572#else
45055573 return fmax(x.x, x.y);
lib/libc/include/any-macos-any/simd/conversion.h+452-12
......@@ -18,6 +18,13 @@
1818 * are guaranteed to wrap modulo 2^N (where N is the number of bits in an
1919 * element of the result type).
2020 *
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 *
2128 * For integer vector types, saturating conversions are also available:
2229 *
2330 * simd_char_sat(x) simd_uchar_sat(x)
......@@ -28,12 +35,14 @@
2835 * These conversions clamp x to the representable range of the result type
2936 * before converting.
3037 *
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:
3239 *
33 * C++ Function Equivalent C Function
34 * -------------------------------------------------------------------
35 * simd::convert<ScalarType>(x) simd_ScalarType(x)
36 * simd::convert_sat<ScalarType>(x) simd_ScalarType_sat(x)
40 * simd_short_rte(simd_half<N> x) simd_ushort_rte(simd_half<N> x)
41 * simd_int_rte(simd_float<N> x) simd_uint_rte(simd_float<N> x)
42 * simd_long_rte(simd_double<N> x) simd_ulong_rte(simd_double<N> x)
43 *
44 * Unlike most vector operations in <simd/>, there are no abbreviated C++
45 * names for these functions in the simd:: namespace.
3746 */
3847
3948#ifndef __SIMD_CONVERSION_HEADER__
......@@ -73,6 +82,12 @@ static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x);
7382static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x);
7483static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x);
7584static 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);
7691static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x);
7792static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x);
7893static simd_char4 SIMD_CFUNC simd_char(simd_int4 __x);
......@@ -112,6 +127,12 @@ static simd_char4 SIMD_CFUNC simd_char_sat(simd_short4 __x);
112127static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x);
113128static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x);
114129static 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);
115136static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x);
116137static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x);
117138static simd_char4 SIMD_CFUNC simd_char_sat(simd_int4 __x);
......@@ -178,6 +199,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar(simd_ushort4 __x);
178199static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x);
179200static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x);
180201static 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);
181208static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x);
182209static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x);
183210static simd_uchar4 SIMD_CFUNC simd_uchar(simd_int4 __x);
......@@ -217,6 +244,12 @@ static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_short4 __x);
217244static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x);
218245static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x);
219246static 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);
220253static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x);
221254static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x);
222255static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_int4 __x);
......@@ -283,6 +316,12 @@ static simd_short4 SIMD_CFUNC simd_short(simd_ushort4 __x);
283316static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x);
284317static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x);
285318static 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);
286325static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x);
287326static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x);
288327static simd_short4 SIMD_CFUNC simd_short(simd_int4 __x);
......@@ -322,6 +361,12 @@ static simd_short4 SIMD_CFUNC simd_short_sat(simd_short4 __x);
322361static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x);
323362static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x);
324363static 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);
325370static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x);
326371static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x);
327372static 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);
361406static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x);
362407static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x);
363408static 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);
364415#define vector_short simd_short
365416#define vector_short_sat simd_short_sat
366417
......@@ -388,6 +439,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort(simd_ushort4 __x);
388439static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x);
389440static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x);
390441static 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);
391448static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x);
392449static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x);
393450static simd_ushort4 SIMD_CFUNC simd_ushort(simd_int4 __x);
......@@ -427,6 +484,12 @@ static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_short4 __x);
427484static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x);
428485static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x);
429486static 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);
430493static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x);
431494static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x);
432495static 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);
466529static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x);
467530static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x);
468531static 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);
469538#define vector_ushort simd_ushort
470539#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
472594static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x);
473595static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x);
474596static simd_int4 SIMD_CFUNC simd_int(simd_char4 __x);
......@@ -489,6 +611,11 @@ static simd_int3 SIMD_CFUNC simd_int(simd_ushort3 __x);
489611static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x);
490612static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x);
491613static 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);
492619static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x);
493620static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x);
494621static simd_int4 SIMD_CFUNC simd_int(simd_int4 __x);
......@@ -526,6 +653,11 @@ static simd_int3 SIMD_CFUNC simd_int_sat(simd_short3 __x);
526653static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x);
527654static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x);
528655static 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);
529661static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x);
530662static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x);
531663static simd_int4 SIMD_CFUNC simd_int_sat(simd_int4 __x);
......@@ -591,6 +723,11 @@ static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x);
591723static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x);
592724static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x);
593725static 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);
594731static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x);
595732static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x);
596733static simd_uint4 SIMD_CFUNC simd_uint(simd_int4 __x);
......@@ -628,6 +765,11 @@ static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_short3 __x);
628765static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x);
629766static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x);
630767static 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);
631773static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x);
632774static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x);
633775static 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);
665807static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x);
666808static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x);
667809static 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);
668815#define vector_uint simd_uint
669816#define vector_uint_sat simd_uint_sat
670817
......@@ -688,6 +835,11 @@ static simd_float3 SIMD_CFUNC simd_float(simd_ushort3 __x);
688835static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x);
689836static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x);
690837static 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);
691843static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x);
692844static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x);
693845static simd_float4 SIMD_CFUNC simd_float(simd_int4 __x);
......@@ -733,6 +885,10 @@ static simd_long2 SIMD_CFUNC simd_long(simd_ushort2 __x);
733885static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x);
734886static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x);
735887static 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);
736892static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x);
737893static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x);
738894static simd_long4 SIMD_CFUNC simd_long(simd_int4 __x);
......@@ -765,6 +921,10 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_short2 __x);
765921static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x);
766922static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x);
767923static 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);
768928static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x);
769929static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x);
770930static simd_long4 SIMD_CFUNC simd_long_sat(simd_int4 __x);
......@@ -820,6 +980,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x);
820980static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x);
821981static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x);
822982static 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);
823987static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x);
824988static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x);
825989static simd_ulong4 SIMD_CFUNC simd_ulong(simd_int4 __x);
......@@ -852,6 +1016,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_short2 __x);
8521016static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x);
8531017static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x);
8541018static 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);
8551023static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x);
8561024static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x);
8571025static 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);
8841052static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x);
8851053static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x);
8861054static 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);
8871059#define vector_ulong simd_ulong
8881060#define vector_ulong_sat simd_ulong_sat
8891061
......@@ -903,6 +1075,10 @@ static simd_double2 SIMD_CFUNC simd_double(simd_ushort2 __x);
9031075static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x);
9041076static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x);
9051077static 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);
9061082static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x);
9071083static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x);
9081084static simd_double4 SIMD_CFUNC simd_double(simd_int4 __x);
......@@ -933,6 +1109,7 @@ static simd_char2 SIMD_CFUNC vector2(char __x, char __y) {
9331109static simd_uchar2 SIMD_CFUNC vector2(unsigned char __x, unsigned char __y) { return ( simd_uchar2){__x, __y}; }
9341110static simd_short2 SIMD_CFUNC vector2(short __x, short __y) { return ( simd_short2){__x, __y}; }
9351111static 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}; }
9361113static simd_int2 SIMD_CFUNC vector2(int __x, int __y) { return ( simd_int2){__x, __y}; }
9371114static simd_uint2 SIMD_CFUNC vector2(unsigned int __x, unsigned int __y) { return ( simd_uint2){__x, __y}; }
9381115static 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
9441121static simd_uchar3 SIMD_CFUNC vector3(unsigned char __x, unsigned char __y, unsigned char __z) { return ( simd_uchar3){__x, __y, __z}; }
9451122static simd_short3 SIMD_CFUNC vector3(short __x, short __y, short __z) { return ( simd_short3){__x, __y, __z}; }
9461123static 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}; }
9471125static simd_int3 SIMD_CFUNC vector3(int __x, int __y, int __z) { return ( simd_int3){__x, __y, __z}; }
9481126static simd_uint3 SIMD_CFUNC vector3(unsigned int __x, unsigned int __y, unsigned int __z) { return ( simd_uint3){__x, __y, __z}; }
9491127static 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) {
9551133static simd_uchar3 SIMD_CFUNC vector3(simd_uchar2 __xy, unsigned char __z) { simd_uchar3 __r; __r.xy = __xy; __r.z = __z; return __r; }
9561134static simd_short3 SIMD_CFUNC vector3(simd_short2 __xy, short __z) { simd_short3 __r; __r.xy = __xy; __r.z = __z; return __r; }
9571135static 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; }
9581137static simd_int3 SIMD_CFUNC vector3(simd_int2 __xy, int __z) { simd_int3 __r; __r.xy = __xy; __r.z = __z; return __r; }
9591138static simd_uint3 SIMD_CFUNC vector3(simd_uint2 __xy, unsigned int __z) { simd_uint3 __r; __r.xy = __xy; __r.z = __z; return __r; }
9601139static 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
9661145static simd_uchar4 SIMD_CFUNC vector4(unsigned char __x, unsigned char __y, unsigned char __z, unsigned char __w) { return ( simd_uchar4){__x, __y, __z, __w}; }
9671146static simd_short4 SIMD_CFUNC vector4(short __x, short __y, short __z, short __w) { return ( simd_short4){__x, __y, __z, __w}; }
9681147static 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}; }
9691149static simd_int4 SIMD_CFUNC vector4(int __x, int __y, int __z, int __w) { return ( simd_int4){__x, __y, __z, __w}; }
9701150static simd_uint4 SIMD_CFUNC vector4(unsigned int __x, unsigned int __y, unsigned int __z, unsigned int __w) { return ( simd_uint4){__x, __y, __z, __w}; }
9711151static 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
9771157static simd_uchar4 SIMD_CFUNC vector4(simd_uchar2 __xy, simd_uchar2 __zw) { simd_uchar4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
9781158static simd_short4 SIMD_CFUNC vector4(simd_short2 __xy, simd_short2 __zw) { simd_short4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
9791159static 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; }
9801161static simd_int4 SIMD_CFUNC vector4(simd_int2 __xy, simd_int2 __zw) { simd_int4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
9811162static simd_uint4 SIMD_CFUNC vector4(simd_uint2 __xy, simd_uint2 __zw) { simd_uint4 __r; __r.xy = __xy; __r.zw = __zw; return __r; }
9821163static 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) {
9881169static simd_uchar4 SIMD_CFUNC vector4(simd_uchar3 __xyz, unsigned char __w) { simd_uchar4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
9891170static simd_short4 SIMD_CFUNC vector4(simd_short3 __xyz, short __w) { simd_short4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
9901171static 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; }
9911173static simd_int4 SIMD_CFUNC vector4(simd_int3 __xyz, int __w) { simd_int4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
9921174static simd_uint4 SIMD_CFUNC vector4(simd_uint3 __xyz, unsigned int __w) { simd_uint4 __r; __r.xyz = __xyz; __r.w = __w; return __r; }
9931175static 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
9991181static simd_uchar8 SIMD_CFUNC vector8(simd_uchar4 __lo, simd_uchar4 __hi) { simd_uchar8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10001182static simd_short8 SIMD_CFUNC vector8(simd_short4 __lo, simd_short4 __hi) { simd_short8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10011183static 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; }
10021185static simd_int8 SIMD_CFUNC vector8(simd_int4 __lo, simd_int4 __hi) { simd_int8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10031186static simd_uint8 SIMD_CFUNC vector8(simd_uint4 __lo, simd_uint4 __hi) { simd_uint8 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10041187static 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) {
10101193static simd_uchar16 SIMD_CFUNC vector16(simd_uchar8 __lo, simd_uchar8 __hi) { simd_uchar16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10111194static simd_short16 SIMD_CFUNC vector16(simd_short8 __lo, simd_short8 __hi) { simd_short16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10121195static 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; }
10131197static simd_int16 SIMD_CFUNC vector16(simd_int8 __lo, simd_int8 __hi) { simd_int16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10141198static simd_uint16 SIMD_CFUNC vector16(simd_uint8 __lo, simd_uint8 __hi) { simd_uint16 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10151199static 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)
10181202static simd_uchar32 SIMD_CFUNC vector32(simd_uchar16 __lo, simd_uchar16 __hi) { simd_uchar32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10191203static simd_short32 SIMD_CFUNC vector32(simd_short16 __lo, simd_short16 __hi) { simd_short32 __r; __r.lo = __lo; __r.hi = __hi; return __r; }
10201204static 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
10221207#pragma mark - Implementation
10231208
......@@ -1045,6 +1230,12 @@ static simd_char4 SIMD_CFUNC simd_char(simd_ushort4 __x) { return simd_char(si
10451230static simd_char8 SIMD_CFUNC simd_char(simd_ushort8 __x) { return simd_char(simd_short(__x)); }
10461231static simd_char16 SIMD_CFUNC simd_char(simd_ushort16 __x) { return simd_char(simd_short(__x)); }
10471232static 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)); }
10481239static simd_char2 SIMD_CFUNC simd_char(simd_int2 __x) { return simd_char(simd_short(__x)); }
10491240static simd_char3 SIMD_CFUNC simd_char(simd_int3 __x) { return simd_char(simd_short(__x)); }
10501241static 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
10851276static simd_char8 SIMD_CFUNC simd_char_sat(simd_short8 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
10861277static simd_char16 SIMD_CFUNC simd_char_sat(simd_short16 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
10871278static 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)); }
10881285static simd_char2 SIMD_CFUNC simd_char_sat(simd_int2 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
10891286static simd_char3 SIMD_CFUNC simd_char_sat(simd_int3 __x) { return simd_char(simd_clamp(__x,-0x80,0x7f)); }
10901287static 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
11501347static simd_uchar8 SIMD_CFUNC simd_uchar(simd_ushort8 __x) { return simd_uchar(simd_char(__x)); }
11511348static simd_uchar16 SIMD_CFUNC simd_uchar(simd_ushort16 __x) { return simd_uchar(simd_char(__x)); }
11521349static 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)); }
11531356static simd_uchar2 SIMD_CFUNC simd_uchar(simd_int2 __x) { return simd_uchar(simd_char(__x)); }
11541357static simd_uchar3 SIMD_CFUNC simd_uchar(simd_int3 __x) { return simd_uchar(simd_char(__x)); }
11551358static 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
11901393static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_short8 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
11911394static simd_uchar16 SIMD_CFUNC simd_uchar_sat(simd_short16 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
11921395static 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)); }
11931402static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_int2 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
11941403static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_int3 __x) { return simd_uchar(simd_clamp(__x,0,0xff)); }
11951404static 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
12551464static simd_short8 SIMD_CFUNC simd_short(simd_ushort8 __x) { return (simd_short8)__x; }
12561465static simd_short16 SIMD_CFUNC simd_short(simd_ushort16 __x) { return (simd_short16)__x; }
12571466static 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); }
12581473static simd_short2 SIMD_CFUNC simd_short(simd_int2 __x) { return __builtin_convertvector(__x & 0xffff, simd_short2); }
12591474static simd_short3 SIMD_CFUNC simd_short(simd_int3 __x) { return __builtin_convertvector(__x & 0xffff, simd_short3); }
12601475static 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; }
12951510static simd_short8 SIMD_CFUNC simd_short_sat(simd_short8 __x) { return __x; }
12961511static simd_short16 SIMD_CFUNC simd_short_sat(simd_short16 __x) { return __x; }
12971512static 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); }
12981519static simd_short2 SIMD_CFUNC simd_short_sat(simd_int2 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
12991520static simd_short3 SIMD_CFUNC simd_short_sat(simd_int3 __x) { return simd_short(simd_clamp(__x,-0x8000,0x7fff)); }
13001521static 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
13341555static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x) { return simd_short(simd_min(__x,0x7fff)); }
13351556static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x) { return simd_short(simd_min(__x,0x7fff)); }
13361557static 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
13391579static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x) { return simd_ushort(simd_short(__x)); }
13401580static 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; }
13601600static simd_ushort8 SIMD_CFUNC simd_ushort(simd_ushort8 __x) { return __x; }
13611601static simd_ushort16 SIMD_CFUNC simd_ushort(simd_ushort16 __x) { return __x; }
13621602static 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); }
13631609static simd_ushort2 SIMD_CFUNC simd_ushort(simd_int2 __x) { return simd_ushort(simd_short(__x)); }
13641610static simd_ushort3 SIMD_CFUNC simd_ushort(simd_int3 __x) { return simd_ushort(simd_short(__x)); }
13651611static 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
14001646static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_short8 __x) { return simd_ushort(simd_max(__x, 0)); }
14011647static simd_ushort16 SIMD_CFUNC simd_ushort_sat(simd_short16 __x) { return simd_ushort(simd_max(__x, 0)); }
14021648static 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); }
14031655static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_int2 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
14041656static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_int3 __x) { return simd_ushort(simd_clamp(__x, 0, 0xffff)); }
14051657static 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
14391691static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
14401692static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x) { return simd_ushort(simd_min(__x, 0xffff)); }
14411693static 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
14441767static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x) { return __builtin_convertvector(__x, simd_int2); }
14451768static 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
14611784static simd_int4 SIMD_CFUNC simd_int(simd_ushort4 __x) { return __builtin_convertvector(__x, simd_int4); }
14621785static simd_int8 SIMD_CFUNC simd_int(simd_ushort8 __x) { return __builtin_convertvector(__x, simd_int8); }
14631786static 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); }
14641792static simd_int2 SIMD_CFUNC simd_int(simd_int2 __x) { return __x; }
14651793static simd_int3 SIMD_CFUNC simd_int(simd_int3 __x) { return __x; }
14661794static 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(_
14991827static simd_int4 SIMD_CFUNC simd_int_sat(simd_short4 __x) { return simd_int(__x); }
15001828static simd_int8 SIMD_CFUNC simd_int_sat(simd_short8 __x) { return simd_int(__x); }
15011829static 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); }
15021835static simd_int2 SIMD_CFUNC simd_int_sat(simd_int2 __x) { return __x; }
15031836static simd_int3 SIMD_CFUNC simd_int_sat(simd_int3 __x) { return __x; }
15041837static 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
15381871static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x) { return simd_int(simd_min(__x,0x7fffffff)); }
15391872
15401873static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x) {
1541#if defined __arm64__
1874#if defined __arm64__ || defined __aarch64__
15421875 return vcvtn_s32_f32(__x);
15431876#else
15441877 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) {
15521885static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x) {
15531886#if defined __SSE2__
15541887 return _mm_cvtps_epi32(__x);
1555#elif defined __arm64__
1888#elif defined __arm64__ || defined __aarch64__
15561889 return vcvtnq_s32_f32(__x);
15571890#else
15581891 simd_float4 magic = __tg_copysign(0x1.0p23, __x);
......@@ -1571,7 +1904,7 @@ static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x) {
15711904
15721905static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x) {
15731906#if defined __AVX512F__
1574 return _mm512_cvt_roundps_epi32(__x, _MM_FROUND_RINT);
1907 return _mm512_cvtps_epi32(__x);
15751908#else
15761909 return simd_make_int16(simd_int_rte(__x.lo), simd_int_rte(__x.hi));
15771910#endif
......@@ -1597,6 +1930,11 @@ static simd_uint3 SIMD_CFUNC simd_uint(simd_ushort3 __x) { return simd_uint(si
15971930static simd_uint4 SIMD_CFUNC simd_uint(simd_ushort4 __x) { return simd_uint(simd_int(__x)); }
15981931static simd_uint8 SIMD_CFUNC simd_uint(simd_ushort8 __x) { return simd_uint(simd_int(__x)); }
15991932static 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)); }
16001938static simd_uint2 SIMD_CFUNC simd_uint(simd_int2 __x) { return (simd_uint2)__x; }
16011939static simd_uint3 SIMD_CFUNC simd_uint(simd_int3 __x) { return (simd_uint3)__x; }
16021940static 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
16351973static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_short4 __x) { return simd_uint(simd_max(__x,0)); }
16361974static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_short8 __x) { return simd_uint(simd_max(__x,0)); }
16371975static 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)); }
16381981static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_int2 __x) { return simd_uint(simd_max(__x,0)); }
16391982static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_int3 __x) { return simd_uint(simd_max(__x,0)); }
16401983static 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
16732016static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
16742017static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); }
16752018
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
16772059static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
16782060static 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
16942076static simd_float4 SIMD_CFUNC simd_float(simd_ushort4 __x) { return (simd_float4)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
16952077static simd_float8 SIMD_CFUNC simd_float(simd_ushort8 __x) { return (simd_float8)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; }
16962078static 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); }
16972084static simd_float2 SIMD_CFUNC simd_float(simd_int2 __x) { return __builtin_convertvector(__x,simd_float2); }
16982085static simd_float3 SIMD_CFUNC simd_float(simd_int3 __x) { return __builtin_convertvector(__x,simd_float3); }
16992086static 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
17392126static simd_long3 SIMD_CFUNC simd_long(simd_ushort3 __x) { return __builtin_convertvector(__x,simd_long3); }
17402127static simd_long4 SIMD_CFUNC simd_long(simd_ushort4 __x) { return __builtin_convertvector(__x,simd_long4); }
17412128static 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); }
17422133static simd_long2 SIMD_CFUNC simd_long(simd_int2 __x) { return __builtin_convertvector(__x,simd_long2); }
17432134static simd_long3 SIMD_CFUNC simd_long(simd_int3 __x) { return __builtin_convertvector(__x,simd_long3); }
17442135static 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
17722163static simd_long3 SIMD_CFUNC simd_long_sat(simd_short3 __x) { return simd_long(__x); }
17732164static simd_long4 SIMD_CFUNC simd_long_sat(simd_short4 __x) { return simd_long(__x); }
17742165static 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); }
17752170static simd_long2 SIMD_CFUNC simd_long_sat(simd_int2 __x) { return simd_long(__x); }
17762171static simd_long3 SIMD_CFUNC simd_long_sat(simd_int3 __x) { return simd_long(__x); }
17772172static 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
18082203static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x) {
18092204#if defined __AVX512F__
18102205 return _mm_cvtpd_epi64(__x);
1811#elif defined __arm64__
2206#elif defined __arm64__ || defined __aarch64__
18122207 return vcvtnq_s64_f64(__x);
18132208#else
18142209 simd_double2 magic = __tg_copysign(0x1.0p52, __x);
......@@ -1831,7 +2226,7 @@ static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x) {
18312226
18322227static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x) {
18332228#if defined __AVX512F__
1834 return _mm512_cvt_roundpd_epi64(__x, _MM_FROUND_RINT);
2229 return _mm512_cvtpd_epi64(__x);
18352230#else
18362231 return simd_make_long8(simd_long_rte(__x.lo), simd_long_rte(__x.hi));
18372232#endif
......@@ -1854,6 +2249,10 @@ static simd_ulong2 SIMD_CFUNC simd_ulong(simd_ushort2 __x) { return simd_ulong
18542249static simd_ulong3 SIMD_CFUNC simd_ulong(simd_ushort3 __x) { return simd_ulong(simd_long(__x)); }
18552250static simd_ulong4 SIMD_CFUNC simd_ulong(simd_ushort4 __x) { return simd_ulong(simd_long(__x)); }
18562251static 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)); }
18572256static simd_ulong2 SIMD_CFUNC simd_ulong(simd_int2 __x) { return simd_ulong(simd_long(__x)); }
18582257static simd_ulong3 SIMD_CFUNC simd_ulong(simd_int3 __x) { return simd_ulong(simd_long(__x)); }
18592258static 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
18872286static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_short3 __x) { return simd_ulong(simd_max(__x,0)); }
18882287static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_short4 __x) { return simd_ulong(simd_max(__x,0)); }
18892288static 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)); }
18902293static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_int2 __x) { return simd_ulong(simd_max(__x,0)); }
18912294static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_int3 __x) { return simd_ulong(simd_max(__x,0)); }
18922295static 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; }
19202323static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x) { return __x; }
19212324static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x) { return __x; }
19222325
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
19242358static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x) { return simd_double(simd_int(__x)); }
19252359static 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
19372371static simd_double3 SIMD_CFUNC simd_double(simd_ushort3 __x) { return simd_double(simd_int(__x)); }
19382372static simd_double4 SIMD_CFUNC simd_double(simd_ushort4 __x) { return simd_double(simd_int(__x)); }
19392373static 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); }
19402378static simd_double2 SIMD_CFUNC simd_double(simd_int2 __x) { return __builtin_convertvector(__x, simd_double2); }
19412379static simd_double3 SIMD_CFUNC simd_double(simd_int3 __x) { return __builtin_convertvector(__x, simd_double3); }
19422380static 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
19912429 return simd_long(vector);
19922430 else if constexpr (std::is_same<ScalarType, ulong1>::value)
19932431 return simd_ulong(vector);
2432 else if constexpr (std::is_same<ScalarType, half1>::value)
2433 return simd_half(vector);
19942434 else if constexpr (std::is_same<ScalarType, float1>::value)
19952435 return simd_float(vector);
19962436 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 *);
3434extern double _simd_insphere_pd3(const double *);
3535#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
3747#pragma mark - matrix
3848extern simd_float2x2 __invert_f2(simd_float2x2);
3949extern simd_double2x2 __invert_d2(simd_double2x2);
......@@ -42,6 +52,12 @@ extern simd_double3x3 __invert_d3(simd_double3x3);
4252extern simd_float4x4 __invert_f4(simd_float4x4);
4353extern 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
4561#ifdef __cplusplus
4662}
4763#endif
lib/libc/include/any-macos-any/simd/geometry.h+428-4
......@@ -136,6 +136,12 @@
136136extern "C" {
137137#endif
138138
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);
139145static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y);
140146static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y);
141147static 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);
147153static double SIMD_CFUNC simd_dot(simd_double8 __x, simd_double8 __y);
148154#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);
150162static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y);
151163static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y);
152164static 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
158170static simd_double8 SIMD_CFUNC simd_precise_project(simd_double8 __x, simd_double8 __y);
159171#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);
161179static simd_float2 SIMD_CFUNC simd_fast_project(simd_float2 __x, simd_float2 __y);
162180static simd_float3 SIMD_CFUNC simd_fast_project(simd_float3 __x, simd_float3 __y);
163181static 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
169187static simd_double8 SIMD_CFUNC simd_fast_project(simd_double8 __x, simd_double8 __y);
170188#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);
172196static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y);
173197static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y);
174198static 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);
180204static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y);
181205#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
183215static float SIMD_CFUNC simd_precise_length(simd_float2 __x);
184216static float SIMD_CFUNC simd_precise_length(simd_float3 __x);
185217static float SIMD_CFUNC simd_precise_length(simd_float4 __x);
......@@ -191,6 +223,12 @@ static double SIMD_CFUNC simd_precise_length(simd_double4 __x);
191223static double SIMD_CFUNC simd_precise_length(simd_double8 __x);
192224#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);
194232static float SIMD_CFUNC simd_fast_length(simd_float2 __x);
195233static float SIMD_CFUNC simd_fast_length(simd_float3 __x);
196234static float SIMD_CFUNC simd_fast_length(simd_float4 __x);
......@@ -202,6 +240,12 @@ static double SIMD_CFUNC simd_fast_length(simd_double4 __x);
202240static double SIMD_CFUNC simd_fast_length(simd_double8 __x);
203241#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);
205249static float SIMD_CFUNC simd_length(simd_float2 __x);
206250static float SIMD_CFUNC simd_length(simd_float3 __x);
207251static float SIMD_CFUNC simd_length(simd_float4 __x);
......@@ -213,6 +257,12 @@ static double SIMD_CFUNC simd_length(simd_double4 __x);
213257static double SIMD_CFUNC simd_length(simd_double8 __x);
214258#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);
216266static float SIMD_CFUNC simd_length_squared(simd_float2 __x);
217267static float SIMD_CFUNC simd_length_squared(simd_float3 __x);
218268static float SIMD_CFUNC simd_length_squared(simd_float4 __x);
......@@ -224,6 +274,12 @@ static double SIMD_CFUNC simd_length_squared(simd_double4 __x);
224274static double SIMD_CFUNC simd_length_squared(simd_double8 __x);
225275#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);
227283static float SIMD_CFUNC simd_norm_one(simd_float2 __x);
228284static float SIMD_CFUNC simd_norm_one(simd_float3 __x);
229285static float SIMD_CFUNC simd_norm_one(simd_float4 __x);
......@@ -235,6 +291,12 @@ static double SIMD_CFUNC simd_norm_one(simd_double4 __x);
235291static double SIMD_CFUNC simd_norm_one(simd_double8 __x);
236292#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);
238300static float SIMD_CFUNC simd_norm_inf(simd_float2 __x);
239301static float SIMD_CFUNC simd_norm_inf(simd_float3 __x);
240302static float SIMD_CFUNC simd_norm_inf(simd_float4 __x);
......@@ -246,6 +308,12 @@ static double SIMD_CFUNC simd_norm_inf(simd_double4 __x);
246308static double SIMD_CFUNC simd_norm_inf(simd_double8 __x);
247309#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);
249317static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y);
250318static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y);
251319static 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 __
257325static double SIMD_CFUNC simd_precise_distance(simd_double8 __x, simd_double8 __y);
258326#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);
260334static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y);
261335static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y);
262336static 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);
268342static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y);
269343#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);
271351static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y);
272352static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y);
273353static 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);
279359static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y);
280360#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);
282368static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y);
283369static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y);
284370static 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 __
290376static double SIMD_CFUNC simd_distance_squared(simd_double8 __x, simd_double8 __y);
291377#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);
293385static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x);
294386static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x);
295387static 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);
301393static simd_double8 SIMD_CFUNC simd_precise_normalize(simd_double8 __x);
302394#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);
304402static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x);
305403static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x);
306404static 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);
312410static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x);
313411#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);
315419static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x);
316420static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x);
317421static simd_float4 SIMD_CFUNC simd_normalize(simd_float4 __x);
......@@ -323,12 +427,17 @@ static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x);
323427static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x);
324428#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);
326432static simd_float3 SIMD_CFUNC simd_cross(simd_float2 __x, simd_float2 __y);
327433static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y);
328434static simd_double3 SIMD_CFUNC simd_cross(simd_double2 __x, simd_double2 __y);
329435static simd_double3 SIMD_CFUNC simd_cross(simd_double3 __x, simd_double3 __y);
330436#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);
332441static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n);
333442static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n);
334443static 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);
337446static simd_double4 SIMD_CFUNC simd_reflect(simd_double4 __x, simd_double4 __n);
338447#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
340454static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta);
341455static simd_float3 SIMD_CFUNC simd_refract(simd_float3 __x, simd_float3 __n, float __eta);
342456static 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
578692 * negatively-oriented. */
579693static double SIMD_CFUNC simd_insphere(simd_double3 __x, simd_double3 __a, simd_double3 __b, simd_double3 __c, simd_double3 __d);
580694#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
582710#ifdef __cplusplus
583711} /* extern "C" */
584712
585713namespace 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); }
586720 static SIMD_CPPFUNC float dot(const float2 x, const float2 y) { return ::simd_dot(x, y); }
587721 static SIMD_CPPFUNC float dot(const float3 x, const float3 y) { return ::simd_dot(x, y); }
588722 static SIMD_CPPFUNC float dot(const float4 x, const float4 y) { return ::simd_dot(x, y); }
......@@ -593,6 +727,12 @@ namespace simd {
593727 static SIMD_CPPFUNC double dot(const double4 x, const double4 y) { return ::simd_dot(x, y); }
594728 static SIMD_CPPFUNC double dot(const double8 x, const double8 y) { return ::simd_dot(x, y); }
595729
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); }
596736 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_project(x, y); }
597737 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_project(x, y); }
598738 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_project(x, y); }
......@@ -603,6 +743,12 @@ namespace simd {
603743 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_project(x, y); }
604744 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_project(x, y); }
605745
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); }
606752 static SIMD_CPPFUNC float length_squared(const float2 x) { return ::simd_length_squared(x); }
607753 static SIMD_CPPFUNC float length_squared(const float3 x) { return ::simd_length_squared(x); }
608754 static SIMD_CPPFUNC float length_squared(const float4 x) { return ::simd_length_squared(x); }
......@@ -613,6 +759,12 @@ namespace simd {
613759 static SIMD_CPPFUNC double length_squared(const double4 x) { return ::simd_length_squared(x); }
614760 static SIMD_CPPFUNC double length_squared(const double8 x) { return ::simd_length_squared(x); }
615761
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); }
616768 static SIMD_CPPFUNC float norm_one(const float2 x) { return ::simd_norm_one(x); }
617769 static SIMD_CPPFUNC float norm_one(const float3 x) { return ::simd_norm_one(x); }
618770 static SIMD_CPPFUNC float norm_one(const float4 x) { return ::simd_norm_one(x); }
......@@ -623,6 +775,12 @@ namespace simd {
623775 static SIMD_CPPFUNC double norm_one(const double4 x) { return ::simd_norm_one(x); }
624776 static SIMD_CPPFUNC double norm_one(const double8 x) { return ::simd_norm_one(x); }
625777
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); }
626784 static SIMD_CPPFUNC float norm_inf(const float2 x) { return ::simd_norm_inf(x); }
627785 static SIMD_CPPFUNC float norm_inf(const float3 x) { return ::simd_norm_inf(x); }
628786 static SIMD_CPPFUNC float norm_inf(const float4 x) { return ::simd_norm_inf(x); }
......@@ -633,6 +791,12 @@ namespace simd {
633791 static SIMD_CPPFUNC double norm_inf(const double4 x) { return ::simd_norm_inf(x); }
634792 static SIMD_CPPFUNC double norm_inf(const double8 x) { return ::simd_norm_inf(x); }
635793
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); }
636800 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_length(x); }
637801 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_length(x); }
638802 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_length(x); }
......@@ -643,6 +807,12 @@ namespace simd {
643807 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_length(x); }
644808 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_length(x); }
645809
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); }
646816 static SIMD_CPPFUNC float distance_squared(const float2 x, const float2 y) { return ::simd_distance_squared(x, y); }
647817 static SIMD_CPPFUNC float distance_squared(const float3 x, const float3 y) { return ::simd_distance_squared(x, y); }
648818 static SIMD_CPPFUNC float distance_squared(const float4 x, const float4 y) { return ::simd_distance_squared(x, y); }
......@@ -653,6 +823,12 @@ namespace simd {
653823 static SIMD_CPPFUNC double distance_squared(const double4 x, const double4 y) { return ::simd_distance_squared(x, y); }
654824 static SIMD_CPPFUNC double distance_squared(const double8 x, const double8 y) { return ::simd_distance_squared(x, y); }
655825
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); }
656832 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_distance(x, y); }
657833 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_distance(x, y); }
658834 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_distance(x, y); }
......@@ -663,6 +839,12 @@ namespace simd {
663839 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_distance(x, y); }
664840 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_distance(x, y); }
665841
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); }
666848 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_normalize(x); }
667849 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_normalize(x); }
668850 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_normalize(x); }
......@@ -673,18 +855,28 @@ namespace simd {
673855 static SIMD_CPPFUNC double4 normalize(const double4 x) { return ::simd_normalize(x); }
674856 static SIMD_CPPFUNC double8 normalize(const double8 x) { return ::simd_normalize(x); }
675857
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); }
676860 static SIMD_CPPFUNC float3 cross(const float2 x, const float2 y) { return ::simd_cross(x,y); }
677861 static SIMD_CPPFUNC float3 cross(const float3 x, const float3 y) { return ::simd_cross(x,y); }
678862 static SIMD_CPPFUNC double3 cross(const double2 x, const double2 y) { return ::simd_cross(x,y); }
679863 static SIMD_CPPFUNC double3 cross(const double3 x, const double3 y) { return ::simd_cross(x,y); }
680864
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); }
681868 static SIMD_CPPFUNC float2 reflect(const float2 x, const float2 n) { return ::simd_reflect(x,n); }
682869 static SIMD_CPPFUNC float3 reflect(const float3 x, const float3 n) { return ::simd_reflect(x,n); }
683870 static SIMD_CPPFUNC float4 reflect(const float4 x, const float4 n) { return ::simd_reflect(x,n); }
684871 static SIMD_CPPFUNC double2 reflect(const double2 x, const double2 n) { return ::simd_reflect(x,n); }
685872 static SIMD_CPPFUNC double3 reflect(const double3 x, const double3 n) { return ::simd_reflect(x,n); }
686873 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
688880 static SIMD_CPPFUNC float2 refract(const float2 x, const float2 n, const float eta) { return ::simd_refract(x,n,eta); }
689881 static SIMD_CPPFUNC float3 refract(const float3 x, const float3 n, const float eta) { return ::simd_refract(x,n,eta); }
690882 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 {
703895 static SIMD_CPPFUNC double orient(const double3 a, const double3 b, const double3 c, const double3 d) { return ::simd_orient(a,b,c,d); }
704896#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
706905 /* precise and fast sub-namespaces */
707906 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); }
708913 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_precise_project(x, y); }
709914 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_precise_project(x, y); }
710915 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_precise_project(x, y); }
......@@ -714,7 +919,15 @@ namespace simd {
714919 static SIMD_CPPFUNC double3 project(const double3 x, const double3 y) { return ::simd_precise_project(x, y); }
715920 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_precise_project(x, y); }
716921 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
718931 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_precise_length(x); }
719932 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_precise_length(x); }
720933 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_precise_length(x); }
......@@ -725,6 +938,12 @@ namespace simd {
725938 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_precise_length(x); }
726939 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_precise_length(x); }
727940
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); }
728947 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_precise_distance(x, y); }
729948 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_precise_distance(x, y); }
730949 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_precise_distance(x, y); }
......@@ -735,6 +954,12 @@ namespace simd {
735954 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_precise_distance(x, y); }
736955 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_precise_distance(x, y); }
737956
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); }
738963 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_precise_normalize(x); }
739964 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_precise_normalize(x); }
740965 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_precise_normalize(x); }
......@@ -747,6 +972,12 @@ namespace simd {
747972 }
748973
749974 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); }
750981 static SIMD_CPPFUNC float2 project(const float2 x, const float2 y) { return ::simd_fast_project(x, y); }
751982 static SIMD_CPPFUNC float3 project(const float3 x, const float3 y) { return ::simd_fast_project(x, y); }
752983 static SIMD_CPPFUNC float4 project(const float4 x, const float4 y) { return ::simd_fast_project(x, y); }
......@@ -757,6 +988,12 @@ namespace simd {
757988 static SIMD_CPPFUNC double4 project(const double4 x, const double4 y) { return ::simd_fast_project(x, y); }
758989 static SIMD_CPPFUNC double8 project(const double8 x, const double8 y) { return ::simd_fast_project(x, y); }
759990
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); }
760997 static SIMD_CPPFUNC float length(const float2 x) { return ::simd_fast_length(x); }
761998 static SIMD_CPPFUNC float length(const float3 x) { return ::simd_fast_length(x); }
762999 static SIMD_CPPFUNC float length(const float4 x) { return ::simd_fast_length(x); }
......@@ -767,6 +1004,12 @@ namespace simd {
7671004 static SIMD_CPPFUNC double length(const double4 x) { return ::simd_fast_length(x); }
7681005 static SIMD_CPPFUNC double length(const double8 x) { return ::simd_fast_length(x); }
7691006
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); }
7701013 static SIMD_CPPFUNC float distance(const float2 x, const float2 y) { return ::simd_fast_distance(x, y); }
7711014 static SIMD_CPPFUNC float distance(const float3 x, const float3 y) { return ::simd_fast_distance(x, y); }
7721015 static SIMD_CPPFUNC float distance(const float4 x, const float4 y) { return ::simd_fast_distance(x, y); }
......@@ -777,6 +1020,12 @@ namespace simd {
7771020 static SIMD_CPPFUNC double distance(const double4 x, const double4 y) { return ::simd_fast_distance(x, y); }
7781021 static SIMD_CPPFUNC double distance(const double8 x, const double8 y) { return ::simd_fast_distance(x, y); }
7791022
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); }
7801029 static SIMD_CPPFUNC float2 normalize(const float2 x) { return ::simd_fast_normalize(x); }
7811030 static SIMD_CPPFUNC float3 normalize(const float3 x) { return ::simd_fast_normalize(x); }
7821031 static SIMD_CPPFUNC float4 normalize(const float4 x) { return ::simd_fast_normalize(x); }
......@@ -794,6 +1043,12 @@ extern "C" {
7941043
7951044#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); }
7971052static float SIMD_CFUNC simd_dot(simd_float2 __x, simd_float2 __y) { return simd_reduce_add(__x*__y); }
7981053static float SIMD_CFUNC simd_dot(simd_float3 __x, simd_float3 __y) { return simd_reduce_add(__x*__y); }
7991054static 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
8041059static double SIMD_CFUNC simd_dot(simd_double4 __x, simd_double4 __y) { return simd_reduce_add(__x*__y); }
8051060static 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; }
8071068static simd_float2 SIMD_CFUNC simd_precise_project(simd_float2 __x, simd_float2 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
8081069static simd_float3 SIMD_CFUNC simd_precise_project(simd_float3 __x, simd_float3 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
8091070static 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
8141075static simd_double4 SIMD_CFUNC simd_precise_project(simd_double4 __x, simd_double4 __y) { return simd_dot(__x,__y)/simd_dot(__y,__y)*__y; }
8151076static 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)); }
8171084static 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)); }
8181085static 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)); }
8191086static 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
8251092static 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
8271094#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); }
8281101static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_fast_project(__x,__y); }
8291102static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_fast_project(__x,__y); }
8301103static 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)
8351108static simd_double4 SIMD_CFUNC simd_project(simd_double4 __x, simd_double4 __y) { return simd_fast_project(__x,__y); }
8361109static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_fast_project(__x,__y); }
8371110#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); }
8381117static simd_float2 SIMD_CFUNC simd_project(simd_float2 __x, simd_float2 __y) { return simd_precise_project(__x,__y); }
8391118static simd_float3 SIMD_CFUNC simd_project(simd_float3 __x, simd_float3 __y) { return simd_precise_project(__x,__y); }
8401119static 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)
8461125static simd_double8 SIMD_CFUNC simd_project(simd_double8 __x, simd_double8 __y) { return simd_precise_project(__x,__y); }
8471126#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
8491136static float SIMD_CFUNC simd_precise_length(simd_float2 __x) { return sqrtf(simd_length_squared(__x)); }
8501137static float SIMD_CFUNC simd_precise_length(simd_float3 __x) { return sqrtf(simd_length_squared(__x)); }
8511138static 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
8551142static double SIMD_CFUNC simd_precise_length(simd_double3 __x) { return sqrt(simd_length_squared(__x)); }
8561143static double SIMD_CFUNC simd_precise_length(simd_double4 __x) { return sqrt(simd_length_squared(__x)); }
8571144static double SIMD_CFUNC simd_precise_length(simd_double8 __x) { return sqrt(simd_length_squared(__x)); }
858
1145#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
8591153static float SIMD_CFUNC simd_fast_length(simd_float2 __x) { return simd_precise_length(__x); }
8601154static float SIMD_CFUNC simd_fast_length(simd_float3 __x) { return simd_precise_length(__x); }
8611155static 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
8671161static double SIMD_CFUNC simd_fast_length(simd_double8 __x) { return simd_precise_length(__x); }
8681162
8691163#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); }
8701170static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_fast_length(__x); }
8711171static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_fast_length(__x); }
8721172static 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
8771177static double SIMD_CFUNC simd_length(simd_double4 __x) { return simd_fast_length(__x); }
8781178static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_fast_length(__x); }
8791179#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
8801188static float SIMD_CFUNC simd_length(simd_float2 __x) { return simd_precise_length(__x); }
8811189static float SIMD_CFUNC simd_length(simd_float3 __x) { return simd_precise_length(__x); }
8821190static 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
8881196static double SIMD_CFUNC simd_length(simd_double8 __x) { return simd_precise_length(__x); }
8891197#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); }
8911205static float SIMD_CFUNC simd_length_squared(simd_float2 __x) { return simd_dot(__x,__x); }
8921206static float SIMD_CFUNC simd_length_squared(simd_float3 __x) { return simd_dot(__x,__x); }
8931207static 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
8981212static double SIMD_CFUNC simd_length_squared(simd_double4 __x) { return simd_dot(__x,__x); }
8991213static 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)); }
9011221static float SIMD_CFUNC simd_norm_one(simd_float2 __x) { return simd_reduce_add(__tg_fabs(__x)); }
9021222static float SIMD_CFUNC simd_norm_one(simd_float3 __x) { return simd_reduce_add(__tg_fabs(__x)); }
9031223static 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
9081228static double SIMD_CFUNC simd_norm_one(simd_double4 __x) { return simd_reduce_add(__tg_fabs(__x)); }
9091229static 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)); }
9111237static float SIMD_CFUNC simd_norm_inf(simd_float2 __x) { return simd_reduce_max(__tg_fabs(__x)); }
9121238static float SIMD_CFUNC simd_norm_inf(simd_float3 __x) { return simd_reduce_max(__tg_fabs(__x)); }
9131239static 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
9181244static double SIMD_CFUNC simd_norm_inf(simd_double4 __x) { return simd_reduce_max(__tg_fabs(__x)); }
9191245static 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
9211255static float SIMD_CFUNC simd_precise_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_length(__x - __y); }
9221256static float SIMD_CFUNC simd_precise_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_length(__x - __y); }
9231257static 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 __
9281262static double SIMD_CFUNC simd_precise_distance(simd_double4 __x, simd_double4 __y) { return simd_precise_length(__x - __y); }
9291263static 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); }
9311271static float SIMD_CFUNC simd_fast_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_length(__x - __y); }
9321272static float SIMD_CFUNC simd_fast_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_length(__x - __y); }
9331273static 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)
9391279static double SIMD_CFUNC simd_fast_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_length(__x - __y); }
9401280
9411281#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); }
9421288static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_fast_distance(__x,__y); }
9431289static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_fast_distance(__x,__y); }
9441290static 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
9491295static double SIMD_CFUNC simd_distance(simd_double4 __x, simd_double4 __y) { return simd_fast_distance(__x,__y); }
9501296static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_fast_distance(__x,__y); }
9511297#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); }
9521304static float SIMD_CFUNC simd_distance(simd_float2 __x, simd_float2 __y) { return simd_precise_distance(__x,__y); }
9531305static float SIMD_CFUNC simd_distance(simd_float3 __x, simd_float3 __y) { return simd_precise_distance(__x,__y); }
9541306static 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
9601312static double SIMD_CFUNC simd_distance(simd_double8 __x, simd_double8 __y) { return simd_precise_distance(__x,__y); }
9611313#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); }
9631321static float SIMD_CFUNC simd_distance_squared(simd_float2 __x, simd_float2 __y) { return simd_length_squared(__x - __y); }
9641322static float SIMD_CFUNC simd_distance_squared(simd_float3 __x, simd_float3 __y) { return simd_length_squared(__x - __y); }
9651323static 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 __
9701328static double SIMD_CFUNC simd_distance_squared(simd_double4 __x, simd_double4 __y) { return simd_length_squared(__x - __y); }
9711329static 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)); }
9731337static simd_float2 SIMD_CFUNC simd_precise_normalize(simd_float2 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
9741338static simd_float3 SIMD_CFUNC simd_precise_normalize(simd_float3 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
9751339static 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
9801344static simd_double4 SIMD_CFUNC simd_precise_normalize(simd_double4 __x) { return __x * simd_precise_rsqrt(simd_length_squared(__x)); }
9811345static 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)); }
9831353static simd_float2 SIMD_CFUNC simd_fast_normalize(simd_float2 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
9841354static simd_float3 SIMD_CFUNC simd_fast_normalize(simd_float3 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
9851355static 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 __
9911361static simd_double8 SIMD_CFUNC simd_fast_normalize(simd_double8 __x) { return __x * simd_fast_rsqrt(simd_length_squared(__x)); }
9921362
9931363#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); }
9941370static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_fast_normalize(__x); }
9951371static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_fast_normalize(__x); }
9961372static 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
10011377static simd_double4 SIMD_CFUNC simd_normalize(simd_double4 __x) { return simd_fast_normalize(__x); }
10021378static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_fast_normalize(__x); }
10031379#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); }
10041386static simd_float2 SIMD_CFUNC simd_normalize(simd_float2 __x) { return simd_precise_normalize(__x); }
10051387static simd_float3 SIMD_CFUNC simd_normalize(simd_float3 __x) { return simd_precise_normalize(__x); }
10061388static 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
10121394static simd_double8 SIMD_CFUNC simd_normalize(simd_double8 __x) { return simd_precise_normalize(__x); }
10131395#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; }
10151399static 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 }; }
10161400static simd_float3 SIMD_CFUNC simd_cross(simd_float3 __x, simd_float3 __y) { return (__x.zxy*__y - __x*__y.zxy).zxy; }
10171401static 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 }; }
10181402static 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; }
10201407static simd_float2 SIMD_CFUNC simd_reflect(simd_float2 __x, simd_float2 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
10211408static simd_float3 SIMD_CFUNC simd_reflect(simd_float3 __x, simd_float3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
10221409static 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)
10241411static simd_double3 SIMD_CFUNC simd_reflect(simd_double3 __x, simd_double3 __n) { return __x - 2*simd_dot(__x,__n)*__n; }
10251412static 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
10271428static simd_float2 SIMD_CFUNC simd_refract(simd_float2 __x, simd_float2 __n, float __eta) {
10281429 const float __k = 1.0f - __eta*__eta*(1.0f - simd_dot(__x,__n)*simd_dot(__x,__n));
10291430 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_
10931494}
10941495#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
10961520#ifdef __cplusplus
10971521}
10981522#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);
343343 * @discussion Deprecated. Use simd_all instead. */
344344#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);
346370/*! @abstract For each lane in the result, selects the corresponding element
347371 * of x or y according to whether the high-order bit of the corresponding
348372 * 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
489513 * or y according to whether the corresponding bit of mask is 0 or 1,
490514 * respectively. */
491515static 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);
492540/*! @abstract For each bit in the result, selects the corresponding bit of x
493541 * or y according to whether the corresponding bit of mask is 0 or 1,
494542 * respectively. */
......@@ -629,7 +677,7 @@ extern "C" {
629677static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) {
630678#if defined __SSE2__
631679 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3);
632#elif defined __arm64__
680#elif defined __arm64__ || defined __aarch64__
633681 return simd_any(x.xyxy);
634682#else
635683 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) {
639687static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) {
640688#if defined __SSE2__
641689 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7);
642#elif defined __arm64__
690#elif defined __arm64__ || defined __aarch64__
643691 return simd_any(x.xyzz);
644692#else
645693 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) {
649697static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) {
650698#if defined __SSE2__
651699 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf);
652#elif defined __arm64__
700#elif defined __arm64__ || defined __aarch64__
653701 return simd_any(x.xyzwxyzw);
654702#else
655703 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) {
659707static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) {
660708#if defined __SSE2__
661709 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff);
662#elif defined __arm64__
710#elif defined __arm64__ || defined __aarch64__
663711 return vmaxv_u8(x) & 0x80;
664712#else
665713 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) {
669717static inline SIMD_CFUNC simd_bool simd_any(simd_char16 x) {
670718#if defined __SSE2__
671719 return _mm_movemask_epi8((__m128i)x);
672#elif defined __arm64__
720#elif defined __arm64__ || defined __aarch64__
673721 return vmaxvq_u8(x) & 0x80;
674722#else
675723 return simd_any(x.lo | x.hi);
......@@ -709,7 +757,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x) {
709757static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) {
710758#if defined __SSE2__
711759 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa);
712#elif defined __arm64__
760#elif defined __arm64__ || defined __aarch64__
713761 return simd_any(x.xyxy);
714762#else
715763 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) {
719767static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) {
720768#if defined __SSE2__
721769 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a);
722#elif defined __arm64__
770#elif defined __arm64__ || defined __aarch64__
723771 return simd_any(x.xyzz);
724772#else
725773 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) {
729777static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) {
730778#if defined __SSE2__
731779 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa);
732#elif defined __arm64__
780#elif defined __arm64__ || defined __aarch64__
733781 return vmaxv_u16(x) & 0x8000;
734782#else
735783 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) {
739787static inline SIMD_CFUNC simd_bool simd_any(simd_short8 x) {
740788#if defined __SSE2__
741789 return (_mm_movemask_epi8((__m128i)x) & 0xaaaa);
742#elif defined __arm64__
790#elif defined __arm64__ || defined __aarch64__
743791 return vmaxvq_u16(x) & 0x8000;
744792#else
745793 return simd_any(x.lo | x.hi);
......@@ -776,7 +824,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x) {
776824static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) {
777825#if defined __SSE2__
778826 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3);
779#elif defined __arm64__
827#elif defined __arm64__ || defined __aarch64__
780828 return vmaxv_u32(x) & 0x80000000;
781829#else
782830 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) {
786834static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) {
787835#if defined __SSE2__
788836 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7);
789#elif defined __arm64__
837#elif defined __arm64__ || defined __aarch64__
790838 return simd_any(x.xyzz);
791839#else
792840 return (x.x | x.y | x.z) & 0x80000000;
......@@ -795,7 +843,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) {
795843static inline SIMD_CFUNC simd_bool simd_any(simd_int4 x) {
796844#if defined __SSE2__
797845 return _mm_movemask_ps((__m128)x);
798#elif defined __arm64__
846#elif defined __arm64__ || defined __aarch64__
799847 return vmaxvq_u32(x) & 0x80000000;
800848#else
801849 return simd_any(x.lo | x.hi);
......@@ -829,7 +877,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x) {
829877static inline SIMD_CFUNC simd_bool simd_any(simd_long2 x) {
830878#if defined __SSE2__
831879 return _mm_movemask_pd((__m128d)x);
832#elif defined __arm64__
880#elif defined __arm64__ || defined __aarch64__
833881 return (x.x | x.y) & 0x8000000000000000U;
834882#else
835883 return (x.x | x.y) & 0x8000000000000000U;
......@@ -868,7 +916,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x) {
868916static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) {
869917#if defined __SSE2__
870918 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3) == 0x3;
871#elif defined __arm64__
919#elif defined __arm64__ || defined __aarch64__
872920 return simd_all(x.xyxy);
873921#else
874922 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) {
878926static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) {
879927#if defined __SSE2__
880928 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7) == 0x7;
881#elif defined __arm64__
929#elif defined __arm64__ || defined __aarch64__
882930 return simd_all(x.xyzz);
883931#else
884932 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) {
888936static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) {
889937#if defined __SSE2__
890938 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf) == 0xf;
891#elif defined __arm64__
939#elif defined __arm64__ || defined __aarch64__
892940 return simd_all(x.xyzwxyzw);
893941#else
894942 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) {
898946static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) {
899947#if defined __SSE2__
900948 return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff) == 0xff;
901#elif defined __arm64__
949#elif defined __arm64__ || defined __aarch64__
902950 return vminv_u8(x) & 0x80;
903951#else
904952 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) {
908956static inline SIMD_CFUNC simd_bool simd_all(simd_char16 x) {
909957#if defined __SSE2__
910958 return _mm_movemask_epi8((__m128i)x) == 0xffff;
911#elif defined __arm64__
959#elif defined __arm64__ || defined __aarch64__
912960 return vminvq_u8(x) & 0x80;
913961#else
914962 return simd_all(x.lo & x.hi);
......@@ -948,7 +996,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x) {
948996static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) {
949997#if defined __SSE2__
950998 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa) == 0xa;
951#elif defined __arm64__
999#elif defined __arm64__ || defined __aarch64__
9521000 return simd_all(x.xyxy);
9531001#else
9541002 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) {
9581006static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) {
9591007#if defined __SSE2__
9601008 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a) == 0x2a;
961#elif defined __arm64__
1009#elif defined __arm64__ || defined __aarch64__
9621010 return simd_all(x.xyzz);
9631011#else
9641012 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) {
9681016static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) {
9691017#if defined __SSE2__
9701018 return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa) == 0xaa;
971#elif defined __arm64__
1019#elif defined __arm64__ || defined __aarch64__
9721020 return vminv_u16(x) & 0x8000;
9731021#else
9741022 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) {
9781026static inline SIMD_CFUNC simd_bool simd_all(simd_short8 x) {
9791027#if defined __SSE2__
9801028 return (_mm_movemask_epi8((__m128i)x) & 0xaaaa) == 0xaaaa;
981#elif defined __arm64__
1029#elif defined __arm64__ || defined __aarch64__
9821030 return vminvq_u16(x) & 0x8000;
9831031#else
9841032 return simd_all(x.lo & x.hi);
......@@ -1015,7 +1063,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x) {
10151063static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) {
10161064#if defined __SSE2__
10171065 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3) == 0x3;
1018#elif defined __arm64__
1066#elif defined __arm64__ || defined __aarch64__
10191067 return vminv_u32(x) & 0x80000000;
10201068#else
10211069 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) {
10251073static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) {
10261074#if defined __SSE2__
10271075 return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7) == 0x7;
1028#elif defined __arm64__
1076#elif defined __arm64__ || defined __aarch64__
10291077 return simd_all(x.xyzz);
10301078#else
10311079 return (x.x & x.y & x.z) & 0x80000000;
......@@ -1034,7 +1082,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) {
10341082static inline SIMD_CFUNC simd_bool simd_all(simd_int4 x) {
10351083#if defined __SSE2__
10361084 return _mm_movemask_ps((__m128)x) == 0xf;
1037#elif defined __arm64__
1085#elif defined __arm64__ || defined __aarch64__
10381086 return vminvq_u32(x) & 0x80000000;
10391087#else
10401088 return simd_all(x.lo & x.hi);
......@@ -1068,7 +1116,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x) {
10681116static inline SIMD_CFUNC simd_bool simd_all(simd_long2 x) {
10691117#if defined __SSE2__
10701118 return _mm_movemask_pd((__m128d)x) == 0x3;
1071#elif defined __arm64__
1119#elif defined __arm64__ || defined __aarch64__
10721120 return (x.x & x.y) & 0x8000000000000000U;
10731121#else
10741122 return (x.x & x.y) & 0x8000000000000000U;
......@@ -1104,6 +1152,24 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ulong8 x) {
11041152 return simd_all((simd_long8)x);
11051153}
11061154
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}
11071173static inline SIMD_CFUNC simd_float2 simd_select(simd_float2 x, simd_float2 y, simd_int2 mask) {
11081174 return simd_make_float2(simd_select(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_int4_undef(mask)));
11091175}
......@@ -1226,6 +1292,24 @@ static inline SIMD_CFUNC simd_ushort16 simd_bitselect(simd_ushort16 x, simd_usho
12261292static inline SIMD_CFUNC simd_ushort32 simd_bitselect(simd_ushort32 x, simd_ushort32 y, simd_short32 mask) {
12271293 return (simd_ushort32)simd_bitselect((simd_short32)x, (simd_short32)y, mask);
12281294}
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}
12291313static inline SIMD_CFUNC simd_int2 simd_bitselect(simd_int2 x, simd_int2 y, simd_int2 mask) {
12301314 return (x & ~mask) | (y & mask);
12311315}
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
11411141static inline SIMD_NONCONST void __tg_sincospi(simd_double8 x, simd_double8 *sinp, simd_double8 *cosp);
11421142
11431143#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);
11441162/*! @abstract Do not call this function; instead use `isfinite` in C and
11451163 * Objective-C, and `simd::isfinite` in C++. */
11461164static 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);
11691187 * Objective-C, and `simd::isfinite` in C++. */
11701188static 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);
11721208/*! @abstract Do not call this function; instead use `isinf` in C and
11731209 * Objective-C, and `simd::isinf` in C++. */
11741210static 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);
11971233 * Objective-C, and `simd::isinf` in C++. */
11981234static 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);
12001254/*! @abstract Do not call this function; instead use `isnan` in C and
12011255 * Objective-C, and `simd::isnan` in C++. */
12021256static 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);
12251279 * Objective-C, and `simd::isnan` in C++. */
12261280static 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);
12281300/*! @abstract Do not call this function; instead use `isnormal` in C and
12291301 * Objective-C, and `simd::isnormal` in C++. */
12301302static 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);
12531325 * Objective-C, and `simd::isnormal` in C++. */
12541326static 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
12571443/*! @abstract Do not call this function; instead use `atan2` in C and
12581444 * 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);
15341720 * Objective-C, and `simd::fmin` in C++. */
15351721static 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
15381781/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
15391782 * and `simd::fma` in C++. */
......@@ -1563,6 +1806,27 @@ static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, s
15631806 * and `simd::fma` in C++. */
15641807static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z);
15651808
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);
15661830/*! @abstract Computes accum + x*y by the most efficient means available;
15671831 * either a fused multiply add or separate multiply and add instructions. */
15681832static 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 *
17532017 * instead. */
17542018static SIMD_INLINE SIMD_NODEBUG void __tg_sincospi(double x, double *sinp, double *cosp) { ::__sincospi(x, sinp, cosp); }
17552019#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
17562034/*! @abstract Do not call this function directly; use simd::isfinite
17572035 * instead. */
1758static SIMD_CPPFUNC float __tg_isfinite(float x) { return ::isfinite(x); }
2036static SIMD_CPPFUNC float __tg_isfinite(float x) { return std::isfinite(x); }
17592037/*! @abstract Do not call this function directly; use simd::isfinite
17602038 * instead. */
1761static SIMD_CPPFUNC double __tg_isfinite(double x) { return ::isfinite(x); }
2039static SIMD_CPPFUNC double __tg_isfinite(double x) { return std::isfinite(x); }
17622040/*! @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); }
17642042/*! @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); }
17662044/*! @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); }
17682046/*! @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); }
17702048/*! @abstract Do not call this function directly; use simd::isnormal
17712049 * instead. */
1772static SIMD_CPPFUNC float __tg_isnormal(float x) { return ::isnormal(x); }
2050static SIMD_CPPFUNC float __tg_isnormal(float x) { return std::isnormal(x); }
17732051/*! @abstract Do not call this function directly; use simd::isnormal
17742052 * instead. */
1775static SIMD_CPPFUNC double __tg_isnormal(double x) { return ::isnormal(x); }
2053static SIMD_CPPFUNC double __tg_isnormal(double x) { return std::isnormal(x); }
17762054/*! @abstract Do not call this function directly; use simd::atan2 instead. */
17772055static SIMD_CPPFUNC float __tg_atan2(float x, float y) { return ::atan2f(x, y); }
17782056/*! @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);
18192097static SIMD_CPPFUNC float __tg_fmin(float x, float y) { return ::fminf(x, y); }
18202098/*! @abstract Do not call this function directly; use simd::fmin instead. */
18212099static 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
18222109/*! @abstract Do not call this function directly; use simd::fma instead. */
18232110static SIMD_CPPFUNC float __tg_fma(float x, float y, float z) { return ::fmaf(x, y, z); }
18242111/*! @abstract Do not call this function directly; use simd::fma instead. */
18252112static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); }
1826
2113
18272114namespace simd {
18282115/*! @abstract Generalizes the <cmath> function acos to operate on vectors of
18292116 * floats and doubles. */
......@@ -2111,6 +2398,12 @@ extern "C" {
21112398#else
21122399#include <tgmath.h>
21132400/* 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);
21142407static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2);
21152408static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3);
21162409static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4);
......@@ -2186,6 +2479,7 @@ static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); }
21862479#define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x))
21872480#endif
21882481
2482
21892483#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__)
21902484static inline SIMD_CFUNC int __tg_isfinite(float x) { return __inline_isfinitef(x); }
21912485static 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
22722566#endif /* !__cplusplus */
22732567
22742568#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); }
22752575static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
22762576static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
22772577static 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
22832583static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffff); }
22842584
22852585#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; }
22862592static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x) { return x == x && __tg_fabs(x) != (simd_float2)INFINITY; }
22872593static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x) { return x == x && __tg_fabs(x) != (simd_float3)INFINITY; }
22882594static 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 ==
22942600static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x) { return x == x && __tg_fabs(x) != (simd_double8)INFINITY; }
22952601
22962602#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; }
22972609static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x) { return __tg_fabs(x) == (simd_float2)INFINITY; }
22982610static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x) { return __tg_fabs(x) == (simd_float3)INFINITY; }
22992611static 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
23052617static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x) { return __tg_fabs(x) == (simd_double8)INFINITY; }
23062618
23072619#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; }
23082626static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x) { return x != x; }
23092627static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x) { return x != x; }
23102628static 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;
23162634static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x) { return x != x; }
23172635
23182636#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__; }
23192643static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float2)__FLT_MIN__; }
23202644static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float3)__FLT_MIN__; }
23212645static 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_
23272651static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double8)__DBL_MIN__; }
23282652
23292653#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
23302686static SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y) {
23312687#if defined __SSE2__
23322688 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__
23342690 return vminnm_f32(x, y);
23352691#elif defined __arm__ && __FINITE_MATH_ONLY__
23362692 return vmin_f32(x, y);
......@@ -2350,7 +2706,7 @@ static SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y) {
23502706 return _mm_min_ps(x, y);
23512707#elif defined __SSE2__
23522708 return simd_bitselect(_mm_min_ps(x, y), x, y != y);
2353#elif defined __arm64__
2709#elif defined __arm64__ || defined __aarch64__
23542710 return vminnmq_f32(x, y);
23552711#elif defined __arm__ && __FINITE_MATH_ONLY__
23562712 return vminq_f32(x, y);
......@@ -2390,7 +2746,7 @@ static SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y) {
23902746 return _mm_min_pd(x, y);
23912747#elif defined __SSE2__
23922748 return simd_bitselect(_mm_min_pd(x, y), x, y != y);
2393#elif defined __arm64__
2749#elif defined __arm64__ || defined __aarch64__
23942750 return vminnmq_f64(x, y);
23952751#else
23962752 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) {
24252781#endif
24262782}
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
24282816static SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y) {
24292817#if defined __SSE2__
24302818 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__
24322820 return vmaxnm_f32(x, y);
24332821#elif defined __arm__ && __FINITE_MATH_ONLY__
24342822 return vmax_f32(x, y);
......@@ -2448,7 +2836,7 @@ static SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y) {
24482836 return _mm_max_ps(x, y);
24492837#elif defined __SSE2__
24502838 return simd_bitselect(_mm_max_ps(x, y), x, y != y);
2451#elif defined __arm64__
2839#elif defined __arm64__ || defined __aarch64__
24522840 return vmaxnmq_f32(x, y);
24532841#elif defined __arm__ && __FINITE_MATH_ONLY__
24542842 return vmaxq_f32(x, y);
......@@ -2488,7 +2876,7 @@ static SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y) {
24882876 return _mm_max_pd(x, y);
24892877#elif defined __SSE2__
24902878 return simd_bitselect(_mm_max_pd(x, y), x, y != y);
2491#elif defined __arm64__
2879#elif defined __arm64__ || defined __aarch64__
24922880 return vmaxnmq_f64(x, y);
24932881#else
24942882 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) {
25242912}
25252913
25262914#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); }
25272921static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); }
25282922static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); }
25292923static 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
25352929static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y) { return simd_bitselect(y, x, 0x7fffffffffffffff); }
25362930
25372931#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
25382972static SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x) {
25392973#if defined __SSE2__
25402974 return simd_make_float2(__tg_sqrt(simd_make_float4_undef(x)));
2541#elif defined __arm64__
2975#elif defined __arm64__ || defined __aarch64__
25422976 return vsqrt_f32(x);
25432977#else
25442978 return simd_make_float2(sqrt(x.x), sqrt(x.y));
......@@ -2552,7 +2986,7 @@ static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) {
25522986static SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x) {
25532987#if defined __SSE2__
25542988 return _mm_sqrt_ps(x);
2555#elif defined __arm64__
2989#elif defined __arm64__ || defined __aarch64__
25562990 return vsqrtq_f32(x);
25572991#else
25582992 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) {
25783012static SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x) {
25793013#if defined __SSE2__
25803014 return _mm_sqrt_pd(x);
2581#elif defined __arm64__
3015#elif defined __arm64__ || defined __aarch64__
25823016 return vsqrtq_f64(x);
25833017#else
25843018 return simd_make_double2(sqrt(x.x), sqrt(x.y));
......@@ -2606,8 +3040,145 @@ static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) {
26063040}
26073041
26083042#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
26093180static SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x) {
2610#if defined __arm64__
3181#if defined __arm64__ || defined __aarch64__
26113182 return vrndp_f32(x);
26123183#else
26133184 return simd_make_float2(__tg_ceil(simd_make_float4_undef(x)));
......@@ -2625,7 +3196,7 @@ extern simd_float4 _simd_ceil_f4(simd_float4 x);
26253196static SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x) {
26263197#if defined __SSE4_1__
26273198 return _mm_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2628#elif defined __arm64__
3199#elif defined __arm64__ || defined __aarch64__
26293200 return vrndpq_f32(x);
26303201#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
26313202 return _simd_ceil_f4(x);
......@@ -2659,7 +3230,7 @@ extern simd_double2 _simd_ceil_d2(simd_double2 x);
26593230static SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x) {
26603231#if defined __SSE4_1__
26613232 return _mm_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2662#elif defined __arm64__
3233#elif defined __arm64__ || defined __aarch64__
26633234 return vrndpq_f64(x);
26643235#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
26653236 return _simd_ceil_d2(x);
......@@ -2691,7 +3262,7 @@ static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) {
26913262}
26923263
26933264static SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x) {
2694#if defined __arm64__
3265#if defined __arm64__ || defined __aarch64__
26953266 return vrndm_f32(x);
26963267#else
26973268 return simd_make_float2(__tg_floor(simd_make_float4_undef(x)));
......@@ -2709,7 +3280,7 @@ extern simd_float4 _simd_floor_f4(simd_float4 x);
27093280static SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x) {
27103281#if defined __SSE4_1__
27113282 return _mm_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2712#elif defined __arm64__
3283#elif defined __arm64__ || defined __aarch64__
27133284 return vrndmq_f32(x);
27143285#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
27153286 return _simd_floor_f4(x);
......@@ -2743,7 +3314,7 @@ extern simd_double2 _simd_floor_d2(simd_double2 x);
27433314static SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x) {
27443315#if defined __SSE4_1__
27453316 return _mm_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2746#elif defined __arm64__
3317#elif defined __arm64__ || defined __aarch64__
27473318 return vrndmq_f64(x);
27483319#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
27493320 return _simd_floor_d2(x);
......@@ -2775,7 +3346,7 @@ static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) {
27753346}
27763347
27773348static SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x) {
2778#if defined __arm64__
3349#if defined __arm64__ || defined __aarch64__
27793350 return vrndx_f32(x);
27803351#else
27813352 return simd_make_float2(__tg_rint(simd_make_float4_undef(x)));
......@@ -2793,7 +3364,7 @@ extern simd_float4 _simd_rint_f4(simd_float4 x);
27933364static SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x) {
27943365#if defined __SSE4_1__
27953366 return _mm_round_ps(x, _MM_FROUND_RINT);
2796#elif defined __arm64__
3367#elif defined __arm64__ || defined __aarch64__
27973368 return vrndxq_f32(x);
27983369#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
27993370 return _simd_rint_f4(x);
......@@ -2827,7 +3398,7 @@ extern simd_double2 _simd_rint_d2(simd_double2 x);
28273398static SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x) {
28283399#if defined __SSE4_1__
28293400 return _mm_round_pd(x, _MM_FROUND_RINT);
2830#elif defined __arm64__
3401#elif defined __arm64__ || defined __aarch64__
28313402 return vrndxq_f64(x);
28323403#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
28333404 return _simd_rint_d2(x);
......@@ -2859,7 +3430,7 @@ static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) {
28593430}
28603431
28613432static SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x) {
2862#if defined __arm64__
3433#if defined __arm64__ || defined __aarch64__
28633434 return vrnd_f32(x);
28643435#else
28653436 return simd_make_float2(__tg_trunc(simd_make_float4_undef(x)));
......@@ -2877,7 +3448,7 @@ extern simd_float4 _simd_trunc_f4(simd_float4 x);
28773448static SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x) {
28783449#if defined __SSE4_1__
28793450 return _mm_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2880#elif defined __arm64__
3451#elif defined __arm64__ || defined __aarch64__
28813452 return vrndq_f32(x);
28823453#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
28833454 return _simd_trunc_f4(x);
......@@ -2912,7 +3483,7 @@ extern simd_double2 _simd_trunc_d2(simd_double2 x);
29123483static SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x) {
29133484#if defined __SSE4_1__
29143485 return _mm_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2915#elif defined __arm64__
3486#elif defined __arm64__ || defined __aarch64__
29163487 return vrndq_f64(x);
29173488#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
29183489 return _simd_trunc_d2(x);
......@@ -5117,7 +5688,7 @@ static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x) {
51175688#if SIMD_LIBRARY_VERSION >= 3
51185689extern simd_float4 _simd_round_f4(simd_float4 x);
51195690static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {
5120#if defined __arm64__
5691#if defined __arm64__ || defined __aarch64__
51215692 return vrndaq_f32(x);
51225693#else
51235694 return _simd_round_f4(x);
......@@ -5154,7 +5725,7 @@ static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
51545725#if SIMD_LIBRARY_VERSION >= 3
51555726extern simd_double2 _simd_round_d2(simd_double2 x);
51565727static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {
5157#if defined __arm64__
5728#if defined __arm64__ || defined __aarch64__
51585729 return vrndaq_f64(x);
51595730#else
51605731 return _simd_round_d2(x);
......@@ -5868,7 +6439,7 @@ static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y)
58686439static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); }
58696440
58706441static 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__
58726443 return vfma_f32(z, x, y);
58736444#else
58746445 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
58836454extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z);
58846455#endif
58856456static 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__
58876458 return vfmaq_f32(z, x, y);
58886459#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
58896460 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
59146485extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z);
59156486#endif
59166487static 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__
59186489 return vfmaq_f64(z, x, y);
59196490#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
59206491 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
59456516#endif
59466517}
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}
59486547static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) {
59496548#pragma STDC FP_CONTRACT ON
59506549 return x*y + z;
lib/libc/include/any-macos-any/simd/matrix.h+894-19
......@@ -93,6 +93,9 @@
9393 extern "C" {
9494#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));
9699extern const simd_float2x2 matrix_identity_float2x2 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
97100extern const simd_float3x3 matrix_identity_float3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
98101extern 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
100103extern const simd_double3x3 matrix_identity_double3x3 __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
101104extern 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);
103109static simd_float2x2 SIMD_CFUNC simd_diagonal_matrix(simd_float2 __x);
104110static simd_float3x3 SIMD_CFUNC simd_diagonal_matrix(simd_float3 __x);
105111static 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);
108114static simd_double4x4 SIMD_CFUNC simd_diagonal_matrix(simd_double4 __x);
109115#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);
111126static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1);
112127static simd_float3x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1, simd_float2 col2);
113128static 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
128143static simd_double4x4 SIMD_CFUNC simd_matrix(simd_double4 col0, simd_double4 col1, simd_double4 col2, simd_double4 col3);
129144#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);
131155static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1);
132156static simd_float2x3 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1, simd_float2 row2);
133157static 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
148172static simd_double4x4 SIMD_CFUNC simd_matrix_from_rows(simd_double4 row0, simd_double4 row1, simd_double4 row2, simd_double4 row3);
149173#define matrix_from_rows simd_matrix_from_rows
150174
175static simd_half3x3 SIMD_NOINLINE simd_matrix3x3(simd_quath q);
176static simd_half4x4 SIMD_NOINLINE simd_matrix4x4(simd_quath q);
151177static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);
152178static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);
153179static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);
154180static 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);
156191static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x);
157192static simd_float3x2 SIMD_CFUNC simd_mul(float __a, simd_float3x2 __x);
158193static 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);
172207static simd_double3x4 SIMD_CFUNC simd_mul(double __a, simd_double3x4 __x);
173208static 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);
175219static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y);
176220static simd_float3x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float3x2 __x, float __b, simd_float3x2 __y);
177221static 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
192236static simd_double4x4 SIMD_CFUNC simd_linear_combination(double __a, simd_double4x4 __x, double __b, simd_double4x4 __y);
193237#define matrix_linear_combination simd_linear_combination
194238
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);
195248static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y);
196249static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y);
197250static 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
212265static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y);
213266#define matrix_add simd_add
214267
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);
215277static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y);
216278static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y);
217279static 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
232294static simd_double4x4 SIMD_CFUNC simd_sub(simd_double4x4 __x, simd_double4x4 __y);
233295#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);
235306static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x);
236307static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x);
237308static simd_float2x4 SIMD_CFUNC simd_transpose(simd_float4x2 __x);
......@@ -252,6 +323,9 @@ static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x);
252323static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x);
253324#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);
255329static float SIMD_CFUNC simd_trace(simd_float2x2 __x);
256330static float SIMD_CFUNC simd_trace(simd_float3x3 __x);
257331static float SIMD_CFUNC simd_trace(simd_float4x4 __x);
......@@ -260,6 +334,9 @@ static double SIMD_CFUNC simd_trace(simd_double3x3 __x);
260334static double SIMD_CFUNC simd_trace(simd_double4x4 __x);
261335#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);
263340static float SIMD_CFUNC simd_determinant(simd_float2x2 __x);
264341static float SIMD_CFUNC simd_determinant(simd_float3x3 __x);
265342static float SIMD_CFUNC simd_determinant(simd_float4x4 __x);
......@@ -268,6 +345,9 @@ static double SIMD_CFUNC simd_determinant(simd_double3x3 __x);
268345static double SIMD_CFUNC simd_determinant(simd_double4x4 __x);
269346#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));
271351static simd_float2x2 SIMD_CFUNC simd_inverse(simd_float2x2 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
272352static simd_float3x3 SIMD_CFUNC simd_inverse(simd_float3x3 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
273353static 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
276356static simd_double4x4 SIMD_CFUNC simd_inverse(simd_double4x4 __x) __API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
277357#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);
279368static simd_float2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2 __y);
280369static simd_float2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3 __y);
281370static 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);
294383static simd_double4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2 __y);
295384static simd_double4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3 __y);
296385static 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);
297395static simd_float2 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float2x2 __y);
298396static simd_float3 SIMD_CFUNC simd_mul(simd_float2 __x, simd_float3x2 __y);
299397static 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);
312410static simd_double2 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double2x4 __y);
313411static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y);
314412static 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);
315422static simd_float2x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float2x2 __y);
316423static simd_float3x2 SIMD_CFUNC simd_mul(simd_float2x2 __x, simd_float3x2 __y);
317424static 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
330437static simd_double2x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double2x2 __y);
331438static simd_double3x4 SIMD_CFUNC simd_mul(simd_double2x4 __x, simd_double3x2 __y);
332439static 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);
333449static simd_float2x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float2x3 __y);
334450static simd_float3x2 SIMD_CFUNC simd_mul(simd_float3x2 __x, simd_float3x3 __y);
335451static 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
348464static simd_double2x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double2x3 __y);
349465static simd_double3x4 SIMD_CFUNC simd_mul(simd_double3x4 __x, simd_double3x3 __y);
350466static 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);
351476static simd_float2x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float2x4 __y);
352477static simd_float3x2 SIMD_CFUNC simd_mul(simd_float4x2 __x, simd_float3x4 __y);
353478static 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
367492static simd_double3x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double3x4 __y);
368493static simd_double4x4 SIMD_CFUNC simd_mul(simd_double4x4 __x, simd_double4x4 __y);
369494
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);
370504static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y);
371505static simd_bool SIMD_CFUNC simd_equal(simd_float2x3 __x, simd_float2x3 __y);
372506static 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);
387521static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y);
388522#define matrix_equal simd_equal
389523
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);
390533static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol);
391534static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x3 __x, simd_float2x3 __y, float __tol);
392535static 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_
407550static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_double4x4 __x, simd_double4x4 __y, double __tol);
408551#define matrix_almost_equal_elements simd_almost_equal_elements
409552
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);
410562static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol);
411563static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x3 __x, simd_float2x3 __y, float __tol);
412564static 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 _
431583} /* extern "C" */
432584
433585namespace 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
434778 static SIMD_CPPFUNC float2x2 operator+(const float2x2 x, const float2x2 y) { return float2x2(::simd_linear_combination(1, x, 1, y)); }
435779 static SIMD_CPPFUNC float2x3 operator+(const float2x3 x, const float2x3 y) { return float2x3(::simd_linear_combination(1, x, 1, y)); }
436780 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" {
8211165
8221166#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; }
8241169static 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; }
8251170static 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; }
8261172static 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; }
8271173static 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; }
8281175static 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; }
8291176static 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; }
8311181static simd_float2x2 SIMD_CFUNC simd_matrix(simd_float2 col0, simd_float2 col1) { simd_float2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
8321182static simd_float2x3 SIMD_CFUNC simd_matrix(simd_float3 col0, simd_float3 col1) { simd_float2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
8331183static simd_float2x4 SIMD_CFUNC simd_matrix(simd_float4 col0, simd_float4 col1) { simd_float2x4 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
8341184static simd_double2x2 SIMD_CFUNC simd_matrix(simd_double2 col0, simd_double2 col1) { simd_double2x2 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
8351185static simd_double2x3 SIMD_CFUNC simd_matrix(simd_double3 col0, simd_double3 col1) { simd_double2x3 __r = { .columns[0] = col0, .columns[1] = col1 }; return __r; }
8361186static 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; }
8371190static 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; }
8381191static 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; }
8391192static 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; }
8401193static 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; }
8411194static 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; }
8421195static 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; }
8431199static 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; }
8441200static 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; }
8451201static 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
8471203static 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; }
8481204static 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)); }
8501209static simd_float2x2 SIMD_CFUNC simd_matrix_from_rows(simd_float2 row0, simd_float2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
8511210static simd_float3x2 SIMD_CFUNC simd_matrix_from_rows(simd_float3 row0, simd_float3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
8521211static simd_float4x2 SIMD_CFUNC simd_matrix_from_rows(simd_float4 row0, simd_float4 row1) { return simd_transpose(simd_matrix(row0, row1)); }
8531212static simd_double2x2 SIMD_CFUNC simd_matrix_from_rows(simd_double2 row0, simd_double2 row1) { return simd_transpose(simd_matrix(row0, row1)); }
8541213static simd_double3x2 SIMD_CFUNC simd_matrix_from_rows(simd_double3 row0, simd_double3 row1) { return simd_transpose(simd_matrix(row0, row1)); }
8551214static 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)); }
8561218static 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)); }
8571219static 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)); }
8581220static 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)); }
8591221static 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)); }
8601222static 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)); }
8611223static 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)); }
8621227static 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)); }
8631228static 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)); }
8641229static 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
8661231static 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)); }
8671232static 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)); }
8681233
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
8691256static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q) {
8701257 simd_float4x4 r = simd_matrix4x4(q);
8711258 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) {
9101297 return r;
9111298}
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; }
9131309static simd_float2x2 SIMD_CFUNC matrix_scale(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
9141310static 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; }
9151311static 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) {
9291325static 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; }
9301326static 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; }
9311327
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; }
9321337static simd_float2x2 SIMD_CFUNC simd_mul(float __a, simd_float2x2 __x) { __x.columns[0] *= __a; __x.columns[1] *= __a; return __x; }
9331338static 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; }
9341339static 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.
9481353static 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; }
9491354static 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}
9511410static simd_float2x2 SIMD_CFUNC simd_linear_combination(float __a, simd_float2x2 __x, float __b, simd_float2x2 __y) {
9521411 __x.columns[0] = __a*__x.columns[0] + __b*__y.columns[0];
9531412 __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
10571516 return __x;
10581517}
10591518
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); }
10601528static simd_float2x2 SIMD_CFUNC simd_add(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
10611529static simd_float3x2 SIMD_CFUNC simd_add(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, 1, __y); }
10621530static 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
10761544static simd_double3x4 SIMD_CFUNC simd_add(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
10771545static simd_double4x4 SIMD_CFUNC simd_add(simd_double4x4 __x, simd_double4x4 __y) { return simd_linear_combination(1, __x, 1, __y); }
10781546
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); }
10791556static simd_float2x2 SIMD_CFUNC simd_sub(simd_float2x2 __x, simd_float2x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
10801557static simd_float3x2 SIMD_CFUNC simd_sub(simd_float3x2 __x, simd_float3x2 __y) { return simd_linear_combination(1, __x, -1, __y); }
10811558static 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
10951572static simd_double3x4 SIMD_CFUNC simd_sub(simd_double3x4 __x, simd_double3x4 __y) { return simd_linear_combination(1, __x, -1, __y); }
10961573static 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
10981727static simd_float2x2 SIMD_CFUNC simd_transpose(simd_float2x2 __x) {
10991728 simd_float4 __x0, __x1;
11001729 __x0.xy = __x.columns[0];
11011730 __x1.xy = __x.columns[1];
11021731#if defined __SSE__
11031732 simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1);
1104#elif defined __ARM_NEON__
1733#elif defined __ARM_NEON__ && defined __arm64__
11051734 simd_float4 __r01 = vzip1q_f32(__x0, __x1);
11061735#else
11071736 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) {
11161745#if defined __SSE__
11171746 simd_float4 __r01 = _mm_unpacklo_ps(__x0, __x1);
11181747 simd_float4 __r2x = _mm_unpackhi_ps(__x0, __x1);
1119#elif defined __ARM_NEON__
1748#elif defined __ARM_NEON__ && defined __arm64__
11201749 simd_float4 __r01 = vzip1q_f32(__x0, __x1);
11211750 simd_float4 __r2x = vzip2q_f32(__x0, __x1);
11221751#else
......@@ -1130,7 +1759,7 @@ static simd_float4x2 SIMD_CFUNC simd_transpose(simd_float2x4 __x) {
11301759#if defined __SSE__
11311760 simd_float4 __r01 = _mm_unpacklo_ps(__x.columns[0], __x.columns[1]);
11321761 simd_float4 __r23 = _mm_unpackhi_ps(__x.columns[0], __x.columns[1]);
1133#elif defined __ARM_NEON__
1762#elif defined __ARM_NEON__ && defined __arm64__
11341763 simd_float4 __r01 = vzip1q_f32(__x.columns[0], __x.columns[1]);
11351764 simd_float4 __r23 = vzip2q_f32(__x.columns[0], __x.columns[1]);
11361765#else
......@@ -1149,7 +1778,7 @@ static simd_float2x3 SIMD_CFUNC simd_transpose(simd_float3x2 __x) {
11491778 simd_float4 __t = _mm_unpacklo_ps(__x0, __x1);
11501779 simd_float4 __r0 = _mm_shuffle_ps(__t,__x2,0xc4);
11511780 simd_float4 __r1 = _mm_shuffle_ps(__t,__x2,0xde);
1152#elif defined __ARM_NEON__
1781#elif defined __ARM_NEON__ && defined __arm64__
11531782 simd_float4 padding = { 0 };
11541783 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
11551784 simd_float4 __t1 = vzip1q_f32(__x1,padding);
......@@ -1173,7 +1802,7 @@ static simd_float3x3 SIMD_CFUNC simd_transpose(simd_float3x3 __x) {
11731802 simd_float4 __r0 = __t0; __r0.hi = __x2.lo;
11741803 simd_float4 __r1 = _mm_shuffle_ps(__t0, __x2, 0xde);
11751804 simd_float4 __r2 = __x2; __r2.lo = __t1.lo;
1176#elif defined __ARM_NEON__
1805#elif defined __ARM_NEON__ && defined __arm64__
11771806 simd_float4 padding = { 0 };
11781807 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
11791808 simd_float4 __t1 = vzip2q_f32(__x0,__x2);
......@@ -1198,7 +1827,7 @@ static simd_float4x3 SIMD_CFUNC simd_transpose(simd_float3x4 __x) {
11981827 simd_float4 __r1 = _mm_shuffle_ps(__t0, __x.columns[2], 0xde);
11991828 simd_float4 __r2 = __x.columns[2]; __r2.lo = __t1.lo;
12001829 simd_float4 __r3 = _mm_shuffle_ps(__t1, __x.columns[2], 0xfe);
1201#elif defined __ARM_NEON__
1830#elif defined __ARM_NEON__ && defined __arm64__
12021831 simd_float4 padding = { 0 };
12031832 simd_float4 __t0 = vzip1q_f32(__x.columns[0],__x.columns[2]);
12041833 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) {
12281857 simd_float4 __t1 = _mm_unpacklo_ps(__x1,__x3);
12291858 simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t1);
12301859 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t1);
1231#elif defined __ARM_NEON__
1860#elif defined __ARM_NEON__ && defined __arm64__
12321861 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
12331862 simd_float4 __t1 = vzip1q_f32(__x1,__x3);
12341863 simd_float4 __r0 = vzip1q_f32(__t0,__t1);
......@@ -1254,7 +1883,7 @@ static simd_float3x4 SIMD_CFUNC simd_transpose(simd_float4x3 __x) {
12541883 simd_float4 __r0 = _mm_unpacklo_ps(__t0,__t2);
12551884 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2);
12561885 simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3);
1257#elif defined __ARM_NEON__
1886#elif defined __ARM_NEON__ && defined __arm64__
12581887 simd_float4 __t0 = vzip1q_f32(__x0,__x2);
12591888 simd_float4 __t1 = vzip2q_f32(__x0,__x2);
12601889 simd_float4 __t2 = vzip1q_f32(__x1,__x3);
......@@ -1280,7 +1909,7 @@ static simd_float4x4 SIMD_CFUNC simd_transpose(simd_float4x4 __x) {
12801909 simd_float4 __r1 = _mm_unpackhi_ps(__t0,__t2);
12811910 simd_float4 __r2 = _mm_unpacklo_ps(__t1,__t3);
12821911 simd_float4 __r3 = _mm_unpackhi_ps(__t1,__t3);
1283#elif defined __ARM_NEON__
1912#elif defined __ARM_NEON__ && defined __arm64__
12841913 simd_float4 __t0 = vzip1q_f32(__x.columns[0],__x.columns[2]);
12851914 simd_float4 __t1 = vzip2q_f32(__x.columns[0],__x.columns[2]);
12861915 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) {
13021931 simd_double2 __x0, __x1;
13031932 __x0 = __x.columns[0];
13041933 __x1 = __x.columns[1];
1305#if defined __ARM_NEON__
1934#if defined __ARM_NEON__ && defined __arm64__
13061935 simd_double2 __r0 = vzip1q_f64(__x0, __x1);
13071936 simd_double2 __r1 = vzip2q_f64(__x0, __x1);
13081937#else
......@@ -1316,7 +1945,7 @@ static simd_double3x2 SIMD_CFUNC simd_transpose(simd_double2x3 __x) {
13161945 simd_double4 __x0, __x1;
13171946 __x0.xyz = __x.columns[0];
13181947 __x1.xyz = __x.columns[1];
1319#if defined __ARM_NEON__
1948#if defined __ARM_NEON__ && defined __arm64__
13201949 simd_double2 __r0 = vzip1q_f64(__x0.lo,__x1.lo);
13211950 simd_double2 __r1 = vzip2q_f64(__x0.lo,__x1.lo);
13221951 simd_double2 __r2 = vzip1q_f64(__x0.hi,__x1.hi);
......@@ -1332,7 +1961,7 @@ static simd_double4x2 SIMD_CFUNC simd_transpose(simd_double2x4 __x) {
13321961 simd_double4 __x0, __x1;
13331962 __x0 = __x.columns[0];
13341963 __x1 = __x.columns[1];
1335#if defined __ARM_NEON__
1964#if defined __ARM_NEON__ && defined __arm64__
13361965 simd_double2 __r0 = vzip1q_f64(__x0.lo,__x1.lo);
13371966 simd_double2 __r1 = vzip2q_f64(__x0.lo,__x1.lo);
13381967 simd_double2 __r2 = vzip1q_f64(__x0.hi,__x1.hi);
......@@ -1351,7 +1980,7 @@ static simd_double2x3 SIMD_CFUNC simd_transpose(simd_double3x2 __x) {
13511980 __x0 = __x.columns[0];
13521981 __x1 = __x.columns[1];
13531982 __x2 = __x.columns[2];
1354#if defined __ARM_NEON__
1983#if defined __ARM_NEON__ && defined __arm64__
13551984 simd_double2 padding = { 0 };
13561985 simd_double4 __r0,__r1;
13571986 __r0.lo = vzip1q_f64(__x0,__x1);
......@@ -1370,7 +1999,7 @@ static simd_double3x3 SIMD_CFUNC simd_transpose(simd_double3x3 __x) {
13701999 __x0.xyz = __x.columns[0];
13712000 __x1.xyz = __x.columns[1];
13722001 __x2.xyz = __x.columns[2];
1373#if defined __ARM_NEON__
2002#if defined __ARM_NEON__ && defined __arm64__
13742003 simd_double2 padding = { 0 };
13752004 simd_double4 __r0,__r1,__r2;
13762005 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
......@@ -1392,7 +2021,7 @@ static simd_double4x3 SIMD_CFUNC simd_transpose(simd_double3x4 __x) {
13922021 __x0 = __x.columns[0];
13932022 __x1 = __x.columns[1];
13942023 __x2 = __x.columns[2];
1395#if defined __ARM_NEON__
2024#if defined __ARM_NEON__ && defined __arm64__
13962025 simd_double2 padding = { 0 };
13972026 simd_double4 __r0,__r1,__r2,__r3;
13982027 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
......@@ -1418,7 +2047,7 @@ static simd_double2x4 SIMD_CFUNC simd_transpose(simd_double4x2 __x) {
14182047 __x1 = __x.columns[1];
14192048 __x2 = __x.columns[2];
14202049 __x3 = __x.columns[3];
1421#if defined __ARM_NEON__
2050#if defined __ARM_NEON__ && defined __arm64__
14222051 simd_double4 __r0,__r1;
14232052 __r0.lo = vzip1q_f64(__x0,__x1);
14242053 __r1.lo = vzip2q_f64(__x0,__x1);
......@@ -1437,7 +2066,7 @@ static simd_double3x4 SIMD_CFUNC simd_transpose(simd_double4x3 __x) {
14372066 __x1.xyz = __x.columns[1];
14382067 __x2.xyz = __x.columns[2];
14392068 __x3.xyz = __x.columns[3];
1440#if defined __ARM_NEON__
2069#if defined __ARM_NEON__ && defined __arm64__
14412070 simd_double4 __r0,__r1,__r2;
14422071 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
14432072 __r1.lo = vzip2q_f64(__x0.lo,__x1.lo);
......@@ -1459,7 +2088,7 @@ static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) {
14592088 __x1 = __x.columns[1];
14602089 __x2 = __x.columns[2];
14612090 __x3 = __x.columns[3];
1462#if defined __ARM_NEON__
2091#if defined __ARM_NEON__ && defined __arm64__
14632092 simd_double4 __r0,__r1,__r2,__r3;
14642093 __r0.lo = vzip1q_f64(__x0.lo,__x1.lo);
14652094 __r1.lo = vzip2q_f64(__x0.lo,__x1.lo);
......@@ -1478,6 +2107,11 @@ static simd_double4x4 SIMD_CFUNC simd_transpose(simd_double4x4 __x) {
14782107 return simd_matrix(__r0,__r1,__r2,__r3);
14792108}
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); }
14812115static simd_float3 SIMD_CFUNC __rotate1( simd_float3 __x) { return __builtin_shufflevector(__x,__x,1,2,0); }
14822116static simd_float3 SIMD_CFUNC __rotate2( simd_float3 __x) { return __builtin_shufflevector(__x,__x,2,0,1); }
14832117static 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
14892123static simd_double4 SIMD_CFUNC __rotate2(simd_double4 __x) { return __builtin_shufflevector(__x,__x,2,3,0,1); }
14902124static 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]; }
14922127static float SIMD_CFUNC simd_trace( simd_float2x2 __x) { return __x.columns[0][0] + __x.columns[1][1]; }
14932128static 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]; }
14942130static float SIMD_CFUNC simd_trace( simd_float3x3 __x) { return __x.columns[0][0] + __x.columns[1][1] + __x.columns[2][2]; }
14952131static 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]; }
14962133static 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]; }
14972134static 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]; }
14992137static 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]; }
15002138static 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]))); }
15012140static 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]))); }
15022141static 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}
15032148static float SIMD_CFUNC simd_determinant( simd_float4x4 __x) {
15042149 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])) +
15052150 __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) {
15132158 return simd_reduce_add(codet.even - codet.odd);
15142159}
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 */
15162166static simd_float2x2 SIMD_CFUNC simd_inverse( simd_float2x2 __x) { return __invert_f2(__x); }
15172167static simd_float3x3 SIMD_CFUNC simd_inverse( simd_float3x3 __x) { return __invert_f3(__x); }
15182168static 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
15202170static simd_double3x3 SIMD_CFUNC simd_inverse(simd_double3x3 __x) { return __invert_d3(__x); }
15212171static 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; }
15232182static 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; }
15242183static 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; }
15252184static 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) {
15392198static 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; }
15402199static 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); }
15422210static simd_float2 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float2x2 __y) { return simd_mul(simd_transpose(__y), __x); }
15432211static simd_float3 SIMD_CFUNC simd_mul( simd_float2 __x, simd_float3x2 __y) { return simd_mul(simd_transpose(__y), __x); }
15442212static 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) {
15582226static simd_double3 SIMD_CFUNC simd_mul(simd_double4 __x, simd_double3x4 __y) { return simd_mul(simd_transpose(__y), __x); }
15592227static 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; }
15612230static 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; }
15622231static 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; }
15632233static 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; }
15642234static 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; }
15652236static 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; }
15662237static 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; }
15672239static 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; }
15682240static 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; }
15692242static 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; }
15702243static 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; }
15712245static 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; }
15722246static 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; }
15732248static 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; }
15742249static 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; }
15752251static 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; }
15762252static 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; }
15772254static 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; }
15782255static 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; }
15802258static 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; }
15812259static 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; }
15822261static 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; }
15832262static 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; }
15842264static 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; }
15852265static 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; }
15862267static 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; }
15872268static 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; }
15882270static 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; }
15892271static 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; }
15902273static 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; }
15912274static 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; }
15922276static 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; }
15932277static 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; }
15942279static 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; }
15952280static 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; }
15962282static 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; }
15972283static 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; }
15992286static 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; }
16002287static 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; }
16012289static 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; }
16022290static 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; }
16032292static 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; }
16042293static 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; }
16052295static 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; }
16062296static 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; }
16072298static 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; }
16082299static 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; }
16092301static 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; }
16102302static 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; }
16112304static 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; }
16122305static 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; }
16132307static 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; }
16142308static 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; }
16152310static 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; }
16162311static 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; }
16172312
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); }
16182322static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2 __y) { return simd_mul(__x, __y); }
16192323static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2 __y) { return simd_mul(__x, __y); }
16202324static 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
16342338static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4x3 __x, simd_double4 __y) { return simd_mul(__x, __y); }
16352339static simd_double4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double4 __y) { return simd_mul(__x, __y); }
16362340
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); }
16372350static simd_float2 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
16382351static simd_float3 SIMD_CFUNC matrix_multiply( simd_float2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
16392352static 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
16522365static simd_double2 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
16532366static simd_double3 SIMD_CFUNC matrix_multiply(simd_double4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
16542367static 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); }
16562370static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
16572371static 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); }
16582373static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
16592374static 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); }
16602376static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float2x2 __y) { return simd_mul(__x, __y); }
16612377static 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); }
16622379static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
16632380static 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); }
16642382static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
16652383static 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); }
16662385static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float2x3 __y) { return simd_mul(__x, __y); }
16672386static 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); }
16682388static simd_float2x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
16692389static 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); }
16702391static simd_float2x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
16712392static 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); }
16722394static simd_float2x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float2x4 __y) { return simd_mul(__x, __y); }
16732395static simd_double2x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double2x4 __y) { return simd_mul(__x, __y); }
16742396
2397static simd_half3x2 SIMD_CFUNC matrix_multiply( simd_half2x2 __x, simd_half3x2 __y) { return simd_mul(__x, __y); }
16752398static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
16762399static 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); }
16772401static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
16782402static 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); }
16792404static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float3x2 __y) { return simd_mul(__x, __y); }
16802405static 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); }
16812407static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
16822408static 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); }
16832410static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
16842411static 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); }
16852413static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float3x3 __y) { return simd_mul(__x, __y); }
16862414static 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); }
16872416static simd_float3x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
16882417static 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); }
16892419static simd_float3x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
16902420static 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); }
16912422static simd_float3x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float3x4 __y) { return simd_mul(__x, __y); }
16922423static simd_double3x4 SIMD_CFUNC matrix_multiply(simd_double4x4 __x, simd_double3x4 __y) { return simd_mul(__x, __y); }
16932424
2425static simd_half4x2 SIMD_CFUNC matrix_multiply( simd_half2x2 __x, simd_half4x2 __y) { return simd_mul(__x, __y); }
16942426static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float2x2 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
16952427static 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); }
16962429static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float2x3 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
16972430static 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); }
16982432static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float2x4 __x, simd_float4x2 __y) { return simd_mul(__x, __y); }
16992433static 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); }
17002435static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float3x2 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
17012436static 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); }
17022438static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float3x3 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
17032439static 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); }
17042441static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float3x4 __x, simd_float4x3 __y) { return simd_mul(__x, __y); }
17052442static 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); }
17062444static simd_float4x2 SIMD_CFUNC matrix_multiply( simd_float4x2 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
17072445static 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); }
17082447static simd_float4x3 SIMD_CFUNC matrix_multiply( simd_float4x3 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
17092448static 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); }
17102450static simd_float4x4 SIMD_CFUNC matrix_multiply( simd_float4x4 __x, simd_float4x4 __y) { return simd_mul(__x, __y); }
17112451static 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}
17132498static simd_bool SIMD_CFUNC simd_equal(simd_float2x2 __x, simd_float2x2 __y) {
17142499 return simd_all((__x.columns[0] == __y.columns[0]) &
17152500 (__x.columns[1] == __y.columns[1]));
......@@ -1801,6 +2586,51 @@ static simd_bool SIMD_CFUNC simd_equal(simd_double4x4 __x, simd_double4x4 __y) {
18012586 (__x.columns[3] == __y.columns[3]));
18022587}
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}
18042634static simd_bool SIMD_CFUNC simd_almost_equal_elements(simd_float2x2 __x, simd_float2x2 __y, float __tol) {
18052635 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol) &
18062636 (__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_
18922722 (__tg_fabs(__x.columns[3] - __y.columns[3]) <= __tol));
18932723}
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}
18952770static simd_bool SIMD_CFUNC simd_almost_equal_elements_relative(simd_float2x2 __x, simd_float2x2 __y, float __tol) {
18962771 return simd_all((__tg_fabs(__x.columns[0] - __y.columns[0]) <= __tol*__tg_fabs(__x.columns[0])) &
18972772 (__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 @@
3434#if SIMD_COMPILER_HAS_REQUIRED_FEATURES
3535
3636/* 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
3749typedef simd_float2x2 matrix_float2x2;
3850typedef simd_float3x2 matrix_float3x2;
3951typedef simd_float4x2 matrix_float4x2;
......@@ -60,6 +72,8 @@ typedef simd_double4x4 matrix_double4x4;
6072
6173#ifdef __cplusplus
6274#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);
6377static simd_float3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatf q);
6478static simd_float4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatf q);
6579static simd_double3x3 SIMD_NOINLINE simd_matrix3x3(simd_quatd q);
......@@ -68,6 +82,117 @@ static simd_double4x4 SIMD_NOINLINE simd_matrix4x4(simd_quatd q);
6882
6983namespace simd {
7084
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
71196 struct float2x2 : ::simd_float2x2 {
72197 SIMD_CONSTEXPR float2x2() SIMD_NOEXCEPT : ::simd_float2x2((simd_float2x2){0}) { }
73198#if __has_feature(cxx_delegating_constructors)
......@@ -303,6 +428,69 @@ template <typename ScalarType, size_t col, size_t row> struct Matrix {
303428template <typename ScalarType, size_t col, size_t row>
304429using 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
306494template<> struct Matrix<float, 2, 2> {
307495 static const size_t col = 2;
308496 static const size_t row = 2;
......@@ -429,6 +617,51 @@ template<> struct Matrix<double, 4, 4> {
429617 typedef double4x4 type;
430618};
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
432665template <> struct get_traits<float2x2>
433666{
434667 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
208208 * type, so you can use it to load or store from an array of that type. */
209209typedef __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
211251/*! @abstract A vector of two 32-bit signed (twos-complement) integers with
212252 * relaxed alignment.
213253 * @description In C++ and Metal, this type is also available as
......@@ -592,6 +632,46 @@ typedef ::simd_packed_ushort16 ushort16;
592632 * type, so you can use it to load or store from an array of that type. */
593633typedef ::simd_packed_ushort32 ushort32;
594634
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
595675 /*! @abstract A vector of two 32-bit signed (twos-complement) integers
596676 * with relaxed alignment.
597677 * @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 @@
1515extern "C" {
1616#endif
1717
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
18604/* MARK: - C and Objective-C float interfaces */
19605
20606/*! @abstract Constructs a quaternion from four scalar values.
......@@ -368,7 +954,7 @@ static inline SIMD_CFUNC simd_quatf simd_normalize(simd_quatf q) {
368954 return simd_quaternion(q.vector * simd_rsqrt(length_squared));
369955}
370956
371#if defined __arm__ || defined __arm64__
957#if defined __arm__ || defined __arm64__ || defined __aarch64__
372958/*! @abstract Multiplies the vector `v` by the quaternion `q`.
373959 *
374960 * @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) {
384970#endif
385971
386972static 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__
388974 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;
389975#else
390976 #pragma STDC FP_CONTRACT ON
......@@ -394,9 +980,9 @@ static inline SIMD_CFUNC simd_float3 simd_act(simd_quatf q, simd_float3 v) {
394980}
395981
396982static 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;
398984 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));
400986 return _simd_quaternion(imag, real);
401987}
402988
......@@ -405,9 +991,9 @@ static SIMD_NOINLINE simd_quatf __tg_exp(simd_quatf q) {
405991 // the resulting quaternion, which is why we don't simply use the (angle,
406992 // axis) constructor to generate `unit`.
407993 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)));
409995 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));
411997 return simd_mul(exp(simd_real(q)), unit);
412998}
413999
......@@ -954,7 +1540,7 @@ static inline SIMD_CFUNC simd_quatd simd_normalize(simd_quatd q) {
9541540 return simd_quaternion(q.vector * simd_rsqrt(length_squared));
9551541}
9561542
957#if defined __arm__ || defined __arm64__
1543#if defined __arm__ || defined __arm64__ || defined __aarch64__
9581544/*! @abstract Multiplies the vector `v` by the quaternion `q`.
9591545 *
9601546 * @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) {
9701556#endif
9711557
9721558static 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__
9741560 return simd_mul(q, _simd_mul_vq(v, simd_conjugate(q))).vector.xyz;
9751561#else
9761562 #pragma STDC FP_CONTRACT ON
......@@ -980,9 +1566,9 @@ static inline SIMD_CFUNC simd_double3 simd_act(simd_quatd q, simd_double3 v) {
9801566}
9811567
9821568static 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;
9841570 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));
9861572 return _simd_quaternion(imag, real);
9871573}
9881574
......@@ -991,9 +1577,9 @@ static SIMD_NOINLINE simd_quatd __tg_exp(simd_quatd q) {
9911577 // the resulting quaternion, which is why we don't simply use the (angle,
9921578 // axis) constructor to generate `unit`.
9931579 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)));
9951581 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));
9971583 return simd_mul(exp(simd_real(q)), unit);
9981584}
9991585
lib/libc/include/any-macos-any/simd/types.h+30
......@@ -36,6 +36,33 @@
3636 * storage details of matrices, you don't need to worry about this at all.
3737 * 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
3966/*! @abstract A matrix with 2 rows and 2 columns. */
4067typedef struct { simd_float2 columns[2]; } simd_float2x2;
4168
......@@ -118,6 +145,9 @@ typedef struct { simd_double4 columns[4]; } simd_double4x4;
118145 * While the C types are defined here, the operations on quaternions and the
119146 * C++ quaternion types are defined in <simd/quaternion.h> */
120147
148/*! @abstract A half-precision quaternion. */
149typedef struct { simd_half4 vector; } simd_quath;
150
121151/*! @abstract A single-precision quaternion. */
122152typedef struct { simd_float4 vector; } simd_quatf;
123153
lib/libc/include/any-macos-any/simd/vector_make.h+885
......@@ -70,6 +70,7 @@
7070#define SIMD_VECTOR_CONSTRUCTORS
7171
7272#include <simd/vector_types.h>
73#include <stddef.h>
7374#if SIMD_COMPILER_HAS_REQUIRED_FEATURES
7475
7576#ifdef __cplusplus
......@@ -2876,6 +2877,617 @@ static inline SIMD_CFUNC simd_ushort32 simd_make_ushort32(simd_ushort32 other) {
28762877 return other;
28772878}
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
28793491/*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed
28803492 * (twos-complement) integers. */
28813493static 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
59976609 return ::simd_make_ushort32_undef(other);
59986610}
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
60006772/*! @abstract Concatenates `x` and `y` to form a vector of two 32-bit signed
60016773 * (twos-complement) integers. */
60026774static inline SIMD_CPPFUNC int2 make_int2(int x, int y) {
......@@ -7208,6 +7980,95 @@ template <> struct get_traits<ushort32>
72087980 using type = Vector<ushort1, 32>;
72097981};
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
72118072template<> struct Vector<int1, 1> {
72128073 static const size_t count = 1;
72138074 typedef int1 scalar_t;
......@@ -7691,6 +8552,18 @@ static constexpr typeN make(Args... args)
76918552 return make_ushort16(args...);
76928553 else if constexpr (std::is_same<typeN, ushort32>::value)
76938554 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...);
76948567 else if constexpr (std::is_same<typeN, int2>::value)
76958568 return make_int2(args...);
76968569 else if constexpr (std::is_same<typeN, int3>::value)
......@@ -7812,6 +8685,18 @@ static constexpr typeN make_undef(Args... args)
78128685 return make_ushort16_undef(args...);
78138686 else if constexpr (std::is_same<typeN, ushort32>::value)
78148687 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...);
78158700 else if constexpr (std::is_same<typeN, int2>::value)
78168701 return make_int2_undef(args...);
78178702 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
310310 * simd_packed_ushort32 instead. */
311311typedef __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
313362/*! @abstract A scalar 32-bit signed (twos-complement) integer. */
314363typedef int simd_int1;
315364
......@@ -769,6 +818,57 @@ typedef ::simd_ushort16 ushort16;
769818 * them using simd::packed_ushort32 instead. */
770819typedef ::simd_ushort32 ushort32;
771820
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
772872 /*! @abstract A scalar 32-bit signed (twos-complement) integer.
773873 * @discussion In C and Objective-C, this type is available as simd_int1. */
774874typedef ::simd_int1 int1;
lib/libc/include/any-macos-any/stdio.h+1-348
......@@ -1,5 +1,5 @@
11/*
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.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -58,355 +58,8 @@
5858 * @(#)stdio.h 8.5 (Berkeley) 4/29/95
5959 */
6060
61#ifndef _STDIO_H_
62#define _STDIO_H_
63
6461#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
40363#ifdef _USE_EXTENDED_LOCALES_
40464#include <xlocale/_stdio.h>
40565#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 @@
11/*
2 * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved.
2 * Copyright (c) 2000, 2002 - 2008, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -55,328 +55,8 @@
5555 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
5656 */
5757
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#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
58#include <_stdlib.h>
37759
37860#ifdef _USE_EXTENDED_LOCALES_
37961#include <xlocale/_stdlib.h>
38062#endif /* _USE_EXTENDED_LOCALES_ */
381
382#endif /* _STDLIB_H_ */
lib/libc/include/any-macos-any/string.h+2-137
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.
2 * Copyright (c) 2000, 2007, 2010, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -55,143 +55,8 @@
5555 * @(#)string.h 8.1 (Berkeley) 6/2/93
5656 */
5757
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. 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
58#include <_string.h>
18759
18860#ifdef _USE_EXTENDED_LOCALES_
18961#include <xlocale/_string.h>
19062#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 @@
11/*
2 * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.
2 * Copyright (c) 2000, 2007, 2010, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -58,44 +58,11 @@
5858#ifndef _STRINGS_H_
5959#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 */
8363#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
9264#include <string.h>
9365#endif
9466
95#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
96/* Security checking functions. */
97#include <secure/_strings.h>
98#endif
99
10067#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 @@
11/*
2 * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -91,7 +91,7 @@
9191#define _SYS__ENDIAN_H_
9292
9393#include <sys/cdefs.h>
94#include <machine/endian.h>
94#include <machine/_endian.h>
9595
9696/*
9797 * Macros for network/external number representation conversion.
......@@ -118,12 +118,12 @@ __END_DECLS
118118#define ntohll(x) ((__uint64_t)(x))
119119#define htonll(x) ((__uint64_t)(x))
120120
121#define NTOHL(x) (x)
122#define NTOHS(x) (x)
123#define NTOHLL(x) (x)
124#define HTONL(x) (x)
125#define HTONS(x) (x)
126#define HTONLL(x) (x)
121#define NTOHL(x) (x) = (x)
122#define NTOHS(x) (x) = (x)
123#define NTOHLL(x) (x) = (x)
124#define HTONL(x) (x) = (x)
125#define HTONS(x) (x) = (x)
126#define HTONLL(x) (x) = (x)
127127#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
128128
129129#else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */
lib/libc/include/any-macos-any/sys/_symbol_aliasing.h+132
......@@ -413,6 +413,18 @@
413413#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_6(x)
414414#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
416428#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160000
417429#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_0(x) x
418430#else
......@@ -449,12 +461,66 @@
449461#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_5(x)
450462#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
452476#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 170000
453477#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_0(x) x
454478#else
455479#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_17_0(x)
456480#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
458524#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
459525#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
460526#else
......@@ -731,6 +797,18 @@
731797#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_5(x)
732798#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
734812#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130000
735813#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_0(x) x
736814#else
......@@ -767,9 +845,63 @@
767845#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_4(x)
768846#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
770860#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140000
771861#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_0(x) x
772862#else
773863#define __DARWIN_ALIAS_STARTING_MAC___MAC_14_0(x)
774864#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 @@
3232#include <sys/cdefs.h>
3333#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
3545/*
3646 * Type definitions; takes common type definitions that must be used
3747 * in multiple header files due to [XSI], removes them from the system
3848 * space, and puts them in the implementation space.
3949 */
4050
41#ifdef __cplusplus
51#if USE_CLANG_TYPES
52#define __DARWIN_NULL NULL
53#elif defined(__cplusplus)
4254#ifdef __GNUG__
4355#define __DARWIN_NULL __null
4456#else /* ! __GNUG__ */
......@@ -50,7 +62,7 @@
5062#endif /* __GNUG__ */
5163#else /* ! __cplusplus */
5264#define __DARWIN_NULL ((void *)0)
53#endif /* __cplusplus */
65#endif
5466
5567typedef __int64_t __darwin_blkcnt_t; /* total blocks */
5668typedef __int32_t __darwin_blksize_t; /* preferred block size */
......@@ -77,6 +89,8 @@ typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
7789typedef unsigned char __darwin_uuid_t[16];
7890typedef char __darwin_uuid_string_t[37];
7991
92#undef USE_CLANG_TYPES
93
8094#include <sys/_pthread/_pthread_types.h>
8195
8296#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 @@
2929#define _CADDR_T
3030typedef char * caddr_t;
3131#endif /* _CADDR_T */
32
lib/libc/include/any-macos-any/sys/_types/_fd_clr.h+1
......@@ -26,5 +26,6 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828#ifndef FD_CLR
29#include <sys/_types/_fd_def.h>
2930#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p)
3031#endif /* FD_CLR */
lib/libc/include/any-macos-any/sys/_types/_fd_copy.h+1
......@@ -26,5 +26,6 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828#ifndef FD_COPY
29#include <sys/_types/_fd_def.h>
2930#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t)
3031#endif /* FD_COPY */
lib/libc/include/any-macos-any/sys/_types/_fd_isset.h+1
......@@ -26,5 +26,6 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828#ifndef FD_ISSET
29#include <sys/_types/_fd_def.h>
2930#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p)
3031#endif /* FD_ISSET */
lib/libc/include/any-macos-any/sys/_types/_fd_set.h+1
......@@ -26,5 +26,6 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828#ifndef FD_SET
29#include <sys/_types/_fd_def.h>
2930#define FD_SET(n, p) __DARWIN_FD_SET(n, p)
3031#endif /* FD_SET */
lib/libc/include/any-macos-any/sys/_types/_fd_setsize.h+1
......@@ -26,5 +26,6 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828#ifndef FD_SETSIZE
29#include <sys/_types/_fd_def.h>
2930#define FD_SETSIZE __DARWIN_FD_SETSIZE
3031#endif /* FD_SETSIZE */
lib/libc/include/any-macos-any/sys/_types/_fd_zero.h+1
......@@ -26,5 +26,6 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828#ifndef FD_ZERO
29#include <sys/_types/_fd_def.h>
2930#define FD_ZERO(p) __DARWIN_FD_ZERO(p)
3031#endif /* FD_ZERO */
lib/libc/include/any-macos-any/sys/_types/_intptr_t.h+1-1
......@@ -27,7 +27,7 @@
2727 */
2828#ifndef _INTPTR_T
2929#define _INTPTR_T
30#include <machine/types.h> /* __darwin_intptr_t */
30#include <machine/_types.h> /* __darwin_intptr_t */
3131
3232typedef __darwin_intptr_t intptr_t;
3333#endif /* _INTPTR_T */
lib/libc/include/any-macos-any/sys/_types/_null.h+23
......@@ -25,7 +25,30 @@
2525 *
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
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
2847#ifndef NULL
2948#include <sys/_types.h> /* __DARWIN_NULL */
3049#define NULL __DARWIN_NULL
3150#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 @@
2525 *
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
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
2847#ifndef offsetof
2948#define offsetof(type, field) __offsetof(type, field)
3049#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 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
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
2948#ifndef _PTRDIFF_T
3049#define _PTRDIFF_T
3150#include <machine/types.h> /* __darwin_ptrdiff_t */
3251typedef __darwin_ptrdiff_t ptrdiff_t;
3352#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 @@
2525 *
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
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
2847#ifndef _RSIZE_T
2948#define _RSIZE_T
3049#include <machine/types.h> /* __darwin_size_t */
3150typedef __darwin_size_t rsize_t;
3251#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 @@
2525 *
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
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
2847#ifndef _SIZE_T
2948#define _SIZE_T
3049#include <machine/_types.h> /* __darwin_size_t */
3150typedef __darwin_size_t size_t;
3251#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 @@
2828
2929#ifndef _VA_LIST_T
3030#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
3143#include <machine/types.h> /* __darwin_va_list */
3244typedef __darwin_va_list va_list;
45#endif
46
47#undef USE_CLANG_STDARG
48
3349#endif /* _VA_LIST_T */
lib/libc/include/any-macos-any/sys/_types/_wchar_t.h+23
......@@ -26,6 +26,25 @@
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
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
2948/* wchar_t is a built-in type in C++ */
3049#ifndef __cplusplus
3150#ifndef _WCHAR_T
......@@ -34,3 +53,7 @@
3453typedef __darwin_wchar_t wchar_t;
3554#endif /* _WCHAR_T */
3655#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 @@
11/*
2 * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 2000-2018, 2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -249,6 +249,12 @@ typedef struct vol_capabilities_attr {
249249 * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed.
250250 * Any modifications to volume data or metadata will be detected and may
251251 * 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.
252258 */
253259#define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001
254260#define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002
......@@ -276,6 +282,7 @@ typedef struct vol_capabilities_attr {
276282#define VOL_CAP_FMT_SHARED_SPACE 0x00800000
277283#define VOL_CAP_FMT_VOL_GROUPS 0x01000000
278284#define VOL_CAP_FMT_SEALED 0x02000000
285#define VOL_CAP_FMT_CLONE_MAPPING 0x04000000
279286
280287/*
281288 * VOL_CAP_INT_SEARCHFS: When set, the volume implements the
......@@ -349,6 +356,13 @@ typedef struct vol_capabilities_attr {
349356 *
350357 * VOL_CAP_INT_RENAME_SECLUDE: When set, the volume supports a
351358 * 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.
352366 */
353367#define VOL_CAP_INT_SEARCHFS 0x00000001
354368#define VOL_CAP_INT_ATTRLIST 0x00000002
......@@ -371,6 +385,8 @@ typedef struct vol_capabilities_attr {
371385#define VOL_CAP_INT_RENAME_EXCL 0x00080000
372386#define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000
373387#define VOL_CAP_INT_RENAME_SECLUDE 0x00200000
388#define VOL_CAP_INT_ATTRIBUTION_TAG 0x00400000
389#define VOL_CAP_INT_PUNCHHOLE 0x00800000
374390
375391typedef struct vol_attributes_attr {
376392 attribute_set_t validattr;
......@@ -597,4 +613,6 @@ struct searchstate {
597613#define FST_EOF (-1) /* end-of-file offset */
598614
599615#endif /* __APPLE_API_UNSTABLE */
616
617
600618#endif /* !_SYS_ATTR_H_ */
lib/libc/include/any-macos-any/sys/cdefs.h+130
......@@ -97,6 +97,9 @@
9797#ifndef __has_attribute
9898#define __has_attribute(x) 0
9999#endif
100#ifndef __has_cpp_attribute
101#define __has_cpp_attribute(x) 0
102#endif
100103#ifndef __has_extension
101104#define __has_extension(x) 0
102105#endif
......@@ -322,6 +325,19 @@
322325#define __swift_unavailable(_msg)
323326#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
325341/*
326342 * __abortlike is the attribute to put on functions like abort() that are
327343 * typically used to mark assertions. These optimize the codegen
......@@ -478,6 +494,94 @@
478494#endif
479495#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
481585/*
482586 * COMPILATION ENVIRONMENTS -- see compat(5) for additional detail
483587 *
......@@ -870,7 +974,9 @@
870974#define __single
871975#define __unsafe_indexable
872976#define __counted_by(N)
977#define __counted_by_or_null(N)
873978#define __sized_by(N)
979#define __sized_by_or_null(N)
874980#define __ended_by(E)
875981#define __terminated_by(T)
876982#define __null_terminated
......@@ -888,6 +994,8 @@
888994/* __unsafe_forge intrinsics are defined as regular C casts. */
889995#define __unsafe_forge_bidi_indexable(T, P, S) ((T)(P))
890996#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))
891999#define __terminated_by_to_indexable(P) (P)
8921000#define __unsafe_terminated_by_to_indexable(P) (P)
8931001#define __null_terminated_to_indexable(P) (P)
......@@ -900,6 +1008,10 @@
9001008
9011009/* this is a write-once variable; not useful without pointer checks. */
9021010#define __unsafe_late_const
1011
1012#define __ptrcheck_unavailable
1013#define __ptrcheck_unavailable_r(REPLACEMENT)
1014
9031015#endif /* !__has_include(<ptrcheck.h>) */
9041016
9051017
......@@ -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
9811111#endif /* !_CDEFS_H_ */
lib/libc/include/any-macos-any/sys/clonefile.h+1
......@@ -33,6 +33,7 @@
3333#define CLONE_NOFOLLOW 0x0001 /* Don't follow symbolic links */
3434#define CLONE_NOOWNERCOPY 0x0002 /* Don't copy ownership information from source */
3535#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
3839#include <sys/cdefs.h>
lib/libc/include/any-macos-any/sys/constrained_ctypes.h-15
......@@ -375,21 +375,6 @@
375375 * };
376376 *
377377 *
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 *
393378 * 4. ABI Compatibility Considerations
394379 *
395380 * The pointer instrumentation process has ABI implications.
lib/libc/include/any-macos-any/sys/dirent.h+1-1
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
2 * Copyright (c) 2000-2008, 2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
lib/libc/include/any-macos-any/sys/event.h+1-1
......@@ -78,7 +78,7 @@
7878#define EVFILT_VM (-12) /* Virtual memory events */
7979#define EVFILT_EXCEPT (-15) /* Exception events */
8080
81#define EVFILT_SYSCOUNT 17
81#define EVFILT_SYSCOUNT 18
8282#define EVFILT_THREADMARKER EVFILT_SYSCOUNT /* Internal use only */
8383
8484#pragma pack(4)
lib/libc/include/any-macos-any/sys/fcntl.h+2
......@@ -338,6 +338,8 @@
338338
339339#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
341343// FS-specific fcntl()'s numbers begin at 0x00010000 and go up
342344#define FCNTL_FS_SPECIFIC_BASE 0x00010000
343345
lib/libc/include/any-macos-any/sys/mman.h+1
......@@ -211,6 +211,7 @@
211211#define MADV_FREE_REUSE 8 /* caller wants to reuse those pages */
212212#define MADV_CAN_REUSE 9
213213#define MADV_PAGEOUT 10 /* page out now (internal only) */
214#define MADV_ZERO 11 /* zero pages without faulting in additional pages */
214215
215216/*
216217 * Return bits from mincore
lib/libc/include/any-macos-any/sys/mount.h+8-5
......@@ -383,7 +383,8 @@ struct netfs_status {
383383#define VQ_NEARLOWDISK 0x2000 /* Above lowdisk and below desired disk space */
384384#define VQ_DESIRED_DISK 0x4000 /* the desired disk space */
385385#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;
407408 * cryptexes. We need to make sure we do not use the reserved values in each for a new authentication type.
408409 */
409410// bump up the version for any change that has kext dependency
410#define CRYPTEX_AUTH_STRUCT_VERSION 1
411#define CRYPTEX_AUTH_STRUCT_VERSION 2
411412OS_ENUM(graftdmg_type, uint32_t,
412413 GRAFTDMG_CRYPTEX_BOOT = 1,
413414 GRAFTDMG_CRYPTEX_PREBOOT = 2,
......@@ -416,8 +417,9 @@ OS_ENUM(graftdmg_type, uint32_t,
416417 // Reserved: CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5,
417418 GRAFTDMG_CRYPTEX_PDI_NONCE = 6,
418419 GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,
420 GRAFTDMG_CRYPTEX_MOBILE_ASSET = 8,
419421 // Update this when a new type is added
420 GRAFTDMG_CRYPTEX_MAX = 7);
422 GRAFTDMG_CRYPTEX_MAX = 8);
421423
422424OS_ENUM(cryptex_auth_type, uint32_t,
423425 // Reserved: GRAFTDMG_CRYPTEX_BOOT = 1,
......@@ -426,9 +428,10 @@ OS_ENUM(cryptex_auth_type, uint32_t,
426428 CRYPTEX1_AUTH_ENV_GENERIC = 4,
427429 CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5,
428430 CRYPTEX_AUTH_PDI_NONCE = 6,
429 // Reserved: GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7
431 // Reserved: GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,
432 CRYPTEX_AUTH_MOBILE_ASSET = 8,
430433 // Update this when a new type is added
431 CRYPTEX_AUTH_MAX = 7);
434 CRYPTEX_AUTH_MAX = 8);
432435
433436
434437__BEGIN_DECLS
lib/libc/include/any-macos-any/sys/proc_info.h+12
......@@ -232,6 +232,18 @@ struct proc_workqueueinfo {
232232#define WQ_EXCEEDED_CONSTRAINED_THREAD_LIMIT 0x1
233233#define WQ_EXCEEDED_TOTAL_THREAD_LIMIT 0x2
234234#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
236248struct proc_fileinfo {
237249 uint32_t fi_openflags;
lib/libc/include/any-macos-any/sys/queue.h+24-24
......@@ -118,30 +118,30 @@
118118 * For details on the use of these macros, see the queue(3) manual page.
119119 *
120120 *
121 * SLIST LIST STAILQ TAILQ CIRCLEQ
122 * _HEAD + + + + +
123 * _HEAD_INITIALIZER + + + + -
124 * _ENTRY + + + + +
125 * _INIT + + + + +
126 * _EMPTY + + + + +
127 * _FIRST + + + + +
128 * _NEXT + + + + +
129 * _PREV - - - + +
130 * _LAST - - + + +
131 * _FOREACH + + + + +
132 * _FOREACH_SAFE + + + + -
133 * _FOREACH_REVERSE - - - + -
134 * _FOREACH_REVERSE_SAFE - - - + -
135 * _INSERT_HEAD + + + + +
136 * _INSERT_BEFORE - + - + +
137 * _INSERT_AFTER + + + + +
138 * _INSERT_TAIL - - + + +
139 * _CONCAT - - + + -
140 * _REMOVE_AFTER + - + - -
141 * _REMOVE_HEAD + - + - -
142 * _REMOVE_HEAD_UNTIL - - + - -
143 * _REMOVE + + + + +
144 * _SWAP - + + + -
121 * SLIST LIST STAILQ TAILQ CIRCLEQ
122 * _HEAD + + + + +
123 * _HEAD_INITIALIZER + + + + -
124 * _ENTRY + + + + +
125 * _INIT + + + + +
126 * _EMPTY + + + + +
127 * _FIRST + + + + +
128 * _NEXT + + + + +
129 * _PREV - - - + +
130 * _LAST - - + + +
131 * _FOREACH + + + + +
132 * _FOREACH_SAFE + + + + -
133 * _FOREACH_REVERSE - - - + -
134 * _FOREACH_REVERSE_SAFE - - - + -
135 * _INSERT_HEAD + + + + +
136 * _INSERT_BEFORE - + - + +
137 * _INSERT_AFTER + + + + +
138 * _INSERT_TAIL - - + + +
139 * _CONCAT - - + + -
140 * _REMOVE_AFTER + - + - -
141 * _REMOVE_HEAD + - + - -
142 * _REMOVE_HEAD_UNTIL - - + - -
143 * _REMOVE + + + + +
144 * _SWAP - + + + -
145145 *
146146 */
147147#ifdef QUEUE_MACRO_DEBUG
lib/libc/include/any-macos-any/sys/resource.h+10-4
......@@ -104,7 +104,7 @@ typedef __uint64_t rlim_t;
104104#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
105105#define PRIO_DARWIN_THREAD 3 /* Second argument is always 0 (current thread) */
106106#define PRIO_DARWIN_PROCESS 4 /* Second argument is a PID */
107
107/* Additional private parameters to getpriority()/setpriority() are in resource_private.h */
108108
109109/*
110110 * Range limitations for the value of the third parameter to setpriority().
......@@ -409,7 +409,12 @@ struct rusage_info_v6 {
409409 uint64_t ri_pcycles;
410410 uint64_t ri_energy_nj;
411411 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];
413418};
414419
415420typedef struct rusage_info_v6 rusage_info_current;
......@@ -496,7 +501,7 @@ struct proc_rlimit_control_wakeupmon {
496501 int32_t wm_rate;
497502};
498503
499
504/* Additional private I/O policies are in resource_private.h */
500505
501506/* I/O type */
502507#define IOPOL_TYPE_DISK 0
......@@ -527,7 +532,6 @@ struct proc_rlimit_control_wakeupmon {
527532#define IOPOL_APPLICATION IOPOL_STANDARD
528533#define IOPOL_NORMAL IOPOL_IMPORTANT
529534
530
531535#define IOPOL_ATIME_UPDATES_DEFAULT 0
532536#define IOPOL_ATIME_UPDATES_OFF 1
533537
......@@ -576,4 +580,6 @@ int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPH
576580int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);
577581__END_DECLS
578582
583
584
579585#endif /* !_SYS_RESOURCE_H_ */
lib/libc/include/any-macos-any/sys/socket.h+5-20
......@@ -78,8 +78,6 @@
7878#include <machine/_param.h>
7979#include <net/net_kev.h>
8080
81
82
8381#include <Availability.h>
8482
8583/*
......@@ -189,6 +187,7 @@
189187
190188#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
193192/* When adding new socket-options, you need to make sure MPTCP supports these as well! */
194193
......@@ -346,7 +345,6 @@ struct so_np_extensions {
346345#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */
347346
348347
349
350348#endif
351349#endif
352350
......@@ -416,11 +414,7 @@ struct so_np_extensions {
416414struct sockaddr {
417415 __uint8_t sa_len; /* total length */
418416 sa_family_t sa_family; /* [XSI] address family */
419#if __has_ptrcheck
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
417 char sa_data[14]; /* [XSI] addr value */
424418};
425419__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr, sockaddr);
426420
......@@ -530,10 +524,7 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
530524 */
531525#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
532526#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)
537528/*
538529 * PF_ROUTE - Routing table
539530 *
......@@ -557,9 +548,6 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
557548#define NET_RT_MAXID 11
558549#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
559550
560
561
562
563551/*
564552 * Maximum queue length specifiable by listen.
565553 */
......@@ -570,17 +558,15 @@ __CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct sockaddr_storage, sockaddr_storage);
570558 * Used value-result for recvmsg, value only for sendmsg.
571559 */
572560struct msghdr {
573 void *msg_name; /* [XSI] optional address */
561 void *__sized_by(msg_namelen) msg_name; /* [XSI] optional address */
574562 socklen_t msg_namelen; /* [XSI] size of address */
575563 struct iovec *msg_iov; /* [XSI] scatter/gather array */
576564 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 */
578566 socklen_t msg_controllen; /* [XSI] ancillary data buffer len */
579567 int msg_flags; /* [XSI] flags on received message */
580568};
581569
582
583
584570#define MSG_OOB 0x1 /* process out-of-band data */
585571#define MSG_PEEK 0x2 /* peek at incoming message */
586572#define MSG_DONTROUTE 0x4 /* send without using routing tables */
......@@ -694,7 +680,6 @@ struct cmsgcred {
694680#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
695681#define SCM_TIMESTAMP_MONOTONIC 0x04 /* timestamp (uint64_t) */
696682
697
698683#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
699684
700685/*
......@@ -718,7 +703,6 @@ struct sf_hdtr {
718703
719704#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
720705
721
722706__BEGIN_DECLS
723707
724708int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
......@@ -762,4 +746,5 @@ int disconnectx(int, sae_associd_t, sae_connid_t);
762746__END_DECLS
763747
764748
749
765750#endif /* !_SYS_SOCKET_H_ */
lib/libc/include/any-macos-any/sys/sockio.h+4-6
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000-2021 Apple Inc. All rights reserved.
2 * Copyright (c) 2000-2023 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -66,6 +66,7 @@
6666
6767#include <sys/appleapiopts.h>
6868
69#include <net/if.h>
6970#include <sys/ioccom.h>
7071
7172/* Socket ioctl's. */
......@@ -77,9 +78,6 @@
7778#define SIOCSPGRP _IOW('s', 8, int) /* set process group */
7879#define SIOCGPGRP _IOR('s', 9, int) /* get process group */
7980
80/*
81 * OSIOCGIF* ioctls are deprecated; they are kept for binary compatibility.
82 */
8381#define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */
8482#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */
8583#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */
......@@ -140,7 +138,6 @@
140138 */
141139#define SIOCGIFXMEDIA _IOWR('i', 72, struct ifmediareq) /* get net extended media */
142140
143
144141#define SIOCSIFCAP _IOW('i', 90, struct ifreq) /* set IF features */
145142#define SIOCGIFCAP _IOWR('i', 91, struct ifreq) /* get IF features */
146143
......@@ -165,7 +162,6 @@
165162#define SIOCSIFASYNCMAP _IOW('i', 125, struct ifreq) /* set ppp asyncmap */
166163
167164
168
169165#define SIOCGIFMAC _IOWR('i', 130, struct ifreq) /* deprecated */
170166#define SIOCSIFMAC _IOW('i', 131, struct ifreq) /* deprecated */
171167#define SIOCSIFKPI _IOW('i', 134, struct ifreq) /* set interface kext param - root only */
......@@ -178,5 +174,7 @@
178174#define SIOCSIF6LOWPAN _IOW('i', 196, struct ifreq) /* set 6LOWPAN config */
179175#define SIOCGIF6LOWPAN _IOWR('i', 197, struct ifreq) /* get 6LOWPAN config */
180176
177#define SIOCGIFDIRECTLINK _IOWR('i', 222, struct ifreq) /* get DIRECTLINK */
178
181179
182180#endif /* !_SYS_SOCKIO_H_ */
lib/libc/include/any-macos-any/sys/sysctl.h+13-9
......@@ -640,13 +640,15 @@ extern struct loadavg averunnable;
640640 * In general is is better to use mach's or higher level timing services, but this value
641641 * is needed to convert the PPC Time Base registers to real time.
642642 *
643 * hw.cpufrequency - These values provide the current, min and max cpu frequency. The min and max are for
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.
643 * hw.cpufrequency, hw.busfrequency and their min/max versions are deprecated because frequency isn't consistent.
646644 *
647 * hw.busfrequency - These values provide the current, min and max bus 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.
649 * hw.busfrequency_min - All frequencies are in Hz.
645 * hw.cpufrequency - (deprecated) These values provide the current, min and max cpu frequency. The min and max are for
646 * hw.cpufrequency_max - (deprecated) all power management modes. The current frequency is the max frequency in the current mode.
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.
650652 *
651653 * hw.cputype - These values provide the mach-o cpu type and subtype. A complete list is in <mach/machine.h>
652654 * 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;
790792
791793
792794__BEGIN_DECLS
793int sysctl(int *, u_int, void *, size_t *, void *, size_t);
794int sysctlbyname(const char *, void *, size_t *, void *, size_t);
795int sysctlnametomib(const char *, int *, size_t *);
795int sysctl(int *, u_int, void *__sized_by(*oldlenp), size_t *oldlenp,
796 void *__sized_by(newlen), size_t newlen);
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);
796800__END_DECLS
797801
798802
lib/libc/include/any-macos-any/sys/syslimits.h+4
......@@ -88,6 +88,10 @@
8888#define LINK_MAX 32767 /* max file link count */
8989#define MAX_CANON 1024 /* max bytes in term canon input line */
9090#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 */
9195#define NAME_MAX 255 /* max bytes in a file name */
9296#define NGROUPS_MAX 16 /* max supplemental group id's */
9397#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 {
102102 (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
103103#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
104104
105
106105#endif /* !_SYS_UN_H_ */
lib/libc/include/any-macos-any/tgmath.h+60
......@@ -49,6 +49,7 @@ static double _TG_ATTRSp __tg_promote(long);
4949static double _TG_ATTRSp __tg_promote(unsigned long);
5050static double _TG_ATTRSp __tg_promote(long long);
5151static double _TG_ATTRSp __tg_promote(unsigned long long);
52static _Float16 _TG_ATTRSp __tg_promote(_Float16);
5253static float _TG_ATTRSp __tg_promote(float);
5354static double _TG_ATTRSp __tg_promote(double);
5455static long double _TG_ATTRSp __tg_promote(long double);
......@@ -502,6 +503,10 @@ static long double _Complex
502503
503504// sqrt
504505
506static _Float16
507 _TG_ATTRS
508 __tg_sqrt(_Float16 __x) {return __sqrtf16(__x);}
509
505510static float
506511 _TG_ATTRS
507512 __tg_sqrt(float __x) {return sqrtf(__x);}
......@@ -531,6 +536,10 @@ static long double _Complex
531536
532537// fabs
533538
539static _Float16
540 _TG_ATTRS
541 __tg_fabs(_Float16 __x) {return __fabsf16(__x);}
542
534543static float
535544 _TG_ATTRS
536545 __tg_fabs(float __x) {return fabsf(__x);}
......@@ -595,6 +604,10 @@ static long double
595604
596605// ceil
597606
607static _Float16
608 _TG_ATTRS
609 __tg_ceil(_Float16 __x) {return __ceilf16(__x);}
610
598611static float
599612 _TG_ATTRS
600613 __tg_ceil(float __x) {return ceilf(__x);}
......@@ -612,6 +625,10 @@ static long double
612625
613626// copysign
614627
628static _Float16
629 _TG_ATTRS
630 __tg_copysign(_Float16 __x, _Float16 __y) {return __copysignf16(__x, __y);}
631
615632static float
616633 _TG_ATTRS
617634 __tg_copysign(float __x, float __y) {return copysignf(__x, __y);}
......@@ -716,6 +733,10 @@ static long double
716733
717734// floor
718735
736static _Float16
737 _TG_ATTRS
738 __tg_floor(_Float16 __x) {return __floorf16(__x);}
739
719740static float
720741 _TG_ATTRS
721742 __tg_floor(float __x) {return floorf(__x);}
......@@ -733,6 +754,11 @@ static long double
733754
734755// fma
735756
757static _Float16
758 _TG_ATTRS
759 __tg_fma(_Float16 __x, _Float16 __y, _Float16 __z)
760 {return __fmaf16(__x, __y, __z);}
761
736762static float
737763 _TG_ATTRS
738764 __tg_fma(float __x, float __y, float __z)
......@@ -756,6 +782,10 @@ static long double
756782
757783// fmax
758784
785static _Float16
786 _TG_ATTRS
787 __tg_fmax(_Float16 __x, _Float16 __y) {return __fmaxf16(__x, __y);}
788
759789static float
760790 _TG_ATTRS
761791 __tg_fmax(float __x, float __y) {return fmaxf(__x, __y);}
......@@ -774,6 +804,10 @@ static long double
774804
775805// fmin
776806
807static _Float16
808 _TG_ATTRS
809 __tg_fmin(_Float16 __x, _Float16 __y) {return __fminf16(__x, __y);}
810
777811static float
778812 _TG_ATTRS
779813 __tg_fmin(float __x, float __y) {return fminf(__x, __y);}
......@@ -827,6 +861,10 @@ static long double
827861
828862// hypot
829863
864static _Float16
865 _TG_ATTRS
866 __tg_hypot(_Float16 __x, _Float16 __y) {return __hypotf16(__x, __y);}
867
830868static float
831869 _TG_ATTRS
832870 __tg_hypot(float __x, float __y) {return hypotf(__x, __y);}
......@@ -894,6 +932,10 @@ static long double
894932#undef lgamma
895933#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
897939// llrint
898940
899941static long long
......@@ -928,6 +970,8 @@ static long long
928970#undef llround
929971#define llround(__x) __tg_llround(__tg_promote1((__x))(__x))
930972
973#endif /* !(__DARWIN_NO_LONG_LONG) */
974
931975// log10
932976
933977static float
......@@ -1049,6 +1093,10 @@ static long double
10491093
10501094// nextafter
10511095
1096static _Float16
1097 _TG_ATTRS
1098 __tg_nextafter(_Float16 __x, _Float16 __y) {return __nextafterf16(__x, __y);}
1099
10521100static float
10531101 _TG_ATTRS
10541102 __tg_nextafter(float __x, float __y) {return nextafterf(__x, __y);}
......@@ -1125,6 +1173,10 @@ static long double
11251173
11261174// rint
11271175
1176static _Float16
1177 _TG_ATTRS
1178 __tg_rint(_Float16 __x) {return __rintf16(__x);}
1179
11281180static float
11291181 _TG_ATTRS
11301182 __tg_rint(float __x) {return rintf(__x);}
......@@ -1142,6 +1194,10 @@ static long double
11421194
11431195// round
11441196
1197static _Float16
1198 _TG_ATTRS
1199 __tg_round(_Float16 __x) {return __roundf16(__x);}
1200
11451201static float
11461202 _TG_ATTRS
11471203 __tg_round(float __x) {return roundf(__x);}
......@@ -1210,6 +1266,10 @@ static long double
12101266
12111267// trunc
12121268
1269static _Float16
1270 _TG_ATTRS
1271 __tg_trunc(_Float16 __x) {return __truncf16(__x);}
1272
12131273static float
12141274 _TG_ATTRS
12151275 __tg_trunc(float __x) {return truncf(__x);}
lib/libc/include/any-macos-any/time.h+2-143
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
2 * Copyright (c) 2000, 2023 Apple Computer, Inc. All rights reserved.
33 *
44 * @APPLE_LICENSE_HEADER_START@
55 *
......@@ -60,149 +60,8 @@
6060 * @(#)time.h 8.3 (Berkeley) 1/21/94
6161 */
6262
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
63#include <_time.h>
20364
20465#ifdef _USE_EXTENDED_LOCALES_
20566#include <xlocale/_time.h>
20667#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);
653653int getdomainname(char *, int);
654654int getgrouplist(const char *, int, int *, int *);
655655__END_DECLS
656#if defined(__has_include)
657#if __has_include(<gethostuuid_private.h>)
658#include <gethostuuid_private.h>
659#else
660656#include <gethostuuid.h>
661#endif
662#else
663#include <gethostuuid.h>
664#endif
665657__BEGIN_DECLS
666658mode_t getmode(const void *, mode_t);
667659int getpeereid(int, uid_t *, gid_t *);
lib/libc/include/any-macos-any/vis.h+10
......@@ -57,6 +57,7 @@
5757#ifndef _VIS_H_
5858#define _VIS_H_
5959
60#include <Availability.h>
6061#include <_types.h>
6162#include <sys/_types/_size_t.h>
6263
......@@ -109,31 +110,40 @@
109110#include <sys/cdefs.h>
110111
111112__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))
112115char *vis(char *, int, int, int);
113116char *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))
115119char *svis(char *, int, int, int, const char *);
116120char *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))
118123int strvis(char *, const char *, int);
119124int stravis(char **, const char *, int);
120125int 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))
122128int strsvis(char *, const char *, int, const char *);
123129int 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))
125132int strvisx(char *, const char *, size_t, int);
126133int strnvisx(char *, size_t, const char *, size_t, int);
127134int 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))
129137int strsvisx(char *, const char *, size_t, int, const char *);
130138int strsnvisx(char *, size_t, const char *, size_t, int, const char *);
131139int strsenvisx(char *, size_t, const char *, size_t , int, const char *,
132140 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))
134143int strunvis(char *, const char *);
135144int 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))
137147int strunvisx(char *, const char *, int);
138148int strnunvisx(char *, size_t, const char *, int);
139149
lib/libc/include/any-macos-any/wchar.h+1-161
......@@ -64,168 +64,8 @@
6464 * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
6565 */
6666
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
67#include <_wchar.h>
22668
22769#ifdef _USE_EXTENDED_LOCALES_
22870#include <xlocale/_wchar.h>
22971#endif /* _USE_EXTENDED_LOCALES_ */
230
231#endif /* !_WCHAR_H_ */
lib/libc/include/any-macos-any/wctype.h-95
......@@ -28,103 +28,8 @@
2828 * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
2929 */
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
4031#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
12633#ifdef _USE_EXTENDED_LOCALES_
12734#include <xlocale/_wctype.h>
12835#endif /* _USE_EXTENDED_LOCALES_ */
129
130#endif /* _WCTYPE_H_ */
lib/libc/include/any-macos-any/xlocale.h+3-53
......@@ -21,62 +21,14 @@
2121 * @APPLE_LICENSE_HEADER_END@
2222 */
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>
3424#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
7426#ifdef _CTYPE_H_
7527#include <xlocale/_ctype.h>
7628#endif /* _CTYPE_H_ */
77#ifdef __WCTYPE_H_
78#include <xlocale/__wctype.h>
79#endif /* __WCTYPE_H_ */
29#ifdef ___WCTYPE_H_
30#include <xlocale/___wctype.h>
31#endif /* ___WCTYPE_H_ */
8032#ifdef _INTTYPES_H_
8133#include <xlocale/_inttypes.h>
8234#endif /* _INTTYPES_H_ */
......@@ -107,5 +59,3 @@ __END_DECLS
10759#ifdef _WCTYPE_H_
10860#include <xlocale/_wctype.h>
10961#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 @@
2525#define _XLOCALE__CTYPE_H_
2626
2727#include <_ctype.h>
28#include <_xlocale.h>
28#include <__xlocale.h>
2929
3030/*
3131 * 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 @@
2727#include <sys/cdefs.h>
2828#include <stdint.h>
2929#include <stddef.h> /* wchar_t */
30#include <_xlocale.h>
30#include <__xlocale.h>
3131
3232__BEGIN_DECLS
3333intmax_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 @@
2626
2727#include <sys/cdefs.h>
2828#include <_types/_nl_item.h>
29#include <_xlocale.h>
29#include <__xlocale.h>
3030
3131__BEGIN_DECLS
3232char *nl_langinfo_l(nl_item, locale_t);
lib/libc/include/any-macos-any/xlocale/_monetary.h+1-1
......@@ -28,7 +28,7 @@
2828#include <_types.h>
2929#include <sys/_types/_size_t.h>
3030#include <sys/_types/_ssize_t.h>
31#include <_xlocale.h>
31#include <__xlocale.h>
3232
3333__BEGIN_DECLS
3434ssize_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 @@
2626
2727#ifndef _REGEX_H_
2828#include <_regex.h>
29#endif // _REGEX_H_
30#include <_xlocale.h>
29#include <__xlocale.h>
30#endif
3131
3232__BEGIN_DECLS
3333
lib/libc/include/any-macos-any/xlocale/_stdio.h+1-1
......@@ -25,7 +25,7 @@
2525#define _XLOCALE__STDIO_H_
2626
2727#include <_stdio.h>
28#include <_xlocale.h>
28#include <__xlocale.h>
2929
3030__BEGIN_DECLS
3131
lib/libc/include/any-macos-any/xlocale/_stdlib.h+1-1
......@@ -27,7 +27,7 @@
2727#include <sys/cdefs.h>
2828#include <sys/_types/_size_t.h>
2929#include <sys/_types/_wchar_t.h>
30#include <_xlocale.h>
30#include <__xlocale.h>
3131
3232__BEGIN_DECLS
3333double atof_l(const char *, locale_t);
lib/libc/include/any-macos-any/xlocale/_string.h+1-1
......@@ -26,7 +26,7 @@
2626
2727#include <sys/cdefs.h>
2828#include <sys/_types/_size_t.h>
29#include <_xlocale.h>
29#include <__xlocale.h>
3030
3131__BEGIN_DECLS
3232int strcoll_l(const char *, const char *, locale_t);
lib/libc/include/any-macos-any/xlocale/_time.h+1-1
......@@ -27,7 +27,7 @@
2727#include <sys/cdefs.h>
2828#include <sys/_types/_size_t.h>
2929#include <_types.h>
30#include <_xlocale.h>
30#include <__xlocale.h>
3131
3232__BEGIN_DECLS
3333size_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 @@
2525#define _XLOCALE__WCHAR_H_
2626
2727#include <_stdio.h>
28#include <_xlocale.h>
28#include <__xlocale.h>
2929#include <sys/_types/_mbstate_t.h>
3030#include <sys/_types/_wint_t.h>
3131#include <stddef.h> /* wchar_t */
lib/libc/include/any-macos-any/xlocale/_wctype.h+1-1
......@@ -24,7 +24,7 @@
2424#ifndef _XLOCALE__WCTYPE_H_
2525#define _XLOCALE__WCTYPE_H_
2626
27#include <__wctype.h>
27#include <___wctype.h>
2828#include <_types/_wctrans_t.h>
2929#include <xlocale/_ctype.h>
3030
lib/libc/include/any-macos-any/xpc/activity.h+56-28
......@@ -33,7 +33,8 @@ __BEGIN_DECLS
3333 * the interval before more aggressive scheduling occurs. The grace period
3434 * does not increase the size of the interval.
3535 */
36__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
36API_AVAILABLE(macos(10.9))
37API_UNAVAILABLE(ios)
3738XPC_EXPORT
3839const char * const XPC_ACTIVITY_INTERVAL;
3940
......@@ -41,7 +42,8 @@ const char * const XPC_ACTIVITY_INTERVAL;
4142 * @constant XPC_ACTIVITY_REPEATING
4243 * A boolean property indicating whether this is a repeating activity.
4344 */
44__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
45API_AVAILABLE(macos(10.9))
46API_UNAVAILABLE(ios)
4547XPC_EXPORT
4648const char * const XPC_ACTIVITY_REPEATING;
4749
......@@ -50,7 +52,8 @@ const char * const XPC_ACTIVITY_REPEATING;
5052 * An integer property indicating the number of seconds to delay before
5153 * beginning the activity.
5254 */
53__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
55API_AVAILABLE(macos(10.9))
56API_UNAVAILABLE(ios)
5457XPC_EXPORT
5558const char * const XPC_ACTIVITY_DELAY;
5659
......@@ -59,44 +62,54 @@ const char * const XPC_ACTIVITY_DELAY;
5962 * An integer property indicating the number of seconds to allow as a grace
6063 * period before the scheduling of the activity becomes more aggressive.
6164 */
62__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
65API_AVAILABLE(macos(10.9))
66API_UNAVAILABLE(ios)
6367XPC_EXPORT
6468const 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)
6873XPC_EXPORT
6974const 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)
7278XPC_EXPORT
7379const 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)
7683XPC_EXPORT
7784const 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)
8088XPC_EXPORT
8189const 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)
8493XPC_EXPORT
8594const 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)
8898XPC_EXPORT
8999const 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)
92103XPC_EXPORT
93104const 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)
96108XPC_EXPORT
97109const 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)
100113XPC_EXPORT
101114const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS;
102115
......@@ -104,7 +117,8 @@ const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS;
104117 * @constant XPC_ACTIVITY_PRIORITY
105118 * A string property indicating the priority of the activity.
106119 */
107__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
120API_AVAILABLE(macos(10.9))
121API_UNAVAILABLE(ios)
108122XPC_EXPORT
109123const char * const XPC_ACTIVITY_PRIORITY;
110124
......@@ -121,7 +135,8 @@ const char * const XPC_ACTIVITY_PRIORITY;
121135 * permitted to run while the device is on battery, or plugged in and the
122136 * battery level is lower than 30%.
123137 */
124__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
138API_AVAILABLE(macos(10.9))
139API_UNAVAILABLE(ios)
125140XPC_EXPORT
126141const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE;
127142
......@@ -138,7 +153,8 @@ const char * const XPC_ACTIVITY_PRIORITY_MAINTENANCE;
138153 * are only permitted when they are close to their deadline (90% of their time
139154 * window has elapsed).
140155 */
141__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
156API_AVAILABLE(macos(10.9))
157API_UNAVAILABLE(ios)
142158XPC_EXPORT
143159const char * const XPC_ACTIVITY_PRIORITY_UTILITY;
144160
......@@ -148,7 +164,8 @@ const char * const XPC_ACTIVITY_PRIORITY_UTILITY;
148164 * while the computer is on battery power. The default value is false for
149165 * maintenance priority activity and true for utility priority activity.
150166 */
151__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
167API_AVAILABLE(macos(10.9))
168API_UNAVAILABLE(ios)
152169XPC_EXPORT
153170const char * const XPC_ACTIVITY_ALLOW_BATTERY;
154171
......@@ -160,7 +177,8 @@ const char * const XPC_ACTIVITY_ALLOW_BATTERY;
160177 * idle despite the fact that the display itself is still powered. Defaults to
161178 * false.
162179 */
163__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
180API_AVAILABLE(macos(10.9))
181API_UNAVAILABLE(ios)
164182XPC_EXPORT
165183const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool
166184
......@@ -174,7 +192,8 @@ const char * const XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool
174192 * interrupted by system sleep should set this.
175193 * Setting this property can impact battery life.
176194 */
177__API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0))
195API_AVAILABLE(macos(12.0))
196API_UNAVAILABLE(ios, watchos)
178197XPC_EXPORT
179198const char * const XPC_ACTIVITY_PREVENT_DEVICE_SLEEP; // bool
180199
......@@ -205,7 +224,8 @@ const char * const XPC_ACTIVITY_REQUIRE_HDD_SPINNING; // bool
205224 * A type representing the XPC activity object.
206225 */
207226#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)
209229XPC_EXPORT
210230XPC_TYPE(_xpc_type_activity);
211231
......@@ -241,7 +261,8 @@ typedef void (^xpc_activity_handler_t)(xpc_activity_t activity);
241261 * activity using the same identifier (for example, an activity taken from a
242262 * launchd property list).
243263 */
244__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
264API_AVAILABLE(macos(10.9))
265API_UNAVAILABLE(ios)
245266XPC_EXPORT
246267const xpc_object_t XPC_ACTIVITY_CHECK_IN;
247268
......@@ -280,7 +301,8 @@ const xpc_object_t XPC_ACTIVITY_CHECK_IN;
280301 * The handler block is never invoked reentrantly. It will be invoked on a
281302 * dispatch queue with an appropriate priority to perform the activity.
282303 */
283__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
304API_AVAILABLE(macos(10.9))
305API_UNAVAILABLE(ios)
284306XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3
285307void
286308xpc_activity_register(const char *identifier, xpc_object_t criteria,
......@@ -294,7 +316,8 @@ xpc_activity_register(const char *identifier, xpc_object_t criteria,
294316 * This will return NULL in cases where the activity has already completed, e.g.
295317 * when checking in to an event that finished and was not rescheduled.
296318 */
297__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
319API_AVAILABLE(macos(10.9))
320API_UNAVAILABLE(ios)
298321XPC_EXPORT XPC_WARN_RESULT XPC_RETURNS_RETAINED XPC_NONNULL1
299322xpc_object_t _Nullable
300323xpc_activity_copy_criteria(xpc_activity_t activity);
......@@ -305,7 +328,8 @@ xpc_activity_copy_criteria(xpc_activity_t activity);
305328 * @abstract
306329 * Modifies the execution criteria of an activity.
307330 */
308__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
331API_AVAILABLE(macos(10.9))
332API_UNAVAILABLE(ios)
309333XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
310334void
311335xpc_activity_set_criteria(xpc_activity_t activity, xpc_object_t criteria);
......@@ -386,7 +410,8 @@ typedef long xpc_activity_state_t;
386410 * @abstract
387411 * Returns the current state of an activity.
388412 */
389__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
413API_AVAILABLE(macos(10.9))
414API_UNAVAILABLE(ios)
390415XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
391416xpc_activity_state_t
392417xpc_activity_get_state(xpc_activity_t activity);
......@@ -401,7 +426,8 @@ xpc_activity_get_state(xpc_activity_t activity);
401426 * Returns true if the state was successfully updated; otherwise, returns
402427 * false if the requested state transition is not valid.
403428 */
404__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
429API_AVAILABLE(macos(10.9))
430API_UNAVAILABLE(ios)
405431XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
406432bool
407433xpc_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);
424450 * @return
425451 * Returns true if the activity should be deferred.
426452 */
427__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
453API_AVAILABLE(macos(10.9))
454API_UNAVAILABLE(ios)
428455XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
429456bool
430457xpc_activity_should_defer(xpc_activity_t activity);
......@@ -447,7 +474,8 @@ xpc_activity_should_defer(xpc_activity_t activity);
447474 * @param identifier
448475 * The identifier of the activity to unregister.
449476 */
450__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0)
477API_AVAILABLE(macos(10.9))
478API_UNAVAILABLE(ios)
451479XPC_EXPORT XPC_NONNULL1
452480void
453481xpc_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;
8989 */
9090#define XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT \
9191 XPC_GLOBAL_OBJECT(_xpc_error_peer_code_signing_requirement)
92__API_AVAILABLE(macos(12.0))
92__API_AVAILABLE(macos(12.0), macCatalyst(15.0))
9393XPC_EXPORT
9494const struct _xpc_dictionary_s _xpc_error_peer_code_signing_requirement;
9595
......@@ -198,7 +198,8 @@ xpc_connection_create(const char * _Nullable name,
198198 * because the Mach namespace is not queried for the service name until the
199199 * connection has been activated. See {@link xpc_connection_activate()}.
200200 */
201__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
201API_AVAILABLE(macos(10.7), macCatalyst(5.0))
202API_UNAVAILABLE(ios)
202203XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
203204xpc_connection_t
204205xpc_connection_create_mach_service(const char *name,
......@@ -668,7 +669,8 @@ xpc_connection_get_egid(xpc_connection_t connection);
668669 * away, but there are no guarantees as to the timing of this notification's
669670 * delivery either at the kernel layer or at the XPC layer.
670671 */
671__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
672API_AVAILABLE(macos(10.7))
673API_UNAVAILABLE(ios)
672674XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
673675pid_t
674676xpc_connection_get_pid(xpc_connection_t connection);
......@@ -683,7 +685,8 @@ xpc_connection_get_pid(xpc_connection_t connection);
683685 * @result
684686 * The audit session ID of the remote peer at the time the connection was made.
685687 */
686__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
688API_AVAILABLE(macos(10.7))
689API_UNAVAILABLE(ios)
687690XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
688691au_asid_t
689692xpc_connection_get_asid(xpc_connection_t connection);
......@@ -778,17 +781,222 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection,
778781 * All messages received on this connection will be checked to ensure they come from a peer who satisfies
779782 * the code signing requirement. For a listener connection, requests that do not satisfy the requirement
780783 * 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.
782785 *
783786 * This API is not supported on embedded platforms and will return ENOTSUP.
784787 *
785788 * @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements
786789 */
787__API_AVAILABLE(macos(12.0))
790__API_AVAILABLE(macos(12.0), macCatalyst(15.0))
791API_UNAVAILABLE(ios, tvos, watchos)
788792XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
789793int
790794xpc_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
7931001__END_DECLS
7941002XPC_ASSUME_NONNULL_END
lib/libc/include/any-macos-any/xpc/listener.h+48-5
......@@ -36,11 +36,19 @@ OS_OBJECT_DECL_CLASS(xpc_listener);
3636 * Indicates that the listener should not be activated during its creation. The
3737 * returned listener must be manually activated using
3838 * {@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
3945 */
4046XPC_SWIFT_NOEXPORT
4147XPC_FLAGS_ENUM(xpc_listener_create_flags, uint64_t,
4248 XPC_LISTENER_CREATE_NONE XPC_SWIFT_NAME("none") = 0,
4349 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),
4452);
4553
4654#pragma mark Handlers
......@@ -59,7 +67,8 @@ typedef void (^xpc_listener_incoming_session_handler_t)(xpc_session_t peer);
5967 * should be disposed of with free(3) when done. This will return NULL if a
6068 * string description could not be generated.
6169 */
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)
6372XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_WARN_RESULT
6473char * _Nullable
6574xpc_listener_copy_description(xpc_listener_t listener);
......@@ -107,7 +116,8 @@ xpc_listener_copy_description(xpc_listener_t listener);
107116 * or cancel the session using `xpc_session_cancel`. Failure to take one of
108117 * these two actions will result in an API misuse crash.
109118 */
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)
111121XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
112122xpc_listener_t _Nullable
113123xpc_listener_create(const char * service,
......@@ -136,7 +146,8 @@ xpc_listener_create(const char * service,
136146 * activated. Releasing the last reference on an inactive listener that was
137147 * created with an xpc_listener_create() is undefined.
138148 */
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)
140151XPC_EXPORT XPC_SWIFT_NOEXPORT
141152bool
142153xpc_listener_activate(xpc_listener_t listener,
......@@ -157,7 +168,8 @@ xpc_listener_activate(xpc_listener_t listener,
157168 * to be explicitly cancelled and the process can safely terminate
158169 * without cancelling the listener.
159170 */
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)
161173XPC_EXPORT XPC_SWIFT_NOEXPORT
162174void
163175xpc_listener_cancel(xpc_listener_t listener);
......@@ -176,11 +188,42 @@ xpc_listener_cancel(xpc_listener_t listener);
176188 * @discussion
177189 * The peer session will be cancelled and cannot be used after it has been rejected
178190 */
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)
180193XPC_EXPORT XPC_SWIFT_NOEXPORT
181194void
182195xpc_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
184227__END_DECLS
185228XPC_ASSUME_NONNULL_END
186229
lib/libc/include/any-macos-any/xpc/session.h+54-2
......@@ -14,6 +14,20 @@
1414XPC_ASSUME_NONNULL_BEGIN
1515__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
1731#pragma mark Constants
1832/*!
1933 * @typedef xpc_session_create_flags_t
......@@ -94,7 +108,8 @@ xpc_session_copy_description(xpc_session_t session);
94108 * This will fail if the specified XPC service is either not found or is
95109 * unavailable.
96110 */
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)
98113XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
99114xpc_session_t _Nullable
100115xpc_session_create_xpc_service(const char *name,
......@@ -139,7 +154,8 @@ xpc_session_create_xpc_service(const char *name,
139154 * bootstrap or is otherwise unavailable.
140155 *
141156 */
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)
143159XPC_EXPORT XPC_SWIFT_NOEXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
144160xpc_session_t _Nullable
145161xpc_session_create_mach_service(const char *mach_service,
......@@ -367,6 +383,42 @@ void
367383xpc_session_send_message_with_reply_async(xpc_session_t session,
368384 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
370422__END_DECLS
371423XPC_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)
325325XPC_EXPORT
326326const 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
345328/*!
346329 * @define XPC_TYPE_RICH_ERROR
347330 *
......@@ -367,7 +350,9 @@ XPC_ASSUME_NONNULL_END
367350#include <xpc/listener.h>
368351#endif // __BLOCKS__
369352#undef __XPC_INDIRECT__
353#if __has_include(<launch.h>)
370354#include <launch.h>
355#endif // __has_include(<launch.h>)
371356#endif // !defined(__XPC_BUILDING_XPC__) || !__XPC_BUILDING_XPC__
372357XPC_ASSUME_NONNULL_BEGIN
373358__BEGIN_DECLS
......@@ -2342,6 +2327,32 @@ void
23422327xpc_dictionary_set_connection(xpc_object_t xdict, const char *key,
23432328 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
23452356#pragma mark Dictionary Primitive Getters
23462357/*!
23472358 * @function xpc_dictionary_get_bool
......@@ -2625,6 +2636,33 @@ XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
26252636xpc_object_t _Nullable
26262637xpc_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
26282666#pragma mark Runtime
26292667/*!
26302668 * @function xpc_main
......@@ -2637,7 +2675,8 @@ xpc_dictionary_get_array(xpc_object_t xdict, const char *key);
26372675 * @param handler
26382676 * The handler with which to accept new connections.
26392677 */
2640__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
2678API_AVAILABLE(macos(10.7), macCatalyst(5.0))
2679API_UNAVAILABLE(ios)
26412680XPC_EXPORT XPC_NORETURN XPC_NONNULL1
26422681void
26432682xpc_main(xpc_connection_handler_t handler);
......@@ -2673,7 +2712,8 @@ xpc_main(xpc_connection_handler_t handler);
26732712 * connection's event handler, no more messages will be delivered to the
26742713 * connection.
26752714 */
2676__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
2715API_AVAILABLE(macos(10.7))
2716API_UNAVAILABLE(ios)
26772717XPC_TRANSACTION_DEPRECATED
26782718XPC_EXPORT
26792719void
......@@ -2690,7 +2730,8 @@ xpc_transaction_begin(void);
26902730 * See the discussion for {@link xpc_transaction_begin()} for details regarding
26912731 * the XPC runtime's idle-exit policy.
26922732 */
2693__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
2733API_AVAILABLE(macos(10.7))
2734API_UNAVAILABLE(ios)
26942735XPC_TRANSACTION_DEPRECATED
26952736XPC_EXPORT
26962737void
......@@ -2725,7 +2766,8 @@ xpc_transaction_end(void);
27252766 * between the event handler running and the process exiting.
27262767 */
27272768#if __BLOCKS__
2728__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
2769API_AVAILABLE(macos(10.7))
2770API_UNAVAILABLE(ios)
27292771XPC_EXPORT XPC_NONNULL1 XPC_NONNULL3
27302772void
27312773xpc_set_event_stream_handler(const char *stream,