From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187AbbCZJ3B (ORCPT ); Thu, 26 Mar 2015 05:29:01 -0400 Received: from mail.skyhub.de ([78.46.96.112]:45258 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbbCZJ27 (ORCPT ); Thu, 26 Mar 2015 05:28:59 -0400 Date: Thu, 26 Mar 2015 10:27:12 +0100 From: Borislav Petkov To: Linus Torvalds Cc: "H. Peter Anvin" , Denys Vlasenko , Ingo Molnar , Steven Rostedt , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH 3/4] x86/asm/entry/64: use smaller insns Message-ID: <20150326092712.GA27751@pd.tnic> References: <1427303896-24023-1-git-send-email-dvlasenk@redhat.com> <1427303896-24023-3-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2015 at 05:05:50PM -0700, Linus Torvalds wrote: > so 'as' is clearly just stupid. It already takes the size of the > constant into account and generates different instructions. Why not > for the common 32-bit case too? I think the destination register mandates which insn to use: mov $0x12345678, %rdi mov $0x12345678, %edi ... 15: 48 c7 c7 78 56 34 12 mov $0x12345678,%rdi 1c: bf 78 56 34 12 mov $0x12345678,%edi and 'as' is perhaps not insolent enough to go and change it when seeing the 32-bit constant. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --