From owner-freebsd-mips@freebsd.org Thu Jan 3 16:07:23 2019 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C1E142E61B for ; Thu, 3 Jan 2019 16:07:23 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C42882BFD for ; Thu, 3 Jan 2019 16:07:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E46C83C475F; Thu, 3 Jan 2019 16:07:20 +0000 (UTC) Date: Thu, 3 Jan 2019 16:07:20 +0000 From: Brooks Davis To: Mori Hiroki Cc: "freebsd-mips@freebsd.org" Subject: Re: MIPS16 Message-ID: <20190103160720.GF41492@spindle.one-eyed-alien.net> References: <824815.56539.qm@web103902.mail.ssk.yahoo.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KuLpqunXa7jZSBt+" Content-Disposition: inline In-Reply-To: <824815.56539.qm@web103902.mail.ssk.yahoo.co.jp> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 8C42882BFD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.85 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.976,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.80)[-0.803,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spindle.one-eyed-alien.net]; RCPT_COUNT_TWO(0.00)[2]; SUBJ_ALL_CAPS(0.45)[6]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[yahoo.co.jp]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; SIGNED_PGP(-2.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.62)[ip: (-9.40), ipnet: 199.48.128.0/22(-4.68), asn: 36236(-3.91), country: US(-0.08)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 16:07:23 -0000 --KuLpqunXa7jZSBt+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 26, 2018 at 11:08:05AM +0900, Mori Hiroki wrote: > Hi >=20 > Dose some body work on MIPS16 support on FreeBSD ? >=20 > I want MIPS16 support because of 4M Flash target is > good on FreeBSD. As far so I know, no one is working on this. Ruslan (br@freebsd.org) has done some work on RISC-V's compressed encoding which I belive is similar, I'm not sure what was involved. -- Brooks --KuLpqunXa7jZSBt+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcLjM4AAoJEKzQXbSebgfAC8UH/RJi5dfUpEMXG0XrWMaZdy+k JzlunFbVMe/sr7NNthMctWIn0nxtpFrusfitRHXTQoFV9cScdKlV/ZMi6/c4Hp4M vyrv7fkZdB8/Y3Ha6/Qhohyp7yT2CmRNOAngOBbxFHIaPmCVt6NE+N/Dva+pFt0R RlOSYPAs2LlIZzZ1d6+YQUoS2L1c8DDGX3UB88KN0VK2yvdegMb3jWQ22vRWESEH JQCMb7yWXcezNKB0K/Is90BmY/1HIqHVGfKgBQUfKbgIToVyXviZXppOuB8YKOIB 9IWE3mg/Bs3HRkqmUnezX+q6fqBWorgSfex/BVP28YnxE9mlzsYDplnV+ibFfJg= =Lj7V -----END PGP SIGNATURE----- --KuLpqunXa7jZSBt+-- From owner-freebsd-mips@freebsd.org Thu Jan 3 19:05:46 2019 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B814A143397D for ; Thu, 3 Jan 2019 19:05:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D24AE8A1DE for ; Thu, 3 Jan 2019 19:05:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82c.google.com with SMTP id v11so38018361qtc.2 for ; Thu, 03 Jan 2019 11:05:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UX9FaNZyCxK5TrPCNhc2upEmtNtveMvT0Ck2xMdzIZ4=; b=0N4X4P4U0zVj9vyVfEtJJJL+oiCqzQVcI2Tfb9BS9PjCbUs471D47UgRvUF2b9aTzC K3fNub3qtWDa+xXs7HTHbBH/TJDfuZ7jDPnHZ7mIbOQqH2cWJMCvYjNZ39U7FnKEJKOX aXY1jAzB7ZFFZ0uXC0q3tXE2MkbUTa9Y9q1LkuAvUwDfpkC0r8NoESMHfn6a4WQjAP2u tin+2WOIBxQ0Z3RNcJlZPP7A32JgFzefcIwCLG8WiyPpC+LRE+Q7RN+GmfdL7n+wvEgR afp4iENfgSZIMhqxfqXLTegq6AUlrtNk9WylKuSeb8TNO3ba2jLMifmYbzKE7+Kbnue0 ZVOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UX9FaNZyCxK5TrPCNhc2upEmtNtveMvT0Ck2xMdzIZ4=; b=apj0JpGFJnO9fsVlxy5WF+C0nBtTYz6R+1wkmYEMfDAly3w8sSja+PxTaD/gGpDz1d ptI9+ByJPQL3S9A3uvN9IuFgV9IPyY5vxX3lEHwglY9hw1I0AyKyH3VTyj1YfpJNaZeS MqqkFRvy+H51kN/+YzayYsE6OxN95r2DiAEQw2LJFbuWAon1WvlusonISxtEzrcF7a+h ZPBa8MMYhTVLtSq3THCySIIF0rPXhMrYnj5KF0UzXQxvpEe2PAwdEay2rPOyGsqiDDEY aQLdxtH+lFpg3Gw+CiEaQdJsYiH4L2Db4Zd9CanDS1qRaC0YY+En/l+VCbFlCt2miV9t bLJg== X-Gm-Message-State: AJcUukcrjH6XuJ2kT5G8wxDSx4+7kDKZHrzXkkn0T0oLFDNFVF3mpdq4 GHYEba6+Q3DhGBq1xSBhMFC+bqiH346HKr5k8lVXwA== X-Google-Smtp-Source: ALg8bN5kWoj8RMA0+TJlUshLHvh5RpA8b9PlLBwALKJPpY9ToIRVHkW/3u8MAQVzed2SNUQA98So2cFuFtemuQGp32c= X-Received: by 2002:a05:6214:1087:: with SMTP id o7mr48372763qvr.115.1546542344967; Thu, 03 Jan 2019 11:05:44 -0800 (PST) MIME-Version: 1.0 References: <824815.56539.qm@web103902.mail.ssk.yahoo.co.jp> <20190103160720.GF41492@spindle.one-eyed-alien.net> In-Reply-To: <20190103160720.GF41492@spindle.one-eyed-alien.net> From: Warner Losh Date: Thu, 3 Jan 2019 12:05:33 -0700 Message-ID: Subject: Re: MIPS16 To: Brooks Davis Cc: Mori Hiroki , "freebsd-mips@freebsd.org" X-Rspamd-Queue-Id: D24AE8A1DE X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=0N4X4P4U X-Spamd-Result: default: False [-5.11 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; SUBJ_ALL_CAPS(0.45)[6]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.91)[-0.915,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-mips@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[c.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_CC(0.00)[yahoo.co.jp]; IP_SCORE(-2.64)[ip: (-9.34), ipnet: 2607:f8b0::/32(-2.14), asn: 15169(-1.64), country: US(-0.08)] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 19:05:46 -0000 On Thu, Jan 3, 2019 at 9:07 AM Brooks Davis wrote: > On Wed, Dec 26, 2018 at 11:08:05AM +0900, Mori Hiroki wrote: > > Hi > > > > Dose some body work on MIPS16 support on FreeBSD ? > > > > I want MIPS16 support because of 4M Flash target is > > good on FreeBSD. > > As far so I know, no one is working on this. Ruslan (br@freebsd.org) has > done some work on RISC-V's compressed encoding which I belive is > similar, I'm not sure what was involved. > I scoped the work to do this out maybe a decade ago. There's the usual toolchain stuff for dealing with multiple libraries (which we don't do now). The in-tree gcc/binutils toolchain is hopeless. Clang is a non-starter for mips16 last I looked. Newer gcc + binutils are required and some tweaks to the external toolchain support (though that may have worked itself out in the mean time). There's a few issues with syscalls (though mostly these fall into thunking issues) There's some issues with signal delivery and processor state There's some problems with thunking in general (transitioning into and out of mips16 execution) There's the problem of traps in general, since the kernel needs to decode certain instructions to know how to restart instructions after traps, etc. At the time, I concluded this was too heavy a lift for me to do and I never got past the initial few hours to scope the work. It was so long ago, I couldn't find my notes on it just now that I took at the time. IIRC, none of the work was all that difficult to do conceptually, it's just that there was a lot of it. Warner