From patchwork Mon Oct 11 10:42:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 46065 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 C8A5D3858409 for ; Mon, 11 Oct 2021 10:44:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-eopbgr1310124.outbound.protection.outlook.com [40.107.131.124]) by sourceware.org (Postfix) with ESMTPS id 0C7013858D28 for ; Mon, 11 Oct 2021 10:43:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C7013858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cipunited.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cipunited.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q0ba+K7Ayo8uiY86JiLhbSgpUxOmX7psbLBe5uqzLJpCIMUMyfEqbuLTk4fFCwz/YjlqhY0sfY1aNJVXPOreJKOqpJAXiNZJjxI3R6m4D52WtmU+J648ukz+1Qo8gyfPQvQ8Ytfmwa8jPTGvjmetqnyDonic3as4Gn0GCmz61Y26nHa7qQoYf7DiLF36iCxCSbcJBWqUmx/uRz2HCIOdjv0NfFRnXrWrEL1lTwPq0dp0Kv7TtbNMUejZXvBSBgpwtXobgVYH4X6bZLrShmNBAcciYVUh3kxpb9b2R7iyDV+YW+77RRgbFyty4nlOw+7cp+awFW9SC5QHBdvnHkTuiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=orYdVlJ0JwtKzmtIM+Pfa1z9ZwOvHMVLD2nlPRK9/mM=; b=YXhCXq2Aa2nGc1+xt2xB6B8VcoupqJm3hF3Pi/41rwEbdEStNa3WLyMqGmx+eAtUGrQmrrbsq7oDC+hDc7ZhbMSeoOrW3CFJOix2ZQjH5ZDM8U0iQRdbAwMwxBx/mZWxcYZLIbM01lPVXNxmTjGzcECuMBuq172pBtkQgBN7CfBeRuObl84ei1zeo+vtKgd29mAmnJTpynmwUDNVUH0oTJYnUjmsSpG/YTuCvYQxlsSSZNFW+rM2V6LvHTS/Sit6dkZVogczuthhZy8raUMk4zBhXsF52010mP2igzTH0Igog4bVO6vU8+RheG4C0Idz4mLEuJEgDy1LAFpcwFarYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cipunited.com; dmarc=pass action=none header.from=cipunited.com; dkim=pass header.d=cipunited.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cipunited.onmicrosoft.com; s=selector1-cipunited-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=orYdVlJ0JwtKzmtIM+Pfa1z9ZwOvHMVLD2nlPRK9/mM=; b=N2FtfUKXtFNhV4HenofuGx3iNkSSoP7q3CB5XM821SB1TQtADeI54chVC1zBSSngV1IZA80OBq5qNjVBH8RQogTn44snML3tClEwcwu69e88PwVXulT7FkHyD/llflg8+O8+AVd3DNem9RQPRav6uHPOI2kNA+MotSeAjq+xAmQ= Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=cipunited.com; Received: from HKAPR04MB3956.apcprd04.prod.outlook.com (2603:1096:203:d5::13) by HK2PR04MB3779.apcprd04.prod.outlook.com (2603:1096:202:3a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Mon, 11 Oct 2021 10:43:44 +0000 Received: from HKAPR04MB3956.apcprd04.prod.outlook.com ([fe80::4d0:36d8:f42d:4927]) by HKAPR04MB3956.apcprd04.prod.outlook.com ([fe80::4d0:36d8:f42d:4927%8]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 10:43:44 +0000 From: YunQiang Su To: gcc-patches@gcc.gnu.org Subject: [PATCH v3] MIPS: R6: load/store can process unaligned address Date: Mon, 11 Oct 2021 06:42:39 -0400 Message-Id: <20211011104239.407933-1-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To HKAPR04MB3956.apcprd04.prod.outlook.com (2603:1096:203:d5::13) MIME-Version: 1.0 Received: from localhost.localdomain (2001:da8:20f:4532:feda::b016) by BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24 via Frontend Transport; Mon, 11 Oct 2021 10:43:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cf72338-3abe-4119-73fd-08d98ca3ff7f X-MS-TrafficTypeDiagnostic: HK2PR04MB3779: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J/DbJU6tOwTGs/AqFS/c6uV1ezi3+DyCTs+ZcEuXd/fyTgHTJLqYHWXLGDULRcG63X1SfMGshiWD5ZF/lcf8Zd6fzyRAHIakradcBhIamp7Za6gZpgiKwo2ta0A/a38xhxl71j+L5RfgMCPuW6xqcmBvZXDKHyKRS98RFn5OXMQb2yZVGl1qmi+dL4iLLjgR7bstoAyVpLSsDybsaYvBtV+uJ0oYWbyeMIYC3+clMJXk2ZufhLqY6t3J17yQO14gQPLo6S/tGkEgwogKYVWXNzHZR/rmPKrGq6yOX++ntEDJqd7M3Vzb4h+qo0nHP/nC/y6syp3qHyi6pe9s3KexmhBBPM+9YwC24GzsmpmxmKe9yBfmiJU2JDcdS+tDtmhnqnvQR4Ai03hdr5SsygkheY/jZ/xIcHfE20t7owyCUWBZp9vmHVqV76LZfsToKC2vmLuWr8ZuyCcqqxMka9IxMKJ7act+gch1QLAIX+v0fKXXbP41qhSkiOqFY4fjLousb2cRsKGHK6JpRW5awRpWMYsj4Ag3XJqiiPvZqvXHqCYq8ot2FRwpFMy57iO513/BED+wG5+b/adbkbnvusN+g0DSe06tHMjIDQcMZdTOfr/4y8H9Xxwgk5GxV7B5MhEqomXT/FZTdH5Kc9dSuqxsHiqSxX/JOHZVhgOZbhisQggiGkbSXzhFnNflvQrfwxVNLrPa1bGKhfiJJCu/+AXwsoHBAYmvx8PhIhhj3y7sDRg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HKAPR04MB3956.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(136003)(396003)(376002)(39830400003)(346002)(36756003)(1076003)(83380400001)(2616005)(4326008)(8676002)(186003)(8936002)(66556008)(38100700002)(6916009)(6506007)(6486002)(107886003)(2906002)(66946007)(66476007)(86362001)(52116002)(5660300002)(316002)(6512007)(508600001)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VyBXIj3h0KQ0+tphoTqRKFJLq6gvbyEZxTvjPRLjw/B/wpXnc1f4Xfy/KhoCAVAxGMREYKVTI28VQQsn8zdQnOrKAQUjOev+8mh3s0tZ3HtcxZGzUiGvLSJzSVh/Yvi+DSJXQEtaeCrbSkLR1F5p3+KcQKTx4cyJ4AUe+etjW133T83RxYyy4MH+sAHncf+t5IcwCLKOzHfzJrKaLC6uPAHO7jZQHrF+o7vcqzOoEbjR5wHfTesIsE0De4XGXcGDroJyI/BfGCdEsntq+yb2Ql6NnkyDjZUpZ+V+omRSz801ZpoU4mbXS7Rky7rO8jSAR8mMJMJCtH7G7BHd34yv6Xmktde7swAaX8HOsoYnNUCmrLr0eA3dmrLluG/uyWMzhyozR/20CaKXGomtQX36F96M+mU3agRc9FQX3bWXdmS4036T0bgxOpoFant+KVyas7yzD1n/L7Jw0AhatJ3++saXPk8XBIt1xT6ygOl/95cl5QE7TFHeKKkDkavq4J5PzJF7irvAynL0UbEX0V3f1rf+haXBtqTQS8m1ZEFsK3jd05t5Uv7KLtaKFdlfEDw67iOI0pQDwW0qt1OlFkIGYimtGDqUnhMu4Os6gr6ap2zJAmY5u7qldQYgbV4Qs2kJa20Rf1vXbdOJL09Aewmu4YBikXBepN7qdl8BVkYvZXv7diThfXZlA9nVW5+9PGSyICU4ijsNdeUfHzPe+077BLMj5WvLXYghdc8XJPjJTve8N1ncw6JGWfv/ApNIETCRNqSxHSZdLYRjLh1qJX2lHxxAdxqycGOJfeAABsbeRKuoXXVXX+apR1A2P+ci4UpZBeZ2L3B1qQZiSePO/VgikyGp7U5zgCWOqC0oyTSOXrqo/bAdl6mlpLN0tFA5sQYY0gmUcZKHE5JGm+yesLSLBywNJ6njDn+IN9Aa7yScAJO4aNWfYHJOhAo9hheTeWrmr0zWxqxWCne3wGsd6TVcoAjLNjJkPpaX2bPH/ps0RfSv1WSuL0obGBg8r+Rll36JWHL8MFE/gHcSrRWn3e578XZUa/JUNOyKKF/nZ8tNMlYhZOxit29flvOfpg/Vqh/Vjf0WsJbwhWF/4Y55Hmc+dSoTeYBIfwJpJLCuEHUqyswXkQ87I5zsQbTmFZaqanPkIOTOd6FUlrtYtyYafO5cCBSBfv3DgwOHH220ARG8WF6LljN/zhVBRxm82QEHyEbbCWwGX5qex+7xj9ZvWZHXrR0uQwJaIcYqZl3E07kqWpbOZfRMEPCkWmJvM8wZ5ycr+0iNa9AbPu7hCdY8+Q7DyjWuwso202Tf3ESbBEDW2G4Xnzdi25EwQ/tfYqYzH1bWKxwbtxmzIfv6cFKwdfhrCvCQ3qMa544F+wCtMECv7UM= X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cf72338-3abe-4119-73fd-08d98ca3ff7f X-MS-Exchange-CrossTenant-AuthSource: HKAPR04MB3956.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 10:43:44.7002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e31cf5b5-ee69-4d5f-9c69-edeeda2458c0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /GKiIS9RCePPXut1ojBALE9FCd2ZviBMrhk7d/qvns0tH1t9iE443lCKQX3i//+1nAzzGCAtDfYY9XZPLuNBq9Zjkh59KvlKltI+hqVf/qM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR04MB3779 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: YunQiang Su Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" MIPS release 6 requires the lw/ld/sw/sd can work with unaligned address, while it can be implemented by full hardware or trap&emulate. Since it doesn't have to be fully done by hardware, we add a pair of options -m(no-)unaligned-access. Kernels may need them. gcc/ChangeLog: * config/mips/mips.h (ISA_HAS_UNALIGNED_ACCESS): (STRICT_ALIGNMENT): R6 can unaligned access. * config/mips/mips.md (movmisalign): Likewise. * config/mips/mips.opt: add -m(no-)unaligned-access * doc/invoke.texi: Likewise. gcc/testsuite/ChangeLog: * gcc.target/mips/mips.exp: add unaligned-access * gcc.target/mips/unaligned-2.c: New test. * gcc.target/mips/unaligned-3.c: New test. --- gcc/config/mips/mips.h | 6 ++- gcc/config/mips/mips.md | 10 ++++ gcc/config/mips/mips.opt | 4 ++ gcc/doc/invoke.texi | 10 ++++ gcc/testsuite/gcc.target/mips/mips.exp | 1 + gcc/testsuite/gcc.target/mips/unaligned-2.c | 53 +++++++++++++++++++++ gcc/testsuite/gcc.target/mips/unaligned-3.c | 53 +++++++++++++++++++++ 7 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/mips/unaligned-2.c create mode 100644 gcc/testsuite/gcc.target/mips/unaligned-3.c diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 973372e78..34490bfc2 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -243,6 +243,10 @@ struct mips_cpu_info { && (mips_isa_rev >= 6 \ || ISA_HAS_MSA)) +/* ISA load/store instructions can handle unaligned address */ +#define ISA_HAS_UNALIGNED_ACCESS (TARGET_UNALIGNED_ACCESS \ + && (mips_isa_rev >= 6)) + /* The ISA compression flags that are currently in effect. */ #define TARGET_COMPRESSION (target_flags & (MASK_MIPS16 | MASK_MICROMIPS)) @@ -1684,7 +1688,7 @@ FP_ASM_SPEC "\ (ISA_HAS_MSA ? BITS_PER_MSA_REG : LONG_DOUBLE_TYPE_SIZE) /* All accesses must be aligned. */ -#define STRICT_ALIGNMENT 1 +#define STRICT_ALIGNMENT (!ISA_HAS_UNALIGNED_ACCESS) /* Define this if you wish to imitate the way many other C compilers handle alignment of bitfields and the structures that contain diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 455b9b802..e35d57d9e 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -4459,6 +4459,16 @@ (define_insn "mov_r" [(set_attr "move_type" "store") (set_attr "mode" "")]) +;; Unaligned direct access +(define_expand "movmisalign" + [(set (match_operand:JOIN_MODE 0) + (match_operand:JOIN_MODE 1))] + "ISA_HAS_UNALIGNED_ACCESS" +{ + if (mips_legitimize_move (mode, operands[0], operands[1])) + DONE; +}) + ;; An instruction to calculate the high part of a 64-bit SYMBOL_ABSOLUTE. ;; The required value is: ;; diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt index 6af8037e9..ebb4c6164 100644 --- a/gcc/config/mips/mips.opt +++ b/gcc/config/mips/mips.opt @@ -404,6 +404,10 @@ mtune= Target RejectNegative Joined Var(mips_tune_option) ToLower Enum(mips_arch_opt_value) -mtune=PROCESSOR Optimize the output for PROCESSOR. +munaligned-access +Target Var(TARGET_UNALIGNED_ACCESS) Init(1) +Generate code with unaligned load store, valid for MIPS R6. + muninit-const-in-rodata Target Var(TARGET_UNINIT_CONST_IN_RODATA) Put uninitialized constants in ROM (needs -membedded-data). diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8b3ebcfbc..ffb1f4676 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1069,6 +1069,7 @@ Objective-C and Objective-C++ Dialects}. -mcheck-zero-division -mno-check-zero-division @gol -mdivide-traps -mdivide-breaks @gol -mload-store-pairs -mno-load-store-pairs @gol +-munaligned-access -mno-unaligned-access @gol -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls @gol -mmad -mno-mad -mimadd -mno-imadd -mfused-madd -mno-fused-madd -nocpp @gol -mfix-24k -mno-fix-24k @gol @@ -25503,6 +25504,15 @@ instructions to enable load/store bonding. This option is enabled by default but only takes effect when the selected architecture is known to support bonding. +@item -munaligned-access +@itemx -mno-unaligned-access +@opindex munaligned-access +@opindex mno-unaligned-access +Enable (disable) direct unaligned access for MIPS Release 6. +MIPSr6 requires load/store unaligned-access support, +by hardware or trap&emulate. +So @option{-mno-unaligned-access} may be needed by kernel. + @item -mmemcpy @itemx -mno-memcpy @opindex mmemcpy diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp index d4d4b90d8..f76ab7adc 100644 --- a/gcc/testsuite/gcc.target/mips/mips.exp +++ b/gcc/testsuite/gcc.target/mips/mips.exp @@ -264,6 +264,7 @@ set mips_option_groups { frame-header "-mframe-header-opt|-mno-frame-header-opt" stack-protector "-fstack-protector" stdlib "REQUIRES_STDLIB" + unaligned-access "-m(no-|)unaligned-access" } for { set option 0 } { $option < 32 } { incr option } { diff --git a/gcc/testsuite/gcc.target/mips/unaligned-2.c b/gcc/testsuite/gcc.target/mips/unaligned-2.c new file mode 100644 index 000000000..8679afac4 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/unaligned-2.c @@ -0,0 +1,53 @@ +/* { dg-options "isa_rev>=6 -mgp64" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ +/* { dg-final { scan-assembler-not "\tsb\t" } } */ +/* { dg-final { scan-assembler-not "\tsh\t" } } */ +/* { dg-final { scan-assembler-not "\tlb\t" } } */ +/* { dg-final { scan-assembler-not "\tlh\t" } } */ +/* { dg-final { scan-assembler-not "\tswl\t" } } */ +/* { dg-final { scan-assembler-not "\tswr\t" } } */ +/* { dg-final { scan-assembler-not "\tlwl\t" } } */ +/* { dg-final { scan-assembler-not "\tlwr\t" } } */ +/* { dg-final { scan-assembler-not "\tsdl\t" } } */ +/* { dg-final { scan-assembler-not "\tsdr\t" } } */ +/* { dg-final { scan-assembler-not "\tldl\t" } } */ +/* { dg-final { scan-assembler-not "\tldr\t" } } */ +/* { dg-final { scan-assembler-times "\tsw\t" 1 } } */ +/* { dg-final { scan-assembler-times "\tlw\t" 1 } } */ +/* { dg-final { scan-assembler-times "\tsd\t" 1 } } */ +/* { dg-final { scan-assembler-times "\tld\t" 1 } } */ +/* { dg-final { scan-assembler-not "\tnop" } } */ + +/* Test to make sure we produce the unaligned load/store for + both 64bit and 32bits sized accesses. */ + +struct s +{ + char c; + int i; + long long l; +} __attribute__ ((packed)) s __attribute__((aligned(1) )); + +NOMIPS16 void +sd (long long l) +{ + s.l = l; +} + +NOMIPS16 long long +ld () +{ + return s.l; +} + +NOMIPS16 void +sw (int i) +{ + s.i = i; +} + +NOMIPS16 int +lw () +{ + return s.i; +} diff --git a/gcc/testsuite/gcc.target/mips/unaligned-3.c b/gcc/testsuite/gcc.target/mips/unaligned-3.c new file mode 100644 index 000000000..d0fbe19de --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/unaligned-3.c @@ -0,0 +1,53 @@ +/* { dg-options "isa_rev>=6 -mgp64 -mno-unaligned-access" } */ +/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ +/* { dg-final { scan-assembler-times "\tsb\t" 12 } } */ +/* { dg-final { scan-assembler-times "\tlbu\t" 12 } } */ +/* { dg-final { scan-assembler-not "\tsh\t" } } */ +/* { dg-final { scan-assembler-not "\tlh\t" } } */ +/* { dg-final { scan-assembler-not "\tsw\t" } } */ +/* { dg-final { scan-assembler-not "\tlw\t" } } */ +/* { dg-final { scan-assembler-not "\tsd\t" } } */ +/* { dg-final { scan-assembler-not "\tld\t" } } */ +/* { dg-final { scan-assembler-not "\tswl\t" } } */ +/* { dg-final { scan-assembler-not "\tswr\t" } } */ +/* { dg-final { scan-assembler-not "\tlwl\t" } } */ +/* { dg-final { scan-assembler-not "\tlwr\t" } } */ +/* { dg-final { scan-assembler-not "\tsdl\t" } } */ +/* { dg-final { scan-assembler-not "\tsdr\t" } } */ +/* { dg-final { scan-assembler-not "\tldl\t" } } */ +/* { dg-final { scan-assembler-not "\tldr\t" } } */ +/* { dg-final { scan-assembler-not "\tnop" } } */ + +/* Test to make sure we produce the unaligned load/store for + both 64bit and 32bits sized accesses. */ + +struct s +{ + char c; + int i; + long long l; +} __attribute__ ((packed)) s __attribute__((aligned(1) )); + +NOMIPS16 void +sd (long long l) +{ + s.l = l; +} + +NOMIPS16 long long +ld () +{ + return s.l; +} + +NOMIPS16 void +sw (int i) +{ + s.i = i; +} + +NOMIPS16 int +lw () +{ + return s.i; +}