pouët.net

Go to bottom

Extended Instruction Set

category: code [glöplog]
What kind of cpu instruction you'd like to have and why?

Come up with any super useful, crazy or just silly stuff, but keep it sort of realistic.

Here is an example: instruction that applies mask to some data so result is all the masked bits gathered on the right(or left I don't care).

0x01011101(data)
0x01100101(mask)
0x00001011(result)

See? It's first, third, sixth and seventh bit of data on the right(for sake of it) in the result.
The problem is I don't know where or why to apply that yet.
added on the 2013-01-10 16:58:16 by a13X_B a13X_B
fld dword st(0),eax
fst eax,dword st(0)

I would've killed for these.
added on the 2013-01-10 17:15:05 by Gargaj Gargaj
one more index register on the 6510 could make wonders
added on the 2013-01-10 17:42:25 by Oswald Oswald
The ARM cpu instructions is just fine, it's the most elegant to code in assembly with...
http://en.wikipedia.org/wiki/ARM_architecture
added on the 2013-01-10 17:54:29 by baah baah
You only need one instruction: http://en.wikipedia.org/wiki/One_instruction_set_computer
added on the 2013-01-10 19:46:55 by Scali Scali
Sounds like this thread
added on the 2013-01-10 20:26:19 by MsK` MsK`
Currently: A cordic instruction:

if (carry)
{
dest += arg1 >> arg2;
} else {
dest -= arg1 >> arg2;
}

That would help *lots* in complex numbers rectangular to polar conversion and vice versa.

Could also do super fast fixed-point sin/cos/sqrt/atan2/log/exponent
added on the 2013-01-11 00:36:40 by torus torus
Reason is; I execute lots of these in a tight loop:

Code: static const sInt atantab[19] = { 0x0000c910, 0x0000c910, 0x0000c910, 0x000076b2, 0x00003eb7, 0x00001fd6, 0x00000ffb, 0x000007ff, 0x00000400, 0x00000200, 0x00000100, 0x00000080, 0x00000040, 0x00000020, 0x00000010, 0x00000008, 0x00000004, 0x00000002, 0x00000001, }; #define scaleK 0x00004dba void cordicXY2RT ( int x, int y, int *r, int *theta) { int i; int z = 0; for (i=0; i<16+3; i++) { int xa,ya; int angle = atantab[i]; int shift = i-2; if (shift < 0) shift = 0; ya = y >> shift; xa = x >> shift; if (y < 0) { x -= ya, y += xa, z -= angle; } else { x += ya, y -= xa, z += angle; } } *r = fixmul16 (x, scaleK); *theta = z; }


Add coordinates (complex numbers) in x,y, get sqrt(x*x+y*y) as well as atan2(y,x) in r and theta back.

added on the 2013-01-11 00:48:37 by torus torus
NOP
added on the 2013-01-11 01:10:11 by xernobyl xernobyl
MsK', but this time you aren't constrained by 8 bit. Go wild!

xernobyl, absolutely implementing that one.
added on the 2013-01-11 03:20:05 by a13X_B a13X_B
A single cycle NOP on 6502.
added on the 2013-01-11 10:12:13 by Tjoppen Tjoppen
a "traverse kd-tree node"-instruction would be neat!
added on the 2013-01-11 11:03:14 by kusma kusma
Quote:
a "traverse kd-tree node"-instruction would be neat!
hahahahahaaa!!
added on the 2013-01-11 11:15:49 by ferris ferris
Doc.K. told me about a funky intruction on the KC85 series which is called "PUSE", mnemonic for "Punkt setzen" ( set point, a.k.a. draw pixel: X,Y,Colour ). That'd be a great instruction to have when dealing with bitplanes.
added on the 2013-01-11 12:02:08 by d0DgE d0DgE
What kind of sick fuck prefixes a binary number with 0x?
added on the 2013-01-11 12:08:29 by skurk skurk
.. better than prefixing it with (______0______)
added on the 2013-01-11 12:34:21 by trc_wm trc_wm
skurk, because I mix 'em up all the time. Is it 0000f, no, must be something else.

trc_wm, I like the idea, but that would be ternary.
added on the 2013-01-11 13:57:16 by a13X_B a13X_B
I'm with Gargaj :)

Quote:

fld dword st(0),eax
fst eax,dword st(0)
added on the 2013-01-11 14:17:37 by bp bp
I'd be completely satisfied with fmov st(0), 0.4535902f
added on the 2013-01-11 14:29:00 by Preacher Preacher
The CPU would have an array of 4x4 8bits registers, and can do all logic & arithmetic with 8, 16, 24, 32 bits, say A[0] = op(A[1], A[2]. In case of 16 or 24 bits, it does it for any pair/triplet of 8 bits registers. And of course with conditional executions for each instructions, ARM style. That would allow some very dense routines.
What about a single-byte instruction that displays a cool demo? :)
added on the 2013-01-11 16:24:12 by Adok Adok
cache levels got big. how about explicit process cache page/window and load/store instructions and "fire and forget" batch memory writeback operations. also fpu to sse and general register moves. yeah.
added on the 2013-01-11 17:09:29 by yumeji yumeji
hardware GC
added on the 2013-01-11 18:33:41 by ponce ponce
Quote:
Doc.K. told me about a funky intruction on the KC85 series which is called "PUSE", mnemonic for "Punkt setzen" ( set point, a.k.a. draw pixel: X,Y,Colour ). That'd be a great instruction to have when dealing with bitplanes.


You might like a certain "bset" instruction too. Almost as simple to use as the PUSE instruction for drawing pixels. Emphasis on almost. :)
added on the 2013-01-11 20:05:39 by StingRay StingRay
cws (Cube with scroller)
added on the 2013-01-11 20:44:29 by FreeFull FreeFull

login

Go to top