Bit Field Manipulation - Intel XScale Core Developer's Manual

Table of Contents

Advertisement

A.3.2

Bit Field Manipulation

The Intel XScale
Bit field operations can be optimized as follows:
;Set the bit number specified by r1 in register r0
mov
orr
;Clear the bit number specified by r1 in register r0
mov
bic
;Extract the bit-value of the bit number specified by r1 of the
;value in r0 storing the value in r0
mov
and
;Extract the higher order 8 bits of the value in r0 storing
;the result in r1
mov
Developer's Manual
®
core shift and logical operations provide a useful way of manipulating bit fields.
r2, #1
r0, r0, r2, asl r1
r2, #1
r0, r0, r2, asl r1
r1, r0, asr r1
r0, r1, #1
r1, r0, lsr #24
January, 2004
Intel XScale® Core Developer's Manual
Optimization Guide
187

Advertisement

Table of Contents
loading

Table of Contents