From patchwork Thu Feb 29 11:46:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lulu Cai X-Patchwork-Id: 208327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp334462dyb; Thu, 29 Feb 2024 03:48:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVqK4v3hitftBppVkAz0DVBSZeqOdMHG+jhClY798J8Lzexwv2B39JUqntYpTWRKMx0oUay/nWLYs6UT+vlBtOjOagNqw== X-Google-Smtp-Source: AGHT+IEGCMR2e07abC4clSh83KWY5lbnoYt1TO1Btc95HRu+AkwWVxzclgZqlFHB+cCJ0UdDsY6F X-Received: by 2002:ad4:4f02:0:b0:68f:e19a:7519 with SMTP id fb2-20020ad44f02000000b0068fe19a7519mr1919462qvb.21.1709207305121; Thu, 29 Feb 2024 03:48:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709207305; cv=pass; d=google.com; s=arc-20160816; b=y8vNIYYWUT72RihROYZq4Gf0ojlJjvmN6ypNfVk3SbA1+Pcz5Xe1r2vmnNS4T53Y21 l9AqEhv0S2HV1h78FRaj2AsjGUGTKe5oVBh9ymcPFbOlBH2QKgwQxHV6jj8ovN66kTMP V0U7RJsO9IQ1VFL6gZ/199rtj7CajgT93LZfTTlOl3kL7APv9a3jnrHdLxMXTnYhzBgU kMx11B3sWVSs/LBXpcUw9Icma3nG1qDd1rdRxIU5SSPkcw09+54za9gSbqMzXEDkCT1L rwn6ApgGeMKP9BoHVM3c3xExTck3mi4pJ5Ec8Ric8BXqP1utJS4GyzdweF+/O26id5Y2 I2Pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:arc-filter :dmarc-filter:delivered-to; bh=Mk48dk8H3sJg5PUSq+RwWr12weX+LsWJVKHjY2TQwK0=; fh=FvlVQEmCpm5H8oBXQswexzCupeeQXnbssobXN+3R2Wg=; b=ANwermKyajxCduJ8RUZ9dknWFlLSlcUOt3/mgpn3Jy4Dc92dbvtzTggkw4nYm1YVUv 6IGtsrL9RTSJC/rCMlrTJZoadzOszkgjVPGeX5rhIKxdh4azVroSVGw+hxa05QsjYX3p Z6Fc9DBBwnrkzlnwrqpOf4n0rki0PEZXOYVttvmFgXn+KiJwkbDjN626mj7Ub3RmAPqY vqoDzyOsp3SfVPmXGZmHbY6lpN6ghvuIiuVhdpgYr5Vno0fDldsKVUstXGNKGxZvNmNQ YBp+EQeorV/VEBZ92a6Y88DdPYTFenn9WB++7temr3+WiAZUYxy1R/iDgmPPmvGtDoNE GSxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id u12-20020ad45aac000000b0068fb7e2785dsi1168200qvg.517.2024.02.29.03.48.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 03:48:25 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C52B3858C3A for ; Thu, 29 Feb 2024 11:48:24 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id CB87F3858401 for ; Thu, 29 Feb 2024 11:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB87F3858401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CB87F3858401 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709207218; cv=none; b=D1NaZEvEBSu8FOsxQcf+xey55JSIO5d6y43tz5sO89zEoi2Vf6j0upaEylmnZPrUGrwjV/u0up6AdhjZ0+CicNii9/CeDVw7YGVdbhxpSF0NbstIG54XZ4nb1i7SwdutP8ja9kTgZUsK/rKl/wM3U1mm6Mn3TLscCIuc8UxLocY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709207218; c=relaxed/simple; bh=t/mGLETWI4RoPT94bPvfuOCcYObH+xS1kN6GPl6Jdhw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=poAeXZZnkvkCLesNLnkbmt7xEeEACBLkq8wuyVeWhY3E/wnm8MnhHMaXctLi1TcCv/OU6/fX8049M7FqlhhqIKuOaNxWTtoN03h1nqrTcxjZpDC4ygQhYNxNIMHZdsPmCfDf45X+yWyUnl5aZuPbrltn28hxsYIC1rdUgTT7WIs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.2.6.5]) by gateway (Coremail) with SMTP id _____8Axz+uqbuBlDeMSAA--.47969S3; Thu, 29 Feb 2024 19:46:50 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx_c6pbuBloL9KAA--.2410S4; Thu, 29 Feb 2024 19:46:49 +0800 (CST) From: Lulu Cai To: binutils@sourceware.org Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn, liuzhensong@loongson.cn, mengqinggang@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn, wanglei@loongson.cn, hejinyang@loongson.cn, Lulu Cai Subject: [PATCH v1 5/7] LoongArch: Add gas testsuit for LA32 int/float instructions Date: Thu, 29 Feb 2024 19:46:45 +0800 Message-Id: <20240229114647.1587477-1-cailulu@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx_c6pbuBloL9KAA--.2410S4 X-CM-SenderInfo: xfdlz3tox6z05rqj20fqof0/1tbiAQACB2XgQGUEngACs8 X-Coremail-Antispam: 1Uk129KBj9fXoW3CrWfGr1xXFWktrykGF43twc_yoW8ZF18Wo WrAry3tF4ft3yDKFyUAr4Yv3WUXFW7GFsYkr4avw4fZa4a9r12yrsF9345ta4vgr4xu3Zx uryUJr48Jr13JFnrl-sFpf9Il3svdjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY07kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280 aVAFwI0_Cr0_Gr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20x vY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I 3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIx AIcVC0I7IYx2IY67AKxVW5JVW7JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAI cVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2js IEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jOjjgUUUUU= X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SCC_5_SHORT_WORD_LINES, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792233758754793057 X-GMAIL-MSGID: 1792233758754793057 Test the int/float instructions of LA32. --- gas/testsuite/gas/loongarch/insn_float32.d | 157 +++++++++++++++++++++ gas/testsuite/gas/loongarch/insn_float32.s | 149 +++++++++++++++++++ gas/testsuite/gas/loongarch/insn_int32.d | 147 +++++++++++++++++++ gas/testsuite/gas/loongarch/insn_int32.s | 156 ++++++++++++++++++++ 4 files changed, 609 insertions(+) create mode 100644 gas/testsuite/gas/loongarch/insn_float32.d create mode 100644 gas/testsuite/gas/loongarch/insn_float32.s create mode 100644 gas/testsuite/gas/loongarch/insn_int32.d create mode 100644 gas/testsuite/gas/loongarch/insn_int32.s diff --git a/gas/testsuite/gas/loongarch/insn_float32.d b/gas/testsuite/gas/loongarch/insn_float32.d new file mode 100644 index 00000000000..ee2408af2f9 --- /dev/null +++ b/gas/testsuite/gas/loongarch/insn_float32.d @@ -0,0 +1,157 @@ +#as-new: +#objdump: -d +#skip: loongarch64-*-* + +.*: file format .* + + +Disassembly of section .text: + +0+ <.*>: + 0: 01008820 fadd.s \$fa0, \$fa1, \$fa2 + 4: 01010820 fadd.d \$fa0, \$fa1, \$fa2 + 8: 01028820 fsub.s \$fa0, \$fa1, \$fa2 + c: 01030820 fsub.d \$fa0, \$fa1, \$fa2 + 10: 01048820 fmul.s \$fa0, \$fa1, \$fa2 + 14: 01050820 fmul.d \$fa0, \$fa1, \$fa2 + 18: 01068820 fdiv.s \$fa0, \$fa1, \$fa2 + 1c: 01070820 fdiv.d \$fa0, \$fa1, \$fa2 + 20: 01088820 fmax.s \$fa0, \$fa1, \$fa2 + 24: 01090820 fmax.d \$fa0, \$fa1, \$fa2 + 28: 010a8820 fmin.s \$fa0, \$fa1, \$fa2 + 2c: 010b0820 fmin.d \$fa0, \$fa1, \$fa2 + 30: 010c8820 fmaxa.s \$fa0, \$fa1, \$fa2 + 34: 010d0820 fmaxa.d \$fa0, \$fa1, \$fa2 + 38: 010e8820 fmina.s \$fa0, \$fa1, \$fa2 + 3c: 010f0820 fmina.d \$fa0, \$fa1, \$fa2 + 40: 01108820 fscaleb.s \$fa0, \$fa1, \$fa2 + 44: 01110820 fscaleb.d \$fa0, \$fa1, \$fa2 + 48: 01128820 fcopysign.s \$fa0, \$fa1, \$fa2 + 4c: 01130820 fcopysign.d \$fa0, \$fa1, \$fa2 + 50: 01140420 fabs.s \$fa0, \$fa1 + 54: 01140820 fabs.d \$fa0, \$fa1 + 58: 01141420 fneg.s \$fa0, \$fa1 + 5c: 01141820 fneg.d \$fa0, \$fa1 + 60: 01142420 flogb.s \$fa0, \$fa1 + 64: 01142820 flogb.d \$fa0, \$fa1 + 68: 01143420 fclass.s \$fa0, \$fa1 + 6c: 01143820 fclass.d \$fa0, \$fa1 + 70: 01144420 fsqrt.s \$fa0, \$fa1 + 74: 01144820 fsqrt.d \$fa0, \$fa1 + 78: 01145420 frecip.s \$fa0, \$fa1 + 7c: 01145820 frecip.d \$fa0, \$fa1 + 80: 01146420 frsqrt.s \$fa0, \$fa1 + 84: 01146820 frsqrt.d \$fa0, \$fa1 + 88: 01149420 fmov.s \$fa0, \$fa1 + 8c: 01149820 fmov.d \$fa0, \$fa1 + 90: 0114a4a0 movgr2fr.w \$fa0, \$a1 + 94: 0114a8a0 movgr2fr.d \$fa0, \$a1 + 98: 0114aca0 movgr2frh.w \$fa0, \$a1 + 9c: 0114b424 movfr2gr.s \$a0, \$fa1 + a0: 0114b824 movfr2gr.d \$a0, \$fa1 + a4: 0114bc24 movfrh2gr.s \$a0, \$fa1 + a8: 0114c0a0 movgr2fcsr \$fcsr0, \$a1 + ac: 0114c804 movfcsr2gr \$a0, \$fcsr0 + b0: 0114d020 movfr2cf \$fcc0, \$fa1 + b4: 0114d4a0 movcf2fr \$fa0, \$fcc5 + b8: 0114d8a0 movgr2cf \$fcc0, \$a1 + bc: 0114dca4 movcf2gr \$a0, \$fcc5 + c0: 01191820 fcvt.s.d \$fa0, \$fa1 + c4: 01192420 fcvt.d.s \$fa0, \$fa1 + c8: 011a0420 ftintrm.w.s \$fa0, \$fa1 + cc: 011a0820 ftintrm.w.d \$fa0, \$fa1 + d0: 011a2420 ftintrm.l.s \$fa0, \$fa1 + d4: 011a2820 ftintrm.l.d \$fa0, \$fa1 + d8: 011a4420 ftintrp.w.s \$fa0, \$fa1 + dc: 011a4820 ftintrp.w.d \$fa0, \$fa1 + e0: 011a6420 ftintrp.l.s \$fa0, \$fa1 + e4: 011a6820 ftintrp.l.d \$fa0, \$fa1 + e8: 011a8420 ftintrz.w.s \$fa0, \$fa1 + ec: 011a8820 ftintrz.w.d \$fa0, \$fa1 + f0: 011aa420 ftintrz.l.s \$fa0, \$fa1 + f4: 011aa820 ftintrz.l.d \$fa0, \$fa1 + f8: 011ac420 ftintrne.w.s \$fa0, \$fa1 + fc: 011ac820 ftintrne.w.d \$fa0, \$fa1 + 100: 011ae420 ftintrne.l.s \$fa0, \$fa1 + 104: 011ae820 ftintrne.l.d \$fa0, \$fa1 + 108: 011b0420 ftint.w.s \$fa0, \$fa1 + 10c: 011b0820 ftint.w.d \$fa0, \$fa1 + 110: 011b2420 ftint.l.s \$fa0, \$fa1 + 114: 011b2820 ftint.l.d \$fa0, \$fa1 + 118: 011d1020 ffint.s.w \$fa0, \$fa1 + 11c: 011d1820 ffint.s.l \$fa0, \$fa1 + 120: 011d2020 ffint.d.w \$fa0, \$fa1 + 124: 011d2820 ffint.d.l \$fa0, \$fa1 + 128: 011e4420 frint.s \$fa0, \$fa1 + 12c: 011e4820 frint.d \$fa0, \$fa1 + 130: 01147420 frecipe.s \$fa0, \$fa1 + 134: 01147820 frecipe.d \$fa0, \$fa1 + 138: 01148420 frsqrte.s \$fa0, \$fa1 + 13c: 01148820 frsqrte.d \$fa0, \$fa1 + 140: 08118820 fmadd.s \$fa0, \$fa1, \$fa2, \$fa3 + 144: 08218820 fmadd.d \$fa0, \$fa1, \$fa2, \$fa3 + 148: 08518820 fmsub.s \$fa0, \$fa1, \$fa2, \$fa3 + 14c: 08618820 fmsub.d \$fa0, \$fa1, \$fa2, \$fa3 + 150: 08918820 fnmadd.s \$fa0, \$fa1, \$fa2, \$fa3 + 154: 08a18820 fnmadd.d \$fa0, \$fa1, \$fa2, \$fa3 + 158: 08d18820 fnmsub.s \$fa0, \$fa1, \$fa2, \$fa3 + 15c: 08e18820 fnmsub.d \$fa0, \$fa1, \$fa2, \$fa3 + 160: 0c100820 fcmp.caf.s \$fcc0, \$fa1, \$fa2 + 164: 0c108820 fcmp.saf.s \$fcc0, \$fa1, \$fa2 + 168: 0c110820 fcmp.clt.s \$fcc0, \$fa1, \$fa2 + 16c: 0c118820 fcmp.slt.s \$fcc0, \$fa1, \$fa2 + 170: 0c118820 fcmp.slt.s \$fcc0, \$fa1, \$fa2 + 174: 0c120820 fcmp.ceq.s \$fcc0, \$fa1, \$fa2 + 178: 0c128820 fcmp.seq.s \$fcc0, \$fa1, \$fa2 + 17c: 0c130820 fcmp.cle.s \$fcc0, \$fa1, \$fa2 + 180: 0c138820 fcmp.sle.s \$fcc0, \$fa1, \$fa2 + 184: 0c138820 fcmp.sle.s \$fcc0, \$fa1, \$fa2 + 188: 0c140820 fcmp.cun.s \$fcc0, \$fa1, \$fa2 + 18c: 0c148820 fcmp.sun.s \$fcc0, \$fa1, \$fa2 + 190: 0c150820 fcmp.cult.s \$fcc0, \$fa1, \$fa2 + 194: 0c150820 fcmp.cult.s \$fcc0, \$fa1, \$fa2 + 198: 0c158820 fcmp.sult.s \$fcc0, \$fa1, \$fa2 + 19c: 0c160820 fcmp.cueq.s \$fcc0, \$fa1, \$fa2 + 1a0: 0c168820 fcmp.sueq.s \$fcc0, \$fa1, \$fa2 + 1a4: 0c170820 fcmp.cule.s \$fcc0, \$fa1, \$fa2 + 1a8: 0c170820 fcmp.cule.s \$fcc0, \$fa1, \$fa2 + 1ac: 0c178820 fcmp.sule.s \$fcc0, \$fa1, \$fa2 + 1b0: 0c180820 fcmp.cne.s \$fcc0, \$fa1, \$fa2 + 1b4: 0c188820 fcmp.sne.s \$fcc0, \$fa1, \$fa2 + 1b8: 0c1a0820 fcmp.cor.s \$fcc0, \$fa1, \$fa2 + 1bc: 0c1a8820 fcmp.sor.s \$fcc0, \$fa1, \$fa2 + 1c0: 0c1c0820 fcmp.cune.s \$fcc0, \$fa1, \$fa2 + 1c4: 0c1c8820 fcmp.sune.s \$fcc0, \$fa1, \$fa2 + 1c8: 0c200820 fcmp.caf.d \$fcc0, \$fa1, \$fa2 + 1cc: 0c208820 fcmp.saf.d \$fcc0, \$fa1, \$fa2 + 1d0: 0c210820 fcmp.clt.d \$fcc0, \$fa1, \$fa2 + 1d4: 0c218820 fcmp.slt.d \$fcc0, \$fa1, \$fa2 + 1d8: 0c218820 fcmp.slt.d \$fcc0, \$fa1, \$fa2 + 1dc: 0c220820 fcmp.ceq.d \$fcc0, \$fa1, \$fa2 + 1e0: 0c228820 fcmp.seq.d \$fcc0, \$fa1, \$fa2 + 1e4: 0c230820 fcmp.cle.d \$fcc0, \$fa1, \$fa2 + 1e8: 0c238820 fcmp.sle.d \$fcc0, \$fa1, \$fa2 + 1ec: 0c238820 fcmp.sle.d \$fcc0, \$fa1, \$fa2 + 1f0: 0c240820 fcmp.cun.d \$fcc0, \$fa1, \$fa2 + 1f4: 0c248820 fcmp.sun.d \$fcc0, \$fa1, \$fa2 + 1f8: 0c250820 fcmp.cult.d \$fcc0, \$fa1, \$fa2 + 1fc: 0c250820 fcmp.cult.d \$fcc0, \$fa1, \$fa2 + 200: 0c258820 fcmp.sult.d \$fcc0, \$fa1, \$fa2 + 204: 0c260820 fcmp.cueq.d \$fcc0, \$fa1, \$fa2 + 208: 0c268820 fcmp.sueq.d \$fcc0, \$fa1, \$fa2 + 20c: 0c270820 fcmp.cule.d \$fcc0, \$fa1, \$fa2 + 210: 0c270820 fcmp.cule.d \$fcc0, \$fa1, \$fa2 + 214: 0c278820 fcmp.sule.d \$fcc0, \$fa1, \$fa2 + 218: 0c280820 fcmp.cne.d \$fcc0, \$fa1, \$fa2 + 21c: 0c288820 fcmp.sne.d \$fcc0, \$fa1, \$fa2 + 220: 0c2a0820 fcmp.cor.d \$fcc0, \$fa1, \$fa2 + 224: 0c2a8820 fcmp.sor.d \$fcc0, \$fa1, \$fa2 + 228: 0c2c0820 fcmp.cune.d \$fcc0, \$fa1, \$fa2 + 22c: 0c2c8820 fcmp.sune.d \$fcc0, \$fa1, \$fa2 + 230: 0d000820 fsel \$fa0, \$fa1, \$fa2, \$fcc0 + 234: 2b00058a fld.s \$ft2, \$t0, 1 + 238: 2b40058a fst.s \$ft2, \$t0, 1 + 23c: 2b80058a fld.d \$ft2, \$t0, 1 + 240: 2bc0058a fst.d \$ft2, \$t0, 1 + 244: 48000000 bceqz \$fcc0, 0 # 0x244 + 248: 48000100 bcnez \$fcc0, 0 # 0x248 diff --git a/gas/testsuite/gas/loongarch/insn_float32.s b/gas/testsuite/gas/loongarch/insn_float32.s new file mode 100644 index 00000000000..8465633b91a --- /dev/null +++ b/gas/testsuite/gas/loongarch/insn_float32.s @@ -0,0 +1,149 @@ +fadd.s $f0,$f1,$f2 +fadd.d $f0,$f1,$f2 +fsub.s $f0,$f1,$f2 +fsub.d $f0,$f1,$f2 +fmul.s $f0,$f1,$f2 +fmul.d $f0,$f1,$f2 +fdiv.s $f0,$f1,$f2 +fdiv.d $f0,$f1,$f2 +fmax.s $f0,$f1,$f2 +fmax.d $f0,$f1,$f2 +fmin.s $f0,$f1,$f2 +fmin.d $f0,$f1,$f2 +fmaxa.s $f0,$f1,$f2 +fmaxa.d $f0,$f1,$f2 +fmina.s $f0,$f1,$f2 +fmina.d $f0,$f1,$f2 +fscaleb.s $f0,$f1,$f2 +fscaleb.d $f0,$f1,$f2 +fcopysign.s $f0,$f1,$f2 +fcopysign.d $f0,$f1,$f2 +fabs.s $f0,$f1 +fabs.d $f0,$f1 +fneg.s $f0,$f1 +fneg.d $f0,$f1 +flogb.s $f0,$f1 +flogb.d $f0,$f1 +fclass.s $f0,$f1 +fclass.d $f0,$f1 +fsqrt.s $f0,$f1 +fsqrt.d $f0,$f1 +frecip.s $f0,$f1 +frecip.d $f0,$f1 +frsqrt.s $f0,$f1 +frsqrt.d $f0,$f1 +fmov.s $f0,$f1 +fmov.d $f0,$f1 +movgr2fr.w $f0,$r5 +movgr2fr.d $f0,$r5 +movgr2frh.w $f0,$r5 +movfr2gr.s $r4,$f1 +movfr2gr.d $r4,$f1 +movfrh2gr.s $r4,$f1 +movgr2fcsr $fcsr0,$r5 +movfcsr2gr $r4,$fcsr0 +movfr2cf $fcc0,$f1 +movcf2fr $f0,$fcc5 +movgr2cf $fcc0,$r5 +movcf2gr $r4,$fcc5 +fcvt.s.d $f0,$f1 +fcvt.d.s $f0,$f1 +ftintrm.w.s $f0,$f1 +ftintrm.w.d $f0,$f1 +ftintrm.l.s $f0,$f1 +ftintrm.l.d $f0,$f1 +ftintrp.w.s $f0,$f1 +ftintrp.w.d $f0,$f1 +ftintrp.l.s $f0,$f1 +ftintrp.l.d $f0,$f1 +ftintrz.w.s $f0,$f1 +ftintrz.w.d $f0,$f1 +ftintrz.l.s $f0,$f1 +ftintrz.l.d $f0,$f1 +ftintrne.w.s $f0,$f1 +ftintrne.w.d $f0,$f1 +ftintrne.l.s $f0,$f1 +ftintrne.l.d $f0,$f1 +ftint.w.s $f0,$f1 +ftint.w.d $f0,$f1 +ftint.l.s $f0,$f1 +ftint.l.d $f0,$f1 +ffint.s.w $f0,$f1 +ffint.s.l $f0,$f1 +ffint.d.w $f0,$f1 +ffint.d.l $f0,$f1 +frint.s $f0,$f1 +frint.d $f0,$f1 +frecipe.s $f0,$f1 +frecipe.d $f0,$f1 +frsqrte.s $f0,$f1 +frsqrte.d $f0,$f1 + +# 4_opt_op +fmadd.s $f0,$f1,$f2,$f3 +fmadd.d $f0,$f1,$f2,$f3 +fmsub.s $f0,$f1,$f2,$f3 +fmsub.d $f0,$f1,$f2,$f3 +fnmadd.s $f0,$f1,$f2,$f3 +fnmadd.d $f0,$f1,$f2,$f3 +fnmsub.s $f0,$f1,$f2,$f3 +fnmsub.d $f0,$f1,$f2,$f3 +fcmp.caf.s $fcc0,$f1,$f2 +fcmp.saf.s $fcc0,$f1,$f2 +fcmp.clt.s $fcc0,$f1,$f2 +fcmp.slt.s $fcc0,$f1,$f2 +fcmp.sgt.s $fcc0,$f2,$f1 +fcmp.ceq.s $fcc0,$f1,$f2 +fcmp.seq.s $fcc0,$f1,$f2 +fcmp.cle.s $fcc0,$f1,$f2 +fcmp.sle.s $fcc0,$f1,$f2 +fcmp.sge.s $fcc0,$f2,$f1 +fcmp.cun.s $fcc0,$f1,$f2 +fcmp.sun.s $fcc0,$f1,$f2 +fcmp.cult.s $fcc0,$f1,$f2 +fcmp.cugt.s $fcc0,$f2,$f1 +fcmp.sult.s $fcc0,$f1,$f2 +fcmp.cueq.s $fcc0,$f1,$f2 +fcmp.sueq.s $fcc0,$f1,$f2 +fcmp.cule.s $fcc0,$f1,$f2 +fcmp.cuge.s $fcc0,$f2,$f1 +fcmp.sule.s $fcc0,$f1,$f2 +fcmp.cne.s $fcc0,$f1,$f2 +fcmp.sne.s $fcc0,$f1,$f2 +fcmp.cor.s $fcc0,$f1,$f2 +fcmp.sor.s $fcc0,$f1,$f2 +fcmp.cune.s $fcc0,$f1,$f2 +fcmp.sune.s $fcc0,$f1,$f2 +fcmp.caf.d $fcc0,$f1,$f2 +fcmp.saf.d $fcc0,$f1,$f2 +fcmp.clt.d $fcc0,$f1,$f2 +fcmp.slt.d $fcc0,$f1,$f2 +fcmp.sgt.d $fcc0,$f2,$f1 +fcmp.ceq.d $fcc0,$f1,$f2 +fcmp.seq.d $fcc0,$f1,$f2 +fcmp.cle.d $fcc0,$f1,$f2 +fcmp.sle.d $fcc0,$f1,$f2 +fcmp.sge.d $fcc0,$f2,$f1 +fcmp.cun.d $fcc0,$f1,$f2 +fcmp.sun.d $fcc0,$f1,$f2 +fcmp.cult.d $fcc0,$f1,$f2 +fcmp.cugt.d $fcc0,$f2,$f1 +fcmp.sult.d $fcc0,$f1,$f2 +fcmp.cueq.d $fcc0,$f1,$f2 +fcmp.sueq.d $fcc0,$f1,$f2 +fcmp.cule.d $fcc0,$f1,$f2 +fcmp.cuge.d $fcc0,$f2,$f1 +fcmp.sule.d $fcc0,$f1,$f2 +fcmp.cne.d $fcc0,$f1,$f2 +fcmp.sne.d $fcc0,$f1,$f2 +fcmp.cor.d $fcc0,$f1,$f2 +fcmp.sor.d $fcc0,$f1,$f2 +fcmp.cune.d $fcc0,$f1,$f2 +fcmp.sune.d $fcc0,$f1,$f2 +fsel $f0,$f1,$f2,$fcc0 +fld.s $f10,$r12,1 +fst.s $f10,$r12,1 +fld.d $f10,$r12,1 +fst.d $f10,$r12,1 +bceqz $fcc0,.L1 +bcnez $fcc0,.L1 diff --git a/gas/testsuite/gas/loongarch/insn_int32.d b/gas/testsuite/gas/loongarch/insn_int32.d new file mode 100644 index 00000000000..d90dbe402c4 --- /dev/null +++ b/gas/testsuite/gas/loongarch/insn_int32.d @@ -0,0 +1,147 @@ +#as-new: +#objdump: -d -M no-aliases +#skip: loongarch64-*-* + +.*: file format .* + + +Disassembly of section .text: + +0+ <.*>: + 0: 020000a4 slti \$a0, \$a1, 0 + 4: 021ffca4 slti \$a0, \$a1, 2047 + 8: 022004a4 slti \$a0, \$a1, -2047 + c: 024000a4 sltui \$a0, \$a1, 0 + 10: 025ffca4 sltui \$a0, \$a1, 2047 + 14: 026004a4 sltui \$a0, \$a1, -2047 + 18: 028000a4 addi.w \$a0, \$a1, 0 + 1c: 029ffca4 addi.w \$a0, \$a1, 2047 + 20: 02a004a4 addi.w \$a0, \$a1, -2047 + 24: 034000a4 andi \$a0, \$a1, 0x0 + 28: 035ffca4 andi \$a0, \$a1, 0x7ff + 2c: 038000a4 ori \$a0, \$a1, 0x0 + 30: 039ffca4 ori \$a0, \$a1, 0x7ff + 34: 03c000a4 xori \$a0, \$a1, 0x0 + 38: 03dffca4 xori \$a0, \$a1, 0x7ff + 3c: 14000004 lu12i.w \$a0, 0 + 40: 14ffffe4 lu12i.w \$a0, 524287 + 44: 1c000004 pcaddu12i \$a0, 0 + 48: 1cffffe4 pcaddu12i \$a0, 524287 + 4c: 1d000024 pcaddu12i \$a0, -524287 + 50: 0004b58b alsl.w \$a7, \$t0, \$t1, 0x2 + 54: 0006b58b alsl.wu \$a7, \$t0, \$t1, 0x2 + 58: 002a0002 break 0x2 + 5c: 002a8002 dbcl 0x2 + 60: 002b0002 syscall 0x2 + 64: 0040898b slli.w \$a7, \$t0, 0x2 + 68: 0044898b srli.w \$a7, \$t0, 0x2 + 6c: 004889ac srai.w \$t0, \$t1, 0x2 + 70: 02048dac slti \$t0, \$t1, 291 + 74: 02448dac sltui \$t0, \$t1, 291 + 78: 02848dac addi.w \$t0, \$t1, 291 + 7c: 034009ac andi \$t0, \$t1, 0x2 + 80: 038009ac ori \$t0, \$t1, 0x2 + 84: 03c009ac xori \$t0, \$t1, 0x2 + 88: 1400246c lu12i.w \$t0, 291 + 8c: 1c00246c pcaddu12i \$t0, 291 + 90: 04048c0c csrrd \$t0, 0x123 + 94: 04048c2c csrwr \$t0, 0x123 + 98: 040009ac csrxchg \$t0, \$t1, 0x2 + 9c: 060009a2 cacop 0x2, \$t1, 2 + a0: 064009ac lddir \$t0, \$t1, 0x2 + a4: 06440980 ldpte \$t0, 0x2 + a8: 0649b9a2 invtlb 0x2, \$t1, \$t2 + ac: 000060a4 rdtimel.w \$a0, \$a1 + b0: 000064a4 rdtimeh.w \$a0, \$a1 + b4: 000418a4 alsl.w \$a0, \$a1, \$a2, 0x1 + b8: 000598a4 alsl.w \$a0, \$a1, \$a2, 0x4 + bc: 000618a4 alsl.wu \$a0, \$a1, \$a2, 0x1 + c0: 000798a4 alsl.wu \$a0, \$a1, \$a2, 0x4 + c4: 001018a4 add.w \$a0, \$a1, \$a2 + c8: 001118a4 sub.w \$a0, \$a1, \$a2 + cc: 001218a4 slt \$a0, \$a1, \$a2 + d0: 001298a4 sltu \$a0, \$a1, \$a2 + d4: 001418a4 nor \$a0, \$a1, \$a2 + d8: 001498a4 and \$a0, \$a1, \$a2 + dc: 001518a4 or \$a0, \$a1, \$a2 + e0: 001598a4 xor \$a0, \$a1, \$a2 + e4: 001718a4 sll.w \$a0, \$a1, \$a2 + e8: 001798a4 srl.w \$a0, \$a1, \$a2 + ec: 001818a4 sra.w \$a0, \$a1, \$a2 + f0: 001c18a4 mul.w \$a0, \$a1, \$a2 + f4: 001c98a4 mulh.w \$a0, \$a1, \$a2 + f8: 001d18a4 mulh.wu \$a0, \$a1, \$a2 + fc: 002018a4 div.w \$a0, \$a1, \$a2 + 100: 002098a4 mod.w \$a0, \$a1, \$a2 + 104: 002118a4 div.wu \$a0, \$a1, \$a2 + 108: 002198a4 mod.wu \$a0, \$a1, \$a2 + 10c: 002a0000 break 0x0 + 110: 002a7fff break 0x7fff + 114: 002a8000 dbcl 0x0 + 118: 002affff dbcl 0x7fff + 11c: 004080a4 slli.w \$a0, \$a1, 0x0 + 120: 004084a4 slli.w \$a0, \$a1, 0x1 + 124: 0040fca4 slli.w \$a0, \$a1, 0x1f + 128: 004480a4 srli.w \$a0, \$a1, 0x0 + 12c: 004484a4 srli.w \$a0, \$a1, 0x1 + 130: 0044fca4 srli.w \$a0, \$a1, 0x1f + 134: 004880a4 srai.w \$a0, \$a1, 0x0 + 138: 004884a4 srai.w \$a0, \$a1, 0x1 + 13c: 0048fca4 srai.w \$a0, \$a1, 0x1f + 140: 200000a4 ll.w \$a0, \$a1, 0 + 144: 203ffca4 ll.w \$a0, \$a1, 16380 + 148: 210000a4 sc.w \$a0, \$a1, 0 + 14c: 213ffca4 sc.w \$a0, \$a1, 16380 + 150: 280000a4 ld.b \$a0, \$a1, 0 + 154: 281ffca4 ld.b \$a0, \$a1, 2047 + 158: 282004a4 ld.b \$a0, \$a1, -2047 + 15c: 284000a4 ld.h \$a0, \$a1, 0 + 160: 285ffca4 ld.h \$a0, \$a1, 2047 + 164: 286004a4 ld.h \$a0, \$a1, -2047 + 168: 288000a4 ld.w \$a0, \$a1, 0 + 16c: 289ffca4 ld.w \$a0, \$a1, 2047 + 170: 28a004a4 ld.w \$a0, \$a1, -2047 + 174: 290000a4 st.b \$a0, \$a1, 0 + 178: 291ffca4 st.b \$a0, \$a1, 2047 + 17c: 292004a4 st.b \$a0, \$a1, -2047 + 180: 294000a4 st.h \$a0, \$a1, 0 + 184: 295ffca4 st.h \$a0, \$a1, 2047 + 188: 296004a4 st.h \$a0, \$a1, -2047 + 18c: 298000a4 st.w \$a0, \$a1, 0 + 190: 299ffca4 st.w \$a0, \$a1, 2047 + 194: 29a004a4 st.w \$a0, \$a1, -2047 + 198: 2a0000a4 ld.bu \$a0, \$a1, 0 + 19c: 2a1ffca4 ld.bu \$a0, \$a1, 2047 + 1a0: 2a2004a4 ld.bu \$a0, \$a1, -2047 + 1a4: 2a4000a4 ld.hu \$a0, \$a1, 0 + 1a8: 2a5ffca4 ld.hu \$a0, \$a1, 2047 + 1ac: 2a6004a4 ld.hu \$a0, \$a1, -2047 + 1b0: 2ac000a0 preld 0x0, \$a1, 0 + 1b4: 2adffcbf preld 0x1f, \$a1, 2047 + 1b8: 2ae004bf preld 0x1f, \$a1, -2047 + 1bc: 385714c4 sc.q \$a0, \$a1, \$a2 + 1c0: 385714c4 sc.q \$a0, \$a1, \$a2 + 1c4: 385780a4 llacq.w \$a0, \$a1 + 1c8: 385780a4 llacq.w \$a0, \$a1 + 1cc: 385784a4 screl.w \$a0, \$a1 + 1d0: 385784a4 screl.w \$a0, \$a1 + 1d4: 38720000 dbar 0x0 + 1d8: 38727fff dbar 0x7fff + 1dc: 38728000 ibar 0x0 + 1e0: 3872ffff ibar 0x7fff + +0+1e4 <.L1>: + 1e4: 03400000 andi \$zero, \$zero, 0x0 + 1e8: 53ffffff b -4 # 1e4 <.L1> + 1ec: 57fffbff bl -8 # 1e4 <.L1> + 1f0: 5bfff485 beq \$a0, \$a1, -12 # 1e4 <.L1> + 1f4: 5ffff085 bne \$a0, \$a1, -16 # 1e4 <.L1> + 1f8: 63ffec85 blt \$a0, \$a1, -20 # 1e4 <.L1> + 1fc: 63ffe8a4 blt \$a1, \$a0, -24 # 1e4 <.L1> + 200: 67ffe485 bge \$a0, \$a1, -28 # 1e4 <.L1> + 204: 67ffe0a4 bge \$a1, \$a0, -32 # 1e4 <.L1> + 208: 6bffdc85 bltu \$a0, \$a1, -36 # 1e4 <.L1> + 20c: 6bffd8a4 bltu \$a1, \$a0, -40 # 1e4 <.L1> + 210: 6fffd485 bgeu \$a0, \$a1, -44 # 1e4 <.L1> + 214: 6fffd0a4 bgeu \$a1, \$a0, -48 # 1e4 <.L1> + 218: 4c000080 jirl \$zero, \$a0, 0 diff --git a/gas/testsuite/gas/loongarch/insn_int32.s b/gas/testsuite/gas/loongarch/insn_int32.s new file mode 100644 index 00000000000..4889df1f7a7 --- /dev/null +++ b/gas/testsuite/gas/loongarch/insn_int32.s @@ -0,0 +1,156 @@ +# imm_op +slti $r4,$r5,0 +slti $r4,$r5,0x7ff +slti $r4,$r5,-0x7ff +sltui $r4,$r5,0 +sltui $r4,$r5,0x7ff +sltui $r4,$r5,-0x7ff +addi.w $r4,$r5,0 +addi.w $r4,$r5,0x7ff +addi.w $r4,$r5,-0x7ff +andi $r4,$r5,0 +andi $r4,$r5,0x7ff +ori $r4,$r5,0 +ori $r4,$r5,0x7ff +xori $r4,$r5,0 +xori $r4,$r5,0x7ff +lu12i.w $r4,0 +lu12i.w $r4,0x7ffff +pcaddu12i $r4,0 +pcaddu12i $r4,0x7ffff +pcaddu12i $r4,-0x7ffff + +# imm_ins +.equ a, 0x123 +.equ b, 0xfffff00000 +.equ c, 0xfffffffffff +.equ d, 2 +.equ e,0x100 + +alsl.w $r11,$r12,$r13,d +alsl.wu $r11,$r12,$r13,d + +break d +dbcl d +syscall d + +slli.w $r11,$r12,d +srli.w $r11,$r12,d +srai.w $r12,$r13,d + +slti $r12,$r13,a +sltui $r12,$r13,a +addi.w $r12,$r13,a +andi $r12,$r13,d +ori $r12,$r13,d +xori $r12,$r13,d +lu12i.w $r12,a +pcaddu12i $r12,a + +csrrd $r12,a +csrwr $r12,a +csrxchg $r12,$r13,d +cacop d,$r13,d +lddir $r12,$r13,d +ldpte $r12,d + +invtlb d,$r13,$r14 + +# fix_op +rdtimel.w $r4,$r5 +rdtimeh.w $r4,$r5 +alsl.w $r4,$r5,$r6,1 +alsl.w $r4,$r5,$r6,4 +alsl.wu $r4,$r5,$r6,1 +alsl.wu $r4,$r5,$r6,4 +add.w $r4,$r5,$r6 +sub.w $r4,$r5,$r6 +slt $r4,$r5,$r6 +sltu $r4,$r5,$r6 +nor $r4,$r5,$r6 +and $r4,$r5,$r6 +or $r4,$r5,$r6 +xor $r4,$r5,$r6 + +# load_store +sll.w $r4,$r5,$r6 +srl.w $r4,$r5,$r6 +sra.w $r4,$r5,$r6 +mul.w $r4,$r5,$r6 +mulh.w $r4,$r5,$r6 +mulh.wu $r4,$r5,$r6 +div.w $r4,$r5,$r6 +mod.w $r4,$r5,$r6 +div.wu $r4,$r5,$r6 +mod.wu $r4,$r5,$r6 +break 0 +break 0x7fff +dbcl 0 +dbcl 0x7fff +slli.w $r4,$r5,0 +slli.w $r4,$r5,1 +slli.w $r4,$r5,0x1f +srli.w $r4,$r5,0 +srli.w $r4,$r5,1 +srli.w $r4,$r5,0x1f +srai.w $r4,$r5,0 +srai.w $r4,$r5,1 +srai.w $r4,$r5,0x1f +ll.w $r4,$r5,0 +ll.w $r4,$r5,0x3ffc +sc.w $r4,$r5,0 +sc.w $r4,$r5,0x3ffc +ld.b $r4,$r5,0 +ld.b $r4,$r5,0x7ff +ld.b $r4,$r5,-0x7ff +ld.h $r4,$r5,0 +ld.h $r4,$r5,0x7ff +ld.h $r4,$r5,-0x7ff +ld.w $r4,$r5,0 +ld.w $r4,$r5,0x7ff +ld.w $r4,$r5,-0x7ff +st.b $r4,$r5,0 +st.b $r4,$r5,0x7ff +st.b $r4,$r5,-0x7ff +st.h $r4,$r5,0 +st.h $r4,$r5,0x7ff +st.h $r4,$r5,-0x7ff +st.w $r4,$r5,0 +st.w $r4,$r5,0x7ff +st.w $r4,$r5,-0x7ff +ld.bu $r4,$r5,0 +ld.bu $r4,$r5,0x7ff +ld.bu $r4,$r5,-0x7ff +ld.hu $r4,$r5,0 +ld.hu $r4,$r5,0x7ff +ld.hu $r4,$r5,-0x7ff +preld 0,$r5,0 +preld 31,$r5,0x7ff +preld 31,$r5,-0x7ff +sc.q $r4,$r5,$r6,0 +sc.q $r4,$r5,$r6 +llacq.w $r4,$r5,0 +llacq.w $r4,$r5 +screl.w $r4,$r5,0 +screl.w $r4,$r5 +dbar 0 +dbar 0x7fff +ibar 0 +ibar 0x7fff + +# jmp_op +.L1: +nop +b .L1 +bl .L1 +beq $r4,$r5,.L1 +bne $r4,$r5,.L1 +blt $r4,$r5,.L1 +bgt $r4,$r5,.L1 +bge $r4,$r5,.L1 +ble $r4,$r5,.L1 +bltu $r4,$r5,.L1 +bgtu $r4,$r5,.L1 +bgeu $r4,$r5,.L1 +bleu $r4,$r5,.L1 +jirl $zero,$r4,0