From patchwork Fri Jul 19 08:51:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 94198 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B3D5386180D for ; Fri, 19 Jul 2024 08:52:57 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 13AE33861004 for ; Fri, 19 Jul 2024 08:51:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13AE33861004 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 13AE33861004 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721379117; cv=none; b=oMbnbLq2U3mjIozSHM7hYYABpeP2W7U8b2YH4eYnnt6qKi7P8YFshPnLZUozy4NXFexm++aUP2z1gZvNKsB3NUpLxovRWTw5c0bpn0SFI9FMaqycQjdecE72cvB1tYWHbvecmOrbWQpblDRuxjyZ+4pQefXCBC7lqmEO1wuOJyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721379117; c=relaxed/simple; bh=Lm5guqZ/4vdstVJHpJVviFvoKW5BwL/dPwRFOjw1RSc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=kS0xMk+aiO1dfqipYul1cnYV+nb+w8IPbeAB4wDuH9PKIqc+Fh3zN7g1dPWAC+RgPq6K+BDjFL3QnJdo85xCPXGw/x7QSKvVpWmReepfPsUta/AHLHpx8aks8Yk77MX+sM69JSXGMKqnKSdxyxW/DP44BRlux5cR3z5eQEWrPlg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721379113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=AtGwMSpmRMPf5tGNMSWL4FZvU2wRlAUzv5FBWGkf1zk=; b=J7lS9nuB8SAbSMFFXp8c1/HmJy+N7ji2agsQddkVt0xDW0gW0AmDD3LXLu6Lq0F9x24sIf Lv7Ifyug6Vnu3bTeABjLVRmTcaF7IVXEx1MqF/w1xptO1e0m8ZfKfHD+bEfGaGUhDPalY8 Uqsbf2bpJ2hhTzQzD+QUb3Ppv1xPtpE= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-694-4-mHoqiHNHy4ETWqq8Ynlg-1; Fri, 19 Jul 2024 04:51:52 -0400 X-MC-Unique: 4-mHoqiHNHy4ETWqq8Ynlg-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-57d3eca4c01so433819a12.0 for ; Fri, 19 Jul 2024 01:51:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721379110; x=1721983910; h=mime-version:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AtGwMSpmRMPf5tGNMSWL4FZvU2wRlAUzv5FBWGkf1zk=; b=FfmNBN3psrXMEAgYfaDchyII6kP/ZU7Rg8mK1gufhxTsZlU1NiL1Ifxf6yAot107+C KTcn5vaGQpIYOOE08IIhRuebAJWLFTyBLiIV55yMPKVU8GPvMjAJoLZDY9wSX6JwxtYD 2ttZYgD5yBp1pt6jkLpzGuu8RuGuk8ViE2hpcaxGGopgAXohky4SG2PGArwc/3de/paP swiPHBU0IRfHI9xXXZpQUra1rnVDtmAZe2EHzvOO4fPsvTcGZMnacmObLmo3Tg4KdbK8 GyXYPv6re0JEwVuTiJfPFM8QMDanTEWQy35MttNL8xNSOFD3AccBXYt0Hb66aX72iTfc V05A== X-Gm-Message-State: AOJu0YyqhEHOeg/1jkcIe4rLorg5tYRrlEHDV/s5w/5b7t665BK9hGuA kg5vkfHNJj5O313GfNDHZ8dshQmgbYV7uqAqHfMh2VMIefzkMtr8+ZkFiKEppe8hs8T4p6OWhJE kbAgfmgmi+LWJZAb+tr+mBx0gB8UUiTbibOvigNYYFePUAZHsXb2xX3a0wNvyN0amKsrx9BWZ79 EP9m+syqHY+HfuHAFF35n0Ixjt7YQXtZ2ieKg= X-Received: by 2002:a17:906:511:b0:a72:b4d6:ec6c with SMTP id a640c23a62f3a-a7a011b99a6mr464441666b.33.1721379109721; Fri, 19 Jul 2024 01:51:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDFHtR3u5mH/rkMYtec1jvIyOBq+tUFFtgaar2AACuLd0uMoWEyrEDGaxMIkeaFc6gcP6a7Q== X-Received: by 2002:a17:906:511:b0:a72:b4d6:ec6c with SMTP id a640c23a62f3a-a7a011b99a6mr464438466b.33.1721379108768; Fri, 19 Jul 2024 01:51:48 -0700 (PDT) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [81.187.245.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7a33acbf2fsm78368566b.88.2024.07.19.01.51.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 01:51:48 -0700 (PDT) Date: Fri, 19 Jul 2024 09:51:47 +0100 (BST) From: "Maciej W. Rozycki" To: binutils@sourceware.org Subject: [committed] MIPS/GAS/testsuite: Also verify trap expansions of division macros Message-ID: <24b06fa9-1edf-0943-0edc-30750b82c3b7@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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~patchwork=sourceware.org@sourceware.org Provide 'div' test variants for trap expansions as requested by the '-trap' command-line option, and run them across all the compatible architectures. --- gas/testsuite/gas/mips/allegrex@div-trap.d | 5 + gas/testsuite/gas/mips/div-trap.d | 80 +++++++++++++++++++++ gas/testsuite/gas/mips/div64-trap.d | 28 +++++++ gas/testsuite/gas/mips/micromips@div-trap.d | 83 ++++++++++++++++++++++ gas/testsuite/gas/mips/micromips@div64-trap.d | 29 +++++++ gas/testsuite/gas/mips/mips.exp | 4 + gas/testsuite/gas/mips/mips1@div-trap.d | 5 + gas/testsuite/gas/mips/mips2@div-trap.d | 98 ++++++++++++++++++++++++++ gas/testsuite/gas/mips/mips3@div-trap.d | 5 + gas/testsuite/gas/mips/mips3@div64-trap.d | 31 ++++++++ gas/testsuite/gas/mips/mips4@div-trap.d | 5 + gas/testsuite/gas/mips/mips4@div64-trap.d | 5 + gas/testsuite/gas/mips/mips5@div-trap.d | 5 + gas/testsuite/gas/mips/mips5@div64-trap.d | 5 + gas/testsuite/gas/mips/r3000@div-trap.d | 5 + gas/testsuite/gas/mips/r3900@div-trap.d | 5 + gas/testsuite/gas/mips/r4000@div-trap.d | 5 + gas/testsuite/gas/mips/r4000@div64-trap.d | 5 + gas/testsuite/gas/mips/vr5400@div-trap.d | 5 + gas/testsuite/gas/mips/vr5400@div64-trap.d | 5 + 20 files changed, 418 insertions(+) binutils-mips-gas-test-div-trap.diff Index: binutils-gdb/gas/testsuite/gas/mips/allegrex@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/allegrex@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses +#name: MIPS div with traps +#source: div.s +#dump: div.d Index: binutils-gdb/gas/testsuite/gas/mips/div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/div-trap.d @@ -0,0 +1,80 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s + +# Test the div macro. + +.*: +file format .*mips.* + +Disassembly of section .text: +[0-9a-f]+ <[^>]*> 0085001a div zero,a0,a1 +[0-9a-f]+ <[^>]*> 00a001f4 teq a1,zero,0x7 +[0-9a-f]+ <[^>]*> 0085001a div zero,a0,a1 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14a10002 bne a1,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 3c018000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 008101b4 teq a0,at,0x6 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001a div zero,a1,a2 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14c10002 bne a2,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 3c018000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 00a101b4 teq a1,at,0x6 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00802025 move a0,a0 +[0-9a-f]+ <[^>]*> 00a02025 move a0,a1 +[0-9a-f]+ <[^>]*> 00042022 neg a0,a0 +[0-9a-f]+ <[^>]*> 00052022 neg a0,a1 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 34018000 li at,0x8000 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 34018000 li at,0x8000 +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24018000 li at,-32768 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24018000 li at,-32768 +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 3421a5a5 ori at,at,0xa5a5 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 3421a5a5 ori at,at,0xa5a5 +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 0085001b divu zero,a0,a1 +[0-9a-f]+ <[^>]*> 00a001f4 teq a1,zero,0x7 +[0-9a-f]+ <[^>]*> 0085001b divu zero,a0,a1 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001b divu zero,a1,a2 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00802025 move a0,a0 +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001a div zero,a1,a2 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14c10002 bne a2,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 3c018000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 00a101b4 teq a1,at,0x6 +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 00a1001b divu zero,a1,at +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 + \.\.\. Index: binutils-gdb/gas/testsuite/gas/mips/div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/div64-trap.d @@ -0,0 +1,28 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s + +# Test the div macro. + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001e ddiv zero,a1,a2 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14c10003 bne a2,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 24010001 li at,1 +[0-9a-f]+ <[^>]*> 00010ffc dsll32 at,at,0x1f +[0-9a-f]+ <[^>]*> 00a101b4 teq a1,at,0x6 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 00a1001f ddivu zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 34018000 li at,0x8000 +[0-9a-f]+ <[^>]*> 00a1001e ddiv zero,a1,at +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 +[0-9a-f]+ <[^>]*> 24018000 li at,-32768 +[0-9a-f]+ <[^>]*> 00a1001f ddivu zero,a1,at +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 + \.\.\. Index: binutils-gdb/gas/testsuite/gas/mips/micromips@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/micromips@div-trap.d @@ -0,0 +1,83 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s + +# Test the div macro. + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 00a4 ab3c div zero,a0,a1 +[0-9a-f]+ <[^>]*> 0005 703c teq a1,zero,0x7 +[0-9a-f]+ <[^>]*> 00a4 ab3c div zero,a0,a1 +[0-9a-f]+ <[^>]*> 3020 ffff li at,-1 +[0-9a-f]+ <[^>]*> b425 fffe bne a1,at,[0-9a-f]+ <[^>]*> + [0-9a-f]+: R_MICROMIPS_PC16_S1 \.L\^_0 +[0-9a-f]+ <[^>]*> 41a1 8000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 0024 603c teq a0,at,0x6 +[0-9a-f]+ <\.L\^_0> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 0006 703c teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00c5 ab3c div zero,a1,a2 +[0-9a-f]+ <[^>]*> 3020 ffff li at,-1 +[0-9a-f]+ <[^>]*> b426 fffe bne a2,at,[0-9a-f]+ <[^>]*> + [0-9a-f]+: R_MICROMIPS_PC16_S1 \.L\^_1 +[0-9a-f]+ <[^>]*> 41a1 8000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 0025 603c teq a1,at,0x6 +[0-9a-f]+ <\.L\^_1> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 0c84 move a0,a0 +[0-9a-f]+ <[^>]*> 0c85 move a0,a1 +[0-9a-f]+ <[^>]*> 0080 2190 neg a0,a0 +[0-9a-f]+ <[^>]*> 00a0 2190 neg a0,a1 +[0-9a-f]+ <[^>]*> 3020 0002 li at,2 +[0-9a-f]+ <[^>]*> 0024 ab3c div zero,a0,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 3020 0002 li at,2 +[0-9a-f]+ <[^>]*> 0025 ab3c div zero,a1,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 5020 8000 li at,0x8000 +[0-9a-f]+ <[^>]*> 0024 ab3c div zero,a0,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 5020 8000 li at,0x8000 +[0-9a-f]+ <[^>]*> 0025 ab3c div zero,a1,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 3020 8000 li at,-32768 +[0-9a-f]+ <[^>]*> 0024 ab3c div zero,a0,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 3020 8000 li at,-32768 +[0-9a-f]+ <[^>]*> 0025 ab3c div zero,a1,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 41a1 0001 lui at,0x1 +[0-9a-f]+ <[^>]*> 0024 ab3c div zero,a0,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 41a1 0001 lui at,0x1 +[0-9a-f]+ <[^>]*> 0025 ab3c div zero,a1,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 41a1 0001 lui at,0x1 +[0-9a-f]+ <[^>]*> 5021 a5a5 ori at,at,0xa5a5 +[0-9a-f]+ <[^>]*> 0024 ab3c div zero,a0,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 41a1 0001 lui at,0x1 +[0-9a-f]+ <[^>]*> 5021 a5a5 ori at,at,0xa5a5 +[0-9a-f]+ <[^>]*> 0025 ab3c div zero,a1,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 00a4 bb3c divu zero,a0,a1 +[0-9a-f]+ <[^>]*> 0005 703c teq a1,zero,0x7 +[0-9a-f]+ <[^>]*> 00a4 bb3c divu zero,a0,a1 +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 0006 703c teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00c5 bb3c divu zero,a1,a2 +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 0c84 move a0,a0 +[0-9a-f]+ <[^>]*> 0006 703c teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00c5 ab3c div zero,a1,a2 +[0-9a-f]+ <[^>]*> 3020 ffff li at,-1 +[0-9a-f]+ <[^>]*> b426 fffe bne a2,at,[0-9a-f]+ <[^>]*> + [0-9a-f]+: R_MICROMIPS_PC16_S1 \.L\^_2 +[0-9a-f]+ <[^>]*> 41a1 8000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 0025 603c teq a1,at,0x6 +[0-9a-f]+ <\.L\^_2> 4604 mfhi a0 +[0-9a-f]+ <[^>]*> 3020 0002 li at,2 +[0-9a-f]+ <[^>]*> 0025 bb3c divu zero,a1,at +[0-9a-f]+ <[^>]*> 4604 mfhi a0 + \.\.\. Index: binutils-gdb/gas/testsuite/gas/mips/micromips@div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/micromips@div64-trap.d @@ -0,0 +1,29 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s + +# Test the div macro. + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 0006 703c teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 58c5 ab3c ddiv zero,a1,a2 +[0-9a-f]+ <[^>]*> 3020 ffff li at,-1 +[0-9a-f]+ <[^>]*> b426 fffe bne a2,at,[0-9a-f]+ <[^>]*> + [0-9a-f]+: R_MICROMIPS_PC16_S1 \.L\^_0 +[0-9a-f]+ <[^>]*> 3020 0001 li at,1 +[0-9a-f]+ <[^>]*> 5821 f808 dsll32 at,at,0x1f +[0-9a-f]+ <[^>]*> 0025 603c teq a1,at,0x6 +[0-9a-f]+ <\.L\^_0> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 3020 0002 li at,2 +[0-9a-f]+ <[^>]*> 5825 bb3c ddivu zero,a1,at +[0-9a-f]+ <[^>]*> 4644 mflo a0 +[0-9a-f]+ <[^>]*> 5020 8000 li at,0x8000 +[0-9a-f]+ <[^>]*> 5825 ab3c ddiv zero,a1,at +[0-9a-f]+ <[^>]*> 4604 mfhi a0 +[0-9a-f]+ <[^>]*> 3020 8000 li at,-32768 +[0-9a-f]+ <[^>]*> 5825 bb3c ddivu zero,a1,at +[0-9a-f]+ <[^>]*> 4604 mfhi a0 + \.\.\. Index: binutils-gdb/gas/testsuite/gas/mips/mips.exp =================================================================== --- binutils-gdb.orig/gas/testsuite/gas/mips/mips.exp +++ binutils-gdb/gas/testsuite/gas/mips/mips.exp @@ -727,8 +727,12 @@ if { [istarget mips*-*-vxworks*] } { run_dump_test_arches "div" [mips_arch_list_matching mips1 \ !mips32r6] + run_dump_test_arches "div-trap" [mips_arch_list_matching mips1 \ + !mips32r6] run_dump_test_arches "div64" [mips_arch_list_matching mips3 !r5900 \ !mips64r6] + run_dump_test_arches "div64-trap" [mips_arch_list_matching mips3 !r5900 \ + !mips64r6] if { !$addr32 && $has_newabi } { run_dump_test_arches "dli" [mips_arch_list_matching mips3] Index: binutils-gdb/gas/testsuite/gas/mips/mips1@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips1@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses +#name: MIPS div with traps +#source: div.s +#dump: mips1@div.d Index: binutils-gdb/gas/testsuite/gas/mips/mips2@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips2@div-trap.d @@ -0,0 +1,98 @@ +#as: -32 -trap +#objdump: -drz --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s + +# Test the div macro. + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 0085001a div zero,a0,a1 +[0-9a-f]+ <[^>]*> 00a001f4 teq a1,zero,0x7 +[0-9a-f]+ <[^>]*> 0085001a div zero,a0,a1 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14a10002 bne a1,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 3c018000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 008101b4 teq a0,at,0x6 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001a div zero,a1,a2 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14c10002 bne a2,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 3c018000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 00a101b4 teq a1,at,0x6 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00802025 move a0,a0 +[0-9a-f]+ <[^>]*> 00a02025 move a0,a1 +[0-9a-f]+ <[^>]*> 00042022 neg a0,a0 +[0-9a-f]+ <[^>]*> 00052022 neg a0,a1 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 34018000 li at,0x8000 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 34018000 li at,0x8000 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24018000 li at,-32768 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24018000 li at,-32768 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 3421a5a5 ori at,at,0xa5a5 +[0-9a-f]+ <[^>]*> 0081001a div zero,a0,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 3c010001 lui at,0x1 +[0-9a-f]+ <[^>]*> 3421a5a5 ori at,at,0xa5a5 +[0-9a-f]+ <[^>]*> 00a1001a div zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 0085001b divu zero,a0,a1 +[0-9a-f]+ <[^>]*> 00a001f4 teq a1,zero,0x7 +[0-9a-f]+ <[^>]*> 0085001b divu zero,a0,a1 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001b divu zero,a1,a2 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 00802025 move a0,a0 +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001a div zero,a1,a2 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14c10002 bne a2,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 3c018000 lui at,0x8000 +[0-9a-f]+ <[^>]*> 00a101b4 teq a1,at,0x6 +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001b divu zero,a1,at +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00000000 nop Index: binutils-gdb/gas/testsuite/gas/mips/mips3@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips3@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -drz --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s +#dump: mips2@div-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/mips3@div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips3@div64-trap.d @@ -0,0 +1,31 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s + +# Test the div macro. + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 00c001f4 teq a2,zero,0x7 +[0-9a-f]+ <[^>]*> 00a6001e ddiv zero,a1,a2 +[0-9a-f]+ <[^>]*> 2401ffff li at,-1 +[0-9a-f]+ <[^>]*> 14c10003 bne a2,at,[0-9a-f]+ <[^>]*> +[0-9a-f]+ <[^>]*> 24010001 li at,1 +[0-9a-f]+ <[^>]*> 00010ffc dsll32 at,at,0x1f +[0-9a-f]+ <[^>]*> 00a101b4 teq a1,at,0x6 +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 24010002 li at,2 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001f ddivu zero,a1,at +[0-9a-f]+ <[^>]*> 00002012 mflo a0 +[0-9a-f]+ <[^>]*> 34018000 li at,0x8000 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001e ddiv zero,a1,at +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 +[0-9a-f]+ <[^>]*> 24018000 li at,-32768 +[0-9a-f]+ <[^>]*> 00000000 nop +[0-9a-f]+ <[^>]*> 00a1001f ddivu zero,a1,at +[0-9a-f]+ <[^>]*> 00002010 mfhi a0 + \.\.\. Index: binutils-gdb/gas/testsuite/gas/mips/mips4@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips4@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -drz --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s +#dump: mips2@div-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/mips4@div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips4@div64-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s +#dump: mips3@div64-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/mips5@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips5@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -drz --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s +#dump: mips2@div-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/mips5@div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/mips5@div64-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s +#dump: mips3@div64-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/r3000@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/r3000@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses +#name: MIPS div with traps +#source: div.s +#dump: mips1@div.d Index: binutils-gdb/gas/testsuite/gas/mips/r3900@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/r3900@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses +#name: MIPS div with traps +#source: div.s +#dump: mips1@div.d Index: binutils-gdb/gas/testsuite/gas/mips/r4000@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/r4000@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -drz --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s +#dump: mips2@div-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/r4000@div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/r4000@div64-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s +#dump: mips3@div64-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/vr5400@div-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/vr5400@div-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -drz --prefix-addresses --show-raw-insn +#name: MIPS div with traps +#source: div.s +#dump: mips2@div-trap.d Index: binutils-gdb/gas/testsuite/gas/mips/vr5400@div64-trap.d =================================================================== --- /dev/null +++ binutils-gdb/gas/testsuite/gas/mips/vr5400@div64-trap.d @@ -0,0 +1,5 @@ +#as: -32 -trap +#objdump: -dr --prefix-addresses --show-raw-insn +#name: MIPS 64-bit div with traps +#source: div64.s +#dump: mips3@div64-trap.d