# redacted

This topic is 4932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

redacted [Edited by - Nice Coder on November 12, 2008 10:38:28 PM]

##### Share on other sites

a MAP or Translate

input 1
data a count and array of size count+1 (first or last is out of range default)

output is set to value in array corresponding to the input position in the array.

(secondary use if for offset jumps (like a switch/case statement) and the values are address/relative offset

What is this for ??
Simple is fine for a superscalar RISC but terrible for a interpretor language.

Mult (not just power of 2 -- shifts)

Min/Max ??

ABS

Not having sub makes doing compare > = = <

##### Share on other sites
How do you use constants in the middle of your program?
Could it be as simple as in normal asm? Or do you have to explicitly insetr constant in the register?

Quote:
 Original post by Nice CoderMin/Max, i'm looking for a good version for these

x - y = x + (-y) = x + (inv(y) + 1) = (x+1) + inv(y)
So the program (assuming we have to explicitly insert mask into register):

minmax(x,y):
x is in #1
y is in #2

clock1:
#3 INC #1
#4 INV #2
clock2:
#4 is 0x80000000
clock3:
#3 AND #3 #4
clock4:
#1 SetEvar #3 #4 #2
#2 SetEvar #3 #4 #1

That if you can use banks in parallel.
/def

##### Share on other sites
Quote:
 Original post by Nice CoderWhich instructions would you require as absolutely essential/Really useful for doing things very quickly. (ie. something like SUM).Currently i've got (all int i'm afraid. i got no idea how to do floating point arithmatic in hw).Add (no sub)InvInc (INV + INC = NEG, so if you have -210, you INV it, then INC it to turn it into 210. Is inc really nessisary?)Sum (just for performance, four inputs, one output. Out = in1 + in2 + in3 + in4)Gbarrel (two inputs, and you determine wether your shifting right or left by using the lsb.)Lshift (same thing, just a required shift direction)RshiftAnd (you can't get away from these)OrXor SetEvar (Pretty much, if x == y, then set its output to Z. Three input)SetNvar (Same thing just x != y)Set (just output = input)Importaint - These are the jumps as well. Instead of jmp 210, you would use #Pc set 210)Am i missing anyhing massively importaint?From,Nice coder

okay, subtract can [and usually is] be implemented using an adder combined with a bit to invert all of the parts of one input

so now you can do invert

but still you have the adder attached, you can do invert and increment in the same cycle

I don't belive you'd often add many inputs like that [in sum]

... I don't understand gbarrel, yes a set would be important. the pentium 4 has conditional loads and stores...

I think I missed something fundamental

##### Share on other sites
Didn't quite catch your explanation about data segments. Could you explain it more?

Quote:
 Original post by Nice CoderCan you explain how that works :-)

minmax(x,y):
x is in #1 // #1 := x
y is in #2 // #2 := y

clock1:
#3 INC #1 // #1 := x + 1
#4 INV #2 // #2 := inv(y)
clock2:
#3 ADD #3 #4 // #3 := (x+1)+(inv(y)) = (x - y)
#4 is 0x80000000 // #4 := mask(sign bit of int)
clock3:
#3 AND #3 #4 // #3 := sign of (x - y)
clock4:
#1 SetEvar #3 #4 #2 // if (the sign == 0x80000000) then #1 := y (else stays as x)
#2 SetEvar #3 #4 #1 // if (the sign == 0x80000000) then #2 := x (else stays as y)

And in the end #1 gets max and #2 gets min.

Also, is your goal to limit the amount of opcodes, or to speed up calculations?
If latter, I'd sugest adding XCHG opcode.
/def

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 14
• 46
• 22
• 27
• ### Forum Statistics

• Total Topics
634047
• Total Posts
3015232
×