Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

eschaton posted:

I’ve been writing some plain ANSI C89 (with sprinkles) for fun and it’s honestly really fun and refreshing

the sprinkles are // end-of-line comments, <stdint.h>, and free conversion between pointer types and uintptr_t/intptr_t, which is no big deal because I don’t expect this code to ever run on a Lisp Machine or an old Burroughs mainframe—even though I could

also I’m writing my tests in ObjC with XCTest because it’s convenient to do that and use Xcode for my development, but I’m not doing anything that wouldn’t work in either MOW or THINK C on my Mac IIci in 1991

Yeah it's good. Even the ancient compilers I'm working with support an extension for // comments

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

redleader posted:

the compiler's understanding of undefined behaviour has gotten more complex, and now the code doesn't work

that’s why if you live in hell they specify which ancient compiler and set of flags you’re required to use

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Bloody posted:

that’s why if you live in hell they specify which ancient compiler and set of flags you’re required to use

Nice of them to specify them rather than make your read the foreign language manuals

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
the one non-O flag which may make sense to add to things you're building for personal use is -march=native, which makes it target your cpu rather than very old ones and sometimes meaningfully improves performance

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
yeah linux is very held back by its minimum cpu targets, especially on i386. some of that is even baked into the abi, like fp values being returned in x87 registers. turns out being able to use the last thirty years of isa improvements is pretty good

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
i think you'll find the possibilities are rather limited

Kazinsal
Dec 13, 2011

Internet Janitor posted:

i think you'll find the possibilities are rather limited

yeah, limited only by your imagination

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

rjmccall posted:

yeah linux is very held back by its minimum cpu targets, especially on i386. some of that is even baked into the abi, like fp values being returned in x87 registers. turns out being able to use the last thirty years of isa improvements is pretty good

so what you’re saying is, the gentooers are right

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Kazinsal posted:

yeah, limited only by your imagination

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
if x86 mov is turing-complete why not nop

mystes
May 31, 2006

I'm not ready to go all the way to no code but I'm willing to hop onboard with the slow code movement

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

mystes posted:

I'm not ready to go all the way to no code but I'm willing to hop onboard with the slow code movement

baby steps

Bloody
Mar 3, 2013

mystes posted:

I'm not ready to go all the way to no code but I'm willing to hop onboard with the slow code movement

ah, a python programmer

feedmegin
Jul 30, 2008

rjmccall posted:

yeah linux is very held back by its minimum cpu targets, especially on i386. some of that is even baked into the abi, like fp values being returned in x87 registers. turns out being able to use the last thirty years of isa improvements is pretty good

Good thing things are mostly x86-64 now where at least you get SSE2...

