Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219048/?format=api
{ "id": 2219048, "url": "http://patchwork.ozlabs.org/api/patches/2219048/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/02cf6a499f7363330a7e600f75b70ed0c6ebb7ca.1775122853.git.matheus.bernardino@oss.qualcomm.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<02cf6a499f7363330a7e600f75b70ed0c6ebb7ca.1775122853.git.matheus.bernardino@oss.qualcomm.com>", "list_archive_url": null, "date": "2026-04-02T10:47:27", "name": "[v2,10/16] target/hexagon: add v68 HVX IEEE float compare insns", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0dd4a0f19a9797ab07fe01263d7502c0093e40d3", "submitter": { "id": 90606, "url": "http://patchwork.ozlabs.org/api/people/90606/?format=api", "name": "Matheus Tavares Bernardino", "email": "matheus.bernardino@oss.qualcomm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/02cf6a499f7363330a7e600f75b70ed0c6ebb7ca.1775122853.git.matheus.bernardino@oss.qualcomm.com/mbox/", "series": [ { "id": 498468, "url": "http://patchwork.ozlabs.org/api/series/498468/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498468", "date": "2026-04-02T10:47:20", "name": "hexagon: add missing HVX float instructions", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/498468/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219048/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219048/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=hFqHR50j;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=Phk/nYBz;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmdrM2k0Fz1yGJ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 21:48:51 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w8Fb0-0004oa-VE; Thu, 02 Apr 2026 06:48:22 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <matheus.bernardino@oss.qualcomm.com>)\n id 1w8Fan-0004kd-ED\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 06:48:05 -0400", "from mx0a-0031df01.pphosted.com ([205.220.168.131])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <matheus.bernardino@oss.qualcomm.com>)\n id 1w8Fag-0007ot-L2\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 06:48:01 -0400", "from pps.filterd (m0279867.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 6328Rt8V352289\n for <qemu-devel@nongnu.org>; Thu, 2 Apr 2026 10:47:47 GMT", "from mail-dy1-f197.google.com (mail-dy1-f197.google.com\n [74.125.82.197])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d9myh8h17-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <qemu-devel@nongnu.org>; Thu, 02 Apr 2026 10:47:47 +0000 (GMT)", "by mail-dy1-f197.google.com with SMTP id\n 5a478bee46e88-2c72849f648so3525459eec.0\n for <qemu-devel@nongnu.org>; Thu, 02 Apr 2026 03:47:47 -0700 (PDT)", "from hu-mathbern-lv.qualcomm.com (Global_NAT1.qualcomm.com.\n [129.46.96.20]) by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2ca7d00f5easm2004783eec.29.2026.04.02.03.47.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 02 Apr 2026 03:47:45 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=qcppdkim1; bh=qQ0CPCSb3EJ\n vawUvosj5tPUWguLWpst70une3py6NVA=; b=hFqHR50jxkuaO9/wBXGDwJ3D1cO\n IcPs1FEAMF2nducc7hqZUBmz/MuHK3ObNgg0ZiMhtZQtI1TUr7iEz9vTUqRlgcOk\n 5T2UNQI6V8v3R9Rq8cQJ8w4VGqeInHKPUZrBs54KdethXCni4V4r8TIq3Erb2kh9\n FoACH7bWHPDcbScVewOXpSod4U8sDGJ1GRRvQJyzDIv8E0Z7CLWTZnbZenJUIkp3\n GlzHPIxUbBcUc+nyJNm1s3VUivMu8P+jGl7IQDW9A/Q1sSyiAHwHUZ7cVtXoi7H/\n sI+g3QE1AT2SuHfdBiz80FYcGxC/e/WA7qsl6sWppvKSz+4eOEx8ZAzWtXA==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1775126866; x=1775731666; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=qQ0CPCSb3EJvawUvosj5tPUWguLWpst70une3py6NVA=;\n b=Phk/nYBzRo4GP6d0ecMGRrxWHTAKa5qvlAu3Eb3hAt5f+bgKnUiW0cQ1a+4cEXxqHD\n IPCmaX6LPNSpx4ngc1Z66EwCiB/BTdQ7ZHAYk04lZD+D7zM8tuIcFCWAIKtwsiNwW9sU\n 8kejMJJz9XLhqlEaxEQ8C+XoGEawsgwfnZX/twMbPl7/qNpVTYVXqtlxeJeKS9V6PUX0\n TRpx3VWEjl66De5rQKEo0UdPMcfg4R/rM53hAWWG1Q2GRbvZOnFZ21AJfpQvuC9Jcjjy\n sh/SyPBnKTHSAEeVCoo6pSwn+4vezJv96SCwGqlSsKfLZbIwVonwfLCwvx+qk2RkJxBg\n 2bTg==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775126866; x=1775731666;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=qQ0CPCSb3EJvawUvosj5tPUWguLWpst70une3py6NVA=;\n b=r18Bo0F2+W+qa0CFNrmNkzUi5FbxjPRQnD4s7y3xgzhFGTj1n9PYHXZhxylZfKvQoY\n jurIYJfBgnmaqQqDXX2KaioUbKgmFj70bgAvj7g+tf+a3/Rm36BUmVw+kziLgWDWZpzL\n ND6XxN4LQLWERVkvLOwXteHOfr8YOB25exwXc43LE3ZSydqNPV3UzDuEGQcEj9uGW6FO\n yCV7pqkbwsPi3IC0qiJCr/VR1rxPsbM5aOpeKH2qHLHqSaDb7ZmK84PQ22cvIx5vuEXl\n scoBblpIMSbuwXe+8xXcK5FspmPFPBAAQqj7go2CvuiJntrLXaN3X7nemGMSBHG5ouiY\n 1djw==", "X-Gm-Message-State": "AOJu0Yz9VC7ymYZwZOrIpRB1SZmFvRGt23mC4tOOsir3vZB4OyFZOlVp\n jfIc3jwbmubLfHBVaYckDXcm3c+X9paVQeRx2gW2SOFwPWc4DZBN3BRQwSO14C+98fSkpJPmlwN\n SQrxvUaX7B6DvZPPlvIGQJHZMP/DB+nEJLx7bsNE5FnAZdJx3teQahjudcJxYx87HGz/a", "X-Gm-Gg": "ATEYQzxg3r5VxoG1S+RqGJehC5EnSbGxHuCd5IrKrFqW2oNz7X52IpkZVtYFxiTmcUy\n RAsUbu7u/MSjf9rVb5QRNYPPh7wGvu5Pdt++xEAFcdWK3ojnox2REAYGJpOZEd/P2nmvNAopMMy\n U6BHy/3qB7bormalEp3yKnEBzKBN4gz0rxKboT0izHdCc5N3jiFYyxFwd1H5IUT7maN/2mz5Ubi\n it1yj4gvrd/YQM0VyeqZUDGmIsnQrH+ZjMSpQ3G/plcQ133st/7DuRZG+3skm6VFopRqua+Z1xU\n swVu9l8sl8xZW0oHYqTEURH5rHsXK/rQUFKGAHM9ew53q5ryVEExmo8Gcd2pi2Q8pG+uTS7VI8L\n 2Btlkrjrh+eX3I6LWcmXWxiJ02rW3Hk1xuABWMc1s/iBVrL2iBKPxc8eicriS40qNkRWZjrMbHB\n 2mLgcB+UTe", "X-Received": [ "by 2002:a05:7300:fb8e:b0:2c7:11f2:d072 with SMTP id\n 5a478bee46e88-2c9323b8c8cmr4502835eec.16.1775126866167;\n Thu, 02 Apr 2026 03:47:46 -0700 (PDT)", "by 2002:a05:7300:fb8e:b0:2c7:11f2:d072 with SMTP id\n 5a478bee46e88-2c9323b8c8cmr4502809eec.16.1775126865584;\n Thu, 02 Apr 2026 03:47:45 -0700 (PDT)" ], "From": "Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>", "To": "qemu-devel@nongnu.org", "Cc": "richard.henderson@linaro.org, ale@rev.ng, anjo@rev.ng,\n brian.cain@oss.qualcomm.com, ltaylorsimpson@gmail.com,\n marco.liebel@oss.qualcomm.com, philmd@linaro.org,\n quic_mburton@quicinc.com, sid.manning@oss.qualcomm.com", "Subject": "[PATCH v2 10/16] target/hexagon: add v68 HVX IEEE float compare insns", "Date": "Thu, 2 Apr 2026 03:47:27 -0700", "Message-Id": "\n <02cf6a499f7363330a7e600f75b70ed0c6ebb7ca.1775122853.git.matheus.bernardino@oss.qualcomm.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<cover.1775122853.git.matheus.bernardino@oss.qualcomm.com>", "References": "<cover.1775122853.git.matheus.bernardino@oss.qualcomm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-GUID": "hUzUK1J7_uxmL1xTuVAQrFvPhlara4MW", "X-Proofpoint-ORIG-GUID": "hUzUK1J7_uxmL1xTuVAQrFvPhlara4MW", "X-Authority-Analysis": "v=2.4 cv=JII2csKb c=1 sm=1 tr=0 ts=69ce4953 cx=c_pps\n a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8\n a=9xUHUbetx40kEkOjbCQA:9 a=PxkB5W3o20Ba91AHUih5:22", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDAyMDA5NyBTYWx0ZWRfX9s+an11PevIs\n cWBM0E5LAs74WyRLKF3asoiJodsehyJ1TBytQkAAei6kr5Yu1fxvGDjTrqxGSCraEXonXpmM0xN\n R3tdiIlfCvDapbNyyPHRLdL1TQn1ZqFNKcQVUiQjCtFCMz9iT5+mdO3WfljNyoMw3DWVpwx+ShY\n 0LwlTtoVeEWCNIPnt8lXrhk6HtdtBHwLO9/Y5c1PR+BMReF/2Ovkm+IOkpYwh5Fd1905PuY50ql\n nRAA9mNE1tWSgfSZjwQiwzbRx2mG9Sgfu0PZFvYGjH2vyvaq2MDlJSs4pdQNUmek3wGKNAzWB+1\n /O+0xBNvHCOOjtj1KvzVsWkj3e1Nwy9w7plmlJJRDfVTr9OJUIv5ThJ8kIhVio/mw3TtOH5oKiD\n nTqHdLKj3eVQiKYp1hZ/dfofiCQcTaBETyXpfim9KEb8IsO/Gez2GKM2QIcvyJVhONEd7OTBNo5\n BH99aKIMysF4WSg8Ksw==", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-02_01,2026-04-02_01,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n adultscore=0 impostorscore=0 phishscore=0 priorityscore=1501\n lowpriorityscore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0\n malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001\n definitions=main-2604020097", "Received-SPF": "pass client-ip=205.220.168.131;\n envelope-from=matheus.bernardino@oss.qualcomm.com;\n helo=mx0a-0031df01.pphosted.com", "X-Spam_score_int": "-7", "X-Spam_score": "-0.8", "X-Spam_bar": "/", "X-Spam_report": "(-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=no autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Add HVX IEEE floating-point compare instructions:\n- V6_vgthf, V6_vgtsf: greater-than compare\n- V6_vgthf_and, V6_vgtsf_and: greater-than with predicate-and\n- V6_vgthf_or, V6_vgtsf_or: greater-than with predicate-or\n- V6_vgthf_xor, V6_vgtsf_xor: greater-than with predicate-xor\n\nSigned-off-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>\n---\n target/hexagon/mmvec/hvx_ieee_fp.h | 4 ++\n target/hexagon/mmvec/macros.h | 3 +\n target/hexagon/attribs_def.h.inc | 2 +\n target/hexagon/mmvec/hvx_ieee_fp.c | 52 +++++++++++++++++\n target/hexagon/hex_common.py | 1 +\n target/hexagon/imported/mmvec/encode_ext.def | 10 ++++\n target/hexagon/imported/mmvec/ext.idef | 61 ++++++++++++++++++++\n 7 files changed, 133 insertions(+)", "diff": "diff --git a/target/hexagon/mmvec/hvx_ieee_fp.h b/target/hexagon/mmvec/hvx_ieee_fp.h\nindex e73f8161b1..b68d6db23e 100644\n--- a/target/hexagon/mmvec/hvx_ieee_fp.h\n+++ b/target/hexagon/mmvec/hvx_ieee_fp.h\n@@ -56,6 +56,10 @@ uint32_t qf_min_sf(uint32_t a1, uint32_t a2, float_status *fp_status);\n uint16_t qf_max_hf(uint16_t a1, uint16_t a2, float_status *fp_status);\n uint16_t qf_min_hf(uint16_t a1, uint16_t a2, float_status *fp_status);\n \n+/* IEEE - FP compare instructions */\n+uint32_t cmpgt_sf(uint32_t a1, uint32_t a2, float_status *fp_status);\n+uint16_t cmpgt_hf(uint16_t a1, uint16_t a2, float_status *fp_status);\n+\n /*\n * IEEE - FP Convert instructions\n */\ndiff --git a/target/hexagon/mmvec/macros.h b/target/hexagon/mmvec/macros.h\nindex ac709d8993..318d44efb7 100644\n--- a/target/hexagon/mmvec/macros.h\n+++ b/target/hexagon/mmvec/macros.h\n@@ -356,4 +356,7 @@\n extract32(VAL, POS * 8, 8); \\\n } while (0);\n \n+#define fCMPGT_SF(A, B) cmpgt_sf(A, B, &env->hvx_fp_status)\n+#define fCMPGT_HF(A, B) cmpgt_hf(A, B, &env->hvx_fp_status)\n+\n #endif\ndiff --git a/target/hexagon/attribs_def.h.inc b/target/hexagon/attribs_def.h.inc\nindex d3c4bf6301..2d0fc7e9c0 100644\n--- a/target/hexagon/attribs_def.h.inc\n+++ b/target/hexagon/attribs_def.h.inc\n@@ -81,6 +81,7 @@ DEF_ATTRIB(CVI_SCATTER, \"CVI Scatter operation\", \"\", \"\")\n DEF_ATTRIB(CVI_SCATTER_RELEASE, \"CVI Store Release for scatter\", \"\", \"\")\n DEF_ATTRIB(CVI_TMP_DST, \"CVI instruction that doesn't write a register\", \"\", \"\")\n DEF_ATTRIB(CVI_SLOT23, \"Can execute in slot 2 or slot 3 (HVX)\", \"\", \"\")\n+DEF_ATTRIB(CVI_VA_2SRC, \"Execs on multimedia vector engine; requires two srcs\", \"\", \"\")\n \n DEF_ATTRIB(VTCM_ALLBANK_ACCESS, \"Allocates in all VTCM schedulers.\", \"\", \"\")\n \n@@ -179,6 +180,7 @@ DEF_ATTRIB(HVX_IEEE_FP_ACC, \"HVX IEEE FP accumulate instruction\", \"\", \"\")\n DEF_ATTRIB(HVX_IEEE_FP_OUT_16, \"HVX IEEE FP 16-bit output\", \"\", \"\")\n DEF_ATTRIB(HVX_IEEE_FP_OUT_32, \"HVX IEEE FP 32-bit output\", \"\", \"\")\n DEF_ATTRIB(CVI_VX_NO_TMP_LD, \"HVX multiply without tmp load\", \"\", \"\")\n+DEF_ATTRIB(HVX_FLT, \"This a floating point HVX instruction.\", \"\", \"\")\n \n /* Keep this as the last attribute: */\n DEF_ATTRIB(ZZ_LASTATTRIB, \"Last attribute in the file\", \"\", \"\")\ndiff --git a/target/hexagon/mmvec/hvx_ieee_fp.c b/target/hexagon/mmvec/hvx_ieee_fp.c\nindex d39a883ab7..131d8e5595 100644\n--- a/target/hexagon/mmvec/hvx_ieee_fp.c\n+++ b/target/hexagon/mmvec/hvx_ieee_fp.c\n@@ -217,3 +217,55 @@ int16_t conv_h_hf(uint16_t a, float_status *fp_status)\n }\n return float16_to_int16_round_to_zero(f1, fp_status);\n }\n+\n+/*\n+ * Returns true if f1 > f2, where at least one of the elements is guaranteed\n+ * to be NaN.\n+ * Up to v73, Hexagon HVX IEEE FP follows this order:\n+ * QNaN > SNaN > +Inf > numbers > -Inf > SNaN_neg > QNaN_neg\n+ */\n+static bool float32_nan_compare(float32 f1, float32 f2, float_status *fp_status)\n+{\n+ /* opposite signs case */\n+ if (float32_is_neg(f1) != float32_is_neg(f2)) {\n+ return !float32_is_neg(f1);\n+ }\n+\n+ /* same sign case */\n+ bool result = (float32_is_any_nan(f1) && !float32_is_any_nan(f2)) ||\n+ (float32_is_quiet_nan(f1, fp_status) && !float32_is_quiet_nan(f2, fp_status));\n+ return float32_is_neg(f1) ? !result : result;\n+}\n+\n+static bool float16_nan_compare(float16 f1, float16 f2, float_status *fp_status)\n+{\n+ /* opposite signs case */\n+ if (float16_is_neg(f1) != float16_is_neg(f2)) {\n+ return !float16_is_neg(f1);\n+ }\n+\n+ /* same sign case */\n+ bool result = (float16_is_any_nan(f1) && !float16_is_any_nan(f2)) ||\n+ (float16_is_quiet_nan(f1, fp_status) && !float16_is_quiet_nan(f2, fp_status));\n+ return float16_is_neg(f1) ? !result : result;\n+}\n+\n+uint32_t cmpgt_sf(uint32_t a1, uint32_t a2, float_status *fp_status)\n+{\n+ float32 f1 = make_float32(a1);\n+ float32 f2 = make_float32(a2);\n+ if (float32_is_any_nan(f1) || float32_is_any_nan(f2)) {\n+ return float32_nan_compare(f1, f2, fp_status);\n+ }\n+ return float32_compare(a1, a2, fp_status) == float_relation_greater;\n+}\n+\n+uint16_t cmpgt_hf(uint16_t a1, uint16_t a2, float_status *fp_status)\n+{\n+ float16 f1 = make_float16(a1);\n+ float16 f2 = make_float16(a2);\n+ if (float16_is_any_nan(f1) || float16_is_any_nan(f2)) {\n+ return float16_nan_compare(f1, f2, fp_status);\n+ }\n+ return float16_compare(a1, a2, fp_status) == float_relation_greater;\n+}\ndiff --git a/target/hexagon/hex_common.py b/target/hexagon/hex_common.py\nindex 9e8bcfdcf0..c81dd5b836 100755\n--- a/target/hexagon/hex_common.py\n+++ b/target/hexagon/hex_common.py\n@@ -216,6 +216,7 @@ def need_env(tag):\n \"A_CVI_GATHER\" in attribdict[tag] or\n \"A_CVI_SCATTER\" in attribdict[tag] or\n \"A_HVX_IEEE_FP\" in attribdict[tag] or\n+ \"A_HVX_FLT\" in attribdict[tag] or\n \"A_IMPLICIT_WRITES_USR\" in attribdict[tag])\n \n \ndiff --git a/target/hexagon/imported/mmvec/encode_ext.def b/target/hexagon/imported/mmvec/encode_ext.def\nindex c1ed1b6c23..3572e4de4c 100644\n--- a/target/hexagon/imported/mmvec/encode_ext.def\n+++ b/target/hexagon/imported/mmvec/encode_ext.def\n@@ -858,4 +858,14 @@ DEF_ENC(V6_vconv_w_sf,\"00011110--0--101PP1uuuuu001ddddd\")\n DEF_ENC(V6_vconv_hf_h,\"00011110--0--101PP1uuuuu100ddddd\")\n DEF_ENC(V6_vconv_h_hf,\"00011110--0--101PP1uuuuu010ddddd\")\n \n+/* IEEE FP compare instructions */\n+DEF_ENC(V6_vgtsf,\"00011100100vvvvvPP1uuuuu011100dd\")\n+DEF_ENC(V6_vgthf,\"00011100100vvvvvPP1uuuuu011101dd\")\n+DEF_ENC(V6_vgtsf_and,\"00011100100vvvvvPP1uuuuu110010xx\")\n+DEF_ENC(V6_vgthf_and,\"00011100100vvvvvPP1uuuuu110011xx\")\n+DEF_ENC(V6_vgtsf_or,\"00011100100vvvvvPP1uuuuu001100xx\")\n+DEF_ENC(V6_vgthf_or,\"00011100100vvvvvPP1uuuuu001101xx\")\n+DEF_ENC(V6_vgtsf_xor,\"00011100100vvvvvPP1uuuuu111010xx\")\n+DEF_ENC(V6_vgthf_xor,\"00011100100vvvvvPP1uuuuu111011xx\")\n+\n #endif /* NO MMVEC */\ndiff --git a/target/hexagon/imported/mmvec/ext.idef b/target/hexagon/imported/mmvec/ext.idef\nindex 6d5bab0894..6f01a9d48f 100644\n--- a/target/hexagon/imported/mmvec/ext.idef\n+++ b/target/hexagon/imported/mmvec/ext.idef\n@@ -3135,6 +3135,67 @@ ITERATOR_INSN_SHIFT_SLOT_FLT(16, vconv_hf_h,\"Vd32.hf=Vu32.h\",\n \"Vector conversion of int hw format to hf16\",\n VdV.hf[i] = conv_hf_h(VuV.h[i], &env->hvx_fp_status))\n \n+/******************************************************************************\n+ * IEEE FP compare instructions\n+ ******************************************************************************/\n+\n+#define VCMPGT_SF(DEST, ASRC, ASRCOP, CMP, N, SRC, MASK, WIDTH) \\\n+{ \\\n+ for (fHIDE(int) i = 0; i < fVBYTES(); i += WIDTH) { \\\n+ fHIDE(int) VAL = fCMPGT_SF(VuV.SRC[i/WIDTH],VvV.SRC[i/WIDTH]) ? MASK : 0; \\\n+ fSETQBITS(DEST,WIDTH,MASK,i,ASRC ASRCOP VAL); \\\n+ } \\\n+}\n+\n+#define VCMPGT_HF(DEST, ASRC, ASRCOP, CMP, N, SRC, MASK, WIDTH) \\\n+{ \\\n+ for (fHIDE(int) i = 0; i < fVBYTES(); i += WIDTH) { \\\n+ fHIDE(int) VAL = fCMPGT_HF(VuV.SRC[i/WIDTH],VvV.SRC[i/WIDTH]) ? MASK : 0; \\\n+ fSETQBITS(DEST,WIDTH,MASK,i,ASRC ASRCOP VAL); \\\n+ } \\\n+}\n+\n+/* Vector SF compare */\n+#define MMVEC_CMPGT_SF(TYPE,TYPE2,DESCR,N,MASK,WIDTH,SRC) \\\n+ EXTINSN(V6_vgt##TYPE##_and, \"Qx4&=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than with predicate-and\", \\\n+ VCMPGT_SF(QxV, fGETQBITS(QxV,WIDTH,MASK,i), &, \">\", N, SRC, MASK, WIDTH)) \\\n+ EXTINSN(V6_vgt##TYPE##_xor, \"Qx4^=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than with predicate-xor\", \\\n+ VCMPGT_SF(QxV, fGETQBITS(QxV,WIDTH,MASK,i), ^, \">\", N, SRC, MASK, WIDTH)) \\\n+ EXTINSN(V6_vgt##TYPE##_or, \"Qx4|=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than with predicate-or\", \\\n+ VCMPGT_SF(QxV, fGETQBITS(QxV,WIDTH,MASK,i), |, \">\", N, SRC, MASK, WIDTH)) \\\n+ EXTINSN(V6_vgt##TYPE, \"Qd4=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than\", \\\n+ VCMPGT_SF(QdV, , , \">\", N, SRC, MASK, WIDTH))\n+\n+/* Vector HF compare */\n+#define MMVEC_CMPGT_HF(TYPE,TYPE2,DESCR,N,MASK,WIDTH,SRC) \\\n+ EXTINSN(V6_vgt##TYPE##_and, \"Qx4&=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than with predicate-and\", \\\n+ VCMPGT_HF(QxV, fGETQBITS(QxV,WIDTH,MASK,i), &, \">\", N, SRC, MASK, WIDTH)) \\\n+ EXTINSN(V6_vgt##TYPE##_xor, \"Qx4^=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than with predicate-xor\", \\\n+ VCMPGT_HF(QxV, fGETQBITS(QxV,WIDTH,MASK,i), ^, \">\", N, SRC, MASK, WIDTH)) \\\n+ EXTINSN(V6_vgt##TYPE##_or, \"Qx4|=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than with predicate-or\", \\\n+ VCMPGT_HF(QxV, fGETQBITS(QxV,WIDTH,MASK,i), |, \">\", N, SRC, MASK, WIDTH)) \\\n+ EXTINSN(V6_vgt##TYPE, \"Qd4=vcmp.gt(Vu32.\" TYPE2 \",Vv32.\" TYPE2 \")\", \\\n+ ATTRIBS(A_EXTENSION,A_CVI,A_CVI_VA,A_CVI_VA_2SRC,A_HVX_FLT), \\\n+ DESCR\" greater than\", \\\n+ VCMPGT_HF(QdV, , , \">\", N, SRC, MASK, WIDTH))\n+\n+MMVEC_CMPGT_SF(sf,\"sf\",\"Vector sf Compare \", fVELEM(32), 0xF, 4, sf)\n+MMVEC_CMPGT_HF(hf,\"hf\",\"Vector hf Compare \", fVELEM(16), 0x3, 2, hf)\n+\n /******************************************************************************\n DEBUG Vector/Register Printing\n ******************************************************************************/\n", "prefixes": [ "v2", "10/16" ] }