From patchwork Sat Jul 23 21:54:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Bernabeu X-Patchwork-Id: 1659993 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lr0Tj4wQSz9sGk for ; Sun, 24 Jul 2022 07:55:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C31A44245D; Sat, 23 Jul 2022 21:55:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C31A44245D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K4lOluZTsa_i; Sat, 23 Jul 2022 21:55:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 6C26D41803; Sat, 23 Jul 2022 21:55:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6C26D41803 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 52E411BF419 for ; Sat, 23 Jul 2022 21:54:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 250F341803 for ; Sat, 23 Jul 2022 21:54:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 250F341803 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HWZ4opyLVZ9D for ; Sat, 23 Jul 2022 21:54:57 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B6223417AB Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by smtp4.osuosl.org (Postfix) with ESMTPS id B6223417AB for ; Sat, 23 Jul 2022 21:54:56 +0000 (UTC) Received: by mail-wr1-x435.google.com with SMTP id g2so2893819wru.3 for ; Sat, 23 Jul 2022 14:54:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yg1RUSue5jMOQKzGBKrJeIdugso1RbRRkDTrATXhG70=; b=kKljq0gafKQYvH1a/nzgtRkGRGvu+ah8JcHVF78njpooiK0QHsuLqbYqfTfNFhr6DE jbUEN/4BATKBVXXV71dZWqhKg9xVrgAoQkvCT6nNlfxJybnIcqOgUsqlSKVsSXE6PvWq EeU/3l6n75ZlZKYXW6XObXsHGt039Qlu5TCAAQTlYGXxSKs8GV8/ah7nvWOPkdeY2wy1 e92/CZgSZOnNrwoareQJYBsTPJ8iFs1keke/3P4NUcSocBDyop1NqcyvAxm63CeMJBhg czTfJj6ZOHUCKdXqE8dzUdHp+mWuWf0jk4nq1jOGHu6bdnLFhd8+b61IdnZq8Tp2EAZd 3h3g== X-Gm-Message-State: AJIora+D827nxWZGmZTaz+X/oyCZwZ84hD5KSdbyvpQPKgn4d1OuX/AW iFRLDM1a2dp430Kcd11B2ZV2FGviU3P+SQ== X-Google-Smtp-Source: AGRyM1uP8RSlG2Iq2HTTDLJbs2zzMejHfwr6dihV/u1onhWZueTfhMrIZijO/yO5Cw0Lk+PsBkw1Qg== X-Received: by 2002:a05:6000:186f:b0:21d:969e:c80e with SMTP id d15-20020a056000186f00b0021d969ec80emr3510225wri.129.1658613294656; Sat, 23 Jul 2022 14:54:54 -0700 (PDT) Received: from jupiter.home (14.5.23.95.dynamic.jazztel.es. [95.23.5.14]) by smtp.gmail.com with ESMTPSA id f12-20020a5d568c000000b0021e5cc26dd0sm6227959wrv.62.2022.07.23.14.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 14:54:54 -0700 (PDT) From: Abel Bernabeu To: buildroot@buildroot.org Date: Sat, 23 Jul 2022 23:54:47 +0200 Message-Id: <20220723215448.2532160-1-abel@x-silicon.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=x-silicon.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yg1RUSue5jMOQKzGBKrJeIdugso1RbRRkDTrATXhG70=; b=C8sYuMteK85HeJXE366F/sX93Xd9XkjTFQ3P40+V94U9Qp73q7xlsXydORVRZ1B+pv T/6KsPlkwyIbdD24BfDZBref8b/N2kfEcGLf6n2oaAFvnbiAoLHAhUV4WQiTfhKgDLjV JiWYGhEDGmYntID6TbfMxBt41X/tSDgfZ+CRg= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=x-silicon.com header.i=@x-silicon.com header.a=rsa-sha256 header.s=google header.b=C8sYuMte Subject: [Buildroot] [PATCH 1/2] package/llvm: Support for RISC-V on the LLVM package X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joseph Kogut , Romain Naour , Mark Corbin , Abel Bernabeu , Valentin Korenblit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The initial support for the LLVM package did not include RISC-V, and needed to be added. There is a new configuration parameter added (BR2_PACKAGE_LLVM_TARGETS_TO_BUILD) for dealing with the fact that the LLVM target and the architecture have different naming for RISC-V. While the target for RISC-V is "RISCV" irrespective of the ISA being 32 or 64 bits, the architecture does contain the number of bits leading to "riscv32" and "riscv64". For previously supported architectures the naming for target and architecture matched and thus this parameter had not been needed, but it is now needed for RISC-V. Signed-off-by: Abel Bernabeu --- package/llvm/Config.in | 10 ++++++++++ package/llvm/llvm.mk | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package/llvm/Config.in b/package/llvm/Config.in index c1887e36dd..61197fc588 100644 --- a/package/llvm/Config.in +++ b/package/llvm/Config.in @@ -4,12 +4,22 @@ config BR2_PACKAGE_LLVM_ARCH_SUPPORTS default y if BR2_x86_64 default y if BR2_aarch64 default y if BR2_arm || BR2_armeb + default y if BR2_riscv config BR2_PACKAGE_LLVM_TARGET_ARCH string default "AArch64" if BR2_aarch64 default "ARM" if BR2_arm || BR2_armeb default "X86" if BR2_i386 || BR2_x86_64 + default "riscv32" if BR2_riscv && !BR2_ARCH_IS_64 + default "riscv64" if BR2_riscv && BR2_ARCH_IS_64 + +config BR2_PACKAGE_LLVM_TARGETS_TO_BUILD + string + default "AArch64" if BR2_aarch64 + default "ARM" if BR2_arm || BR2_armeb + default "X86" if BR2_i386 || BR2_x86_64 + default "RISCV" if BR2_riscv config BR2_PACKAGE_LLVM bool "llvm" diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk index 4670773ca3..dbf1f7b813 100644 --- a/package/llvm/llvm.mk +++ b/package/llvm/llvm.mk @@ -42,7 +42,7 @@ HOST_LLVM_CONF_OPTS += -DCMAKE_INSTALL_RPATH="$(HOST_DIR)/lib" LLVM_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_LLVM_TARGET_ARCH)) # Build backend for target architecture. This include backends like AMDGPU. -LLVM_TARGETS_TO_BUILD = $(LLVM_TARGET_ARCH) +LLVM_TARGETS_TO_BUILD = $(BR2_PACKAGE_LLVM_TARGETS_TO_BUILD) HOST_LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" LLVM_CONF_OPTS += -DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(LLVM_TARGETS_TO_BUILD))" From patchwork Sat Jul 23 21:54:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Bernabeu X-Patchwork-Id: 1659994 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lr0VS26NLz9sGk for ; Sun, 24 Jul 2022 07:55:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BAD5061B2C; Sat, 23 Jul 2022 21:55:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BAD5061B2C X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KPwI1ax3ttBl; Sat, 23 Jul 2022 21:55:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 95D6561B2B; Sat, 23 Jul 2022 21:55:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 95D6561B2B X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A71E11BF419 for ; Sat, 23 Jul 2022 21:55:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8F31A61B2B for ; Sat, 23 Jul 2022 21:55:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8F31A61B2B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LC-sRy4VP4hK for ; Sat, 23 Jul 2022 21:55:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A64ED61B28 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by smtp3.osuosl.org (Postfix) with ESMTPS id A64ED61B28 for ; Sat, 23 Jul 2022 21:55:03 +0000 (UTC) Received: by mail-wm1-x32b.google.com with SMTP id b21-20020a05600c4e1500b003a32bc8612fso4274328wmq.3 for ; Sat, 23 Jul 2022 14:55:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XEcwkc6CukaKyaQvKEoM2mjWb0wdqLDUqxUGanRWMZ8=; b=o3xuxsSiPi6MQ0neSjGawFq5s01OLTVdOUhnjifYgYFIgw43nRbB3Wmrpz+5fHMVr2 5fbBVhumbIZiDWZbkJwI/IJuVImn2mVJfx+lFqYhPNByUvOxbhgftjnKCMloANH0O+Z4 HQ0vOZc/Hfl+KYLqaMGeRL/BaUICHT7HuM4cTLfLtHNat4QmgUY82XRnh0fOs6oMG94r OWb+bK2cxruiNzPyOQsgnHlZgE8rd7oqlw7X7adhMVWikXSXKexvs7pKSwCVwdu21oAc PzdreBW7AlYH/B6aAd3rU2zoIVLf8Hw3YU0dkGhJwqIM3GEKzlQPACVid1XTmcBplAzL 2xpg== X-Gm-Message-State: AJIora+KwhL440JvnzHqKzWm9jnz1H0YBjZ6SHsDdKfc2Rmv2w6OLEFu 42ZKWaW0iZueNU2fETsZgtrHk6Mv533YVg== X-Google-Smtp-Source: AGRyM1t+Lwc2cUrF6UQfwzOsqA9kSi4Khuiu4yWbtw8+pQenLVI6MRpKzuZHCFA587t1DdL9F42KMg== X-Received: by 2002:a05:600c:3004:b0:3a3:12b4:24c5 with SMTP id j4-20020a05600c300400b003a312b424c5mr3782812wmh.123.1658613301538; Sat, 23 Jul 2022 14:55:01 -0700 (PDT) Received: from jupiter.home (14.5.23.95.dynamic.jazztel.es. [95.23.5.14]) by smtp.gmail.com with ESMTPSA id f12-20020a5d568c000000b0021e5cc26dd0sm6227959wrv.62.2022.07.23.14.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 14:55:01 -0700 (PDT) From: Abel Bernabeu To: buildroot@buildroot.org Date: Sat, 23 Jul 2022 23:54:48 +0200 Message-Id: <20220723215448.2532160-2-abel@x-silicon.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220723215448.2532160-1-abel@x-silicon.com> References: <20220723215448.2532160-1-abel@x-silicon.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=x-silicon.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XEcwkc6CukaKyaQvKEoM2mjWb0wdqLDUqxUGanRWMZ8=; b=gDEo+MKEcT/afx12iRad0renxwbjUPFNb+oAGFA0xcabjRxfyHMk+Go9dhJ2fs/axG ifv4mN2UJXZK2vw0NUrC0XEJItei9PogE2nrOJ2f3NZCQT/NhBRSPoOWFhOszYhwLing KzTO5cx1MxjtkZruTMaN9hIlFS4NV5PwPYSv0= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=x-silicon.com header.i=@x-silicon.com header.a=rsa-sha256 header.s=google header.b=gDEo+MKE Subject: [Buildroot] [PATCH 2/2] arch/riscv: Added support for RISC-V vector extension on the architecture menu. X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joseph Kogut , Romain Naour , Mark Corbin , Abel Bernabeu , Valentin Korenblit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" This new setting will allow to test new toolchains already available that support the vector extension (more patches coming soon). Signed-off-by: Abel Bernabeu --- arch/Config.in.riscv | 7 +++++++ arch/arch.mk.riscv | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/arch/Config.in.riscv b/arch/Config.in.riscv index 288ed833eb..e4dc936cf8 100644 --- a/arch/Config.in.riscv +++ b/arch/Config.in.riscv @@ -18,6 +18,9 @@ config BR2_RISCV_ISA_RVD config BR2_RISCV_ISA_RVC bool +config BR2_RISCV_ISA_RVV + bool + choice prompt "Target Architecture Variant" default BR2_riscv_g @@ -63,6 +66,10 @@ config BR2_RISCV_ISA_CUSTOM_RVD config BR2_RISCV_ISA_CUSTOM_RVC bool "Compressed Instructions (C)" select BR2_RISCV_ISA_RVC + +config BR2_RISCV_ISA_CUSTOM_RVV + bool "Vector Instructions (V)" + select BR2_RISCV_ISA_RVV endif choice diff --git a/arch/arch.mk.riscv b/arch/arch.mk.riscv index f3bf2b3467..07a94aa6a4 100644 --- a/arch/arch.mk.riscv +++ b/arch/arch.mk.riscv @@ -26,5 +26,9 @@ endif ifeq ($(BR2_RISCV_ISA_RVC),y) GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c endif +ifeq ($(BR2_RISCV_ISA_RVV),y) +GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)v +endif + endif