コンストラクターと初期化

次の表に、Fvec クラスで F32vec オブジェクトを作成して初期化する方法を示します。

Fvec クラスのコンストラクターと初期化

組み込み関数 戻り値
コンストラクターの宣言
F64vec2 A;
F32vec4 B;
F32vec1 C;
N/A N/A
__m128 オブジェクトの初期化
F64vec2 A(__m128d mm);
F32vec4 B(__m128 mm);
F32vec1 C(__m128 mm);
N/A N/A
double 型の初期化
/* Initializes two doubles.*/
F64vec2 A(double d0, double d1);
F64vec2 A = F64vec2(double d0, double d1);
_mm_set_pd A0 := d0;
A1 := d1;
F64vec2 A(double d0);
/* Initializes both return values
with the same double precision value */.
_mm_set1_pd A0 := d0;
A1 := d0;
float 型の初期化
F32vec4 A(float f3, float f2,
float f1, float f0);

F32vec4 A = F32vec4(float f3, float f2,
float f1, float f0);
_mm_set_ps A0 := f0;
A1 := f1;
A2 := f2;
A3 := f3;
F32vec4 A(float f0);
/* Initializes all return values
with the same floating point value.*/
_mm_set1_ps A0 := f0;
A1 := f0;
A2 := f0;
A3 := f0;
F32vec4 A(double d0);
/* Initialize all return values with
the same double-precision value.*/
_mm_set1_ps(d) A0 := d0;
A1 := d0;
A2 := d0;
A3 := d0;
F32vec1 A(double d0);
/* Initializes the lowest value of A
with d0 and the other values with 0.*/
_mm_set_ss(d) A0 := d0;
A1 := 0;
A2 := 0;
A3 := 0;
F32vec1 B(float f0);
/* Initializes the lowest value of B
with f0 and the other values with 0.*/
_mm_set_ss B0 := f0;
B1 := 0;
B2 := 0;
B3 := 0;
F32vec1 B(int I);
/* Initializes the lowest value of B
with f0, other values are undefined.*/
_mm_cvtsi32_ss B0 := f0;
B1 := {}
B2 := {}
B3 := {}