(no commit message)
[libreriscv.git] / isa_conflict_resolution.mdwn
1 # Resolving ISA conflicts and providing a pain-free RISC-V Standards Upgrade Path
2
3 **Note: out-of-date as of review 31apr2018, requires updating to reflect
4 "mvendorid-marchid-isamux" concept.**
5
6 ## Executive Summary
7
8 A non-invasive backwards-compatible change to make mvendorid and marchid
9 being read-only to be a formal declaration of an architecture having no
10 Custom Extensions, and being permitted to be WARL in order to support
11 multiple simultaneous architectures on the same processor (or per hart
12 or harts) permits not only backwards and forwards compatibility with
13 existing implementations of the RISC-V Standard, not only permits seamless
14 transitions to future versions of the RISC-V Standard (something that is
15 not possible at the moment), but fixes the problem of clashes in Custom
16 Extension opcodes on a global worldwide permanent and ongoing basis.
17
18 Summary of impact and benefits:
19
20 * Implementation impact for existing implementations (even though
21 the Standard is not finalised) is zero.
22 * Impact for future implementations compliant with (only one) version of the
23 RISC-V Standard is zero.
24 * Benefits for implementations complying with (one or more) versions
25 of the RISC-V Standard is: increased customer acceptance due to
26 a smooth upgrade path at the customer's pace and initiative vis-a-vis
27 legacy proprietary software.
28 * Benefits for implementations deploying multiple Custom Extensions
29 are a massive reduction in NREs and the hugely reduced ongoing software
30 toolchain maintenance costs plus the benefit of having security updates
31 from upstream software sources due to
32 *globally unique identifying information* resulting in zero binary
33 encoding conflicts in the toolchains and resultant binaries
34 *even for Custom Extensions*.
35
36 ## Introduction
37
38 In a lengthy thread that ironically was full of conflict indicative
39 of the future direction in which RISC-V will go if left unresolved,
40 multiple Custom Extensions were noted to be permitted free rein to
41 introduce global binary-encoding conflict with no means of resolution
42 described or endorsed by the RISC-V Standard: a practice that has known
43 disastrous and irreversible consequences for any architecture that
44 permits such practices (1).
45
46 Much later on in the discussion it was realised that there is also no way
47 within the current RISC-V Specification to transition to improved versions
48 of the standard, regardless of whether the fixes are absolutely critical
49 show-stoppers or whether they are just keeping the standard up-to-date (2).
50
51 With no transition path there is guaranteed to be tension and conflict
52 within the RISC-V Community over whether revisions should be made:
53 should existing legacy designs be prioritised, mutually-exclusively over
54 future designs (and what happens during the transition period is absolute
55 chaos, with the compiler toolchain, software ecosystem and ultimately
56 the end-users bearing the full brunt of the impact). If several
57 overlapping revisions are required that have not yet transitioned out
58 of use (which could take well over two decades to occur) the situation
59 becomes disastrous for the credibility of the entire RISC-V ecosystem.
60
61 It was also pointed out that Compliance is an extremely important factor
62 to take into consideration, and that Custom Extensions (as being optional)
63 effectively and quite reasonably fall entirely outside of the scope of
64 Compliance Testing. At this point in the discussion however it was not
65 yet noted the stark problem that the *mandatory* RISC-V Specification
66 also faces, by virtue of there being no transitional way to bring in
67 show-stopping critical alterations.
68
69 To put this into perspective, just taking into account hardware costs
70 alone: with production mask charges for 28nm being around USD $1.5m,
71 engineering development costs and licensing of RTLs for peripherals
72 being of a similar magnitude, no manufacturer is going to back away
73 from selling a "flawed" or "legacy" product (whether it complies with
74 the RISC-V Specification or not) without a bitter fight.
75
76 It was also pointed out that there will be significant software tool
77 maintenance costs for manufacturers, meaning that the probability will
78 be extremely high that they will refuse to shoulder such costs, and
79 will publish and continue to publish (and use) hopelessly out-of-date
80 unpatched tools. This practice is well-known to result in security
81 flaws going unpatched, with one of many immediate undesirable consequences
82 being that product in extremely large volume gets discarded into landfill.
83
84 **All and any of the issues that were discussed, and all of those that
85 were not, can be avoided by providing a hardware-level runtime-enabled
86 forwards and backwards compatible transition path between *all* parts
87 (mandatory or not) of current and future revisions of the RISC-V ISA
88 Standard.**
89
90 The rest of the discussion - indicative as it was of the stark mutually
91 exclusive gap being faced by the RISC-V ISA Standard given that it does
92 not cope with the problem - was an effort by two groups in two clear
93 camps: one that wanted things to remain as they are, and another that
94 made efforts to point out that the consequences of not taking action
95 are clearly extreme and irreversible (which, unfortunately, given the
96 severity, some of the first group were unable to believe, despite there
97 being clear historical precedent for the exact same mistake being made in
98 other architectures, and the consequences on the same being absolutely
99 clear).
100
101 However after a significant amount of time, certain clear requirements came
102 out of the discussion:
103
104 * Any proposal must be a minimal change with minimal (or zero) impact
105 * Any proposal should place no restriction on existing or future
106 ISA encoding space
107 * Any proposal should take into account that there are existing implementors
108 of the (yet to be finalised but still "partly frozen") Standard who may
109 resist, for financial investment reasons, efforts to make any change
110 (at all) that could cost them immediate short-term profits.
111
112 Several proposals were put forward (and some are still under discussion)
113
114 * "Do nothing": problem is not severe: no action needed.
115 * "Do nothing": problem is out-of-scope for RISC-V Foundation.
116 * "Do nothing": problem complicates Compliance Testing (and is out of scope)
117 * "MISA": the MISA CSR enables and disables extensions already: use that
118 * "MISA-like": a new CSR which switches in and out new encodings
119 (without destroying state)
120 * "mvendorid/marchid WARL": switching the entire "identity" of a machine
121 * "ioctl-like": a OO proposal based around the linux kernel "ioctl" system.
122
123 Each of these will be discussed below in their own sections.
124
125 # Do nothing (no problem exists)
126
127 (Summary: not an option)
128
129 There were several solutions offered that fell into this category.
130 A few of them are listed in the introduction; more are listed below,
131 and it was exhaustively (and exhaustingly) established that none of
132 them are workable.
133
134 Initially it was pointed out that Fabless Semiconductor companies could
135 simply license multiple Custom Extensions and a suitable RISC-V core, and
136 modify them accordingly. The Fabless Semi Company would be responsible
137 for paying the NREs on re-developing the test vectors (as the extension
138 licensers would be extremely unlikely to do that without payment), and
139 given that said Companies have an "integration" job to do, it would
140 be reasonable to expect them to have such additional costs as well.
141
142 The costs of this approach were outlined and discussed as being
143 disproportionate and extreme compared to the actual likely cost of
144 licensing the Custom Extensions in the first place. Additionally it
145 was pointed out that not only hardware NREs would be involved but
146 custom software tools (compilers and more) would also be required
147 (and maintained separately, on the basis that upstream would not
148 accept them except under extreme pressure, and then only with
149 prejudice).
150
151 All similar schemes involving customisation of the custom extensions
152 were likewise rejected, but not before the customisation process was
153 mistakenly conflated with tne *normal* integration process of developing
154 a custom processor (Bus Architectures, Cache layouts, peripheral layouts).
155
156 The most compelling hardware-related reason (excluding the severe impact on
157 the software ecosystem) for rejecting the customisation-of-customisation
158 approach was the case where Extensions were using an instruction encoding
159 space (48-bit, 64-bit) *greater* than that which the chosen core could
160 cope with (32-bit, 48-bit).
161
162 Overall, none of the options presented were feasible, and, in addition,
163 with no clear leadership from the RISC-V Foundation on how to avoid
164 global world-wide encoding conflict, even if they were followed through,
165 still would result in the failure of the RISC-V ecosystem due to
166 irreversible global conflicting ISA binary-encoding meanings (POWERPC's
167 Altivec / SPE nightmare).
168
169 This in addition to the case where the RISC-V Foundation wishes to
170 fix a critical show-stopping update to the Standard, post-release,
171 where billions of dollars have been spent on deploying RISC-V in the
172 field.
173
174 # Do nothing (out of scope)
175
176 (Summary: may not be RV Foundation's "scope", still results in
177 problem, so not an option)
178
179 This was one of the first arguments presented: The RISC-V Foundation
180 considers Custom Extensions to be "out of scope"; that "it's not their
181 problem, therefore there isn't a problem".
182
183 The logical errors in this argument were quickly enumerated: namely that
184 the RISC-V Foundation is not in control of the uses to which RISC-V is
185 put, such that public global conflicts in binary-encoding are a hundred
186 percent guaranteed to occur (*outside* of the control and remit of the
187 RISC-V Foundation), and a hundred percent guaranteed to occur in
188 *commodity* hardware where Debian, Fedora, SUSE and other distros will
189 be hardest hit by the resultant chaos, and that will just be the more
190 "visible" aspect of the underlying problem.
191
192 # Do nothing (Compliance too complex, therefore out of scope)
193
194 (Summary: may not be RV Foundation's "scope", still results in
195 problem, so not an option)
196
197 The summary here was that Compliance testing of Custom Extensions is
198 not just out-of-scope, but even if it was taken into account that
199 binary-encoding meanings could change, it would still be out-of-scope.
200
201 However at the time that this argument was made, it had not yet been
202 appreciated fully the impact that revisions to the Standard would have,
203 when billions of dollars worth of (older, legacy) RISC-V hardware had
204 already been deployed.
205
206 Two interestingly diametrically-opposed equally valid arguments exist here:
207
208 * Whilst Compliance testing of Custom Extensions is definitely legitimately
209 out of scope, Compliance testing of simultaneous legacy (old revisions of
210 ISA Standards) and current (new revisions of ISA Standard) definitely
211 is not. Efforts to reduce *Compliance Testing* complexity is therefore
212 "Compliance Tail Wagging Standard Dog".
213 * Beyond a certain threshold, complexity of Compliance Testing is so
214 burdensome that it risks outright rejection of the entire Standard.
215
216 Meeting these two diametrically-opposed perspectives requires that the
217 solution be very, very simple.
218
219 # MISA
220
221 (Summary: MISA not suitable, leads to better idea)
222
223 MISA permits extensions to be disabled by masking out the relevant bit.
224 Hypothetically it could be used to disable one extension, then enable
225 another that happens to use the same binary encoding.
226
227 *However*:
228
229 * MISA Extension disabling is permitted (optionally) to **destroy**
230 the state information. Thus it is totally unsuitable for cases
231 where instructions from different Custom extensions are needed in
232 quick succession.
233 * MISA was only designed to cover Standard Extensions.
234 * There is nothing to prevent multiple Extensions being enabled
235 that wish to simultaneously interpret the same binary encoding.
236 * There is nothing in the MISA specification which permits
237 *future* versions (bug-fixes) of the RISC-V ISA to be "switched in".
238
239 Overall, whilst the MISA concept is a step in the right direction it's
240 a hundred percent unsuitable for solving the problem.
241
242 # MISA-like
243
244 (Summary: basically same as mvend/march WARL except needs an extra CSR where
245 mv/ma doesn't. Along right lines, doesn't meet full requirements)
246
247 Out of the MISA discussion came a "MISA-like" proposal, which would
248 take into account the flaws pointed out by trying to use "MISA":
249
250 * The MISA-like CSR's meaning would be identified by compilers using the
251 mvendor-id/march-id tuple as a compiler target
252 * Each custom-defined bit of the MISA-like CSR would (mutually-exclusively)
253 redirect binary encoding(s) to specific encodings
254 * No Extension would *actually* be disabled: its internal state would
255 be left on (permanently) so that switching of ISA decoding
256 could be done inside inner loops without adverse impact on
257 performance.
258
259 Whilst it was the first "workable" solution it was also noted that the
260 scheme is invasive: it requires an entirely new CSR to be added
261 to the privileged spec (thus making existing implementations redundant).
262 This does not fulfil the "minimum impact" requirement.
263
264 Also interesting around the same time an additional discussion was
265 raised that covered the *compiler* side of the same equation. This
266 revolved around using mvendorid-marchid tuples at the compiler level,
267 to be put into assembly output (by gcc), preserving the required
268 *globally* unique identifying information for binutils to successfully
269 turn the custom instruction into an actual binary-encoding (plus
270 binary-encoding of the context-switching information). (**TBD, Jacob,
271 separate page? review this para?**)
272
273 # mvendorid/marchid WARL <a name="mvendor_marchid_warl"></a>
274
275 (Summary: the only idea that meets the full requirements. Needs
276 toolchain backup, but only when the first chip is released)
277
278 This proposal has full details at the following page:
279 [[mvendor_march_warl]]
280
281 Coming out of the software-related proposal by Jacob Bachmeyer, which
282 hinged on the idea of a globally-maintained gcc / binutils database
283 that kept and coordinated architectural encodings (curated by the Free
284 Software Foundation), was to quite simply make the mvendorid and marchid
285 CSRs have WARL (writeable) characteristics. Read-only is taken to
286 mean a declaration of "Having no Custom Extensions" (a zero-impact
287 change).
288
289 By making mvendorid-marchid tuples WARL the instruction decode phase
290 may re-route mutually-exclusively to different engines, thus providing
291 a controlled means and method of supporting multiple (future, past and
292 present) versions of the **Base** ISA, Custom Extensions and even
293 completely foreign ISAs in the same processor.
294
295 This incredibly simple non-invasive idea has some unique and distinct
296 advantages over other proposals:
297
298 * Existing designs - even though the specification is not finalised
299 (but has "frozen" aspects) - would be completely unaffected: the
300 change is to the "wording" of the specification to "retrospectively"
301 fit reality.
302 * Unlike with the MISA idea this is *purely* at the "decode" phase:
303 no internal Extension state information is permitted to be disabled,
304 altered or destroyed as a direct result of writing to the
305 mvendor/march-id CSRs.
306 * Compliance Testing may be carried out with a different vendorid/marchid
307 tuple set prior to a test, allowing a vendor to claim *Certified*
308 compatibility with *both* one (or more) legacy variants of the RISC-V
309 Specification *and* with a present one.
310 * With sufficient care taken in the implementation an implementor
311 may have multiple interpretations of the same binary encoding within
312 an inner loop, with a single instruction (to the WARL register)
313 changing the meaning.
314
315 **This is the only one of the proposals that meet the full requirements**
316
317 # Overloadable opcodes <a name="overloadable opcodes"></a>
318
319 See [[overloadable opcodes]] for full details, including a description in terms of C functions.
320
321 NOTE: under discussion.
322
323 ==RB 2018-5-1 dropped IOCTL proposal for the much simpler overloadable opcodes proposal==
324
325 The overloadable opcode (or xext) proposal allows a non standard extension to use a documented 20 + 3 bit (or 52 + 3 bit on RV64) UUID identifier for an instruction for _software_ to use. At runtime, a cpu translates the UUID to a small implementation defined 12 + 3 bit bit identifier for _hardware_ to use. It also defines a fallback mechanism for the UUID's of instructions the cpu does not recognise.
326
327 The overloadable opcodes proposal defines 8 standardised R-type instructions xcmd0, xcmd1, ...xcmd7 preferably in the brownfield opcode space.
328 Each xcmd takes in rs1 a 12 bit "logical unit" (lun) identifying a device on the cpu that implements some "extension interface" (xintf) together with some additional data. An xintf is a set of up to 8 commands with 2 input and 1 output port (i.e. like an R-type instruction), together with a description of the semantics of the commands. Calling e.g. xcmd3 routes its two inputs and one output ports to command 3 on the device determined by the lun bits in rs1. Thus, the 8 standard xcmd instructions are standard-designated overloadable opcodes, with the non standard semantics of the opcode determined by the lun.
329
330 Portable software, does not use luns directly. Instead, it goes through a level of indirection using a further instruction xext that translates a 20 bit globally unique identifier UUID of an xintf, to the lun of a device on the cpu that implements that xintf. The cpu can do this, because it knows (at manufacturing or boot time) which devices it has, and which xintfs they provide. This includes devices that would be described as non standard extension of the cpu if the designers had used custom opcodes instead of xintf as an interface. If the UUID of the xintf is not recognised at the current privilege level, the xext instruction returns the special lun = 0, causing any xcmd to trap. Minor variations of this scheme (requiring two more instructions) cause xcmd instructions to fallback to always return 0 or -1 instead of trapping.
331
332 The 20 bit provided by the UUID of the xintf is much more room than provided by the 2 custom 32 bit, or even 4 custom 64/48 bit opcode spaces. Thus the overloadable opcodes proposal avoids most of the need to put a claim on opcode space and the associated collisions when combining independent extensions. In this respect it is similar to POSIX ioctls, which obviate the need for defining new syscalls to control new and nonstandard hardware.
333
334 Remark1: the main difference with a previous "ioctl like proposal" is that UUID translation is stateless and does not use resources. The xext instruction _neither_ initialises a device _nor_ builds global state identified by a cookie. If a device needs initialisation it can do this using xcmds as init and deinit instructions. Likewise, it can hand out cookies (which can include the lun) as a return value .
335
336 Remark2: Implementing devices can respond to an (essentially) arbitrary number of xintfs. Hence an implementing device can respond to an arbitrary number of commands. Organising related commands in xintfs, helps avoid UUID space pollution, and allows to amortise the (small) cost of UUID to lun translation if related commands are used in combination.
337
338 ==RB not sure if this is still correct and relevant==
339
340 The proposal is functionally similar to that of the mvendor/march-id
341 except the non standard extension is explicit and restricted to a small set of well defined individual opcodes.
342 Hence several extensions can be mixed and there is no state to be tracked over context switches.
343 As such it could hypothetically be proposed as an independent Standard Extension.
344
345 Despite the proposal (which is still undergoing clarification)
346 being worthwhile in its own right, and standing on its own merits and
347 thus definitely worthwhile pursuing, it is non-trivial and more
348 invasive than the mvendor/march-id WARL concept.
349
350 ==RB==
351
352 # Comments, Discussion and analysis
353
354 TBD: placeholder as of 26apr2018
355
356 ## new (old) m-a-i tuple idea
357
358 > actually that's a good point: where the user decides that they want
359 > to boot one and only one tuple (for the entire OS), forcing a HARDWARE
360 > level default m-a-i tuple at them actually prevents and prohibits them
361 > from doing that, Jacob.
362 >
363 > so we have apps on one RV-Base ISA and apps on an INCOMPATIBLE (future)
364 > variant of RV-Base ISA.  with the approach that i was advocating (S-mode
365 > does NOT switch automatically), there are totally separate mtvec /
366 > stvec / bstvec traps.
367 >
368 > would it be reasonable to assume the following:
369 >
370 > (a) RV-Base ISA, particularly code-execution in the critical S-mode
371 > trap-handling, is *EXTREMELY* unlikely to ever be changed, even thinking
372 > 30 years into the future ?
373 >
374 > (b) if the current M-mode (user app level) context is "RV Base ISA 1"
375 > then i would hazard a guess that S-mode is prettty much going to drop
376 > down into *exactly* the same mode / context, the majority of the time
377 >
378 > thus the hypothesis is that not only is it the common code-path to *not*
379 > switch the ISA in the S-mode trap but that the instructions used are
380 > extremely unlikely to be changed between "RV Base Revisions".
381 >
382 > foreign isa hardware-level execution
383 > ------------------------
384 >
385 > this is the one i've not really thought through so much, other than it
386 > would clearly be disadvantageous for S-mode to be arbitrarily restricted
387 > to running RV-Base code (of any variant).  a case could be made that by the
388 > time the m-a-i tuple is switched to the foreign isa it's "all bets off",
389 > foreign arch is "on its own", including having to devise a means and
390 > method to switch back (equivalent in its ISA of m-a-i switching).
391 >
392 > conclusion / idea
393 > --------------------
394 >
395 > the multi-base "user wants to run one and only one tuple" is the key
396 > case, here, that is a show-stopper to the idea of hard-wiring the default
397 > S-mode m-a-i.
398 >
399 > now, if instead we were to say, "ok so there should be a default S-mode
400 > m-a-i tuple" and it was permitted to SET (choose) that tuple, *that*
401 > would solve that problem.  it could even be set to the foreign isa. 
402 > which would be hilarious.
403
404 jacob's idea: one hart, one configuration:
405
406 >>>  (a) RV-Base ISA, particularly code-execution in the critical S-mode
407 >>> trap-handling, is *EXTREMELY* unlikely to ever be changed, even
408 >>> thinking 30 years into the future ?
409 >>
410 >> Oddly enough, due to the minimalism of RISC-V, I believe that this is
411 >> actually quite likely.  :-)
412 >>
413 >>>  thus the hypothesis is that not only is it the common code-path to
414 >>> *not* switch the ISA in the S-mode trap but that the instructions used
415 >>> are extremely unlikely to be changed between "RV Base Revisions".
416 >>>
417 >> Correct.  I argue that S-mode should *not* be able to switch the selected
418 >> ISA on multi-arch processors. 
419 >
420 > that would produce an artificial limitation which would prevent
421 > and prohibit implementors from making a single-core (single-hart)
422 > multi-configuration processor.
423
424
425
426 # Summary and Conclusion
427
428 In the early sections (those in the category "no action") it was established
429 in each case that the problem is not solved. Avoidance of responsibility,
430 or conflation of "not our problem" with "no problem" does not make "problem"
431 go away. Even "making it the Fabless Semiconductor's design problem" resulted
432 in a chip being *more costly to engineer as hardware **and** more costly
433 from a software-support perspective to maintain*... without actually
434 fixing the problem.
435
436 The first idea considered which could fix the problem was to just use
437 the pre-existing MISA CSR, however this was determined not to have
438 the right coverage (Standard Extensions only), and also crucially it
439 destroyed state. Whilst unworkable it did lead to the first "workable"
440 solution, "MISA-like".
441
442 The "MISA-like" proposal, whilst meeting most of the requirements, led to
443 a better idea: "mvendor/march-id WARL", which, in combination with an offshoot
444 idea related to gcc and binutils, is the only proposal that fully meets the
445 requirements.
446
447 The "ioctl-like" idea *also* solves the problem, but, unlike the WARL idea
448 does not meet the full requirements to be "non-invasive" and "backwards
449 compatible" with pre-existing (pre-Standards-finalised) implementations.
450 It does however stand on its own merit as a way to extend the extremely
451 small Custom Extension opcode space, even if it itself implemented *as*
452 a Custom Extension into which *other* Custom Extensions are subsequently
453 shoe-horned. This approach has the advantage that it requires no "approval"
454 from the RISC-V Foundation... but without the RISC-V Standard "approval"
455 guaranteeing no binary-encoding conflicts, still does not actually solve the
456 problem (if deployed as a Custom Extension for extending Custom Extensions).
457
458 Overall the mvendor/march-id WARL idea meets the three requirements,
459 and is the only idea that meets the three requirements:
460
461 * **Any proposal must be a minimal change with minimal (or zero) impact**
462 (met through being purely a single backwards-compatible change to the
463 wording of the specification: mvendor/march-id changes from read-only
464 to WARL)
465 * **Any proposal should place no restriction on existing or future
466 ISA encoding space**
467 (met because it is just a change to one pre-existing CSR, as opposed
468 to requiring additional CSRs or requiring extra opcodes or changes
469 to existing opcodes)
470 * **Any proposal should take into account that there are existing implementors
471 of the (yet to be finalised but still "partly frozen") Standard who may
472 resist, for financial investment reasons, efforts to make any change
473 (at all) that could cost them immediate short-term profits.**
474 (met because existing implementations, with the exception of those
475 that have Custom Extensions, come under the "vendor/arch-id read only
476 is a formal declaration of an implementation having no Custom Extensions"
477 fall-back category)
478
479 So to summarise:
480
481 * The consequences of not tackling this are severe: the RISC-V Foundation
482 cannot take a back seat. If it does, clear historical precedent shows
483 100% what the outcome will be (1).
484 * Making the mvendorid and marchid CSRs WARL solves the problem in a
485 minimal to zero-disruptive backwards-compatible fashion that provides
486 indefinite transparent *forwards*-compatibility.
487 * The retro-fitting cost onto existing implementations (even though the
488 specification has not been finalised) is zero to negligeable
489 (only changes to words in the specification required at this time:
490 no vendor need discard existing designs, either being designed,
491 taped out, or actually in production).
492 * The benefits are clear (pain-free transition path for vendors to safely
493 upgrade over time; no fights over Custom opcode space; no hassle for
494 software toolchain; no hassle for GNU/Linux Distros)
495 * The implementation details are clear (and problem-free except for
496 vendors who insist on deploying dozens of conflicting Custom Extensions:
497 an extreme unlikely outlier).
498 * Compliance Testing is straightforward and allows vendors to seek and
499 obtain *multiple* Compliance Certificates with past, present and future
500 variants of the RISC-V Standard (in the exact same processor,
501 simultaneously), in order to support end-customer legacy scenarios and
502 provide the same with a way to avoid "impossible-to-make" decisions that
503 throw out ultra-costly multi-decade-investment in proprietary legacy
504 software at the same as the (legacy) hardware.
505
506 -------
507
508 # Conversation Exerpts
509
510 The following conversation exerpts are taken from the ISA-dev discussion
511
512 ## (1) Albert Calahan on SPE / Altiven conflict in POWERPC
513
514 > Yes. Well, it should be blocked via legal means. Incompatibility is
515 > a disaster for an architecture.
516 >
517 > The viability of PowerPC was badly damaged when SPE was
518 > introduced. This was a vector instruction set that was incompatible
519 > with the AltiVec instruction set. Software vendors had to choose,
520 > and typically the choice was "neither". Nobody wants to put in the
521 > effort when there is uncertainty and a market fragmented into
522 > small bits.
523 >
524 > Note how Intel did not screw up. When SSE was added, MMX remained.
525 > Software vendors could trust that instructions would be supported.
526 > Both MMX and SSE remain today, in all shipping processors. With very
527 > few exceptions, Intel does not ship chips with missing functionality.
528 > There is a unified software ecosystem.
529 >
530 > This goes beyond the instruction set. MMU functionality also matters.
531 > You can add stuff, but then it must be implemented in every future CPU.
532 > You can not take stuff away without harming the architecture.
533
534 ## (2) Luke Kenneth Casson Leighton on Standards backwards-compatibility
535
536 > For the case where "legacy" variants of the RISC-V Standard are
537 > backwards-forwards-compatibly supported over a 10-20 year period in
538 > Industrial and Military/Goverment-procurement scenarios (so that the
539 > impossible-to-achieve pressure is off to get the spec ABSOLUTELY
540 > correct, RIGHT now), nobody would expect a seriously heavy-duty amount
541 > of instruction-by-instruction switching: it'd be used pretty much once
542 > and only once at boot-up (or once in a Hypervisor Virtual Machine
543 > client) and that's it.
544
545 ## (3) Allen Baum on Standards Compliance
546
547 > Putting my compliance chair hat on: One point that was made quite
548 > clear to me is that compliance will only test that an implementation
549 > correctly implements the portions of the spec that are mandatory, and
550 > the portions of the spec that are optional and the implementor claims
551 > it is implementing. It will test nothing in the custom extension space,
552 > and doesn't monitor or care what is in that space.
553
554 ## (4) Jacob Bachmeyer on explaining disambiguation of opcode space
555
556 > ...have different harts with different sets of encodings.)  Adding a "select"
557 > CSR as has been proposed does not escape this fundamental truth that
558 > instruction decode must be unambiguous, it merely expands every opcode with
559 > extra bits from a "select" CSR.
560
561 ## (5) Krste Asanovic on clarification of use of opcode space
562
563 > A CPU is even free to reuse some standard extension encoding space for
564 > non-standard extensions provided it does not claim to implement that
565 > standard extension.
566
567 ## (6) Clarification of difference between assembler and encodings
568
569 > > The extensible assembler database I proposed assumes that each processor
570 > > will have *one* and *only* one set of recognized instructions.  (The "hidden
571 > > prefix" is the immutable vendor/arch/impl tuple in my proposals.) 
572 >
573 >  ah this is an extremely important thing to clarify, the difference
574 > between the recognised instruction assembly mnemonic (which must be
575 > globally world-wide accepted as canonical) and the binary-level encodings
576 > of that mnemonic used different vendor implementations which will most
577 > definitely *not* be unique but require "registration" in the form of
578 > atomic acceptance as a patch by the FSF to gcc and binutils [and other
579 > compiler tools].
580
581
582 # References
583
584 * <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/7bbwSIW5aqM>
585 * <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/InzQ1wr_3Ak%5B1-25%5D>
586 * Review mvendorid-marchid WARL <https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/Uvy9paXN1xA>