Live data from Hacker News

ARM chips have an instruction with JavaScript in the name

stackoverflow.com

91–100 of 312 posts

Re: ARM chips have an instruction with JavaScript in the name

#91
post #42
post #36

Earlier quoted context omitted.

Not necessarily programming languages (in similar vain as what est31 said) but cryptography has made its way into instructions, see SHA1RNDS4, SHA1NEXTE, SHA1MSG1 and more. They are not general cryptographic primitives but specific instructions for computing a specific cryptographic hash, just because SHA became popular. Also has SHA in it's name :)

Yes, the examples I quoted AES and CRC all have dedicated instructions in x86 processors (at least the ones that implement the extensions). https://en.wikipedia.org/wiki/AES_instruction_set#Instructio... https://www.felixcloutier.com/x86/crc32 As does ARM: https://developer.arm.com/documentation/ddi0514/g/introducti... https://developer.arm.com/documentation/dui0801/g/A32-and-T3... You could say that these are langua…

More importantly, the customers of the cpu vendors use benchmarks to evaluate potential chip suppliers, and Js benchmarks are near the top of the list for ARM now. Everyone from the OS vendor to the compiler authors to ARM itself are looking at the same operations, so instructions like this get requested and added.

There are also funny xaflag, axflag instructions in armv8 specifically to speed up x86 emulation on arm64. I believe they were added at the request of the msft emulator team.

Re: ARM chips have an instruction with JavaScript in the name

#92
post #10
post #2

Unless I misread the current arm docs, I don't think this is still present in the ISA as of 2020? The whole RISC/CISC thing is long dead anyway, so I don't really mind having something like this on my CPU. Bring on the mill (I don't think it'll set the world on fire if they ever make it to real silicon but it's truly different)

I think you are thinking of the old Java-optimizing instructions on the older ARM processors.

Those never really took off…

Re: ARM chips have an instruction with JavaScript in the name

#93
post #55

Earlier quoted context omitted.

The branch always has to be taken if executing JavaScript, because otherwise how would you tell if the value was correct or not? You'd have to calculate it using this method regardless and then compare!

What are you defining as correct?

"correct" in this case being consistent with the JavaScript specification.

Re: ARM chips have an instruction with JavaScript in the name

#94
post #60

Emery Berger argues that the systems community should be doing exactly this -- improving infrastructure to run JS and Python workloads: https://blog.sigplan.org/2020/10/12/from-heavy-metal-to-irra... We need to incorporate JavaScript and Python workloads into our evaluations. There are already standard benchmark suites for JavaScript performance in the browser, and we can include applications written in node.js (serv…

Please No. Let the hardware do best what it's good at, being simple and running fast. Let the interpreter/compiler layer do its thing best, flexibility. There have been attempts to move the hardware 'upwards' to meet the software and it's not generally worked well. No special purpose language supporting hardware exists now that I'm aware of - lisp machines, smalltalk machines, Rekursiv, stretch, that 1980s object ori…

You do understand that current hardware exists to support C, right?

Re: ARM chips have an instruction with JavaScript in the name

#95
post #60

Emery Berger argues that the systems community should be doing exactly this -- improving infrastructure to run JS and Python workloads: https://blog.sigplan.org/2020/10/12/from-heavy-metal-to-irra... We need to incorporate JavaScript and Python workloads into our evaluations. There are already standard benchmark suites for JavaScript performance in the browser, and we can include applications written in node.js (serv…

Personally I think this would be unfortunate as I don't think JavaScript is the path forward, but computers have always existed to run software (d'oh), which mean the natural selection will obviously make this happen if there is a market advantage. However I see all high performance web computing moving to WASM and JavaScipt will exist just as the glue to tie it together. Adding hardware support for this is naive and…

It would mean JavaScript would have to compile to the same byte code less there are multiple instruction sets.

Re: ARM chips have an instruction with JavaScript in the name

#96
post #85

Earlier quoted context omitted.

The branch always has to be taken if executing JavaScript, because otherwise how would you tell if the value was correct or not? You'd have to calculate it using this method regardless and then compare!

If you always take a branch, it's not a branch. Or did you mean by "taken" that the branch instruction has to be executed regardless of whether the branch is taken or not?

JavaScript JITs always emit this instruction when ToInt32 is required, since checking would be more expensive in user code. And the instruction always used the JS rounding method, since that's cheaper in silicon. I used branch since the parent used "branch".

Re: ARM chips have an instruction with JavaScript in the name

#97

Earlier quoted context omitted.

Seeing as JavaScript was designed and implemented in two weeks, I'm betting this is the answer

Today's JavaScript is so divorced, so radically different from the the original implementation to be considered a different language, though.

Rounding mode was defined then and hasn't changed since though.

Re: ARM chips have an instruction with JavaScript in the name

#98
post #12

So it was easier to add an instruction in silicon to cater for an ill-designed programming language, than to change the language itself? I mean, if float-to-integer performance is so critical, why was this not fixed a long time ago in the language ? What am I missing?

One is a technology change, the other is a culture change. The former is infinitely easier than the latter, in my opinion/experience.

Re: ARM chips have an instruction with JavaScript in the name

#99
post #59

Earlier quoted context omitted.

Someone once explained it like “not a reduced set, but a set of reduced instructions”. Not r(is)c, but (ri)sc. Pretty much what you say, I just liked the way of describing it.

It seems to me people are ignoring that the C stands for Complexity. What's reduced is Complexity of the instruction set, not the size of it (or even the instructions themselves). In the context of the coinage of the term, they almost certainly could have called it "microcode-free ISA", but it wouldn't have sounded as cool.

Doesn't the C stand for Computer?

Re: ARM chips have an instruction with JavaScript in the name

#100
post #88

Earlier quoted context omitted.

Nothing justifies the prolonging of C torture either, except of the C's wide spread. Why do you think modern CPUs still expose mostly C-abstract-machine-like interface instead of their actual out-of-order, pipelined, heterogeneous-memory-hierarch-ied internal workings?

It's not like other languages are well-adapted to that either. That's a hard target to code for.

Why couldn’t Haskell compilers make good use of that?
Post reply on HN