Bitwise Instruction Group

The Bitwise ALU performs all bitwise and logical operations. The Bitwise ALU may not be used at the same time as the Main ALU.


0 : lsl ft2, s2, s1 # Shift1 instruction
 ftb ft3, ft2 # Count instruction, ft3 implicitly drives w1
 and ft4, ft2, s3 # Logical instruction
 asr ft5, ft4, s1, ft3 # Shift2 instruction, ft5 implicitly drives w0
 tz p0, ft5 # Test instruction


A bitwise instruction group consists of up to six instructions (grouped into three phases) which are associated with the following six functional units:

Phase 0:

  • bitmask

  • bit shift #1

  • bit count

Phase 1:

  • logical instruction

Phase 2:

  • bit shift #2

  • bit test

Different instructions are available for each functional unit. Not all six instructions have to be present, but those that are present must be arranged in the order shown above. The source declarations should be placed before the instructions and the destination declarations should be placed after the instructions.

In the code example above no instruction has been provided for the bitmask function in phase 0. So this logical unit is unused and the opcode for it will be set to a default value by the compiler.

In general, the compiler will fill in default encoding values for unused instructions in any phase that is used. The programmer need not worry about phases and can just assign opcodes to functional blocks as required.

Note: No bitwise instructions use multiple phases and there are no bitwise backend instructions.