Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3801539pxb; Mon, 9 Nov 2020 23:38:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJz39FsrOXVOwxCsCCVF+1TBaAD98fybNbbY2VfQuQsNBk5bNDJnr66WmOHvv5eJGZo4vQYR X-Received: by 2002:a17:906:114b:: with SMTP id i11mr18224384eja.106.1604993928769; Mon, 09 Nov 2020 23:38:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604993928; cv=none; d=google.com; s=arc-20160816; b=kFhKiLqEQKYh6ZGGv0P4AWNHSivQIak8P53LNNOS2TI2X7j/1FFzy/8/H3YudGGKqF AcvHUax18kCWMUBLQt7GzzVqzWNfds5mPE4cl+7bZunrKzrLMFu5MqwiwEznG2p0PPAP bGFI99xVUOOfX6ZOF0nayB5j/uwMg24qpyW4ay+yQTf37u0bX+EfKMEW/IjgJAZWI4wQ RvZzmoTZaNyQgJs8OULjpug/TldQVbabVBa6nav1wvEo3MAHhSPSocZcBUXXYaF8Cztv 4gFToOBlplUmz2gKgoYnL7UWYJ3YikeZptd57+cvyz8TA4EF7L8Jj7nCUauf5fIosof/ D8yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SywJL0OWB8D8wbkNu7717xgFNVjoh9tformafpK+9AY=; b=A9GN+x/s3bm10ot2aSp2Z8GidVt2FU40X76yUmEHqLCkf94DbF9rtD54Wx+fznMfEH 7CqIRiw2FONK0CJaGLvBFvKLl550EqFbSoDw4PsoaUILcAgVH+DBCux6GWGbWiwNHkrI CxA5E0//3eVfqtM7T73wi5NZeY/R7KAnPSt7iPzXYFGLJ7FU0owefWRPgGOSXwpW0z5r XRguNJGV439/3XrnA7+5hF7tTlpPhSMlglXVm9qp7prs478NpifHYBAN1azMJJsRCJjb Mk1SK+7peXdEb4s4tzPbMkA3q0NO/2a9uCz4fVhI5PbjwlirF4RWjNxvOXR/Kx0qXdl0 zJjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="OR/fFoSX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc10si10608458edb.156.2020.11.09.23.38.25; Mon, 09 Nov 2020 23:38:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="OR/fFoSX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbgKJHgL (ORCPT + 99 others); Tue, 10 Nov 2020 02:36:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:47342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgKJHgL (ORCPT ); Tue, 10 Nov 2020 02:36:11 -0500 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A531D2080A for ; Tue, 10 Nov 2020 07:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604993770; bh=SywJL0OWB8D8wbkNu7717xgFNVjoh9tformafpK+9AY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OR/fFoSXTlsuizgoyetJwe0P5JYi2LfWR8vx+jfQ+mA8XhDNN6pskhk7WpPrnylvc d4dtO0GW/XXMCzjaxNpRZNCDo1T00AF+zZ0UKkVx9Cq7lxqxvVCv75Pw2Kl6FwnCeL wFhJ+sYT3zjb0lYsJzTwp8mqXvR1D/9c0hMACI1Q= Received: by mail-ot1-f53.google.com with SMTP id z16so11616902otq.6 for ; Mon, 09 Nov 2020 23:36:10 -0800 (PST) X-Gm-Message-State: AOAM530JJ0EsfS4J6z1tizJttoDA4/ZbzcAg1Ylm5d+03q0hfjD33k7V AHkm9NZ2LeVfBPzdjmlCmsgsMRdz6EUilz1mGtc= X-Received: by 2002:a05:6830:214c:: with SMTP id r12mr3941559otd.90.1604993769849; Mon, 09 Nov 2020 23:36:09 -0800 (PST) MIME-Version: 1.0 References: <20200409232728.231527-1-caij2003@gmail.com> <20201107001056.225807-1-jiancai@google.com> In-Reply-To: From: Ard Biesheuvel Date: Tue, 10 Nov 2020 08:35:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] Make iwmmxt.S support Clang's integrated assembler To: Nick Desaulniers Cc: Jian Cai , Manoj Gupta , Luis Lozano , clang-built-linux , Russell King , Nathan Chancellor , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Nov 2020 at 02:55, Nick Desaulniers wrote: > > On Sat, Nov 7, 2020 at 12:29 AM Ard Biesheuvel wrote: > > > > On Sat, 7 Nov 2020 at 01:11, Jian Cai wrote: > > > > > > This patch replaces 6 IWMMXT instructions Clang's integrated assembler > > > does not support in iwmmxt.S using macros, while making sure GNU > > > assembler still emit the same instructions. This should be easier than > > > providing full IWMMXT support in Clang. > > > > > > "Intel Wireless MMX Technology - Developer Guide - August, 2002" should > > > be referenced for the encoding schemes of these extensions. > > > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/975 > > > > > > Suggested-by: Nick Desaulniers > > > Suggested-by: Ard Biesheuvel > > > Signed-off-by: Jian Cai > > > > Please make sure you test this carefully on BE32, as the instruction > > byte order used by .inst is LE IIRC > > Unless that was a recent-ish change in GAS, it looks like I get the > same disassembly/encodings before/after this patch for > CONFIG_BIG_ENDIAN with GNU as. > > $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71 defconfig > $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71 menuconfig > > $ grep BIG_ENDIAN .config > CONFIG_CPU_BIG_ENDIAN=y > CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y > $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71 > arch/arm/kernel/iwmmxt.o > $ arm-linux-gnueabi-objdump -dr arch/arm/kernel/iwmmxt.o > gas_before.txt > $ b4 am https://lore.kernel.org/lkml/20201107001056.225807-1-jiancai@google.com/ > -o - | git am > $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make CC=clang -j71 > arch/arm/kernel/iwmmxt.o > $ arm-linux-gnueabi-objdump -dr arch/arm/kernel/iwmmxt.o > gas_after.txt > $ diff -u gas_before.txt gas_after.txt > $ echo $? > 0 > > (Orthogonal, it looks like llvm-objdump has issues decoding > elf32-bigarm that we'll need to fix.) > > Either way the patch LGTM for IWMMXT, thanks Jian for the patch and > Ard for the suggestions. > > Reviewed-by: Nick Desaulniers > Tested-by: Nick Desaulniers BE32 != BE8 Please use, e.g., ixp4xx_defconfig with IWMMXT and BE enabled. It seems like .inst does the right thing here, i.e., the assembler knows that it should emit BE for BE32 and LE for BE8, but it needs to be confirmed.