On 2020-06-24 09:59, Alan Browne wrote:
> What nospam was referring to is the particular architecture of Apple's
> chips which are structured with specialized CPU's for some tasks. (ie:
> some focused on performance and some focused on lower power background,
> the neural engine, etc.).
The gizmos around the CPU, sur as neural engine, secure enclave and what
not are separate peripherals. Similar to the graphics cards. Your
program is compiled to run on the CPU with access to the RAM attached to
the CPU. As such, it supports the ARM instruction set.
You can make calls to various system services that lets you make use of
the peripherals such as neural engine. But what you feed as "data" to
the neural engine may not be ARM code. What you feed Secure ENclare are
IO function codes. (on IOS, when you make a disk IO request, it goes
through the secure enclave since it has the physical link to the disk
and controls encryptioN/decryption).
> I doubt very much an ARM compiler/assembler would compile Apple's code
> for their chips. Apple have surely added, modified and extended
> instructions in the machine set.
Nop. Apple provides OS level subroutines (framework in millenial
terminology) to access those devices. Same with graphics cards. The
standard code compiler doesn't generate binary code that will run on a
graphic card. It is either generated separately for a specific card, or
uses standard language such as openGL or Metal for Apple which is
created separately.
The source code file can contain mixed languages with a pre-processor
that extracts statements for one language and converts them into a
system call followed by arguments containing "data" (what it compiled).
The second compiler (the main one) then seens this as a simple
subroutine call with data arguments, compiles it. At run time, that
system serviec is called and it likely then takes the data argument and
moves it to the device which does whatever it does and returns whatever
it returns.
This is common when writing code that uses a database engine since the
"SELECT" statements are not part of COBOL, C or whatever. But then you
showed earlier you had no clue on how database systems are accessed from
source code.
It should be noted that when Apple moved the Axx chips to 64 bits, it
used the ARM supplied architecture and instruction set. It didn't write
its own. If ARM Inc left some opcodes to be used at implementors'
discretion, than Apple mahy have used them to create now opcodes and
then has to manage the LLVM to make use of that opcode when targetting
an Axx chips that has those new Apple-only opcodes.
Apple cannot willy-nilly use any spare opcode because ARM inc may
decided to use it at a later point.