Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Logical Operators

The following table lists the logical operators of the Fvec classes and generic syntax. The logical operators for F32vec1 classes use only the lower 32 bits.

Bitwise Operation

Operators

Generic Syntax

AND

&
&=

R = A & B;
R &= A;

OR

|
|=

R = A | B;
R |= A;

XOR

^
^=

R = A ^ B;
R ^= A;

andnot

andnot

R = andnot(A);

The following table lists standard logical operators syntax and corresponding intrinsics. Note that there is no corresponding scalar intrinsic for the F32vec1 classes, which accesses the lower 32 bits of the packed vector intrinsics.

Operation

Returns

Example Syntax Usage

Intrinsic

AND

 

 

4 floats

F32vec4 & = F32vec4 A & F32vec4 B;
F32vec4 & &= F32vec4 A;

_mm_and_ps

2 doubles

F64vec2 R = F64vec2 A & F64vec2 B;
F64vec2 R &= F64vec2 A;

_mm_and_pd

1 float

F32vec1 R = F32vec1 A & F32vec1 B;
F32vec1 R &= F32vec1 A;

_mm_and_ps

OR

 

 

4 floats

F32vec4 R = F32vec4 A | F32vec4 B;
F32vec4 R |= F32vec4 A;

_mm_or_ps

2 doubles

F64vec2 R = F64vec2 A | F64vec2 B;
F64vec2 R |= F64vec2 A;

_mm_or_pd

1 float

F32vec1 R = F32vec1 A | F32vec1 B;
F32vec1 R |= F32vec1 A;

_mm_or_ps

XOR

 

 

4 floats

F32vec4 R = F32vec4 A ^ F32vec4 B;
F32vec4 R ^= F32vec4 A;

_mm_xor_ps

2 doubles

F64vec2 R = F64vec2 A ^ F64vec2 B;
F64vec2 R ^= F64vec2 A;

_mm_xor_pd

1 float

F32vec1 R = F32vec1 A ^ F32vec1 B;
F32vec1 R ^= F32vec1 A;

_mm_xor_ps

ANDNOT

2 doubles

F64vec2 R = andnot(F64vec2 A,
F64vec2 B);

_mm_andnot_pd