This documentation is archived and is not being maintained.

Logical Operations

Visual Studio .NET 2003

Microsoft Specific

The intrinsics listed in the following table are followed by a description of each intrinsic.

Logical Intrinsics

Intrinsic name Operation Corresponding instruction
_mm_and_ps Bitwise AND ANDPS
_mm_andnot_ps Logical NOT ANDNPS
_mm_or_ps Bitwise OR ORPS
_mm_xor_ps Bitwise Exclusive OR XORPS

For an explanation of the syntax used in code samples in this topic, see Floating-Point Intrinsics Using Streaming SIMD Extensions.

`__m128 _mm_and_ps(__m128 a , __m128 b );`

```ANDPS
```

Computes the bitwise `AND` of the four single-precision, floating-point values of `a` and `b`.

```r0 := a0 & b0
r1 := a1 & b1
r2 := a2 & b2
r3 := a3 & b3
```

`__m128 _mm_andnot_ps(__m128 a , __m128 b );`

```ANDNPS
```

Computes the bitwise `AND-NOT` of the four single-precision, floating-point values of `a` and `b`.

```r0 := ~a0 & b0
r1 := ~a1 & b1
r2 := ~a2 & b2
r3 := ~a3 & b3
```

`__m128 _mm_or_ps(__m128 a , __m128 b );`

```ORPS
```

Computes the bitwise `OR` of the four single-precision, floating-point values of `a `and `b`.

```r0 := a0 | b0
r1 := a1 | b1
r2 := a2 | b2
r3 := a3 | b3
```

`__m128 _mm_xor_ps(__m128 a , __m128 b );`

```XORPS
```

Computes bitwise `EXOR` (exclusive-or) of the four single-precision, floating-point values of `a` and `b`.

```r0 := a0 ^ b0
r1 := a1 ^ b1
r2 := a2 ^ b2
r3 := a3 ^ b3
```

END Microsoft Specific