From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 7AB87386F442 for ; Sat, 25 Apr 2020 19:53:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7AB87386F442 Received: by mail-lj1-x235.google.com with SMTP id n6so13432666ljg.12 for ; Sat, 25 Apr 2020 12:53:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=jZriklHMybQnLdXZWN8H5TGP+O45nhTEJzWobZR0lNY=; b=DoDAy12v535NjI3GXykk2vtndJc+d9KmG6LZ095cLNO7SjEmmmj5jwccX6jHKkEPQL IQPFEKPyhLM5BwfAO7Io5vR5dbFgTQtsMmpmhpJMLDrxXbTmthc45zUNevA4JSjdteHm F88lf50sNjZ7gwThvC7Bf1iY8hnPPy0ON+YN/KE1g3KOaoRn8764Y3E09tjvtEwdPXpB E8dv/4d/BM4WhpQ2beB68/a2QQCo6xxP4Ibu7w3n6UQE+h38zPk4tVPeoZC0CghH02jU R2t/KhgMVjcN1wNVE3wfnqu0uzhEG+Pla3MelVbisqmvjqvkNWpG/1O75bsXQe2EQ+/O Lqgg== X-Gm-Message-State: AGi0Pub3D+JObLMvKiUvn+qimMGN2YuD49+JpbvQ1c2QaFRWyaZYvWg/ H6A+Ic4xjKaao+vMJHuQ9j9pkDo2iS3ymxg7NyOFCsih9WI= X-Google-Smtp-Source: APiQypL7C3Z2cF/VccH5Ye6fKkioYh/Bg8/k/KEvw420FgA+OIDMTURk37clo6IF+TGBf55fVWtuJuduRhBCnHNd/Sg= X-Received: by 2002:a2e:9e97:: with SMTP id f23mr9605026ljk.228.1587844391710; Sat, 25 Apr 2020 12:53:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: William Tambe Date: Sat, 25 Apr 2020 15:52:59 -0400 Message-ID: Subject: Re: how to use emit_clobber () ? To: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2020 19:53:14 -0000 Correcting typo in my previous email. On Sat, Apr 25, 2020 at 3:21 PM William Tambe wrote: > > The following define_expand is used to generate a call to > __tls_get_addr() when the first operand of movsi is detected as a TLS > symbol by tls_symbol_operand(). > > I am trying to accomplish generating a call to __tls_get_addr() > passing two arguments in two registers where I would like to clobber > the first register argument. > > However the use of emit_clobber() has no effect. > > Any idea, how emit_clobber should be used below ? > > (define_expand "movsi" > [(set (match_operand:SI 0 "nonimmediate_operand" "") > (match_operand:SI 1 "general_operand" ""))] > "" > { > rtx op0 = operands[0]; > rtx op1 = operands[1]; > if (tls_symbolic_operand (op0, VOIDmode)) { > rtx arg0 = gen_rtx_REG (SImode, ARCH_FIRST_ARG_REGNUM); > rtx arg1 = gen_rtx_REG (SImode, ARCH_FIRST_ARG_REGNUM+1); > emit_insn (arg1); > emit_clobber (gen__movsi (arg0, op0)); Above is incorrect; what I am using is below: emit_clobber (arg1); emit_insn (gen__movsi (arg0, op0)); Question remain the same; any idea how emit_clobber should be used in order to have an effect ? > rtx fn = gen_rtx_MEM (FUNCTION_MODE, gen_arch_tga()); > rtx_insn *insn = emit_call_insn (gen_call_value (arg0, fn, const0_rtx)); > RTL_CONST_CALL_P (insn) = 1; > use_reg (&CALL_INSN_FUNCTION_USAGE (insn), arg0); > use_reg (&CALL_INSN_FUNCTION_USAGE (insn), arg1); > if (GET_CODE (op0) == MEM) > arg0 = gen_rtx_MEM (SImode, arg0); > operands[0] = arg0; > } > emit_insn (gen__movsi (operands[0], operands[1])); > DONE; > })