Hacker News new | ask | show | jobs
by gchadwick 3937 days ago
It is a common theme in computer architecture for someone to say, 'look I have an awesome new architecture all you need is a clever compiler to make it work'. None of them really pan out (other than in specific applications, you could argue GPGPU is as an example, though that appeared more by accident than by design).

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.

5 comments

I don't see why a new compiler would be necessary. It's unlikely they'd completely throw out the whole ARM ISA and replace it with something completely different in one go. More likely, they'll gradually add new instructions and mutate the characteristics of existing instructions over time. LLVM IR isn't completely ISA agnostic, a lot of ISA specific assumptions are still baked into it, but gradual iterative improvement is Apple's speciality. A couple of new instructions this year, deprecate a few old one next, and in 5 years time you've got a new ISA that's barely recognizably ARM any more yet each step along the way is just an incremental and largely backwards compatible change.
> I don't see why a new compiler would be necessary. It's unlikely they'd completely throw out the whole ARM ISA and replace it with something completely different in one go. More likely, they'll gradually add new instructions and mutate the characteristics of existing instructions over time

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).

Apple has an Architecture License with ARM. Basically the broadest license that ARMS sells. If you didn't know this, ARM was founded as a joint venture between Apple and Acorn. Their history goes back to the day the company was created. (ARM Chips powered the first PDA, the newton.)

Your assertion that their license will not permit them to alter the architecture is wrong. This is true of the vast majority of ARM licenses, but not Apple's.

They can take the ARM ISA and extend it in any way they want, and they can take ARM cores and adjust them, or design their own-- they have already done all of this (though to a small degree, not enough to be called a "new ISA".)

> Your assertion that their license will not permit them to alter the architecture is wrong. This is true of the vast majority of ARM licenses, but not Apple's.

> They can take the ARM ISA and extend it in any way they want, and they can take ARM cores and adjust them, or design their own-- they have already done all of this (though to a small degree, not enough to be called a "new ISA".)

What is your source for this? As far as I know ARM do not permit modification of the designs they sell or alterations to the architecture. After all allowing such things could lead to the errosion of their business (e.g. by letting apple slowly slide to a non ARM architecture).

Apple does not use ARM designs, they use certain principles present in the ARM architecture and the ISA.

Wikipedia:

"Companies can also obtain an ARM architectural licence for designing their own CPU cores using the ARM instruction sets. These cores must comply fully with the ARM architecture."

https://en.wikipedia.org/wiki/ARM_architecture#Licensing

That's about the best description I could find, too. It all boils down to what 'comply fully' means.

