From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 80C303858C50 for ; Sat, 22 Apr 2023 22:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 80C303858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-63b4bf2d74aso2707250b3a.2 for ; Sat, 22 Apr 2023 15:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682201288; x=1684793288; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+dyCP95z48F1TePRxmOLxLDn0aXxs16bCdJDyogdEkc=; b=aEujTDFLVYmHu6+mRwSHW33D8AZh9dNIx3zEoFuubJDg1gNzNwZ20E6ui8gnvLGLxp Q/RTq9zHT5/8c8Hth4vxDtJTrMF+x3QDBvumlwbx/ry8HaL8nTz4u0/fudPp3ba6Pf0s M07VsYoZThnO9eY3OWu5+KTRXmHGCjZystv9PMwFC0dYtDQVDqowG124KiwGNnrKoQ0x 7j1Ovd9vO3H31M6E61jgRu41jMeauU7t+Id8N66CfJuDT+gZ1U2XSvmymLZVakgLFdS8 rCw9FQpLYBFesh7HJNLYcIJGV3+UbeEry2LT4Z3qG1Del75LNfR76KDuFSNAL0wq28kz xouw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682201288; x=1684793288; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+dyCP95z48F1TePRxmOLxLDn0aXxs16bCdJDyogdEkc=; b=JV/Q6DvP8yV9T65oewSVNrn1Shc05UWzu7+LC8YAQXFP9OwjFSqN4SgQaQDLYSkXTi wQe3vN9RdmZrAlieYObDf+gTzvNePg5Gif+uWpJ0V7OXROPIMzPV2+e888/Vin8WdZp6 MHR8xGH3nbBQavSaZAdW2FN6uIe73gstRb4FTGutIDQ05lDBmbue1rfS1xkM0GlnEDPz YXdkW9N+vIt9zGvkNbRN4z25YcJVTrrnLyIU8kCCjAxorDLBUHuBFgCgUPvrSbhq6mGB QChczdWfH5/qzxGNrjA8IZPLlVUI5lUMXMwZIkhYtWeJQ49mnd6Qz1qXfHpFpgtRaM7A xNEg== X-Gm-Message-State: AAQBX9cWdSl2PF4VhNdCHZT4zGA1LxRBvyG/bKT41PhGVoDwhYDwiCBm /wK71hw4ORGSW+JtBR5mwfE= X-Google-Smtp-Source: AKy350bva3Na/zRLn/CixSb9YwXZMrmmf/9lFv+pR8lcPtVHHDVUpqlVufAhjri0jzRVB94UAy/U8A== X-Received: by 2002:a05:6a00:892:b0:63b:6774:8f1d with SMTP id q18-20020a056a00089200b0063b67748f1dmr11617115pfj.31.1682201288190; Sat, 22 Apr 2023 15:08:08 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::99f? ([2601:681:8600:13d0::99f]) by smtp.gmail.com with ESMTPSA id n12-20020a056a00212c00b0063f172b1c47sm3339489pfj.35.2023.04.22.15.08.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Apr 2023 15:08:07 -0700 (PDT) Message-ID: Date: Sat, 22 Apr 2023 16:08:06 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [xstormy16] Add extendhisi2 and zero_extendhisi2 patterns to stormy16.md Content-Language: en-US To: Roger Sayle , 'GCC Patches' References: <026001d9755d$19b30030$4d190090$@nextmovesoftware.com> From: Jeff Law In-Reply-To: <026001d9755d$19b30030$4d190090$@nextmovesoftware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,MEDICAL_SUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/22/23 14:57, Roger Sayle wrote: > > This patch adds a pair of define_insn patterns to the xstormy16 machine > description that provide extendhisi2 and zero_extendhisi2, i.e. 16-bit > to 32-bit sign- and zero-extension respectively. This functionality is > already synthesized during RTL expansion, but providing patterns allow > the semantics to be exposed to the RTL optimizers. To simplify things, > this patch introduces a new %h0 output format, for emitting the high_part > register name of a double-word (SImode) register pair. The actual > code generated is identical to before. > > Whilst there, I also fixed the instruction lengths and formatting of > the zero_extendqihi2 pattern. Then, mostly for documentation purposes > as the 'T' constraint isn't yet implemented, I've added a "and Rx,#255" > alternative to zero_extendqihi2 that takes advantage of its efficient > instruction encoding. > > This patch has been tested by building a cross-compiler to xstormy16-elf > on x86_64-pc-linux-gnu, and confirming that the new test case passes with > "make -k check-gcc". Ok for mainline? > > > 2023-04-22 Roger Sayle > > gcc/ChangeLog > * config/stormy16/stormy16.cc (xstormy16_print_operand): Add %h > format specifier to output high_part register name of SImode reg. > * config/stormy16/stormy16.md (extendhisi2): New define_insn. > (zero_extendqihi2): Fix lengths, consistent formatting and add > "and Rx,#255" alternative, for documentation purposes. > (zero_extendhisi2): New define_insn. > > gcc/testsuite/ChangeLog > * gcc.target/xstormy16/extendhisi2.c: New test case. > * gcc.target/xstormy16/zextendhisi2.c: Likewise. Does the "T" alternative ever match? AFAICT its constraint check always fails: > (define_constraint "T" > "@internal" > ;; For Rx; not implemented yet. > (match_test "0")) No objections, but just not sure what's going on with that T constraint. jeff