-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Float Comparison | ||
# Floating Point Comparison | ||
|
||
## __m128i __lsx_vfcmp_cond_s (__m128 a, __m128 b) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Floating Point Computation | ||
|
||
## __m128d __lsx_vfadd_d (__m128d a, __m128d b) | ||
|
||
### Synopsis | ||
|
||
```c++ | ||
__m128d __lsx_vfadd_d (__m128d a, __m128d b) | ||
#include <lsxintrin.h> | ||
Instruction: vfadd.d vr, vr, vr | ||
CPU Flags: LSX | ||
``` | ||
### Description | ||
Add double precision floating point elements in `a` to `b` and store the result in `dst`. | ||
### Operation | ||
```c++ | ||
for (int i = 0;i < 2;i++) { | ||
dst.fp64[i] = a.fp64[i] + b.fp64[i]; | ||
} | ||
``` | ||
|
||
## __m128 __lsx_vfadd_s (__m128 a, __m128 b) | ||
|
||
### Synopsis | ||
|
||
```c++ | ||
__m128d __lsx_vfadd_s (__m128d a, __m128d b) | ||
#include <lsxintrin.h> | ||
Instruction: vfadd.s vr, vr, vr | ||
CPU Flags: LSX | ||
``` | ||
### Description | ||
Add single precision floating point elements in `a` to `b` and store the result in `dst`. | ||
### Operation | ||
```c++ | ||
for (int i = 0;i < 4;i++) { | ||
dst.fp32[i] = a.fp32[i] + b.fp32[i]; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Floatint Point Misc | ||
|
||
## __m128i __lsx_vfclass_d (__m128d a) | ||
|
||
### Synopsis | ||
|
||
```c++ | ||
__m128i __lsx_vfclass_d (__m128d a) | ||
#include <lsxintrin.h> | ||
Instruction: vfclass.d vr, vr | ||
CPU Flags: LSX | ||
``` | ||
### Description | ||
Classifiy each double precision floating point elements in `a`. | ||
### Operation | ||
```c++ | ||
for (int i = 0;i < 2;i++) { | ||
dst.dword[i] = fp_classify(a.fp64[i]); | ||
} | ||
``` | ||
|
||
## __m128i __lsx_vfclass_s (__m128 a) | ||
|
||
### Synopsis | ||
|
||
```c++ | ||
__m128i __lsx_vfclass_s (__m128d a) | ||
#include <lsxintrin.h> | ||
Instruction: vfclass.s vr, vr | ||
CPU Flags: LSX | ||
``` | ||
### Description | ||
Classifiy each single precision floating point elements in `a`. | ||
### Operation | ||
```c++ | ||
for (int i = 0;i < 4;i++) { | ||
dst.word[i] = fp_classify(a.fp32[i]); | ||
} | ||
``` |