#avr Logs

May 15 2018

#avr Calendar

12:14 AM day__ is now known as day
01:27 AM polprog: morning
03:16 AM rue_bed: I use nedit and compile with a generic makefile
03:17 AM rue_bed: make; make install
03:25 AM Emil: is there a page for avra
03:25 AM Haohmaru: what's this? is there some kind of secret avra competition going on?
03:25 AM Haohmaru: everybody and their grandma are suddenly asking about avra
03:26 AM Emil: ah is it just atmels own syntax
03:40 AM polprog: looks nice
03:40 AM polprog: http://avra.sourceforge.net/README.html
03:49 AM Emil: oh
03:49 AM Emil: it's some other open source project
03:49 AM Emil: but wait
03:49 AM Emil: is it just for avr32s?
03:50 AM Emil: nope
03:50 AM Emil: but lulz
03:50 AM Emil: only the latest version added support for m328p
03:50 AM Emil: I would skip this one
03:51 AM Emil: And just use gas
03:52 AM Emil: https://www.nongnu.org/avr-libc/user-manual/assembler.html
03:57 AM Emil: I do wonder why the syntax of asm is so retarded though
05:50 AM nuxil: <Emil> I do wonder why the syntax of asm is so retarded though
05:50 AM nuxil: youre joking right? the general syntax in asm is pretty much straight forward . (instruction destinaton source) or (instruction source destination) depending on its intel or at&t
05:50 AM nuxil: C & C++ has for sure some weird syntaxed and stuff going on compared to asm
06:01 AM Haohmaru: nuxil cuz with "a = b;" in C++ a *lot* could be actually happening
06:02 AM Haohmaru: that's teh POWAH..
07:22 AM Thrashbarg_ is now known as Thrashbarg
07:27 AM polprog: maths tests were checked by the teacher
07:27 AM polprog: 20 people got an F
07:27 AM polprog: holy fuck
07:28 AM Haohmaru: <yooooushallnoootpaaassssss.jpg>
07:28 AM polprog: Haohmaru: as much as operator= :p
07:28 AM polprog: i got a b-
07:39 AM nuxil: so i just learned something new today about C.. and its weirdness.
07:39 AM polprog: whats that
07:40 AM nuxil: basically that: n["Hello World] == "Hello World"[n]
07:40 AM nuxil: short example..
07:41 AM nuxil: char arr[] = "HELLO WORLD"; char a; char b;
07:41 AM nuxil: for (int i = 0; i <= ((sizeof(arr)-1) / sizeof(arr[0])); i++) { a = (i)[arr]; printf("%c", a); }
07:41 AM nuxil: for (int i = 0; i <= ((sizeof(arr) - 1) / sizeof(arr[0])); i++) { b = arr[i]; printf("%c", b); }
07:42 AM polprog: makes sense
07:42 AM polprog: its atrocious
07:42 AM polprog: so atrocious
07:43 AM polprog: but i think i see how that works
07:43 AM polprog: if you take a look at ptr arithmetics
07:43 AM polprog: that arr[n] === *(arr+n)
07:43 AM polprog: and addition is swappable
07:44 AM polprog: good way to cause aneurysms in your coworkers though xD
07:44 AM nuxil: :)
07:44 AM polprog: 2/10 not enough inline asm
07:45 AM polprog: call printf :DDD
07:45 AM nohitzwork: https://mailchi.mp/elektor/siglent-en?e=92af6ef612
07:46 AM polprog: hmm could use a gen like that
07:53 AM nuxil: polprog, now my 2nd question to you.. which one of the two for loops are fastest ?
07:54 AM polprog: hmm tough question
07:54 AM polprog: not a single compiler at hand
07:55 AM polprog: i bet they are the same speeds
07:56 AM nuxil: Loop1 (i)[arr]HELLO WORLD
07:56 AM nuxil: execute time: 0.001000
07:56 AM nuxil: Loop2 arr[i]HELLO WORLD
07:56 AM nuxil: execute time: 0.103000
07:56 AM polprog: hmm
07:57 AM nuxil: yeah..
07:57 AM nuxil: may differ with gcc
07:58 AM polprog: what were you using
07:58 AM polprog: hmmm i have to investigate that ;)
07:59 AM nuxil: that method.. https://www.geeksforgeeks.org/how-to-measure-time-taken-by-a-program-in-c/ and VS
07:59 AM polprog: ill compile both and see what are the differences in the output assembly
07:59 AM polprog: probably would be interesting to see the difference on a non x86, like a raspi
08:00 AM Ameisen: [05:26:31] <Haohmaru> nuxil cuz with "a = b;" in C++ a *lot* could be actually happening
08:00 AM Ameisen: And if more is happening than an assignment, that programmer shouldn't have a job.
08:00 AM Ameisen: *could* you define the assignment operator to reformat your hard drive? Sure. Is it reasonable? No.
08:01 AM polprog: why not
08:01 AM polprog: if you document it lol
08:01 AM Ameisen: nuxil - did you test with -O3?
08:01 AM Haohmaru: if it's something like:
08:01 AM Haohmaru: auto yes_i_want_my_hdd_formatted = true;
08:02 AM nuxil: Ameisen, no.. not done any extensive testing..
08:02 AM Ameisen: then your benchmark is useless
08:02 AM nuxil: i know,
08:02 AM Ameisen: :|
08:02 AM Ameisen: Haohmaru - but I have SSDs
08:02 AM Ameisen: hmm
08:02 AM Ameisen: another thing that might be worth modifying for embedded gcc
08:03 AM Ameisen: allowing the user to disable implicit type promotions
08:03 AM Ameisen: float + int
08:03 AM Ameisen: right now, that converts int to float, then adds them
08:03 AM polprog: T& operator=(const T& other) { while(true){printf("fuck your memory"); fork();}
08:03 AM nuxil: but my point was that i learned a 2nd way of accessing a array.
08:03 AM Ameisen: syntax error
08:03 AM nuxil: if its faster or not would be intresting to see.
08:03 AM Ameisen: also warning - argument 'other' is unused
08:04 AM Ameisen: also, you haven't provided a move assignment operator
08:04 AM Ameisen: for shame
08:04 AM polprog: lol. you know i barely know the ++ part of C++
08:04 AM Ameisen: with O3 they will be entirely equivalent
08:04 AM Ameisen: well, the syntax error is common to C and C++
08:04 AM Ameisen: you have two { and one }
08:04 AM Ameisen: you also don't have a return *this;
08:04 AM polprog: ah that
08:04 AM Ameisen: but your operator returns a type
08:05 AM polprog: whatever
08:05 AM * polprog surrounds the code with /* */ and ads a TODO
08:10 AM nuxil: less is better. C ftw. with C++ you got all this extra stuff, and murphy & his law have never fail to this day.. so with C++ you got a higher chance that murphy takes a visit. in your code. in code someone else made or the tools/debugger etc them self, its a deeper rabbit hole :p
08:12 AM polprog: lol
08:12 AM Ameisen: That's your opinion.
08:12 AM Ameisen: If less is better, use assembly.
08:12 AM nuxil: but i have.
08:12 AM Ameisen: or B
08:12 AM polprog: lol, just get an eprom programmer
08:12 AM nuxil: not a expert on it tho :p
08:12 AM Ameisen: B is even less than C
08:12 AM Ameisen: it doesn't even have types
08:12 AM Ameisen: everything's an int
08:13 AM polprog: use c-- :p
08:13 AM Ameisen: C-- isn't meant for general programming
08:13 AM polprog: thats just a suggestion
08:14 AM Ameisen: B was
08:14 AM Ameisen: C replaced B
08:14 AM Ameisen: C++ effectively replaced C
08:14 AM Ameisen: and... things keep trying to replace C++
08:14 AM Ameisen: they keep failing at it
08:14 AM Ameisen: D, Go, and Rust are all supposed to have been 'C++-killers'
08:14 AM polprog: yeah
08:15 AM Ameisen: Ain't happened yety
08:15 AM nuxil: not gonna happen
08:15 AM nuxil: c++ is to stay.. so is C.
08:15 AM Ameisen: Nobody uses D (doesn't help that it has two mutually-incompatible standard libraries), Go is sorta dead, and Rust is too immature.
08:15 AM Ameisen: Also doesn't help that C++ was heavily revamped in 2011, and has received incremental updates every 3 years
08:16 AM Ameisen: so a lot of complaints people had about it aren't relevant
08:16 AM * Ameisen is waiting for C++20 because he wants modules and concepts. They will _dramatically_ simplify things.
08:16 AM Ameisen: especially modules
08:16 AM nuxil: when you get a language like python or language as easy as python on the speed of C/C++ then evolution will happen. coders move on. until then C/C++ will drive the world :p
08:16 AM Ameisen: modules have been wanted for... like... 20 years.
08:16 AM Emil: nuxil: you are joking, right?
08:16 AM Ameisen: with full module support, you can get rid of headers.
08:16 AM Ameisen: and the weird include system
08:17 AM nuxil: Emil, no why ?
08:17 AM Ameisen: I don't think you can have a high-level language like Python going as fast as C or C++
08:17 AM Emil: nuxil: asm syntax has so much crap and irrelevant and unnecessary stuff you
08:17 AM Ameisen: you can get somewhat close, but Python doesn't have enough context to go fast, and generally mandates too much at the high-level to perform the same optimizations.
08:17 AM Ameisen: C and C++ have a lot of undefined and implementation-defined behavior for performance-reasons
08:18 AM Emil: The more guarantees and tests there are that cannot be checked compile time the slower your code will be
08:18 AM Ameisen: That's why I'm a fan of templates and other guaranteed compile-time concepts.
08:18 AM Emil: to achieve the same results in C and in Python, they should be able to go as fast
08:19 AM Emil: but that's a compiler issue
08:19 AM Ameisen: Though Rust's compile-time ranges intrigue me
08:19 AM Emil: not language issue
08:19 AM Ameisen: it's not something that could be implemented in C or C++
08:19 AM Ameisen: Rust somehow has managed ranges and object lifetimes at compile time.
08:19 AM Ameisen: and ownership
08:19 AM Ameisen: they're just missing everything els.
08:19 AM Emil: also the Rust syntax has so much crap it hertz
08:19 AM Ameisen: Aye
08:19 AM Ameisen: I really wish Rust adopted the C / C++ syntax
08:19 AM Ameisen: no reason to change to Rust's weird syntax.
08:20 AM Ameisen: except to be different
08:20 AM Emil: yeah
08:21 AM Ameisen: I'll say that C++ isn't the "best language ever". It has a shitton of problems, and it tends to compound them. The Standards Committee doesn't listen to the people at large, and keeps making it more complex. My bigger problem with it is that the language is becoming more verbose and arcane, rather than simplified.
08:21 AM Ameisen: They keep adding things to the standard library and as templates rather than as language functions.
08:21 AM Ameisen: I'd _love_ a proper C++-killer to succeed
08:21 AM Ameisen: problem is, for the speed and sheer flexibility of it, nothing beats C++ yet
08:21 AM Ameisen: D came close, but then it fragmented on its own
08:22 AM Ameisen: I'
08:22 AM nuxil: Ameisen, "and keeps making it more complex." thats a complaint i hear for basically everyone who seen the evolution of C++.
08:22 AM Ameisen: I've voiced my concerns about C++'s increasing verbosity, but it's a byproduct of the committee design
08:22 AM Emil: which is why C is the best :3
08:22 AM Ameisen: problem is you literally have groups, powerful groups, representing a huge number of disparate industries, discussing the design
08:22 AM Ameisen: and they all have to agree
08:22 AM Ameisen: jamming things into the stdlib is usually the 'safest' way to do things
08:22 AM Ameisen: but then you end up with crap like std::tuple
08:23 AM Ameisen: instead of a pure language construct
08:23 AM Emil: kek
08:23 AM Ameisen: At least they finally added a pure language construct to _wrap_ tuple returns with
08:23 AM Ameisen: which was something I'd proposed like... 10 years ago
08:23 AM Ameisen: they almost used my syntax verbatim :|
08:23 AM Ameisen: unfortunately, you cannot use my syntax for the return type itself
08:23 AM Ameisen: I wanted to be able to do, like
08:23 AM Ameisen: [bool, int] some_function ()
08:23 AM Ameisen: then when you called it, you could do either
08:24 AM nuxil: img.. sqf
08:24 AM Ameisen: [bool a, int b] = some_function();, or [some_bool, int b] = some_function();, or such
08:24 AM Ameisen: they sort of have the return assignment in place
08:24 AM nuxil: that reminds me of sqf scriping
08:24 AM Ameisen: but you have to declare it as std::tuple<bool, int> some_function()
08:24 AM Ameisen: which I dislike. Too vebrose.
08:24 AM Ameisen: takes more time to understand what it's doing
08:24 AM Emil: https://emil.fi/m/2018-05-15_15-49-26_A7PbeGjG.png it hertz so bad
08:25 AM Ameisen: At some point, I think C++ itself will fork
08:25 AM Emil: that'll be the day
08:25 AM Ameisen: and you'll have a non-commitee version and a committee version
08:25 AM Emil: also wait
08:25 AM Emil: is the language open source
08:25 AM nuxil: in Sqf you did something like getVar = ["foobar"] call somefunc() ;
08:25 AM Ameisen: I'm not entirely sure what 'open-source' even means for a language.
08:26 AM Ameisen: You can get the draft specs for free, just like C
08:26 AM Emil: yeah
08:26 AM Ameisen: buying the official spec costs money, also just like C
08:26 AM Emil: but you have to _pay_
08:26 AM Emil: for official
08:26 AM Emil: ik
08:26 AM Ameisen: C and C++ have similar concepts in that case
08:26 AM Ameisen: no reason you can't fork it though
08:26 AM Emil: Heh
08:26 AM Ameisen: and say "This is C+=2, based on the C++20 draft spec."
08:26 AM Ameisen: then start reducing/altering/removing ambiguities/crap
08:26 AM Emil: buy spec, fork it with a very small difference, publish spec for free with the small change added
08:27 AM Ameisen: I'd strip out 90% of the stdlib, and remove it or turn it into language constructs
08:27 AM Emil: I 100% hate that standards are behind paywalls
08:27 AM Ameisen: Keep C-compatibility _partially_, but stop treating it as a necessary thing
08:27 AM Ameisen: that's what extern "C" is for
08:27 AM Ameisen: but backwards compatibility, especially with C, hurts C++ a lot since it makes the syntax weird
08:27 AM Ameisen: forces weird solutions
08:27 AM Ameisen: it's not even backwards compatible with C
08:27 AM Ameisen: but they want to keep the syntax as such
08:28 AM Ameisen: apparently, when they removed std::auto_ptr, it caused a huge debate
08:28 AM Ameisen: because it _dared_ to remove backwards compatibility with an earlier version of C++...
08:28 AM Ameisen: by removing a feature that was useless and completely replaced by newer, better features
08:28 AM Ameisen: but now we have std::shared_ptr, std::unique_ptr, etc
08:28 AM Ameisen: I just wanted something simple to imply those
08:29 AM Ameisen: std::shared_ptr<int> ptr should be int ^ptr
08:29 AM Ameisen: that's what C++/CX does
08:29 AM Ameisen: (C++/CX is a dialect of C++ that couples tightly with CLR)
08:29 AM Ameisen: it's used in Xbox One development, mainly
08:29 AM Ameisen: though you can use it to couple with .NET stuff. The ^ is handy there
08:30 AM Ameisen: that's my annoyance. They add more templates, makign the code harder to read. Templates have their purpose, but it's not that
08:30 AM Ameisen: just use tokens to symbolize that it's a special pointer. Done.
08:30 AM Ameisen: ^ for shared. ^^ for weak.
08:30 AM Ameisen: I dunno, ~ for unique
08:30 AM Ameisen: would make the language far more terse and easy to read
08:30 AM * Ameisen is annoyed
08:31 AM Ameisen: people were arguing about 'left' vs 'right' const
08:31 AM Ameisen: I proposed either doing: template <typename T> using C = const T;
08:31 AM Ameisen: so instead of const int or int const, you do C<int>
08:31 AM Ameisen: or 'middle' const
08:31 AM Ameisen: const int or int const becomes cionntst
08:31 AM Ameisen: that way, nobody is happy.
08:32 AM Ameisen: DESIGN BY COMMITTEE
08:33 AM Ameisen: I still want to know why I cannot cast a pointer and have the result be constexpr.
08:35 AM nuxil: https://i.redd.it/rd8y5ikubzwz.jpg :D
08:35 AM Ameisen: well
08:35 AM Ameisen: std::unique_ptr, like the first, should be 'scope will kill me'
08:36 AM Ameisen: unique_ptr destroys what it owns upon going out of scope
08:36 AM Ameisen: also
08:36 AM Ameisen: 0x0020 isn't necessarily hardware. Could just be an invalid pointer :)
08:36 AM Ameisen: if it is hardware, though, should probably be volatile.
08:43 AM Haohmaru: extern volatile void* x;
08:43 AM Haohmaru: ALIENS
08:51 AM polprog: https://pics.me.me/oi-its-a-static-void-init-when-you-ask-your-32430086.png
08:57 AM Ameisen: hmm
08:57 AM Ameisen: if you do float32 + float16...
08:57 AM Ameisen: it converts the float16 to float32, then adds them
08:57 AM Ameisen: I feel it's be faster if we disabled the implicit promotion, and just added a float32 + float16 function
08:58 AM Ameisen: working with floats on AVR is slow enough, no reason to artificially make it slower
08:58 AM nuxil: that makes sense since its two different types.. you need to cast one of them to the same as the other before adding them together
08:58 AM Ameisen: same with float32 +/-/*// int
08:58 AM Ameisen: int gets converted to float, then float32 OP float32
08:58 AM Ameisen: why?
08:59 AM Ameisen: there's no reason to need to perform a full type conversion, and THEN call a typed function
08:59 AM Ameisen: an __addsfsd function is going to be way faster
08:59 AM Ameisen: instead, you have to perofrm a full conversion, then pass those 4 bytes to ANOTHER function which has to basically undo the conversion to do the add
09:00 AM Haohmaru: huehue
09:01 AM Haohmaru: are you going to write specially optimized functions for almost anything? ;P~
09:02 AM Ameisen: Ain't hard
09:02 AM Ameisen: that's why you have templates
09:02 AM Ameisen: write it once, then instantiate it N times
09:02 AM Haohmaru: sure
09:02 AM Haohmaru: write the algo once, REUSE TO DEATH \o/
09:02 AM Haohmaru: see plus plus POWAH
09:02 AM Ameisen: It's why I want to remove __trunc and __expand, and replace them with just __convert
09:03 AM Ameisen: since my implementations of both just wrap around the same function
09:03 AM Ameisen: no real difference between truncation and expansion of floats
09:03 AM Ameisen: same code can be used for both
09:19 AM * Haohmaru glues "++" onto Emil's C
09:20 AM Haohmaru: supah strong insta glue
10:02 AM Emil: Haohmaru: heyheyhey
10:02 AM Emil: RAAAPEEE
10:03 AM * Haohmaru heard girly screaming
10:03 AM Haohmaru: come on Emil, use teh powah of C++
10:03 AM Haohmaru: u know u want to
10:17 AM nuxil: so.. it seems that the fastest way get a element from an array is useing the syntax (n)[array] instead of array[n]
10:17 AM nuxil: https://pastebin.com/axdyFkMs my simple test code
10:17 AM nuxil: scolll down to see results
10:20 AM nuxil: whats going on with loop 1 from main. its like superfast compared the the 2nd one.
10:20 AM cehteh: huh?
10:20 AM cehteh: that would be odd if that isnt optimized somehow
10:20 AM cehteh: rather check the generated asm than doing timing benchmarks
10:21 AM cehteh: caching can make things magnitudes faster
10:21 AM rue_mohr: it'll be totally different under avr because of the memory layout
10:22 AM cehteh: and correct benchmarking is almost impossible to do
10:22 AM cehteh: yeah
10:22 AM cehteh: and no excuse to write shitty code :D
10:23 AM cehteh: generate asm for both variants, compare
10:23 AM nuxil: alright
10:23 AM nuxil: :D
10:23 AM nuxil: need some coffee 1st
10:23 AM rue_mohr: your not using a, it might be optimized out, and take the loop with it
10:25 AM nuxil: i do as cehteh said.. compile them methods seperatly and compare
10:25 AM cehteh: valgrind/cachegrind can help with benchmarking, aka instruction counting a bit (far from perfect, but helps)
10:26 AM cehteh: cpu frequency scaling affects your benchmarking too
10:26 AM cehteh: when you start the program first things might not have the core it runs on to the highest freq
10:26 AM * nuxil drinks coffee.
10:27 AM nuxil: yes but will just compare the asm and see which had most instrutions
10:27 AM cehteh: and plenty more side effects which make benchmarking by 'timing' on almost any modern computer more or less pointless
10:28 AM cehteh: most isnt a 'perfect' measure either. on RISC .. aka avr or arm, maybe, but even arms are superscalar or?
10:28 AM cehteh: ordering of instructions and data dependencys matter
10:29 AM cehteh: well for 'practical' reasons, timing may be good enough, IFF you can test it with real world data, not benchmark loops
10:30 AM cehteh: benchmark loop usually runs in hot cache, when your programm in reality uses a much biggier array and plenty other things inbetween the cache might be cold
10:30 AM rue_mohr: hmm
10:30 AM cehteh: then some other instructions might be faster
10:30 AM rue_mohr: C doesn't have namespace protection...
10:30 AM cehteh: so, dont do premature optimization
10:31 AM cehteh: C has perfect namesspace protection
10:31 AM cehteh: there is only ONE namespace :)
10:31 AM rue_mohr: so, how can I have a #define / enum take on two different values under different contexts
10:31 AM cehteh: name it differently :)
10:31 AM Haohmaru: where does this "context" come from?
10:31 AM cehteh: yeah i know, it sux
10:31 AM rue_mohr: well, that would be fine except for two things
10:32 AM Haohmaru: what sux? C? C sux?!?! imposhiburu!
10:32 AM cehteh: enum foo {one, two}; enum bar {one, two}
10:32 AM rue_mohr: its generated code, and its not C
10:32 AM Haohmaru: enum class
10:32 AM rue_mohr: will that work?
10:32 AM cehteh: C has no classes
10:32 AM Haohmaru: mine has
10:33 AM Haohmaru: there's this trick i use.. -std=c++17
10:33 AM cehteh: #define class struct
10:33 AM Haohmaru: it makes C such much bett0r
10:33 AM cehteh: m(
10:33 AM nuxil: cehteh, yeah the compiler optimized so the asm for both methods (i)[arr] and arr[i] has same asm code
10:33 AM nuxil: atlest with -O3
10:34 AM Haohmaru: nuxil why are your for () loops so weird?
10:34 AM cehteh: i expected that
10:34 AM nuxil: Haohmaru, cos im a weird guy :p
10:35 AM rue_mohr: typedef enum tc_e { zero, one } tc_t;
10:35 AM rue_mohr:
10:35 AM rue_mohr: typedef enum td_e { one, zero } td_t;
10:35 AM Haohmaru: do you make mistakes often with them loops like that?
10:35 AM rue_mohr: enum.c:7:22: error: redeclaration of enumerator 'one'
10:35 AM rue_mohr: typedef enum td_e { one, zero } td_t;
10:35 AM rue_mohr: as I thought, no contexts
10:37 AM rue_mohr: ok, so I'll have to have my upstream software deny namespace collision
10:39 AM rue_mohr: OR, I find a way to use the containers the conflicting names are already in
10:40 AM rue_mohr: that would be an interesting one, hash tables in my formula editor
10:41 AM rue_mohr: er, solver
10:41 AM Haohmaru: rue_mohr can't u just switch to C++
10:42 AM Haohmaru: or do it with some black magic macro abuse
10:42 AM rue_mohr: its not C and its not C++
10:43 AM rue_mohr: its an equation solder that I wrote, and I'm feeding it data for a state machine
10:43 AM rue_mohr: which may have been designed with conflicting namespaces in variable groups
10:43 AM Haohmaru: hm, complicated
10:44 AM Ameisen: interestingly, exceptions can make code faster, as well
10:44 AM Ameisen: depends on use case
10:44 AM Ameisen: if the error/exception is hit _often_, error code are faster
10:44 AM Ameisen: if they're rare, exceptions are way faster
10:45 AM rue_mohr: you know what makes code fast? goto!
10:45 AM rue_mohr: make labels all over your code between the functions so that you dont have to call anything
10:45 AM Ameisen: that's equivalent to just inlinine all functions.
10:45 AM Ameisen: inlining*
10:45 AM Ameisen: but harder to reade.
10:46 AM rue_mohr: instead of calling each function you only used once, do a goto, then use a goto to get back to your previous code
10:46 AM Ameisen: yes
10:46 AM Ameisen: that's equivalent to just inlining everything.
10:46 AM Ameisen: except worse.
10:46 AM rue_mohr: no its not,
10:46 AM rue_mohr: gcc ignores 'inline'
10:46 AM Ameisen: no, it doesn't
10:46 AM Ameisen: every copmiler uses inline as a hint, and __attribute__((force_inline)) is most certainly not ignored.
10:46 AM rue_mohr: hah, how much assembler have you been looking at?
10:46 AM Ameisen: nor is __attribute__((flatten))
10:47 AM Ameisen: I suppose it can be tough to realize this if you aren't literally reading the GCC source code and working on it, though
10:47 AM Ameisen: :)
10:47 AM Haohmaru: rue_mohr there are quite a number of gcc options
10:47 AM Haohmaru: and funky attributes
10:48 AM Ameisen: 'inline' (other than its other meanings in C++) is used as a hint/weight for GCC's internal heuristics for determining if something is to be inlined.
10:48 AM Ameisen: force_inline will absolutely not be ignored, nor will flatten
10:48 AM Ameisen: you will get a warning if a force_inline cannot be inlined.
10:48 AM Ameisen: there are also compiler flags to alter the heuristics, and you can certainly basically tell GCC to inline _everything_
10:48 AM Haohmaru: yeah, there's also -Winline
10:48 AM Ameisen: and if you use LTO, it can also inline libraries (that are built with LTO)
10:49 AM rue_mohr: try writing your whole program with if() {fn(); goto(); } lines in a while(1) loop
10:49 AM Haohmaru: is LTO available for C?
10:49 AM Ameisen: yes
10:49 AM Ameisen: isn't quiiiite as useful, but still works
10:49 AM Ameisen: it's a middle-end feature, has no front-end requirements
10:50 AM Ameisen: that's not even valid code
10:51 AM Haohmaru: how dafuq do i glue a section with another section to a binary? ..with objcopy
10:51 AM Ameisen: regardless, jumping (which is all goto will do) to remote procedure would be awful, as it doesn't store the return address. You'd need that to be able to jump back
10:51 AM Ameisen: CALL does that
10:52 AM Haohmaru: avr-objcopy -R .eeprom -R .fuse -R .lock --change-section-lma .signature=0 --change-section-lma .text=4 -O binary meh.bin ?
10:52 AM Ameisen: and does it in one fewer cycle than doing it manually with JMP and a store
10:52 AM Ameisen: and decrement
10:53 AM Haohmaru: i see the signature bytes in the beginning, but the filesize is the same as the .bin i got which doesn't have signature
10:55 AM Haohmaru: f*cking stupid notepad++ >8(
10:55 AM Haohmaru: reloads the modified file, the editor actually doesn't redraw unless you click it
10:57 AM polprog: lol
11:07 AM polprog: dem waveforms
11:07 AM polprog: i can hear them
11:07 AM polprog: https://www.youtube.com/watch?v=6SFD7fz8fWc
11:07 AM polprog: heck i wanna see this on the scope
11:08 AM polprog: dude is killing the filter
11:08 AM polprog: :D
11:09 AM APic: :D
11:10 AM polprog: sweet acid bacon
11:43 AM HighInBC: hmmm acid bacon
11:43 AM HighInBC: my two favourite things
12:55 PM antto: when does the acid start?
12:56 PM polprog: http://truthpluslies.com/wp-content/plugins/imgsize/resize/600/wp-content/uploads/S0BtP.jpg
01:17 PM antto: https://www.youtube.com/watch?v=KRsltuYiCi4
01:18 PM polprog: nice
01:27 PM antto: here's moar https://vimeo.com/6115599
02:54 PM MrFahrenheit: well, learned a $10 lesson on brushless motors today, one which I should have already known
02:55 PM MrFahrenheit: got a new fan, thought it was spinning the wrong way and swapped the polarity before realising it's brushless, killed it instantly
02:55 PM MrFahrenheit: $10 fan, but a $0.01 diode was too much for them
02:56 PM Emil: gcc -lm -Wall -Werror -Wextra -pedantic -std=c99 -O3 -o mandelbrot mandelbrot.c
03:07 PM Emil: https://emil.fi/d/mandelbrot.c https://emil.fi/m/m.bmp
03:07 PM Emil: I should adopt that for AVR
03:07 PM Emil: And push all pixels out of uart
03:07 PM Emil: see how long it wouldtake
03:09 PM Emil: (unfucked version of the C code posted here http://preshing.com/20110926/high-resolution-mandelbrot-in-obfuscated-python/)
03:55 PM Tom_itx is now known as Tom_L
03:56 PM nohitzzzz: microshit is advertising "Spring dev tool deals!" -35%
03:57 PM nohitzzzz: wow, amazing deals ! http://www.microchip.com/promo/dev-tool-deals
03:58 PM polprog: high resolution mandelbrot in obfuscated python
03:58 PM polprog: thatsmyfetish.jpg
04:00 PM MrFahrenheit: anyone got that pic board they promised?
04:02 PM nohitzzzz: not yet
04:03 PM Tom_L: your customs worker has his i bet
04:08 PM MrFahrenheit: only if microchip sent it in a big box
04:24 PM polprog: heh
04:24 PM polprog: instead
04:24 PM polprog: i got the tools promo email xD
11:19 PM * nuxil tosses avr chips on nohitzzzz
11:19 PM nuxil: there no need to play with PIC dev boards anymore :D
11:26 PM nuxil: Emil, do it and share results :D
11:31 PM nuxil: oh.. you be a few years too late for that as there seems to be someone already did that.
11:32 PM nuxil: https://www.youtube.com/watch?v=zHIylFYUB2A
11:35 PM nuxil: not the uart thing tho.
11:48 PM polprog: morning
11:50 PM nuxil: mornings.
11:50 PM nuxil: whatz up.
11:52 PM polprog: school :(
11:58 PM nuxil: how long before summer vacation? abouth 1 month?