Reputation: 1851
How microprocessors manufacturers make some things visible to the software and others don't?
for example what makes ISA, registers and register number visible and other features like cache size invisible?
could they choose to make other features also visible like cache size to the software?
How do they make something visible and something not? what makes a feature visible to the software?
Upvotes: 0
Views: 76
Reputation: 37222
First, understand that "visibility" is not a boolean - there are different amounts of visibility. Some things may be defined as "always existing on every implementation" (except when there's bugs in the CPU), some things may be optional, some things may be model specific, some things may be undocumented but still visible, some things may be unintentionally visible even though nobody wants it to be (speculative execution vulnerabilities).
for example what makes ISA, registers and register number visible and other features like cache size invisible
Ideally, an impartial organisation creates a specification (focusing only on "benefits to consumers"), then everyone (programmers, compiler developers, CPU manufacturers) work towards complying with the specification; such that all software that complies with the specification works on all CPUs that comply with the specification. In practice this mostly doesn't happen. Instead, CPU manufacturers fight amongst themselves to make their product seem better while crippling their competition (e.g. by being deliberately incompatible, polluting the opcode space, using patents to prevent competition, etc). The end result is that decisions about how things should work and how visible things should be ends up being a compromise between marketing and legalities without much consideration to "benefits to consumers" (beyond marketing hype). For a "nice" example of this, take a look at the history of "sysenter vs. syscall" on 80x86.
could they choose to make other features also visible like cache size to the software?
Cache is always at least slightly visible (e.g. you can always write a program that uses brute-force timing techniques to auto-determine cache size). CPU manufacturers can make it more visible (e.g. adding cache parameters to CPUID
using 3 or 4 different, incompatible and vendor specific ways to annoy everyone). In theory CPU manufacturers could also make it less visible, but that tends to break compatibility for older software so it rarely happens.
How do they make something visible and something not? what makes a feature visible to the software?
Something is more visible if way/s to see it are described in "the official" standard (or maybe just in one of the manufacturer's manuals if there's no organisation responsible for creating an official standard). Something is less visible if there's no documented way to see it.
Upvotes: 1