From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id BBFBD22335 for ; Thu, 21 Nov 2024 03:26:46 +0100 (CET) Received: (qmail 16337 invoked by uid 550); 21 Nov 2024 02:26:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com x-ms-reactions: disallow Received: (qmail 16302 invoked from network); 21 Nov 2024 02:26:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732155992; x=1732760792; darn=lists.openwall.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=VZV9X3KANjiKFGfPovl5AJy92ziKQrgZEePKuniXbag=; b=huZn4iUDs9TCjsP8dF52LJnzFp+fcWkBLLRe26zODK9ErEgsyuBgpdwS7JJTVEE3ui 0QVzQYxui8fLrIg4K4pBRc8KQnpdo+UvkGzA7R53tIhhtHnAbEaPI24UwiD1Cc0S7fOh leH8BKrZqXBTiPP2m6x1d9pL+S9VoRgtxlUZ2Ax59cvNc/InUPgnSRsD/nfYmOODggLr dyBfLkCwBPyPcjFHFMEgMlcAWRvkEKUxeBWFVduRJ2AS6D4XK/cc5LoD17xRQ+X+dTjl VQDSGwSlrRKC81LKXG4OkvCnReozHJIYvueyh1ZNqauVXZdnsSgAx2U+vYfhoYcXOLff DwYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732155992; x=1732760792; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VZV9X3KANjiKFGfPovl5AJy92ziKQrgZEePKuniXbag=; b=bsM/9UxdTSroCjiwkhG0A1aGHxXYoPVQYBreWTzwd0vlIrGF686lQAFn4WTFkYpvUS +Bjvwd7O3xndA6HhWmukydali0OViINckTNbrFN6r3olE3cnJ1YWPvaZyGviGA6UzFol HtuzMuErQfPQhdjMc5O9oMbte7fif3ZHoHqPm+x9iXmi60Ek82ttlCWLW4mrp+tei19C oxEYN/9FSRv/CUXoxDaT6UTO0YyVhuy/kRBr0KecBvebsC9KACEatB5WZZ00gjafyYuy iOwypZ3HoOiZSYbWXcTKvmr1uAx4No5PZ3vFjLt+Yld/jiB7HeS0zy0IUa2XZNqno5bh wovQ== X-Gm-Message-State: AOJu0YyDT9azym+kMJ0LdG0BZ2Gbg5hkCFE1MbaOBoG+ZcRFUWNDatF0 p5M5an2jl1ZbzQ3RBjH6E80CLahM83eqnPSmaRR7M/5Ol/z/MtmysiI0UxPqLn17ZudNVWCJLfc X4IXff+fwFt8D4bg2knpAUVX6uXAdaZNe X-Google-Smtp-Source: AGHT+IFJg7SyfLfVLTCBqOuncaTwJ+02C2c0SjJN8Yh0AWcmOFTM4ip5GqQGQpO0GRbm+iMfqcFUwpGcRzUd7FwuAWE= X-Received: by 2002:a05:690c:6007:b0:6ee:55c7:6128 with SMTP id 00721157ae682-6eecd236924mr19242927b3.5.1732155991491; Wed, 20 Nov 2024 18:26:31 -0800 (PST) MIME-Version: 1.0 From: Jesse DeGuire Date: Wed, 20 Nov 2024 20:26:23 -0600 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/mixed; boundary="00000000000091c315062762fe25" Subject: [musl] [PATCH] Add additional __ARM_FP checks to ARM FPU math functions --00000000000091c315062762fe25 Content-Type: text/plain; charset="UTF-8" Hi everyone! I found that I was getting compiler errors when I try to build Musl for an ARMv8.1M Mainline target that does not have floating-point support but does have the M-Profile Vector Extensions (MVE). The errors were that Musl wanted to use unsupported floating-point instructions for fabsf() and sqrtf(). I was able to correct this by adding checks for (__ARM_FP & 4) to the ARM "fabsf.c" and "sqrtf.c" files, which is all this tiny patch does. The relevant options I used with Clang were "-march=armv8.1m.main+mve -mfpu=none -mfloat-abi=hard". MVE uses the FP register file, but treats them as 8 128-bit registers instead of 16 64-bit registers, so presumably that's why the hard float ABI is used even when floating-point operations are not enabled. In this case, an integer-only subset of MVE is used. Here is a Godbolt link that shows that you can make this happen on GCC, too. https://www.godbolt.org/z/Mf4h489s8 I'm not sure if this is totally necessary since I suspect this would affect only ARM M-Profile devices, but maybe it at least wouldn't hurt to have. Thanks, Jesse DeGuire --00000000000091c315062762fe25 Content-Type: application/octet-stream; name="arm_fp_check.patch" Content-Disposition: attachment; filename="arm_fp_check.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m3qouxm20 ZGlmZiAtLWdpdCBhL3NyYy9tYXRoL2FybS9mYWJzZi5jIGIvc3JjL21hdGgvYXJtL2ZhYnNmLmMK aW5kZXggNGEyMTdjOTguLjc5MGQ0Y2ZlIDEwMDY0NAotLS0gYS9zcmMvbWF0aC9hcm0vZmFic2Yu YworKysgYi9zcmMvbWF0aC9hcm0vZmFic2YuYwpAQCAtMSw2ICsxLDYgQEAKICNpbmNsdWRlIDxt YXRoLmg+CiAKLSNpZiBfX0FSTV9QQ1NfVkZQICYmICFCUk9LRU5fVkZQX0FTTQorI2lmIF9fQVJN X1BDU19WRlAgJiYgIUJST0tFTl9WRlBfQVNNICYmIChfX0FSTV9GUCY0KQogCiBmbG9hdCBmYWJz ZihmbG9hdCB4KQogewpkaWZmIC0tZ2l0IGEvc3JjL21hdGgvYXJtL3NxcnRmLmMgYi9zcmMvbWF0 aC9hcm0vc3FydGYuYwppbmRleCAzMjY5MzI5My4uNTFmNDRmOGMgMTAwNjQ0Ci0tLSBhL3NyYy9t YXRoL2FybS9zcXJ0Zi5jCisrKyBiL3NyYy9tYXRoL2FybS9zcXJ0Zi5jCkBAIC0xLDYgKzEsNiBA QAogI2luY2x1ZGUgPG1hdGguaD4KIAotI2lmIChfX0FSTV9QQ1NfVkZQIHx8IChfX1ZGUF9GUF9f ICYmICFfX1NPRlRGUF9fKSkgJiYgIUJST0tFTl9WRlBfQVNNCisjaWYgKF9fQVJNX1BDU19WRlAg fHwgKF9fVkZQX0ZQX18gJiYgIV9fU09GVEZQX18pKSAmJiAhQlJPS0VOX1ZGUF9BU00gJiYgKF9f QVJNX0ZQJjQpCiAKIGZsb2F0IHNxcnRmKGZsb2F0IHgpCiB7Cg== --00000000000091c315062762fe25--