Everything Else

if U were a RISC assembly programmer which instructions would U want to have ?

Image

I am going to improve the above design (soft core, fpga): suggestions, tips, are the welcome :D :D :D :D

BP stands for "break point"
WP stands for "watch point"
EA stands for "effective address" (physical address)
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
I was thinking about the following instruction (from PowerPC):

Code: Select all

isel rdest, ra, rb, rsel


if rsel isEqualTo 0 then rdest gets the value of ra
if rsel isNotEqualTo 0 then rdest gets the value of rb

I got the following advice:

HCF. Halt and Catch Fire. The only instruction you need


from IBM S/360 :lol: :lol: :lol: :lol:
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
I use fsel a lot. I was surprised isel was not in Power Macs.
smit happens.

:Fuel: bigred , 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy , 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze , 175MHz R10000, Solid IMPACT
probably posted from Image bruce , Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * HP C8000 * BeBox * Solbourne S3000 * Commodore 128 * many more...
Haha, they made an instruction specifically to implement the ternary operator :D
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/D-50/MT-32/SC-55k, Ensoniq SQ-80/Mirage, Yamaha DX7/V-50/FB-01/SY22, Korg DW-8000/MS-20 Mini/ARP Odyssey/M1/03-RW, E-mu Emax HD/Proteus/2, Rhodes Chroma Polaris
An instruction that reads a a string and automatically convers " u " to " you " :lol:
Google: Don't Be Evil. Apple: Don't Be Greedy. Microsoft: Don't Be Stupid.
guardian452 wrote: automatically convers " u " to " you " :lol:


I was worried that the title was too long, so I contracted :D
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
Image


Progress :D

I have confirmed the following classes & instructions:

Class.Alu.Logic
and
nand
or
nor
xor
xnor
Shift.R
Shift.L

Class.Alu.Arithmetic
Add.signed
Add.unsigned
Sub.signed
Sub.unsigned
Mul.signed
Mul.unsigned
Div.signed
Div.unsigned

Class.Alu.Bitfield
Bit.get
Bit.set
Bit.toggle
Bit.get.first
Bit.set.first
Bit.rotate
Bit.sign-extend
Bit.swap

Class.IO
Load.8
Load.16
Load.32
Store.8
Store.16
Store.32
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
Only one kind of right shift?
:PI: :O2: :Indigo2IMP: :Indigo2IMP:
yes, it's the easiest shift-right I can implement, and it takes 1 cpu cycle to complete
but I have 2 empty classes, so, I can add more instructions (and ALU modules)
suggestions :D ?

do I have to implement Circular Shift units ?
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
I thought you already had that covered with "bit.rotate", but maybe I didn't grasp the intent.
I mean that if you only have one type of right shift, it can't accommodate both logical and arithmetic forms.

Code: Select all

unsigned r1=0xF0F0F0F0;
r1>>=4; // srl r1,r1,#4
assert(r1==0x0F0F0F0F);


vs

Code: Select all

signed r1=-16;
r1>>=4; // sra r1,r1,#4
assert(r1==-1);

P.S. it can also be useful to have "arithmetic left shift" depending on how condition codes and traps are architected. If you can always test overflow after a shift you don't need it.
The other approach is to have "arithmetic shift" and "logical shift" opcodes with a signed (or excess represented, because you don't want to waste a bit for zero) distance. Depending on addressing modes this can allow for both immediate or register distance operand.
:PI: :O2: :Indigo2IMP: :Indigo2IMP:
POWER has very good shift instructions, with rlwmi you can implement multi-precision shifts in a tight loop.
:PI: :O2: :Indigo2IMP: :Indigo2IMP:
Unfortunately I do not have books about the POWER architecture, and I do not have yatta materials about Power/PC, not in details

I have to take a decision about the branch-instructions

  • the 68K way : do ALU, which modifies the condition code register, then test CCR.bit, in case it matches then branch
  • the 88K way : compare and set a register with results (equal? greater? zero? ….), then get-bit, and if it's "1" than branch
  • the MIPS way : compare and branch (1 instruction)
  • the ARM60 way : similar to m68k, it adds 4 bit as " conditional execution ", an instruction is executed if these 4 bits match the CCR status

Ironically, I can implement all of these branch-methods
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
I confirm the following branch & trap instructions:

  • ConditionalExecution.Branch.if.bit.set
  • ConditionalExecution.Branch.if.bit.clr
  • ConditionalExecution.Trap.if.bit.set
  • ConditionalExecution.Trap.if.bit.clr

as you can access r0 which always return zero (0x0000.0000)
the following instructions are a subset case of the above
  • ConditionalExecution.Branch
  • ConditionalExecution.Trap

e.g.
ConditionalExecution.Branch is implemented as ConditionalExecution.Branch.if.bit.clr using r0
is bit.whatever clear in r0 ? yes, always :D


Conditional Execution uses 16 conditions (4 bit, encoded, including overflow, carry, zero, negative, positive, etc) from the CCR (conditional code register)
you can choose to " inhibit " the updating of the CCR, each instruction features the choice as there is a specific " CCR inhibit " bit in the Instruction forma (above is called " mode ", I still have to rename it in the documentation)

each branch can be specified as
  • PC=rs1
  • PC=imm32
  • PC=rs1+signed(imm32)

which permits absolutes branches, and relative branches, and register-driven branches
(the program counter is now part of the registers-set, rs1 can be equal to PC)


what do you think ?
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
I am also going to add
  • saturated arithmetic
  • test r0: { branch if zero, otherwise decrement by 1 } (it's used in 68k)
I wish I could enter into the vegetable garden of William Gibson , on the right of a director, to decide how a film is ultimately released for public viewing, but I am not a nor Cyberpunk writer neither a dude in Hollywood , and my English still looks like an old rusty trailer which needs a fix-up, so my personal wonderland begins with a pill ... tumbling down the rabbit hole , where the sky above the router port is the color of television, tuned to a dead channel and some gears still need a debugger there.
Don't forget "Halt and Catch Fire," obvious, I know, but someone had to say it... :lol:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2: