Tuesday, 2025-05-13

*** yocti <yocti!~limnoria@2a01:4f9:c010:c053::1> has joined #oe17:44
*** yocti <yocti!~limnoria@2a01:4f9:c010:c053::1> has joined #oe17:59
*** yocti <yocti!~limnoria@2a01:4f9:c010:c053::1> has joined #oe18:02
*** Kubu_work is now away: Je ne suis pas lĂ  pour l'instant.18:07
jeroen__khem: you mean just the command line arguments?18:15
*** RP is back18:21
*** ptsneves is now away: I am currently away from the computer.18:25
*** RP is now away: Auto away at Tue May 13 18:32:36 2025 UTC18:32
jeroen__Is gcc infected by a bitcoin miner perhaps? time $CC .... api.cc -> real 0m27.867s, user 0m27.853s :(18:38
khemjeroen__:yes gcc cmdline during compiling18:40
khemthese are builtins __atomic_load_n18:40
khemso they should be coming from gut of gcc18:40
khemit will be good to see what code it generated for __atomic_load_n  in qt5 where it seems it worked18:41
jeroen__yeah I know, I tried to make a c version of it, but trivial usage do work correctly.18:41
jeroen__I need to somehow convince gcc to use that base register, I will have a look at that later18:42
jeroen__I will post those arguments first, there is nothing really exciting as far as I can tell though18:42
khemfor armv7 it could use LDREX/STREX for atomic ops so why it does not choose it18:43
jeroen__well the assembler is unhappy: "Warning: index register overlaps transfer register", but that is too late18:43
khemis question in my mind, unless we say arch is < v618:43
khemjeroen__:that instruction is wrong for sure, some CPUs might execute it ok but thats ISA implementation dependent18:44
*** halstead is now away: Auto-away18:46
jeroen__https://pastebin.com/sbvxLVPG18:50
*** RP is back18:51
khem-mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 is as much armv7 as it can be18:55
khemCan you try preprocessing this file with -dD -E and we can see if its gettin LDRD via a inline assembly or something18:56
*** sakoman is back19:03
*** ptsneves is back19:11
*** RP is now away: Auto away at Tue May 13 19:13:03 2025 UTC19:13
jeroen__sorry that is the test of api.cc, this https://pastebin.com/62CC3RQG is api.cc it self19:21
khemthats the cmdline add -dD -E to it and then check the .o file which will have preprocessed content19:23
khemit can tell a lot about what compiler it seeing19:24
*** Kubu_work is back19:26
jeroen__there doesn't seem to be something interesting in there, let me try to get a smaller test case. This thing is quite large.19:38
*** sakoman is now away: I'm not here right now19:45
*** Kubu_work <Kubu_work!~kubu@lfbn-nan-1-335-137.w82-120.abo.wanadoo.fr> has quit IRC (Quit: Leaving.)20:22
*** RP is back20:26
*** ptsneves <ptsneves!~Thunderbi@088156093164.unknown.vectranet.pl> has quit IRC (Ping timeout: 248 seconds)20:38
*** RP is now away: I'm not here right now20:44
*** flynn378 is now away: Auto-away20:49
*** KanjiMonster is now away: Auto away at Tue May 13 20:53:10 2025 UTC20:53
*** sakoman is back21:01
*** RP is back21:04
*** RP is now away: I'm not here right now21:09
*** Xagen <Xagen!~Xagen@syn-067-048-061-106.biz.spectrum.com> has quit IRC (Quit: My MacBook has gone to sleep. ZZZzzz…)21:10
*** RP is back21:11
*** sakoman is now away: I'm not here right now21:16
*** RP is now away: I'm not here right now21:16
*** RP is back21:21
*** pilonsi <pilonsi!~pilonsi@84.123.45.212.dyn.user.ono.com> has quit IRC (Quit: ZNC 1.9.1 - https://znc.in)21:21
*** pilonsi <pilonsi!~pilonsi@84.123.45.212.dyn.user.ono.com> has joined #oe21:21
*** pilonsi is now away: Auto away at Tue May 13 21:21:40 2025 UTC21:21
*** RP is now away: I'm not here right now21:26
*** RP is back21:28
*** RP is now away: I'm not here right now21:33
khemjeroen__:no inlines etc ?21:37
khemno reference to ldrd21:37
jeroen__khem: nope, no __asm which seem to be relevant..21:38
jeroen__I made it a bit shorter btw, https://pastebin.com/5wTb5nJ821:38
jeroen__it is the futex-emulater, which has a "ldrdr2, [r3, r2]"21:39
khemjeroen__:you can see the ldrd instruction though21:40
khemtry adding -mcpu=cortex-a9 -mno-unaligned-access21:40
khemand see if this still happens21:40
jeroen__-mno-unaligned-access doesn't help, -mcpu=cortex-a9 turn it into ldrexd r2, [r2]21:43
khemyeah so thats why it works on some arm subarches but not everywhere21:44
khemstd::atomic<int64_t>* p make it volatile for tests21:46
khemcortex-a9 does have problems with ldrd/strd for aromic ops and thats why its not using them perhaps21:47
khemFor Cortex-A7, the compiler optimistically assumes ldrd is atomic (which is incorrect in practice)21:49
khemFor Cortex-A9, the compiler knows ldrd is not atomic and correctly uses the exclusive load instruction ldrexd21:50
khemcan you try adding -mno-ldrd :)21:50
*** RP is back21:50
khemwhat does it do with clang I wonder21:51
*** MarcWeDLM <MarcWeDLM!~MarcWeDLM@user/MarcWeDLM> has quit IRC (Quit: Client closed)21:51
khemwhat is your CPU if you dont mind to share details?21:53
jeroen__ error: unrecognized command-line option '-mno-ldrd'21:53
khemyeah I know :) I was joking21:56
*** patersonc is now away: Auto-away21:57
jeroen__it is an Allwinner sun8i Family / ARMv7 Processor rev 5 (v7l)21:57
jeroen__well there is actually -mfix-cortex-m3-ldrd though21:57
khemm3 is MCU21:59
*** RP is now away: I'm not here right now21:59
*** RP is back22:05
jeroen__without nodejs https://pastebin.com/vfNhXm4k and now I call it the day22:12
*** adadad is back22:13
jeroen__it is weird, remove that dummy void* isolate, and it goes away..22:13
*** RP is now away: I'm not here right now22:15
khemjeroen__:hang on I think 64bit atomics are borked on H3 it seems22:15
*** RP is back22:16
khemwhich void* did you remove ?22:16
khemI think the key is to force it to use 8byte data so 64bit atomics can kick in22:17
jeroen__see the pastebin, remove the void* from WaitSync(void* isolate, uint8_t *array_buffer, size_t addr, int64_t value) and it goes away22:21
*** paulbarker is now away: Auto-away22:28
khemjeroen__:I think you should omit using -mcpu=cortex-a7 and add -march=armv7-a for nodejs alone22:37
khemthat should workaround it22:37
khemI can see gcc15 generating same code22:38
khemclang is ok22:38
*** halstead is back22:39
*** dankm <dankm!~dan@user/dankm> has quit IRC (Remote host closed the connection)22:54
*** dankm <dankm!~dan@user/dankm> has joined #oe22:56
*** RP is now away: I'm not here right now23:07
*** RP is back23:11
*** RP is now away: Auto away at Tue May 13 23:12:45 2025 UTC23:12
*** florian <florian!~florian@2a02:3100:4618:4a00:d34f:6f78:8a7d:5086> has quit IRC (Ping timeout: 265 seconds)23:17
*** halstead is now away: Auto-away23:26

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