Friday, 2021-02-12

* lkcl waves to segher17:53
lkclwould be interested to hear your thoughts on whether jacob's noticing that MIPS added "-elf-" options, disabled by default, to switch on IEEE754-2008 mode, RISC-V doing something similar17:55
lkclif you thought that was sane / safe to do (adding to ELF v2 ABI, no need for new triplets)17:55
lkclor is it more along the lines of "hmmm" :)17:56
programmerjake[mmore specifically adding another flag to elf files, handled by the loader, linker, and dynamic linker17:57
lkclnice.  do you happen to know any concrete examples (i mean actual source code) with that?17:58
lkcljust found this for example https://gcc.gnu.org/legacy-ml/gcc/2015-11/msg00068.html18:01
programmerjake[mI think I found a good example: https://patches-gcc.linaro.org/patch/4834/18:11
programmerjake[miirc the RISC-V E ABI doesn't allow using r16 through r3118:12
rsclkcl: just asking...are you attending the embedded world digital trade fair?21:37
lkclprogrammerjake[m: excellent21:58
lkclrsc: didn't know it was running!21:58
lkclthat looks to me like it's an actual new ABI.  ilp32e22:04
lkclto check whether that's true: is it the case that a program compiled for lpl32e will run entirely fine on a current (standard linux) RV32GC ilp32 system?22:06
programmerjake[myes22:06
lkclcool!22:06
programmerjake[mhowever, not the other way around22:06
lkcland can you compile a dynamic library for ilp32e and have it be used by ilp32 programs?22:07
lkclinteresting about "not the other way round"22:07
lkclthat would make sense22:07
rsclkcl: it's not yet running, in 1.5 weeks or so. Not sure if it could be interesting for you/the project.22:08
lkclah the CfP was sep 30 2020 https://call-for-papers.weka-fachmedien.de/frontend/index.php?sub=27822:09
programmerjake[mused by ilp32 programs: often, as long as the code doesn't use too many argument registers...22:09
lkclprogrammerjake[m, _great_.  that's _great_ news22:10
programmerjake[mthe "not the other way around" is because there are RISC-V cpus with only 16 registers, they implement rv32e instead of rv32i22:11
lkclbecause it means that there's a good example where registers were removed, inaccessible from an ABI, and yet still the ABI did not need a new triplet to do it.  it was a modification of an *existing* ABI22:11
rsclkcl: well, yes, CfP is over, you just can attend now ;-(22:11
programmerjake[mso the other registers just don't exist22:11
lkclrsc: it's not a hard rule, but just empirically, there are no technical conferences i've attended in 25 years where i have not also been a speaker22:12
programmerjake[mi think they use a new triplet anyway for riscv32e22:13
rsclkcl: heh. Maybe for 2022 ;-) the trade fair (with a conference) is dedicated to embedded hard/software, thus I thought it could be interesting maybe22:13
jn__ahh, to go to conferences again...22:14
soreartriplets unfortunately don't mean anything technically22:15
lkcljn__: sigh :)22:16
lkclsorear: interesting.  can you say more?  we're currently being recommended that modifications to ELF v2 to remove the (mistaken, mandatory) use of SIMD will need a new triplet, and a new ABI, and therefore an entire new distro port for debian, ubuntu, fedora, everything.22:18
lkcltotal nightmare22:18
sorearsomething like "i686-unknown-linux-gnu" hides hundreds of possible ABIs22:18
sorearwell ABI/ISA combinations22:19
lkclbut the flaw there is in "remove".  we're looking for a way for ELF v2 to *dynamically* include code-that-has-VSX and code-that-does-not in the exact same ELF v2 ABI22:19
programmerjake[msorear: not entirely the case for risc-v since the triplet contains the list of ISA extensions enabled by default: riscv32gc == g + c == i + m + a + f + d + c, riscv32imac == i + m + a + c22:19
sorear-mfp=sse?  -D_FILE_OFFSET_BITS=64?  -mavx2?  etc etc22:19
sorearprogrammerjake[m: I've done OS porting and the only triplets I've seen there are "riscv64-unknown-linux" and "riscv32-unknown-linux"; I have never seen "riscv32gc" even when it would make sense22:20
lkclsorear: if you compile something up that doesn't have any one of those options, does the program still run? does it still work, on a distro that's built for i686-unknown-linux-gnu?22:20
lkclor even if it does :)22:20
sorearcorrection I have seen "riscv32gc" in exactly one place, the Rust target list22:21
soreargcc, llvm, debian, fedora?  nah22:21
sorearlkcl: maybe?  good luck22:22
lkcl:)22:22
sorearthis is why LSB happened22:22
lkcli think those features drop down onto glibc6 HWCAPS, in x8622:22
programmerjake[msorear: hmm, maybe that's where I'd seen it, but I recall it being part of the RISC-V spec somewhere that riscv32gc is how you specify a cpu that supports g + c22:38
programmerjake[mI was under the incorrect impression that llvm supported parsing that info from the target triple22:38
lkclprogrammerjake[m: ahhh... i just realised something else about the rv32e system22:39
lkcllet's say you have an rv32e processor22:39
lkclyou download a current debian rv32gc ISO22:40
sorearprogrammerjake[m: those are ISA strings, which are only tangentially related to triples22:40
lkclwill it work?22:40
sorearno22:40
sorearrv32gc uses 31 integer registers because gc includes i22:40
lkclsorear: that's what i expected, and that's the situation we have to "make work"22:40
lkcl(for A2O, A2I, microwatt *and* LibreSOC, in the OpenPOWER world)22:41
lkcli think getting that to work involves first getting ELF v2 to support non-SIMD (and non-QFP)22:41
lkclthen having libraries *dual compile* just like apple does.  did22:42
programmerjake[miirc elfv2 doesn't require 128-bit fp, it does require simd22:42
lkcltheir "universal binaries"22:42
programmerjake[mwell, good luck with that, it didn't happen last time: see fatelf22:43
lkclit's fine if that multilib-like / universal thing takes a while to propagate through22:44
lkclahh interesting22:44
programmerjake[miirc fatelf was rejected from the linux kernel22:44
lkcli would expect only certain *functions* to be replaced (those that have a different ABI signature)22:45
programmerjake[mfatelf is similar to macos fat binaries in that a fatelf file is just multiple elf files glued together22:45
programmerjake[mI'd expect multilib to have a much better chance, since it's already widespread22:46
lkclit looks however like fatelf was designed to plug together completely separate CPU architectures22:47
lkclyyeah but multilib is literally a total new library, totally new ABI, again totally new triplet22:47
programmerjake[m^ exactly what macos universal binaries do22:47
programmerjake[mfirst one: powerpc + x86, second one: x86 + arm22:48

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!