Given the lego-like structure of the ARM instruction set (the 32-bit variant), with zillions of extensions (Jazelle, DSP instructions, Neon, Thumb, Thumb-2, various revisions of vector floating point instructions) and explicit support for "coprocessors" (https://en.wikipedia.org/wiki/ARM_architecture#Coprocessors), I suspect (based on common sense and nothing else) that the license allows expanding the instruction set and dropping whole modules.

But as I said elsewhere: concrete proof for that is lacking.

Which do you think makes more business sense. Allow a highly profitable and influential customer to gradually move away from your product over a period of many years or just force them to leave immediately.
Apple engineers were heavily involved in the design of the ARM 610. I can imagine they are equally involved now.
"the license will not permit them to alter the architecture it's all or nothing"

Can you give a reference for that? As far as I know, Apple has an architectural license that allows them to ship anything that passes a test suite. Depending on the way the test suite is specified, that may not rule out shipping a superset of ARM, for example with a few extra instructions.

One that I _think_may_ be useful is one to load values from tagged pointers (caveat: I know little of CPU architecture)

> Can you give a reference for that? As far as I know, Apple has an architectural license that allows them to ship anything that passes a test suite.

I can't find one actually, so perhaps I am wrong. If it strictly based upon the test suite then maybe it's sufficiently thorough that interesting alterations are effectively impossible (e.g. it could test you get invalid instruction exceptions when you feed in unused bits of instruction encoding space, preventing you from adding any).

Turns out I'm wrong. The A6 used a variant named ARMv7s: http://www.primatelabs.com/blog/2012/09/apple-a6/

It has two extra integer division instructions and some extra floating point. Though the blog says that the extra floating point instructions are also present in ARMv7 (in XCode) but unused.

So perhaps they're allowed to add whatever they want? I suspect only the lawyers truely know...

What is pretty certain is they couldn't break compatability with the ARM architecture.

Those were the instructions (integer divide and VFPv4) added in Cortex-A15 chips.
You make some good points. I don't think Licensing is likely to be an issue. ARM offer a wide range of licensing deals, and since Apple wouldn't be selling their chips I don't see why ARM would feel the need to enforce compatibility. It's going to be interesting to see if this ever happens.
ARM's market cap is 20B. If Apple sees enough benefit to do this, they can buy their way out of any legal questions that might arise.
It's not the money that's the hurdle for that, buying ARM would be a massive antitrust headache for Apple.
Is owning the ISA worth 20 billion dollars? You could buy half the music industry for that
If Whatsapp was worth 19B it's easy to see the ISA being worth at least that much.

edit: for what possible reason can this be downvoted? It's just a datapoint.

> Apple would need a very good reason to produce their own ISA

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.

They already did that in the 90s when they collaborated with ARM on their first chip as a company split off from Acorn. This chip was the ARM610 for the Newton. It is pretty much the predecessor to every ARM chip sold today, with the possible exception of the Cortex-Ms.
New 15-second Apple spot: We'll hurt everyone but ourselves.

Edit:

We'll hurt everyone, maybe even ourselves.

I think you are missing one thing. This would not be a general purpose ISA designed for 3rd parties to develop and run things on it, this would be an ISA specific to Apple.

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.

Leaner? Faster? More efficient? Hahaha, that's great! Really funny stuff...
Why don't you humor us and explain why it can not be?
Why don't you point out some of the inefficiencies they are hobbled by? I'll assert that there aren't any at the isa layer, none that are measurable.
So, 40 year old x86 and 30 year old ARM is not full of legacy issues and layers over layers of hacks? A good fresh start has always possibilities, real question is if Apple is competent enough to pull it off.
64 bit ARM is a mostly new ISA.
x86 is rough, but ARM is still a fairly clean ISA.
x86 is a variable-length encoding, which is a good thing for cache use, but it doesn't help these days because the most common instructions are not the shortest, and the shortest ones are things like BCD and BOUND that nobody uses.

x86-32 doesn't have nearly enough register names, causing totally unnecessary memory spills, which the hardware was never good enough to hide, and having to pass arguments on the stack. That's why x86-64 is faster than -32, even though 64bit wastes so much cache space.

And some instructions are just randomly slow because of handling the weird encoding, like 16-bit math is slower than either 8-bit or 32-bit math.

Then there's eflags, but that's a minor complaint.

Need a good reason? OK here's one - they need an order of magnitude better battery life for their watch, without sacrificing capabilities. Since Apple has their own chip designers, they have probably already investigated the effects a different ISA could have on power consumption.
> The resources required to produce and support a whole new ISA are a major investment

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.

Apple is basically free of backwards compatilbiitly concerns, since they use LLVM and Xcode. They have previously required all new apps to be recompiled for the current version.

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.

And Apple has a long and reasonably successful history when it comes to forcing developers to adopt new approaches e.g. PowerPC, Intel, 64-bit, LLVM, OSX.
> With such powerful tools as LLVM, a new ISA can even be designed and implemented with all the tooling by a very small team.

The Mill team defines their ISA and encoding manually, and then programmatically generates the compiler, assembler, linker, and entire toolchain.

And the other guys are even generating a hardware (plus a compiler toolchain) out of an ISA spec: https://en.wikipedia.org/wiki/LISA_(Language_for_Instruction...
They might want to merge ARM and x86 and create a super-ISA that allows them to run binaries from either platform in the new super-CPU, which might incidentally be fast enough to make emulating an OSX system quite feasible .. while letting us run iApps, &etc. Maybe, when Apple want to merge their products all into one base architecture, and create the SuperPad, it'll have a CPU that lets OSX+iOS apps run, side-by-side, with ease ..