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