From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14764 invoked by alias); 8 Oct 2013 16:13:08 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 14748 invoked by uid 89); 8 Oct 2013 16:13:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f178.google.com Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 08 Oct 2013 16:13:06 +0000 Received: by mail-ob0-f178.google.com with SMTP id uz6so649725obc.9 for ; Tue, 08 Oct 2013 09:13:04 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.117.225 with SMTP id kh1mr1774744oeb.15.1381248784550; Tue, 08 Oct 2013 09:13:04 -0700 (PDT) Received: by 10.76.110.15 with HTTP; Tue, 8 Oct 2013 09:13:04 -0700 (PDT) In-Reply-To: <5254367002000078000F9A61@nat28.tlf.novell.com> References: <5254349502000078000F9A3D@nat28.tlf.novell.com> <5254367002000078000F9A61@nat28.tlf.novell.com> Date: Tue, 08 Oct 2013 16:13:00 -0000 Message-ID: Subject: Re: [PATCH 6/6] x86/MPX: bndmk, bndldx, and bndstx don't allow RIP-relative addressing From: "H.J. Lu" To: Jan Beulich Cc: kirill.yukhin@intel.com, Binutils Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00087.txt.bz2 On Tue, Oct 8, 2013 at 7:44 AM, Jan Beulich wrote: > gas/ > 2013-10-08 Jan Beulich > > * tc-i386.c (i386_index_check): Reject RIP-relative addressing for > bndmk, bndldx, and bndstx. Warn about register scaling by other > than 1 for bndldx and bndstx. > > --- 2013-10-07/gas/config/tc-i386.c > +++ 2013-10-07/gas/config/tc-i386.c > @@ -8360,6 +8375,25 @@ bad_address: > || i.index_reg->reg_num == RegEiz)) > || !i.index_reg->reg_type.bitfield.baseindex))) > goto bad_address; > + > + /* bndmk, bndldx, and bndstx have special restrictions. */ > + if (current_templates->start->base_opcode == 0xf30f1b > + || (current_templates->start->base_opcode & ~1) == 0x0f1a) > + { > + /* They cannot use RIP-relative addressing. */ > + if (i.base_reg > + && i.base_reg->reg_num == (addr_mode == CODE_64BIT ? RegRip > + : RegEip)) > + { > + as_bad (_("`%s' cannot be used here"), operand_string); > + return 0; > + } RegEip should be disallowed much earlier since address size prefix doesn't work for MPX. > + /* bndldx and bndstx ignore their scale factor. */ > + if (current_templates->start->base_opcode != 0xf30f1b > + && i.log2_scale_factor) > + as_warn (_("register scaling is being ignored here")); Scaling factor is still encoded. I am not sure if it belongs to assembler. > + } > } > else > { > > > -- H.J.