[{"id":3675418,"web_url":"http://patchwork.ozlabs.org/comment/3675418/","msgid":"<CAATN3NpLvCLEndqkRYOFq7VD0h-4=NfrAiPUO6EafnDst_Cb=A@mail.gmail.com>","list_archive_url":null,"date":"2026-04-09T17:27:42","subject":"Re: [PATCH v3 15/16] tests/hexagon: add tests for v68 HVX IEEE float\n comparisons","submitter":{"id":86757,"url":"http://patchwork.ozlabs.org/api/people/86757/","name":"Taylor Simpson","email":"ltaylorsimpson@gmail.com"},"content":"On Wed, Apr 8, 2026 at 10:37 AM Matheus Tavares Bernardino <\nmatheus.bernardino@oss.qualcomm.com> wrote:\n\n> Signed-off-by: Matheus Tavares Bernardino <\n> matheus.bernardino@oss.qualcomm.com>\n> ---\n>  tests/tcg/hexagon/hex_test.h      |   1 +\n>  tests/tcg/hexagon/fp_hvx_cmp.c    | 227 ++++++++++++++++++++++++++++++\n>  tests/tcg/hexagon/Makefile.target |   3 +\n>  3 files changed, 231 insertions(+)\n>  create mode 100644 tests/tcg/hexagon/fp_hvx_cmp.c\n>\n> diff --git a/tests/tcg/hexagon/fp_hvx_cmp.c\n> b/tests/tcg/hexagon/fp_hvx_cmp.c\n> new file mode 100644\n> +static void test_cmp_variants(void)\n> +{\n> +    HVX_VectorPred true_pred, false_pred, pred;\n> +    memset(&true_pred, 0xff, sizeof(true_pred));\n> +    memset(&false_pred, 0, sizeof(false_pred));\n>\n\nMinor nit - Use a single vector with a mix of true/false values instead of\none test with all-true and another test with all-false.\n\n\n> +\n> +    PREP_TEST();\n> +    ADD_TEST_CMP(sf, SF_one,  SF_zero, true);\n> +    ADD_TEST_CMP(sf, SF_zero, SF_one,  false);\n> +    ADD_TEST_CMP(sf, SF_one,  SF_zero, true);\n> +    ADD_TEST_CMP(sf, SF_zero, SF_one,  false);\n> +\n> +    /* greater and */\n> +    pred = Q6_Q_vcmp_gtand_QVsfVsf(true_pred, buffers[0], buffers[1]);\n> +    *hvx_output = Q6_V_vmux_QVV(pred, true_vec, false_vec);\n> +    for (int j = 0; j < 4; j++) {\n> +        int exp = j % 2 ? 0 : 0xffffffff;\n> +        if (output[0].sf[j] != exp) {\n> +            printf(\"ERROR line %d: gtand %d: expected 0x%x got 0x%x\\n\",\n> +                   __LINE__, j, exp, output[0].sf[j]);\n> +            err++;\n> +        }\n> +    }\n> +    pred = Q6_Q_vcmp_gtand_QVsfVsf(false_pred, buffers[0], buffers[1]);\n> +    *hvx_output = Q6_V_vmux_QVV(pred, true_vec, false_vec);\n> +    for (int j = 0; j < 4; j++) {\n> +        if (output[0].sf[j]) {\n> +            printf(\"ERROR line %d: gtand %d: expected false\\n\", __LINE__,\n> j);\n> +            err++;\n> +        }\n> +    }\n> +\n> +    /* greater or */\n> +    pred = Q6_Q_vcmp_gtor_QVsfVsf(false_pred, buffers[0], buffers[1]);\n> +    *hvx_output = Q6_V_vmux_QVV(pred, true_vec, false_vec);\n> +    for (int j = 0; j < 4; j++) {\n> +        int exp = j % 2 ? 0 : 0xffffffff;\n> +        if (output[0].sf[j] != exp) {\n> +            printf(\"ERROR line %d: gtor %d: expected 0x%x got 0x%x\\n\",\n> +                   __LINE__, j, exp, output[0].sf[j]);\n> +            err++;\n> +        }\n> +    }\n> +    pred = Q6_Q_vcmp_gtor_QVsfVsf(true_pred, buffers[0], buffers[1]);\n> +    *hvx_output = Q6_V_vmux_QVV(pred, true_vec, false_vec);\n> +    for (int j = 0; j < 4; j++) {\n> +        if (!output[0].sf[j]) {\n> +            printf(\"ERROR line %d: gtor %d: expected true\\n\", __LINE__,\n> j);\n> +            err++;\n> +        }\n>\n\nAdd a test for xor\n\n\n> +    }\n> +}\n> +\n> +int main(void)\n> +{\n> +    memset(&true_vec, 0xff, sizeof(true_vec));\n> +    memset(&false_vec, 0, sizeof(false_vec));\n> +\n> +    test_cmp_sf();\n> +    test_cmp_hf();\n> +    test_cmp_variants();\n> +\n> +    puts(err ? \"FAIL\" : \"PASS\");\n> +    return err ? 1 : 0;\n> +}\n> diff --git a/tests/tcg/hexagon/Makefile.target\n> b/tests/tcg/hexagon/Makefile.target\n> index 83969e0e73..76ba245add 100644\n> --- a/tests/tcg/hexagon/Makefile.target\n> +++ b/tests/tcg/hexagon/Makefile.target\n> @@ -52,6 +52,7 @@ HEX_TESTS += hvx_misc\n>  HEX_TESTS += hvx_histogram\n>  HEX_TESTS += fp_hvx\n>  HEX_TESTS += fp_hvx_cvt\n> +HEX_TESTS += fp_hvx_cmp\n>  HEX_TESTS += fp_hvx_disabled\n>  HEX_TESTS += invalid-slots\n>  HEX_TESTS += invalid-encoding\n> @@ -135,6 +136,8 @@ fp_hvx_disabled: fp_hvx_disabled.c hvx_misc.h\n>  fp_hvx_disabled: CFLAGS += -mhvx -mhvx-ieee-fp\n>  fp_hvx_cvt: fp_hvx_cvt.c hvx_misc.h\n>  fp_hvx_cvt: CFLAGS += -mhvx -mhvx-ieee-fp\n> +fp_hvx_cmp: fp_hvx_cmp.c hvx_misc.h\n>\n\nAlso hex_test.h\n\nOtherwise\nReviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>","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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=jQRrBRue;\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 (lists1p.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 4fs6Mv6cD5z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 03:28:11 +1000 (AEST)","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 1wAtAe-00028I-AC; Thu, 09 Apr 2026 13:28:00 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <ltaylorsimpson@gmail.com>)\n id 1wAtAc-000270-Qh\n for qemu-devel@nongnu.org; Thu, 09 Apr 2026 13:27:58 -0400","from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <ltaylorsimpson@gmail.com>)\n id 1wAtAa-0005YF-Vx\n for qemu-devel@nongnu.org; Thu, 09 Apr 2026 13:27:58 -0400","by mail-pl1-x62e.google.com with SMTP id\n d9443c01a7336-2addb31945aso7856205ad.1\n for <qemu-devel@nongnu.org>; Thu, 09 Apr 2026 10:27:56 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; t=1775755675; cv=none;\n d=google.com; s=arc-20240605;\n b=VKrxLSs+vXa2kF9jnQars0a1OMNwQibJppSrHA5V6rZ1dB82Y7psgYzaBBcBkO9idW\n 8PLOvNU7yDxJF24THi0i0oHzm4r5qcsAnt0k05V0zxcX8r/KC0gCRY2BqRNsA3hhDkhE\n CegYonVrLC1TKeKfBLffxhVnMi92oyeM4IyFyNZvhp8zR35lYDXYIC92SrqsTmV9i5Ah\n BMqqKSPdNl6knTLdoNKFnOrPCsDLdyf2GunQ6hhHQ+UhNVGzLr7BPyAgZOhTKNG2Qkgf\n nPLX8jrvAw+s4EMNqHM0KTDUPTDxy+crcIaZHngo5NXvhOe+WBZrja2npDClXCY6LVCz\n ozDg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=da8dZHOAV15R7rSphM+0+4IQr+G/pblv8fdCwkg1+gE=;\n fh=seHpsuERei6GoCJPMtZiXpXOw/2EVnvuQ7nSTREwIqg=;\n b=JFSx9n79n2ldv+ZVlg5DuQZLv1YXvpLeeJuVHMjfGMg2WEH4Ea8nY1atOtSpONgC+z\n aWmm8tXRMduct+NXUbqFmYdwQ5M8Xhaft1fDlhVjUMTu8s4pszqIMYkfh2RLNjCDI5ik\n RgJn6R4drYKjXBNwJunhdCHPxGnYoeCYx+hLBcg/+3002npwP3fOQAZ/pWG9I5hC0IFU\n gmre4UoP1MbT774E3JBrIf0LEQJmIGrbXe2kX7rt0Bkwr+GIiqqxXLFP6yRLm1OoIHhh\n zsVIyPCC/p1GkeMEwIo9zAEgDMVe0yiIATSe0z7SgKBW5fYI7V8NR3Y4HSKMBxl0gH0P\n lnlA==; darn=nongnu.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775755675; x=1776360475; darn=nongnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=da8dZHOAV15R7rSphM+0+4IQr+G/pblv8fdCwkg1+gE=;\n b=jQRrBRue3gv0SZWE8q9J2ExH5T8k0Xrrg1XMmGTB3gaOSxCMpBN2UabHyt6viCIVa5\n lT6kENZzjuXwkcNXi4vCbXye52clPnw1GpF9JmED+TrdoTBzYDgtBFqnOuaKb1wHvkKK\n F/69lGCVrBjpMvG7gMChXFZc6VbT47RXk/xgRkhTiSiBEY5dO1zXk1uKIWjJTS4dDj9f\n S3SFKBon3enlm8qo53pPaFFmZuaOjRTvEWRh7V4ryL1fCK6pLf9tZfOshqKwkRAE1uVq\n YlrtFfLftQP5cZawsCLQ3ZVC9NrSodzygZHPvnKp1wHjh2kt7Ou/iY2+j59qIjlPiZXc\n Leng==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775755675; x=1776360475;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=da8dZHOAV15R7rSphM+0+4IQr+G/pblv8fdCwkg1+gE=;\n b=Gpq0I4JfHsw3X9hge3U1Ut6k73R+HIin0yQjuo/okOZ0+wVDqeH5/fSQ0b9fjVjb8T\n 9hMXmP+RzF1bVppJqIi2gKqGV8N21fcXvUD03G70STgGLKMC0415JNgFiv7PqNJSn2dE\n 8rCzVKtrd41+3mG5l2iQcDpz1z8952U/Ju6eZci+uwZo2Y85Pxb4fNRmiMpVdvMxb2m1\n 8hPkmhsK4jXBOxOJQuJXycoRXKRgXHG99dHgo/BrzUIu0UMLppjdSehaYn2ZVkn8ETB1\n RakuFfx9lKCicFYWFyNA8S++lQG/ssyambaays1vZt0M0SSk1NPJNBXSKs4/Qg+QmZhS\n oehQ==","X-Gm-Message-State":"AOJu0Yx5gA9niniyQ5Urd/0kOwwMVZKQv1ZsNwDwu3ihs+goxdaZQ8Z+\n S2PGcvS9Ousvr4KG5vcx2Dniw5Y3M5leYy5OJdseTl2gTreQ1bGUzv0tHn7t+iB5SBFZ02p1eZc\n HzIFV6RFYQC3Ut1uaZ/8YHljyNrVR7v8=","X-Gm-Gg":"AeBDieuAJYLCarnH1reZdRCPt26u676hFM22SnKLUGU8laydWVYFdM9zvpnlqYadU6h\n 4DASJmbIeAchI3n9NX0f8nCe4KtZsv8AUncslkn2nHdOU+XAA+zxgJ5h+hvsWMGDq6JxuJME+KB\n aww2cKGmZ4qD4hFV6/X9U5bEjGGcOSdTDU9QpbcoXeCwLsuoMbqNVDW7hNa6IcoMD5zeRTQVjJp\n 16rRcs14vehA+fQFLKU2Pkd/K4iW9YznlAJM7JGhYtylmOS5LlhOK+gBmWJffxtZa2I0sW9j9/m\n FVfcUKc1PUi/L6Aj9dMILekUUk9f87ZUMbbJs2E=","X-Received":"by 2002:a17:903:984:b0:2aa:d67b:ef96 with SMTP id\n d9443c01a7336-2b28191857emr266832315ad.31.1775755675454; Thu, 09 Apr 2026\n 10:27:55 -0700 (PDT)","MIME-Version":"1.0","References":"<cover.1775665981.git.matheus.bernardino@oss.qualcomm.com>\n <f46538124c66fdd7401438f88f9ba1a3e3a2baf5.1775665981.git.matheus.bernardino@oss.qualcomm.com>","In-Reply-To":"\n <f46538124c66fdd7401438f88f9ba1a3e3a2baf5.1775665981.git.matheus.bernardino@oss.qualcomm.com>","From":"Taylor Simpson <ltaylorsimpson@gmail.com>","Date":"Thu, 9 Apr 2026 11:27:42 -0600","X-Gm-Features":"AQROBzBcC5eXDBb1yPj6tkOdDdFR5z_kXS_iiIGO1b_SXjOReKOJgBMz4N1CvOw","Message-ID":"\n <CAATN3NpLvCLEndqkRYOFq7VD0h-4=NfrAiPUO6EafnDst_Cb=A@mail.gmail.com>","Subject":"Re: [PATCH v3 15/16] tests/hexagon: add tests for v68 HVX IEEE float\n comparisons","To":"Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>","Cc":"qemu-devel@nongnu.org, richard.henderson@linaro.org, ale@rev.ng,\n anjo@rev.ng, brian.cain@oss.qualcomm.com, marco.liebel@oss.qualcomm.com,\n philmd@linaro.org, quic_mburton@quicinc.com, sid.manning@oss.qualcomm.com","Content-Type":"multipart/alternative; boundary=\"0000000000003e52ec064f0a5632\"","Received-SPF":"pass client-ip=2607:f8b0:4864:20::62e;\n envelope-from=ltaylorsimpson@gmail.com; helo=mail-pl1-x62e.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 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, FREEMAIL_FROM=0.001,\n HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham 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"}}]