From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30977 invoked by alias); 8 Feb 2016 17:30:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30918 invoked by uid 89); 8 Feb 2016 17:30:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 08 Feb 2016 17:30:32 +0000 Received: by mail-pf0-f193.google.com with SMTP id 66so8874604pfe.2 for ; Mon, 08 Feb 2016 09:30:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=3Bj6J30P1KBVT2oHtqFenUopMtRs6TcxJw87pnkBXXM=; b=LdHTiQERQKZFh5IyH01aiBpI1RqPQIoPhrm8o433DGX+xSG2kNiuRKvjtsL7r5jfBt LkahHOfe9ANy3fz5jaTvLMkZip9jshCW7H1HrctP4Y0D+oq1OTcq0edgofsXBluBPDFZ d0nZYa6StZI9X7yYW69N+byPOMt4TlwifRfYTsr3VxicQG34hfHtpHEchEygRbWOBEXN tYWGh1gxK98RnE3KRoC7iO/12fasRWvN3KzUUnEksFxRbW15+KKvFEB1iTYzrCUVLEUw z3D40+vx4dJVTGLpEhXV9Knffl8j8rC5g/JXk64lMI83hfCc0LLugGv3PbnyLDp8HtK3 CyTw== X-Gm-Message-State: AG10YORdmzWoZG85EhlgPfF+uT1fpIP/vxCCCZZqEfr2cUBvycqgaAvV9J7tvCGHfbO5rw== X-Received: by 10.98.73.6 with SMTP id w6mr44573685pfa.82.1454952628522; Mon, 08 Feb 2016 09:30:28 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id lt14sm44817538pab.39.2016.02.08.09.30.25 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 08 Feb 2016 09:30:27 -0800 (PST) From: Yao Qi To: Antoine Tremblay Cc: Yao Qi , , Pierre Langlois Subject: Re: [PATCH 4/8] Implement target_emit_ops References: <1442230282-20751-1-git-send-email-pierre.langlois@arm.com> <1442580184-22562-1-git-send-email-yao.qi@linaro.org> <1442580184-22562-5-git-send-email-yao.qi@linaro.org> <56B50172.7040608@ericsson.com> Date: Mon, 08 Feb 2016 17:30:00 -0000 In-Reply-To: <56B50172.7040608@ericsson.com> (Antoine Tremblay's message of "Fri, 5 Feb 2016 15:09:22 -0500") Message-ID: <86oabrnm8k.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00196.txt.bz2 Antoine Tremblay writes: > I'm wondering is there a reason we don't use gcc to generate the > native bytecode like done on x86 ? > > x86 has a macro like so : > > #define EMIT_ASM(NAME, INSNS)=09=09=09=09=09=09 > do=09=09=09=09=09=09=09=09=09 > {=09=09=09=09=09=09=09=09=09 > extern unsigned char start_ ## NAME, end_ ## NAME;=09=09 > add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME);=09 > __asm__ ("jmp end_" #NAME "\n"=09=09=09=09=09 > "\t" "start_" #NAME ":"=09=09=09=09=09 > "\t" INSNS "\n"=09=09=09=09=09=09 > "\t" "end_" #NAME ":");=09=09=09=09=09 > } while (0) > The reason is about the code readability. We find the way we are using in aarch64 is more readable than the way for x86. p +=3D emit_stp (p, x0, x1, sp, preindex_memory_operand (-2 * 16)); p +=3D emit_str (p, lr, sp, offset_memory_operand (3 * 8)); p +=3D emit_str (p, fp, sp, offset_memory_operand (2 * 8)); p +=3D emit_add (p, fp, sp, immediate_operand (2 * 8)); vs. EMIT_ASM (amd64_prologue, "pushq %rbp\n\t" "movq %rsp,%rbp\n\t" "sub $0x20,%rsp\n\t" "movq %rdi,-8(%rbp)\n\t" "movq %rsi,-16(%rbp)"); > Could the same be done for armv7 or there's a reason that prevents it ? > No reason prevents it, but the code should be readable. --=20 Yao (=E9=BD=90=E5=B0=A7)