From patchwork Wed Aug 9 15:52:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 133314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2890899vqr; Wed, 9 Aug 2023 08:53:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb/A8S8DrWGazMySz8pYCVm1XF8ZoC+eFs2gQ0m92fIOIx1w1GEwiYgoeuyvObHCgy5snz X-Received: by 2002:a05:6402:5150:b0:522:ab77:36b7 with SMTP id n16-20020a056402515000b00522ab7736b7mr2413181edd.4.1691596417640; Wed, 09 Aug 2023 08:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691596417; cv=none; d=google.com; s=arc-20160816; b=UNphlmvsPFgmnspKk4l0KaJHUf2z9wcLva49Zh4FRp5wGPT4yQPvjgQzYmwCfBpq+n cEP94dZ0xtygSu1fDnxFW7k1nyXeeCRB80PZSBA67peFcyVeRbkNqAyngg3w5Sxta3Lo gnVhdeqU6BtJ+EdzIhIq81CUXVPLN1C+bp1pZSqxfk5ASaUSoN6lLZ9qnqeK93XkRCu0 prgQn0N6Clb3EZ0x9LfoKfuoPs4fTobi9La1wTLD8JcrK1uy2moJUUX3urXdB4MmZW1h 3n9TiFCgDais9hRA+sGzKGetzk0pfVTbhurM4oKiRvmWzpqO+mYHN4tGFuQ+kIgA51Sz vJtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to:date :cc:to:subject:message-id:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=AAFaz4xArl+F1n7qHbhjkZB6f/JUvPmnttp5ue+Rza8=; fh=bmN2spGjxAfOGtR8LeEZzbJTIg5ESfrRldoWYGN+T2I=; b=iFDXOKavyXD2iGQCK9K3WiNaDV7jbj3j5vES34kRMHd2lxE7LvV4mqNv9ayUVjUkKY mnafB+gXZHfiXAKUlrFbx+bVNu4VGl7tkkyF43j+gG3d8jzY2EfgfZ9RG7zGdXsydVLX 6/m+ZcwnuscyHs/2ONo5wbDlDqO6ywkcUYyknvqQRx9J8hiwioXeA3Q591C/HzEQDwsR Ez4FwNYBrM1DiKr1XpnZJ2aDWNGr5GJFizzukZNLqQXnCWuucWTlWUMQL5eAA5tzk56y MLmYVhz9iKwS7a5PAKGRuWpmG5zTPt2G4kbpEQe6LN0Ca3yIwJEbRkPm928vNk2xGGbW EmsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o8KkMGFs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x22-20020aa7d6d6000000b00522e4a675easi5732997edr.31.2023.08.09.08.53.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 08:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o8KkMGFs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 674023858D20 for ; Wed, 9 Aug 2023 15:53:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 674023858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691596415; bh=AAFaz4xArl+F1n7qHbhjkZB6f/JUvPmnttp5ue+Rza8=; h=Subject:To:Cc:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=o8KkMGFswOlU61rJG7k/KDmPj0YjzR7yjPn7wP6W9/kqnv7ayS78dr/0voZPvVt2W iyK1jxS4+PsrYOZdaX3tPTun+h1dsiO/ZzQ1/cuYwr7CcOso3L40DHjMXPmqfi040H /2reeG7rQr8DbDdHJWiWlhdXpD9DD70JmnPSUxtM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id ACB0C3858D20 for ; Wed, 9 Aug 2023 15:52:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACB0C3858D20 Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 379Fn3ff025514; Wed, 9 Aug 2023 15:52:51 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3scdfq8v1r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 15:52:50 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 379FTUcc006092; Wed, 9 Aug 2023 15:52:49 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3scdfq8v16-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 15:52:49 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 379EPcp8001802; Wed, 9 Aug 2023 15:52:48 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3sa3f2125n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Aug 2023 15:52:48 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 379Fql5r5833248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Aug 2023 15:52:47 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8447F5803F; Wed, 9 Aug 2023 15:52:47 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 052545805A; Wed, 9 Aug 2023 15:52:47 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.61.62.89]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 9 Aug 2023 15:52:46 +0000 (GMT) Message-ID: Subject: [PATCH] rs6000, add overloaded DFP quantize support To: "Kewen.Lin" , Peter Bergner , Segher Boessenkool , David Edelsohn , gcc-patches@gcc.gnu.org Cc: cel@us.ibm.com Date: Wed, 09 Aug 2023 08:52:46 -0700 In-Reply-To: <4137d6efccb023586eedbea77ca4e71e74a01d80.camel@us.ibm.com> References: <4137d6efccb023586eedbea77ca4e71e74a01d80.camel@us.ibm.com> X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: UMgt9VYuZg3Cu1Bw-kZ-6TPuo3zO6uol X-Proofpoint-GUID: 0AJV1gI1SOywosv7bkPXrYOqWte-Gqve X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-09_12,2023-08-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308090137 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carl Love via Gcc-patches From: Carl Love Reply-To: Carl Love Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773767405267501560 X-GMAIL-MSGID: 1773767405267501560 GCC maintainers: The following patch adds four built-ins for the decimal floating point (DFP) quantize instructions on rs6000. The built-ins are for 64-bit and 128-bit DFP operands. The patch also adds a test case for the new builtins. The Patch has been tested on Power 10LE and Power 9 LE/BE. Please let me know if the patch is acceptable for mainline. Thanks. Carl Love ------------------------------------------ rs6000, add overloaded DFP quantize support Add decimal floating point (DFP) quantize built-ins for both 64-bit DFP and 128-DFP operands. In each case, there is an immediate version and a variable version of the bult-in. The RM value is a 2-bit const int which specifies the rounding mode to use. For the immediate versions of the built-in, TE field is a 5-bit constant that specifies the value of the ideal exponent for the result. The built-in specifications are: __Decimal64 builtin_dfp_quantize (_Decimal64, _Decimal64, const int RM) __Decimal64 builtin_dfp_quantize (const int TE, _Decimal64, const int) __Decimal128 builtin_dfpq_quantize (_Decimal128, _Decimal128, const int RM) __Decimal128 builtin_dfpq_quantize (const int TE, _Decimal128, const int) A testcase is added for the new built-in definitions. gcc/ChangeLog: * config/rs6000/dfp.md: New UNSPECDQUAN. (dfp_quan_, dfp_quan_i): New define_insn. * config/rs6000/rs6000-builtins.def (__builtin_dfp_quantize_64, __builtin_dfp_quantize_64i, __builtin_dfp_quantize_128, __builtin_dfp_quantize_128i): New buit-in definitions. * config/rs6000/rs6000-overload.def (__builtin_dfp_quantize, __builtin_dfpq_quantize): New overloaded definitions. gcc/testsuite/ * gcc.target/powerpc/builtin-dfp-quantize-runnable.c: New test case. --- gcc/config/rs6000/dfp.md | 25 ++- gcc/config/rs6000/rs6000-builtins.def | 15 ++ gcc/config/rs6000/rs6000-overload.def | 12 ++ .../powerpc/builtin-dfp-quantize-runnable.c | 198 ++++++++++++++++++ 4 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/builtin-dfp-quantize-runnable.c diff --git a/gcc/config/rs6000/dfp.md b/gcc/config/rs6000/dfp.md index 5ed8a73ac51..254c22a5c20 100644 --- a/gcc/config/rs6000/dfp.md +++ b/gcc/config/rs6000/dfp.md @@ -271,7 +271,8 @@ UNSPEC_DIEX UNSPEC_DSCLI UNSPEC_DTSTSFI - UNSPEC_DSCRI]) + UNSPEC_DSCRI + UNSPEC_DQUAN]) (define_code_iterator DFP_TEST [eq lt gt unordered]) @@ -395,3 +396,25 @@ "dscri %0,%1,%2" [(set_attr "type" "dfp") (set_attr "size" "")]) + +(define_insn "dfp_quan_" + [(set (match_operand:DDTD 0 "gpc_reg_operand" "=d") + (unspec:DDTD [(match_operand:DDTD 1 "gpc_reg_operand" "d") + (match_operand:DDTD 2 "gpc_reg_operand" "d") + (match_operand:QI 3 "immediate_operand" "i")] + UNSPEC_DQUAN))] + "TARGET_DFP" + "dqua %0,%1,%2,%3" + [(set_attr "type" "dfp") + (set_attr "size" "")]) + +(define_insn "dfp_quan_i" + [(set (match_operand:DDTD 0 "gpc_reg_operand" "=d") + (unspec:DDTD [(match_operand:SI 1 "const_int_operand" "n") + (match_operand:DDTD 2 "gpc_reg_operand" "d") + (match_operand:SI 3 "immediate_operand" "i")] + UNSPEC_DQUAN))] + "TARGET_DFP" + "dquai %1,%0,%2,%3" + [(set_attr "type" "dfp") + (set_attr "size" "")]) diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 35c4cdf74c5..36a56311643 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -2983,6 +2983,21 @@ const unsigned long long __builtin_unpack_dec128 (_Decimal128, const int<1>); UNPACK_TD unpacktd {} + const _Decimal64 __builtin_dfp_quantize_64 (_Decimal64, _Decimal64, \ + const int<2>); + DFPQUAN_64 dfp_quan_dd {} + + const _Decimal64 __builtin_dfp_quantize_64i (const int<5>, _Decimal64, \ + const int<2>); + DFPQUAN_64i dfp_quan_idd {} + + const _Decimal128 __builtin_dfp_quantize_128 (_Decimal128, _Decimal128, \ + const int<2>); + DFPQUAN_128 dfp_quan_td {} + + const _Decimal128 __builtin_dfp_quantize_128i (const int<5>, _Decimal128, \ + const int<2>); + DFPQUAN_128i dfp_quan_itd {} [crypto] const vull __builtin_crypto_vcipher (vull, vull); diff --git a/gcc/config/rs6000/rs6000-overload.def b/gcc/config/rs6000/rs6000-overload.def index b83946f5ad8..3bb1bedd69d 100644 --- a/gcc/config/rs6000/rs6000-overload.def +++ b/gcc/config/rs6000/rs6000-overload.def @@ -195,6 +195,18 @@ unsigned long long __builtin_cmpb (unsigned long long, unsigned long long); CMPB +[DFPQUAN_64, dfp_quan_64, __builtin_dfp_quantize] + _Decimal64 __builtin_dfp_quantize (_Decimal64, _Decimal64, const int); + DFPQUAN_64 + _Decimal64 __builtin_dfp_quantize (const int, _Decimal64, const int); + DFPQUAN_64i + +[DFPQUAN_128, dfp_quan_128, __builtin_dfpq_quantize] + _Decimal128 __builtin_dfpq_quantize (_Decimal128, _Decimal128, const int); + DFPQUAN_128 + _Decimal128 __builtin_dfpq_quantize (const int, _Decimal128, const int); + DFPQUAN_128i + [VEC_ABS, vec_abs, __builtin_vec_abs] vsc __builtin_vec_abs (vsc); ABS_V16QI diff --git a/gcc/testsuite/gcc.target/powerpc/builtin-dfp-quantize-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtin-dfp-quantize-runnable.c new file mode 100644 index 00000000000..f4ba7236fe3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/builtin-dfp-quantize-runnable.c @@ -0,0 +1,198 @@ +/* { dg-do run } */ +/* { dg-require-effective-target dfp } */ +/* { dg-options "-O2 -save-temps" } */ + + +#define DEBUG 0 + +#ifdef DEBUG +#include +#endif +#include + +void abort (void); + +int main() +{ +#define IMM2 2 +#define IMM3 3 +#define IMM4 4 + + _Decimal64 srcA_dfp64, srcB_dfp64; + _Decimal64 result_dfp64; + _Decimal64 expected_result_dfp64; + _Decimal128 srcA_dfp128, srcB_dfp128; + _Decimal128 result_dfp128; + _Decimal128 expected_result_dfp128; + + /* Third argument of quantize built-ins is the rounding mode value (RMC). + + RMC Rounding Mode + 00 Round toward 0 + 01 Round to -infinity + 10 Round to nearest, ties toward 0 + 11 Round according to DRN */ + + + /* Tests for quantize with 64-bit DFP variable. */ + srcA_dfp64 = 100.0df; + srcB_dfp64 = 300.456789df; + expected_result_dfp64 = 300.5df; + + result_dfp64 = __builtin_dfp_quantize (srcA_dfp64, srcB_dfp64, 0x0); + + if (result_dfp64 != expected_result_dfp64) +#if DEBUG + printf("DFP 64-bit quantize of variable, RMC = 0 result does not match expected result\n"); +#else + abort(); +#endif + + srcA_dfp64 = 100.00df; + srcB_dfp64 = 300.456789df; + expected_result_dfp64 = 300.45df; + + result_dfp64 = __builtin_dfp_quantize (srcA_dfp64, srcB_dfp64, 0x1); + + if (result_dfp64 != expected_result_dfp64) +#if DEBUG + printf("DFP 64-bit quantize of variable, RMC = 1 result does not match expected result\n"); +#else + abort(); +#endif + + srcA_dfp64 = 100.001df; + srcB_dfp64 = 3001.456789df; + expected_result_dfp64 = 3001.457df; + + result_dfp64 = __builtin_dfp_quantize (srcA_dfp64, srcB_dfp64, 0x2); + + if (result_dfp64 != expected_result_dfp64) +#if DEBUG + printf("DFP 64-bit quantize of variable, RMC = 2 result does not match expected result\n"); +#else + abort(); +#endif + + /* Tests for 64-bit quantize with immediate value. */ + + srcB_dfp64 = 10.4567df; + expected_result_dfp64 = 000.0df; + + result_dfp64 = __builtin_dfp_quantize (IMM2, srcB_dfp64, 0x0); + + if (result_dfp64 != expected_result_dfp64) +#if DEBUG + printf("DFP 64-bit quantize immediate, RMC = 0 result does not match expected result\n"); +#else + abort(); +#endif + + srcB_dfp64 = 104567.891df; + expected_result_dfp64 = 100000.0df; + + result_dfp64 = __builtin_dfp_quantize (IMM4, srcB_dfp64, 0x1); + + if (result_dfp64 != expected_result_dfp64) +#if DEBUG + printf("DFP 64-bit quantize immediate, RMC = 1 result does not match expected result\n"); +#else + abort(); +#endif + + srcB_dfp64 = 109876.54321df; + expected_result_dfp64 = 109900.0df; + + result_dfp64 = __builtin_dfp_quantize (IMM2, srcB_dfp64, 0x2); + + if (result_dfp64 != expected_result_dfp64) +#if DEBUG + printf("DFP 64-bit quantize immediate, RMC = 2 result does not match expected result\n"); +#else + abort(); +#endif + + /* Tests for quantize 128-bit DFP variable. */ + srcA_dfp128 = 0.018df; + srcB_dfp128 = 50000.18345df; + expected_result_dfp128 = 50000.180df; + + result_dfp128 = __builtin_dfpq_quantize (srcA_dfp128, srcB_dfp128, 0x0); + + if (result_dfp128 != expected_result_dfp128) +#if DEBUG + printf("DFP 128-bit quantize variable, RMC = 0 result does not match expected result\n"); +#else + abort(); +#endif + + srcA_dfp128 = 8.01df; + srcB_dfp128 = 50000.18345df; + expected_result_dfp128 = 50000.18df; + + result_dfp128 = __builtin_dfpq_quantize (srcA_dfp128, srcB_dfp128, 0x1); + + if (result_dfp128 != expected_result_dfp128) +#if DEBUG + printf("DFP 128-bit quantize variable, RMC = 1 result does not match expected result\n"); +#else + abort(); +#endif + + srcA_dfp128 = 0.1234df; + srcB_dfp128 = 50000.18346789df; + expected_result_dfp128 = 50000.1800df; + + result_dfp128 = __builtin_dfpq_quantize (srcA_dfp128, srcB_dfp128, 0x2); + + if (result_dfp128 != expected_result_dfp128) +#if DEBUG + printf("DFP 128-bit quantize variable, RMC = 2 result does not match expected result\n"); +#else + abort(); +#endif + + /* Tests for 128-bit quantize with immediate value. */ + srcB_dfp128 = 1234.18345df; + expected_result_dfp128 = 1200.0df; + + result_dfp128 = __builtin_dfpq_quantize (IMM2, srcB_dfp128, 0x0); + + if (result_dfp128 != expected_result_dfp128) +#if DEBUG + printf("DFP 128-bit quantize immediate, RMC = 0 result does not match expected result\n"); +#else + abort(); +#endif + + srcB_dfp128 = 123456.18345df; + expected_result_dfp128 = 120000.0df; + + result_dfp128 = __builtin_dfpq_quantize (IMM4, srcB_dfp128, 0x1); + + if (result_dfp128 != expected_result_dfp128) +#if DEBUG + printf("DFP 128-bit quantize immediate, RMC = 1 result does not match expected result\n"); +#else + abort(); +#endif + + srcB_dfp128 = 12361834.5df; + expected_result_dfp128 = 12362000.0df; + + result_dfp128 = __builtin_dfpq_quantize (IMM3, srcB_dfp128, 0x2); + + if (result_dfp128 != expected_result_dfp128) +#if DEBUG + printf("DFP 128-bit quantize immediate, RMC = 2 result does not match expected result\n"); +#else + abort(); +#endif + + return 0; +} + +/* { dg-final { scan-assembler-times {\mdqua\M} 3 } } */ +/* { dg-final { scan-assembler-times {\mdquai\M} 3 } } */ +/* { dg-final { scan-assembler-times {\mdquaq\M} 3 } } */ +/* { dg-final { scan-assembler-times {\mdquaiq\M} 3 } } */