35.3.9.2. INTEGER BITS AND BITSTRING ON ALPHA




Alpha Operate Format
+-------------------------+------------------------+
| 31..26	Opcode	  | 31..26	Opcode	   |
| 25..21	Ra	  | 25..21	Ra	   |
| 20..16	Rb	  | 20..13	LIT        |
| 15..13	SBZ	  | 12		1          |
| 12		0	  | 11..5	Function   |	
| 11..5		Function  | 4..0	Rc         |
| 4..0		Rc        |                        |
+-------------------------+------------------------+



Count Leading Zeroes 			
	CTLZ	Rb.rq,Rc.wq		!Operate Format


	temp = 0
	FOR i FROM 63 DOWN TO 0
		if { Rbv EQ 1) THEN BREAK
		temp = temp + 1
	END
	Rc<6..0>  <- temp<6..0>
	Rc<63..7> <- 0

	CTLZ	1C.32

	(Ra must be R31)

	// ----------------------------------------------------------



Count Population

	CTPOP	Rb.rq,Rc.wq		!Operate Format


	temp = 0
	FOR i FROM 63 DOWN TO 0
		if { Rbv EQ 1) THEN 	temp = temp + 1
	END
	Rc<6..0>  <- temp<6..0>
	Rc<63..7> <- 0

	CTPOP	1C.30

	(Ra must be R31)

	// ----------------------------------------------------------


Count Trailing Zero

	CTTZ	Rb.rq,Rc.wq		!Operate Format


	temp = 0
	FOR i FROM 0  TO 63
		if { Rbv EQ 1) THEN 	BREAK
		temp = temp + 1
	END
	Rc<6..0>  <- temp<6..0>
	Rc<63..7> <- 0

	CTTZ	1C.33

	(Ra must be R31)


// ----------------------------------------------------------------------



Index Prev Next