Skip to content

Commit

Permalink
Add vpermi and vabsd
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Dec 12, 2023
1 parent c8da323 commit c32d315
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 7 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ Vector Half Sub Unsigned

Vector Add Absolute

### vabsd.b/h/w/d

Vector Absolute Difference

### vavg.b/h/w/d

Vector Average
Expand Down Expand Up @@ -449,5 +445,3 @@ Vector Multiplication High
### vnori.b

### vldi

### vpermi.w
170 changes: 169 additions & 1 deletion docs/lsx_integer/vaddsub.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add/Subtract
# Add/Subtract/Absolute Difference

## __m128i __lsx_vadd_b (__m128i a, __m128i b)

Expand Down Expand Up @@ -104,3 +104,171 @@ Add 128-bit elements in `a` and `b`, save the result in `dst`.
```c++
{% include 'vadd_q.h' %}
```

## __m128i __lsx_vabsd_b (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_b (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.b vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of signed 8-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_b.h' %}
```

## __m128i __lsx_vabsd_bu (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_bu (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.bu vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of unsigned 8-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_bu.h' %}
```

## __m128i __lsx_vabsd_h (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_h (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.h vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of signed 16-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_h.h' %}
```

## __m128i __lsx_vabsd_hu (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_hu (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.hu vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of unsigned 16-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_hu.h' %}
```

## __m128i __lsx_vabsd_w (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_w (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.w vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of signed 32-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_w.h' %}
```

## __m128i __lsx_vabsd_wu (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_wu (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.wu vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of unsigned 32-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_wu.h' %}
```

## __m128i __lsx_vabsd_d (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_d (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.d vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of signed 64-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_d.h' %}
```

## __m128i __lsx_vabsd_du (__m128i a, __m128i b)

### Synopsis

```c++
__m128i __lsx_vabsd_du (__m128i a, __m128i b)
#include <lsxintrin.h>
Instruction: vabsd.du vr, vr, vr
CPU Flags: LSX
```
### Description
Compute absolute difference of unsigned 64-bit elements in `a` and `b`, save the result in `dst`.
### Operation
```c++
{% include 'vabsd_du.h' %}
```
22 changes: 22 additions & 0 deletions docs/lsx_misc/vpermi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Permutation

## __m128i __lsx_vpermi_w (__m128i a, __m128i b, imm0_255 imm)

### Synopsis

```c++
__m128i __lsx_vpermi_w (__m128i a, __m128i b, imm0_255 imm)
#include <lsxintrin.h>
Instruction: vpermi.w vr, vr, imm
CPU Flags: LSX
```
### Description
Permute words from `a` and `b` with indices recorded in `imm` and store into `dst`.
### Operation
```c++
{% include 'vpermi_w.h' %}
```

0 comments on commit c32d315

Please sign in to comment.