6 ms·
How would that work if you have a hundred custom extensions?
by MaKey 5y ago
How would that work if you have a hundred custom extensions?
- rwmj 5y agoApparently it works fine: flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
- MaKey 5y agoI wasn't aware that we already have so many extensions. But doesn't the binary get more bloated the more extensions you have?
- dzaima 5y agoIn practice, at least C compilers don't automatically generate code for multiple extensions, so you get the performance of the base ISA by default. This does indeed mean that every C program for x86-64 that isn't compiled with a specific target architecture just won't ever use AVX/AVX2/AVX-512/any other extension. There is the idea of profiles, i.e. a single nice name for a group of extensions so that there's something one could provide a precompiled binary for, but I don't know what, if any, are RISC-V's plans for that.
- snvzz 5y ago>but I don't know what, if any, are RISC-V's plans for that. Profiles. See RVA22.
- demindiro 5y agoYou can choose which extensions to support at compile time and whether this extension is optional. E.g. many binaries don't use AVX at all, while binaries compiled with -march=native may assume that AVX is supported (and emit SIGILL if not).
- rwmj 5y agoWith x86 there are common extensions that form a baseline (eg. you need SSE2 for any program to run at all). And there are more specialized extensions, eg. for high performance mathematical work. The specialized extensions can usually be confined to a library, and the library can work out at runtime what the hardware supports and swap in optimized functions. It'll likely work much the same way for RISC-V, eg. in Fedora we require that the C (compressed) extension is supported, otherwise the distro won't boot, and things like the vector extension will probably be used only by specialized math libraries and the like.
- colejohnson66 5y agoForgive my ignorance if there’s an answer, but for x86, those extensions don’t overlap (mainly because Intel and AMD avoid stepping on each other). RISC-V doesn’t have a guarantee of non-overlapping vendor extensions, no?
- dzaima 5y agoThere's no way to prevent overlapping extensions. One could easily make an x86 extension that overlaps with some existing one. There's just as much an incentive to not do that for x86 as there is for RISC-V. See AMD's SSE5 vs Intel's SSE4 conflict in x86 - both have instructions that the other doesn't have, and some that both have, and, from what I understand, even the instruction formats conflict.
- saagarjha 5y ago> One could easily make an x86 extension One cannot easily make an x86 extension because there are approximately ~3 entities on the planet allowed to make x86 extensions.
- dzaima 5y agoHere's my random x86 extension: the byte sequence 0xc5,0xfd,0xd4,0x00 sorts the 64-bit floats in ymm0. It conflicts with AVX2. :)
- saagarjha 5y agoYou’ll have trouble shipping that extension. Not because it conflicts with AVX2, but because Intel will sue you for your comparability with the rest of x86.
- sudosysgen 5y agoNot really, China also added their own crypto extensions to x86 chips, though under AMD/VIA's license. I wouldn't be surprised if Sony/Microsoft did too for their consoles. It's doable if you have enough money to get AMD or VIA to make you a one-off.
- panick21_ 5y agoOpen Source software will not adopt 100s of costume extensions. If something becomes a standard it will likely move into a reserved place.