Things Apple can do with bitcode: Produce binaries optimized for different ARM processors. Reoptimize with new versions of LLVM as soon as they are available. Use a big database of LLVM IR to tweak optimizations. Keep some optimizations secret and not even publish binaries doing them.
The biggest argument IMO that speaks against an Apple ISA is that they would have to rewrite tons of hand tuned assembly code.
Every now and then I see a new comparison of the Swift/ObjC dispatch assembly. Now imagine — that could be a single opcode. Or the dispatch table could get pinned to a particular cache. Or it could be other micro-optimizations that they are in a unique position to exploit with full control of the language, compiler and chip.
I have no idea how feasible these things might be or how much of a gain it would create, but they can look through their corpus of LLVM-IR and identify hot-spots where a new opcode would speed everything up by some margin.
But I believe we're (hypothetically) talking about ARM, not x86, code.
They do indeed support LLVM IR target(s) that are, in fact, much more architecturally-nonspecific than PNaCl, namely the spir[64]-unknown-unknown target. See https://github.com/KhronosGroup/SPIR and /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/openclc (on a Mac, since 10.7).
I don't know if bitcode with this target triple is necessarily suitable for the Apple Watch, however.
10 years later they are now in the same position with Intel. If Intel delays the next version of its product line by six months then Apple has to put things on hold. This is bad for a company like Apple as it could cause them to miss out on potentially lucrative periods (back to School, the Holiday season etc).
Ultimately I suspect in the very near term we will see Apple move off Intel, first for the laptops. LLVM IR would fit this strategy better than fat binaries as Apple would not have to wait until developers recompile. They can have the entire App Store available on day 1 of a product release.
This article isn't about laptops, though. It's about ARM. Apple isn't dependent on anyone for ship dates in the ARM space -- they license the ISA, but they design their own chips based on the license. Yes, they're reliant on Samsung to fab the things, but Apple doesn't need their own ISA if they want to use their own fabs. I don't see how replacing ARM with a custom ISA helps Apple any.
(As for Intel -- it's not like Intel's other customers don't have the exact same sales periods that Apple does. So they're motivated. As others have said, if Intel slips deadlines like that, who's to say Apple has the ability to meet them where Intel couldn't?)
Intel's weak spot has always (or at least often) been mips per watt. Apple has a whole slew of products in the ultraportable niche and given their focus could easily have more.
If a custom ARM-like chip gives them the option to stop using Intel chips on everything but the MacBook Pro line, that would be worth a lot to them, even if they continued to use Intel chips on those devices. Just the threat gets them concessions.
Well, what if the time comes when ARM cannot deliver processor designs with necessary improvements to power consumption or processing speed? If they hit that wall, a new processor architecture might be the only way forward.
Given Apple's resources and position, that kind of contingency planning makes sense to me. You can't exactly spin up a architecture design team overnight.
I could see an argument for cutting cost by eliminating the margin that Intel dictates... but even that assumes that you can find a third party to manufacture the chips at a rate that is low enough to both cover the IP Intel has in their chips, and the manufacturing cost itself.
Also, they could take a two-pronged approach -- cherry-pick talent from Intel, nVidia, etc. and offer them the opportunity to leapfrog baggage from the past. How much of the difficulty of moving the x86 platform forward is a result of the ludicrous amount of cruft? Grabbing a few of the smartest people and narrowing your focus to an easier problem gets you a long way.
Apple has managed to outpace the entire industry (including Intel) with its customized ARM cores (getting to 64-bit over a year ahead of everyone, and take a look at benchmarks between Apple's Ax CPUs and rivals usually running at far higher clocks with more RAM and sucking more power), and it got there by cherry-picking talent, omitting stuff it didn't need, focusing on design, and treating fabs as a commodity.
Looks like interesting times ahead.
Intel has other clients who may be just as noisy about their own ship dates. They make custom processors for AWS, as an example. An Apple-owned subsidiary/division would have Apple as its sole priority.
A decade of shipping millions of products that depend on very complicated supply chains on time and to great profit?
Switching to Intel guaranteed that they worst-case will always be on par with their competition. They'd lose that if they switch away to custom built silicon.
Now if ARM would start to make serious inroads in the Laptop/Desktop market that might change. But then again, thanks to P.A. Semi Apple has more than enough ARM knowledge already.
Intel is better than ever at the power-performance game, despite suffering badly from ARM. The performance gap is huge. Their current position is the result of a continuous sequence of design success and R&D reinvestment that started with Pentium M more than 10 years ago.
If anything, I expect Intel to finally start breaking into the phone market as they catch up on SoCs.
I think they are well prepared for every eventuality, but currently Intel’s and Apple’s interests are pretty well aligned.
Basically we are seeing a race towards a common goal from two directions here, though: Can Intel hit the low power goals (with sufficient performance) before Apple hits their performance goals (at low power) through some alternate route? Honestly, I don’t see Apple being able to touch Intel’s performance and with regards to power use Intel is getting better all the time. The space for ARM-like laptop chips is getting smaller by the day.
And Intel actually wants to hit that low power! It’s not like they are disinterested in that (like IBM being disinterested in making the CPUs Apple needs back in the day because they were making their money elsewhere and Apple was just a small, unimportant customer of them, not worth all the effort), they are working on that all the time.
That’s what I mean when I say their interests are aligned. I mean, I obviously think that Apple is always on the lookout for alternatives (and they have been through many such transitions by now, so I’m very confident that they would be able to pull it off), but I honestly think they would prefer their and Intel’s interests to remain aligned and Intel just making some kick-ass low-power CPUs, exactly what they need for their future retina resolution, light-weight, super-thin, all-day battery life, fanless MacBooks.
If they do this, it will be for it's ARM products, iPhone, iPad, iPod touch & AppleTV.
As for the dark days of Apple in the PC market and the deaths of Commodore and Atari, my recollection is that it had more to do with the stock market crash of 1987 tightening access to capital and the S&L crisis that followed it creating a recession where downsizing was what corporations not empty-nesters did.
- Apple has proven they can switch out hardware stacks, so that part seems straight forward enough. Especially given how mature XCode is.
- But: can they really get to a point where they complete with Intel directly? Would they try and use ARM or roll their own ADM64?
Apple/NeXt has much experience with technical challenge of porting entire platforms to different processors and with the business challenges of being tied to critical technologies you do not control.
Apple would need a very good reason to produce their own ISA. Sure they like to do many things in house but they don't do everything themselves. The resources required to produce and support a whole new ISA are a major investment, they're only going to do it if in the long run is cheaper than paying for an ARM architecture license. I just don't see a solid argument that a custom ISA and shiny new compiler would give them much (if indeed anything).
Whilst they may be shipping LLVM IR for the watch apps rather than ARM code I think this is just so they can target the compile for a specific processor. Each one has its own performance quirks and especially in such a power sensitive environment it would make sense to do specific targetting.
Well this is exactly the point. They cannot do this the license will not permit them to alter the architecture it's all or nothing (indeed if the new ISA was too ARM like the lawyers would be sure to come knocking).
I'm sure the could reuse quite a lot of compiler technology but the entire point of the article is by doing clean slate ISA design you can do something radical and get gains. Whether this is true is unclear, but it would require some serious work on the compiler.
Producing their own conventional ISA would seem to be pointless as it wouldn't give them anything vs ARM (or indeed x86).
I think it's pretty much a no-brainer for them to at least try. They have so much cash available that spending a few billion dollars on a moonshot has little downside and crazy potential upside.
When they push Intel to advance on some front, those benefits are enjoyed by Apple competitors as well. If Apple brings it all in-house, they can try to stay a generation ahead of Intel. With the amount of money they have to throw at the problem, they could starve Intel of some key talent and hurting Intel will hurts Apple's competitors.
Edit:
We'll hurt everyone, maybe even ourselves.
Apple has absolutely control on anything and everything that would run on this thing, I don't think it is about paying licenses to Arm. When you have almost infinite money, in long term having a leaner/ faster / more efficient custom ISA is better and lucrative than depending ARM or Intel for innovation. They can make it run existing applications with a transformation layer (already done by Nvidia/Transmeta mentioned elsewhere in this thread) So, I don't see why not.
It's not that hard, really. With such powerful tools as LLVM, a new ISA can even be designed and implemented with all the tooling by a very small team.
What is hard in all this ISA business is the backward compatibility concerns. Once you're liberated from this, you're free to do whatever you like. They may want to experiment with a family of ISAs, maybe entirely incompatible, targeting different device classes (instead of a single ISA across the range).
Source: experience in the mobile GPUs design.
It won't be too long before Apps that have not been updated in 2 years start disappearing from the store-- that's all they'd have to do and the app makers would comply.
The Mill team defines their ISA and encoding manually, and then programmatically generates the compiler, assembler, linker, and entire toolchain.
The crux of the article is:
> ...one last gap remains in the middle of this stack of system exclusivity: Apple licenses the instruction set architecture for its mobile devices from ARM.
But Apple already not only designs the own SoCs independently already, they regularly add their own opcodes to the ARM instruction sets they license, as they see fit.
The alternative to not licensing from ARM, even if they "invented their own ISA", would be to pay an exorbitant sum in royalties to ARM and every other patent-holder whose technology they might dare use in their chip. So paying ARM for their technology in one go just makes the most economical/legal sense.
Sure, the semantic gap exists. But ARM and x86 have evolved and have overcome a lot of difficulties.
People like to bash x86 but it has a big advantage: it's compact. ARM Thumb is compact but not so much.
Also remember how big the last 'new ISA' (Itanium) success was?
Compiler and processor front-end beat "perfect ISA" today
But what's the benefit? Maybe a few percent speed/power efficiency boost? We've already seen that Apple will go to extraordinary lengths for a few percent improved performance, particularly when it comes to power efficiency. A few percent here, a few more there and soon you're talking an hour+ extra battery life.
I think this is highly plausible. There just doesn't seem to be any particular reason why they wouldn't do it, and plenty of reasons why they would.
How is LLVM IR (which I am told is arch specific) different from GCC with RTL?
Remember the transition from VAX to Alpha? And they kept the binary and source compatibility in quite an inventive way (with both binary translation and by making MACRO32 just another high level language).
Margins is the only important thing for Apple, nothing else matters.
x86-64 isn't. I've measured this: the average instruction length is just about 4 bytes. REX prefixes add up quick.
So thought the designers of Itanium too; it turned out that the compiler doesn't know sufficiently much for an architecture like Itanium.
Were there any significant advances in compiler technology since then that would make it worthwhile to experiment with a new ISA?
I'd really like to know the details behind the semantic gap, though. That was annoyingly vague and really is the premise of the entire argument.
But, Intel doesn't exactly produce chips that are helpful to Apple. Since Apple switch, Intel has gotten rid of third-party chipsets. This removed a lot of customization options and basically made life easier for Intel since they produce a fixed set of chips and you have to take them. Also, Intel's market differentiation of chip features probably doesn't help.
Apple wants to provide a custom experience, and Apple building their own PC-class ARM chips will allow that.
[edit: also Intel's paying people to produce Macbook Air clones probably didn't help]
On that note, I get the feeling Bootcamp for ARM Macs would be interesting since it would be an ARM version of Windows.
LLVM is open source and therefore doesn't require licensing unlike the ARM Instruction Set, but it's another thing they don't perfectly control and they're happy with that.
Developing a new ISA would be extremely expensive, and they'd have to have a really good reason for doing it. The post doesn't suggest why it would be beneficial, merely extrapolates a pattern.
So they don't own it, but they do employ some of the most knowledgeable developers of the project. They almost certainly have control over the direction it takes, and could easily develop features behind closed doors.
Hmm, I saw the "LLVM owned since ~2005". What exactly does the article mean by "owned"?
Perhaps, Apple owns it in the same way that all of us do, or perhaps the article just needs a little more work.
From Wikipedia:
"The company was founded in November 1990 as Advanced RISC. Machines Ltd and structured as a joint venture between Acorn Computers, Apple Computer (now Apple Inc.) and VLSI Technology."
http://appleinsider.com/articles/13/08/12/iphone-patent-wars...
I don't know how abstract the LLVM IR is - can you take IR and compile it to two wildly different ISAs, (say) x86 and ARM, and get full optimisation on both? Or is it more limited, e.g. allowing you to compile to ARM version x and ARM version y (e.g. if version 'y' supports some new SIMD instructions).
IR is ISA agnostic. Compiling the same code to x86 and ARM will have the same IR, it's only the backend step that's different. Thus, of course you can take IR "meant for ARM" and compile it to "x86" and get full optimisation. The IR isn't meant for ARM anyway, IR is just IR.
This is incorrect. Clang has specific code paths (producing different IR) for x86 and ARM, specifically around calling conventions but I'm sure there are more.
It's absolutely ISA specific and this target independence pipe dream keeps being repeated on HN. Just search the LLVM documentation for "target specific."
I believe that we will see the new processor architecture in the next Apple Watch, not the next iPhone. I think A9, that will be unveiled later today, will be an improvement over A8 but it will not be a radical improvement and will not contain a new ISA. It will have improved ARM cores.
Apple also doesn't require bitcode for iOS apps right now. They suggest you add them but don't require them. They're required for watchOS apps.
Once Apple starts requiring bitcode for iOS, within a year or two you can expect some radical Apple CPUs for iPhone/iPad.
New microarchitectures take 4 years or so to design. ARM announced the new ISA in 2011 and didn't have a shippable product until 2015 which is very typical. All the other implementers (eg. Qualcomm) have also not been able to ship until now (Qualcomm's custom Kryo doesn't hit until later this year). Apple shipped a better product in 2013 than A57 is today (ARM doesn't catch up until A72 later this year). To my knowledge, a licensee had never shipped a new ISA before the ISA designer up to this point. How did they get a chip designed, validated, tapped out, produced, integrated, and shipped out in 2 years?
I believe that Apple looked into purchasing MIPS or designing a custom ISA, but was put off by the costs and headaches associated with moving ISAs (having already done this with the change from POWER to x86). Instead, they design an ISA that is incredibly close to MIPS and start implementing a micro-architecture. Once they reach the stage where they must make a decision about which ISA, they tell ARM to use their ISA or they will move to MIPS. This head-start also
ARM is already somewhat threatened by Android having first-class support for MIPS. Having such a big player switch would be extremely threatening to them. The result would be an immediate caving. ARM would need to publish the ISA, but Apple would have a couple year head-start on implementing it (this head-start also puts Apple in a good competitive position relative to Android phone manufacturers). The rest is observable history.
This may not accurately represent what really caused this series of events, but it does explain why Apple got a good chip out before ARM could release a bad one (ARM couldn't even get a smaller, easier chip out the door). It also explains why all the other chip companies hint at their surprise at Apple's early launch.
Apple doesn't have to worry about standards, backcompatibility or adoption. If they have noticed unneccesary inefficiencies, they can fix them.
Robert Colwell from DARPA presented a talk at HotChips 2013 which was focused on post 'Moore's Law' technologies and he brings up specialized ISAs.
Looking at the potential of Apple releasing chips with new ISAs from this perspective seems to me to make a lot more sense (to me at least).
See here, https://scholar.google.com/scholar?hl=en&q=A+Technique+for+O...
(Not to mention earlier examples like AS/400, P-code etc)
I think the Mill was doing this too?
If Apple does something here it's going to be for the watch, not Macs. Pushing the envelope of efficiency for the watch is where it becomes worth it to make this kind of (otherwise insane) investment. It's also a relatively simpler stack, so more feasible.
FWIK, on android you can still optimize your app at assembly level and i think that's what motivates developers at times. Remember the iphone camera high speed shot app, that was hand coded to be fast on iphone.
And their reasons to be against a particular patch are often as simple as that it'll break compatibility with their internal, unpublished changes to LLVM.
Learned it the hard way...
Having exclusive rights on a strategic business brick is important when this brick is enough to give someone else a stronghold on the whole vertical market. Although having a good compilers is one of the many requirements in Apple's business model, it's neither the defining feature, nor what competitors miss in order to threaten Apple.
So yes, in this context, Apple non-exclusively owns LLVM.
Open source doesn't mean the process is collaborative. It just means the code is available for you to use, modify and fork. There are numerous open source projects (mostly those sponsored by companies) for which you would never be able to change the direction of.
Look at Node/IO for how things would need to work.
Up until now the CPUs have been designed by ARM. Cores like Swift for example were not developed at Apple, but rather at ARM.
The likelihood of ARM releasing a chip into the wild with a non-ARM ISA is not all that great, since the ARM ISA is what ARM makes all of its living from.
Until the day where Apple is capable of creating a CPU by themselves there will be no Apple ISA.
Apple owns PA Semiconductors which employs some of the smartest and most experienced CPU designers in the business.