(is i386 even much of a thing these days other than seriously legacy stuff? Especially with Linux? I can't imagine it being my first choice for e.g. embedded anything these days, we seem to mostly moved on from using DOS for that sort of thing)

feedmegin fucked around with this message at 14:45 on Oct 6, 2023

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

having SSE2 available for passing vector values is nice but floating point ones are just passed in memory for AMD64 now, right? I don’t know how L1$ operations compare to x87 registers in terms of performance these days, tbh

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Subjunctive posted:

having SSE2 available for passing vector values is nice but floating point ones are just passed in memory for AMD64 now, right? I don’t know how L1$ operations compare to x87 registers in terms of performance these days, tbh

there are three major x86_64 calling conventions: the windows default cc, the unix default cc, and windows __vectorcall. all three pass scalar fp arguments and return values in xmm registers

the default windows convention passes vector arguments indirectly, and both windows conventions needlessly exhaust registers when you declare a parameter of a different type. i do not know why microsoft is so bad at designing calling conventions

feedmegin
Jul 30, 2008

Subjunctive posted:

having SSE2 available for passing vector values is nice but floating point ones are just passed in memory for AMD64 now, right? I don’t know how L1$ operations compare to x87 registers in terms of performance these days, tbh

A vector of length 1 is still a vector.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
yeah, abis don’t do it that way

akadajet
Sep 14, 2003

feedmegin posted:

A vector of length 1 is still a vector.

sorry but I flunked pre-calculus

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

rjmccall posted:

the default windows convention passes vector arguments indirectly, and both windows conventions needlessly exhaust registers when you declare a parameter of a different type. i do not know why microsoft is so bad at designing calling conventions

the main reason early UNIX 68K compilers wound up burning address and data registers was because they were adapted from PDP-11 compilers and the -11 only has general registers r0-7, not distinct a0-7 and d0-7, and it’s easier to just keep a bit per register as to whether to use an a or d in the generated assembly…

who the gently caress knows what MS’s excuse for x86-64 codegen burning registers is

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

rjmccall posted:

yeah, abis don’t do it that way

you know full well ABIs do all sorts of crazy poo poo

OS-9/68K’s syscall ABI uses the TRAP instruction, but instead of putting a selector code in D0 like most 68K OSes, or using illegal instruction dispatch like Apple and Atari, you put the selector directly in the instruction stream immediately after the TRAP instruction

the dispatcher then fetches it from memory instead of having it already in a register, and has to fix up the program counter prior to exit from the kernel as well

disassemblers have to know about this to avoid bogus disassembly

the really funny thing is, this is basically what SOS on Apple III and ProDOS on Apple II does, specifically because of the super-small stack on 6502 (one 256-byte page, not relocatable, no separate supervisor or interrupt stack)

neither 6809 nor 68000 needs that because they both have separate, relocatable supervisor and user stacks

eschaton fucked around with this message at 12:29 on Oct 7, 2023

JawnV6
Jul 4, 2004

So hot ...
my knowledge is hopelessly out of date, but I recall the x87 registers having a huge penalty? perhaps it's just when you try to switch back and forth between that and the XMM/YMM stuff, but I really thought that nuked the pipeline at some point

Kazinsal
Dec 13, 2011
the x87 registers are a pain in the rear end because the x87 is actually a stack machine, a lot of the operations depend on that. the biggest penalty they have is if you're using MMX instructions because they use the same physical registers

codegen for them is just absolutely atrocious too because of the additional instructions needed to deal with the fact that they're 80 bits wide

Sapozhnik
Jan 2, 2005

Nap Ghost
more accuracy is better, right?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
all the mmx instructions immediately invalidate the entire x87 stack in a way that will cause any subsequent x87 instruction to trap. to use x87 again you have to clear the mmx state with the emms instruction. emms is pretty fast on amd but, for some reason, on intel cores it has always varied between “weirdly expensive” and “insanely expensive”. for example, agner fog says that on broadwell emms has 31 cycle latency. i assume amd is renaming fp/mmx state and intel just does it modally and has to stall. in any case it was a huge self-own that pretty much killed mmx

rjmccall fucked around with this message at 02:02 on Oct 18, 2023

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
once again the Motorola 68000 series demonstrates its supremacy among 80s CISC architectures

imagine what an equivalent amount of work as what Intel put into x86 could have achieved

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

eschaton posted:

once again the Motorola 68000 series demonstrates its supremacy among 80s CISC architectures

imagine what an equivalent amount of work as what Intel put into x86 could have achieved

I am, all day, every day, continuously pouring one out for the i432

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
i guess the x87 stack is an 80’s mistake. mmx re-using those registers is a completely separate 90’s mistake. emms being slow as gently caress is an 00’s and 10’s mistake. intel is a pretty bad steward

CPColin
Sep 9, 2003

Big ol' smile.
More like unintel

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
i always wonder what we'll look back on in 20 years and say "what the gently caress were we thinking" about

Kazinsal
Dec 13, 2011

rotor posted:

i always wonder what we'll look back on in 20 years and say "what the gently caress were we thinking" about

legacy x86 boot paths. CSM was supposed to be phased out by 2020, but every new board still has it, sometimes enabled by default. in 2040 you will likely still be able to boot a PC into a simulation of a 5150

also probably IPv6, which is now 25 years old and, despite being supported by pretty much every network stack out there, has minimal adoption due to the complexity inherent in making an IPv6 switchover for hundreds of billions of devices happen

Soricidus
Oct 21, 2010
freedom-hating statist shill
the problem with ipv6 is that they tried to change too much at once. if they’d just made ipv4 with longer addresses, we’d have been using it exclusively for years now

mystes
May 31, 2006

Soricidus posted:

the problem with ipv6 is that they tried to change too much at once. if they’d just made ipv4 with longer addresses, we’d have been using it exclusively for years now
wouldn't that still have broken all existing hardware which seemed like the main issue?

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
i actually don't have any problems with ipv6 except the longer addresses

Kazinsal
Dec 13, 2011

Soricidus posted:

the problem with ipv6 is that they tried to change too much at once. if they’d just made ipv4 with longer addresses, we’d have been using it exclusively for years now

"bolt another two octets on" would have worked just fine

instead they looked at the IPX/SPX addressing scheme and went "we can make this even more hosed up!"

mystes posted:

wouldn't that still have broken all existing hardware which seemed like the main issue?

it would have made a 6-to-4 implementation waaaay easier at the very least, but we'd still have adoption issues due to the need to at some point say "on this day, IPv4 stops working", which, lol

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Kazinsal posted:

"bolt another two octets on" would have worked just fine

i feel like just doubling it would be better. six octets sounds bad. eight octets sounds right.

Kazinsal
Dec 13, 2011
also class E addresses never got unreserved so we're just wasting a quarter of a billion IPv4 addresses because people were concerned circa 1998 that their vintage Cisco Gateway Server wouldn't know what to do with a class E address

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Kazinsal posted:

"bolt another two octets on" would have worked just fine

completely agreed

apart from looking ugly as gently caress, just parsing ipv6 address formats is moderately complex, and that complexity (and its attendant bugs) is reflected an untold number of times across libraries and applications

utterly unnecessary yak-shaving in the standard has cursed everything it touches

Adbot
ADBOT LOVES YOU

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
so like what happened to ipv5? are we just not gonna talk about that at all?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply