Conversation

i just realized id love to have a signed 1 bit type actually. something whose only values are 0 or -1 is actually very useful as a factor, and very easy to translate to the values 1 and -1, an even more useful factor

2
1
0

0 or -1 would be a great factor for creating kernel side linux syscall return values which are often either 0 or the additive inverse of an errno. coercing a bool to 1 or -1 is seemingly useful enough that i keep having to do it but i cant remember any specific place i use it

1
1
0

'multiply sign extended bool bitwise-and constant with value and conditional branch on result' is an instruction i keep wishing i had

2
1
0

@mothcompute the logical conclusion of IEE754 is 2-bit “float”: representing -1, 1, 0 or NaN

1
0
0

honestly i might try implementing this on zen 2 if i can find an appropriate instruction to override

2
1
1

@mothcompute @chfour

I would really like to know how your ideal ISA would look like.

1
0
0

@sudo200 @chfour generally speaking i believe in cisc design principles, so without a doubt variable length, lots of orthogonality, and a lot of compound instructions. but unlike x86 the instruction stream would be self synchronizing, which makes it much easier to decode instructions and fetch and sequence microoperations ahead of execution

2
0
0

@sudo200 @chfour cpus have done predecode for decades now but i think with higher level source machine code and self synchronization that lets you get away with much more intelligent and of course much more parallel reordering, and in ideal cases the ability to do the entire decode step for an instruction page ahead of execution, whereupon you can simply copy them verbatim into the pipeline without actually decoding anything in realtime. the catch is it uses a whole lot of power and die space

1
0
0

@sudo200 @chfour i think in many respects cisc machine code is simply ir, so the more symbolic and less literal it is the better chance you get at runtime to optimize it for the underlying silicon, which is really all compilers do

0
0
0

@mothcompute @chfour

Interesting. I have a MISC ISA spec (if you can call it that) laying about somewhere, which is basically the exact opposite

1
0
0

@mothcompute @chfour

I mean, it is literally designed to be as absolutely minimal and simple as possible, but still

0
0
0

@mothcompute

Yeah, just casually writing your own microcode.

I feel inadequate to be around you now tbh.

1
0
0

@sudo200 honestly i learned everything i know about amd microcode out of two pdfs and five markdown files; im not sure its that far out of reach if youre interested in learning it

2
0
0

@domi @mothcompute this reminds me of the boolean with three states I saw in a production codebase: true, false and undefined

1
0
0

@LilaHexe @domi ive seen stuff like that before and i always wonder if theyve just never heard of ternary logic or something

0
0
1

@mothcompute @chfour this reminds me. my main pc is a 3700X now. and i have a spare 3600 after an upgrade

… you know. maybe i really should look into it. I wonder how much shenanigans could I get away with

1
0
0

@domi @chfour if nothing else its worth it for access to the architectural 'machine segment,' which seems to have unprotected read-write access to not just msrs but also maybe like. cache and various internal state variables and microcode and stuff maybe?

1
1
1

@mothcompute @chfour you know. i really want to run windows 95 inside the cache. there’s enough of it

3
0
0

@mothcompute

That sounds a lot simpler than I expected. Yes, I would be interested in redefining what my CPU does

0
0
0

@domi @mothcompute @chfour coreboot weekend project /j

0
0
1

@domi @chfour i do assume that would be harder just since windows likely assumes (otherwise rightly so) that any page it flushes will be valid targets for an isa or pci dma operation, and so probably doesnt tag such pages explicitly in a way that a cache only system could differentiate automatically

1
1
0

@domi @chfour i have no idea about this though ive never looked into it

1
1
0

@domi @chfour though if you were to do it under svm and simply trap any device accesses that might work...

0
1
0
@domi @mothcompute @chfour unfortunately I don't think modern AMD supports cache-as-RAM (PSP does raminit instead)
2
0
0
@mothcompute @sudo200 could you link those files? I'm interested in learning it (although the only CPUs that can load unsigned microcode that I have are sky/kaby/coffee lake, I'm not sure how much would be applicable to those)
1
0
0

@noisytoot @domi @chfour i mean. write back cache with flushes disabled would do the job, and the assumption here is we have control over both micrododed instructions and the ms segment, which i would hazard to guess needs to be able to manually configure cache in order to perform certain cache coherency and platform integrity related operations

0
1
0

@noisytoot @sudo200 if you can find yourself a copy of the companion cd for anatomy of a high performance microprocessor it has a (seemingly prerelease?) pdf version of the book

0
0
0

@noisytoot @mothcompute @chfour you should read the rest of the thread

there’s no reason this can’t be done if I have microcode exec

0
0
0