Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: March 29, 2024, 4:58 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bit flipping
#25
RE: Bit flipping
(April 24, 2016 at 5:42 am)pocaracas Wrote:
(April 24, 2016 at 4:46 am)Cthulhu Dreaming Wrote: These are common in C (specifically the gcc compiler) , and they work exactly the same as ordinary functions - by the time they go from thr pre-compiler to the compiler, they are ordinary functions.

What language/compiler are you talking about?
C++, it was.
And the purpose of it was to prevent function calls, added stack, and variable copying/passing.
We may think of those as "fast" events, but when every CPU cycle is precious, any trick is valid... Even if the CPU is an Octa-core, with hyperthreading and churning at some 3.6 GHz (a Xeon, I think it was).


Quote:The weirdest thing I've ever seen is everything written in Perl, ever, that was not used for listing rubbish.  I have had to wrote - not by choice - far more Perl than I would wish to admit to.

I've only had to adapt a simple script in Perl, so I can't say much about it.

I'm guessing those pre-processor macros define inline functions - from what you've described.

I never personally got into C++, I did a little bit professionally but I'm far from expert. I would guess 80% of my career has been ANSI C, with most of the rest being Perl and Java.

I definitely agree that in your line of work avoiding a couple of stack operations, etc should be eschewed for keeping it in registers. I can imagine you have data analysis jobs that take hours or days to run. Every optimizion counts when you iterate over that much data.

Of course you already know this, this is more meant for other readers.
Reply



Messages In This Thread
Bit flipping - by SteelCurtain - April 23, 2016 at 10:30 pm
RE: Bit flipping - by SteelCurtain - April 23, 2016 at 10:40 pm
RE: Bit flipping - by SteelCurtain - April 23, 2016 at 11:04 pm
RE: Bit flipping - by Jackalope - April 23, 2016 at 11:30 pm
RE: Bit flipping - by SteelCurtain - April 23, 2016 at 11:37 pm
RE: Bit flipping - by Jackalope - April 23, 2016 at 11:45 pm
RE: Bit flipping - by Tiberius - April 23, 2016 at 11:40 pm
RE: Bit flipping - by I_am_not_mafia - April 24, 2016 at 3:22 am
RE: Bit flipping - by SteelCurtain - April 23, 2016 at 11:42 pm
RE: Bit flipping - by Tiberius - April 23, 2016 at 11:55 pm
RE: Bit flipping - by SteelCurtain - April 24, 2016 at 12:01 am
RE: Bit flipping - by SteelCurtain - April 24, 2016 at 12:05 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 1:19 am
RE: Bit flipping - by SteelCurtain - April 24, 2016 at 1:46 am
RE: Bit flipping - by ErGingerbreadMandude - April 24, 2016 at 3:04 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 3:10 am
RE: Bit flipping - by ErGingerbreadMandude - April 24, 2016 at 3:22 am
RE: Bit flipping - by I_am_not_mafia - April 24, 2016 at 3:34 am
RE: Bit flipping - by pocaracas - April 24, 2016 at 3:41 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 4:46 am
RE: Bit flipping - by pocaracas - April 24, 2016 at 5:42 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 7:21 am
RE: Bit flipping - by pocaracas - April 24, 2016 at 7:38 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 7:42 am
RE: Bit flipping - by I_am_not_mafia - April 24, 2016 at 7:28 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 4:57 am
RE: Bit flipping - by I_am_not_mafia - April 24, 2016 at 4:03 am
RE: Bit flipping - by SteelCurtain - April 24, 2016 at 4:10 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 7:25 am
RE: Bit flipping - by Jackalope - April 24, 2016 at 7:41 am
RE: Bit flipping - by Alex K - April 25, 2016 at 8:59 am
RE: Bit flipping - by J a c k - April 25, 2016 at 12:12 am
RE: Bit flipping - by bennyboy - April 25, 2016 at 8:09 am
RE: Bit flipping - by I_am_not_mafia - April 25, 2016 at 8:24 am
RE: Bit flipping - by bennyboy - April 26, 2016 at 4:56 am
RE: Bit flipping - by KevinM1 - April 26, 2016 at 9:52 am
RE: Bit flipping - by pocaracas - April 26, 2016 at 9:55 am
RE: Bit flipping - by SteelCurtain - April 25, 2016 at 8:12 am
RE: Bit flipping - by SteelCurtain - April 25, 2016 at 8:42 am
RE: Bit flipping - by Angrboda - April 25, 2016 at 10:38 am
RE: Bit flipping - by KevinM1 - April 25, 2016 at 10:32 pm
RE: Bit flipping - by bennyboy - April 26, 2016 at 4:48 am

Possibly Related Threads...
Thread Author Replies Views Last Post
  Coin Flipping Poll Tiberius 15 5133 April 19, 2010 at 1:00 pm
Last Post: Violet



Users browsing this thread: 1 Guest(s)