All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
To: linux-sparse@vger.kernel.org
Subject: [PATCH] cgcc: add Xtensa support
Date: Wed, 20 Apr 2022 14:31:34 +0200 (CEST)	[thread overview]
Message-ID: <144ce263-cb62-5531-b35-c8ab13ce68f7@intel.com> (raw)

Add support for the Xtensa architecture.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
---

This should be used with the Zephyr RTOS on Xtensa as implemented in 
https://github.com/zephyrproject-rtos/zephyr/pull/43776

  cgcc | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/cgcc b/cgcc
index 9c78ee63..733cadfa 100755
--- a/cgcc
+++ b/cgcc
@@ -292,6 +292,9 @@ sub add_specs {
      } elsif ($spec eq 'aarch64') {
  	return (' --arch=aarch64' .
  		&float_types (1, 1, 36, [24,8], [53,11], [113,15]));
+    } elsif ($spec eq 'xtensa') {
+	return (' --arch=xtensa' .
+		&float_types (1, 1, 21, [24,8], [53,11], [53,11]));
      } elsif ($spec eq 'host_os_specs') {
  	my $os = `uname -s`;
  	chomp $os;
@@ -319,6 +322,8 @@ sub add_specs {
  	    return &add_specs ('x86_64') . ' -mx32';
  	} elsif ($gccmachine =~ '^x86_64-') {
  	    return &add_specs ('x86_64');
+	} elsif ($gccmachine =~ '^xtensa-') {
+	    return &add_specs ('xtensa');
  	}

  	# fall back to uname -m to determine the specifics.
@@ -348,6 +353,8 @@ sub add_specs {
  	    return &add_specs ('arm');
  	} elsif ($arch =~ /^(aarch64)$/i) {
  	    return &add_specs ('aarch64');
+	} elsif ($arch =~ /^(xtensa)$/i) {
+	    return &add_specs ('xtensa');
  	}
      } else {
  	die "$0: invalid specs: $spec\n";
-- 
2.30.2


             reply	other threads:[~2022-04-20 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 12:31 Guennadi Liakhovetski [this message]
2022-05-22 10:07 ` [PATCH] cgcc: add Xtensa support Luc Van Oostenryck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=144ce263-cb62-5531-b35-c8ab13ce68f7@intel.com \
    --to=guennadi.liakhovetski@linux.intel.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.