-
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.
Fix vftint_w_d variant's code, reported by Yang Liu
- Loading branch information
Showing
16 changed files
with
200 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "common.h" | ||
|
||
v128 vftintrm_w_d(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vftintrm_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m128d a = {1.0, 2.0}; | ||
__m128d b = {3.0, 4.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lsx_vftintrm_w_d(a, b)); | ||
PRINT(vftintrm_w_d(a, b)); | ||
assert(vftintrm_w_d(a, b) == __lsx_vftintrm_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
for (int i = 0; i < 2; i++) { | ||
dst.dword[i] = (i < 1) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
for (int i = 0; i < 4; i++) { | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v128 vftintrne_w_d(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vftintrne_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m128d a = {1.0, 2.0}; | ||
__m128d b = {3.0, 4.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lsx_vftintrne_w_d(a, b)); | ||
PRINT(vftintrne_w_d(a, b)); | ||
assert(vftintrne_w_d(a, b) == __lsx_vftintrne_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
for (int i = 0; i < 2; i++) { | ||
dst.dword[i] = (i < 1) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
for (int i = 0; i < 4; i++) { | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v128 vftintrp_w_d(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vftintrp_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m128d a = {1.0, 2.0}; | ||
__m128d b = {3.0, 4.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lsx_vftintrp_w_d(a, b)); | ||
PRINT(vftintrp_w_d(a, b)); | ||
assert(vftintrp_w_d(a, b) == __lsx_vftintrp_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
for (int i = 0; i < 2; i++) { | ||
dst.dword[i] = (i < 1) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
for (int i = 0; i < 4; i++) { | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v128 vftintrz_w_d(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vftintrz_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m128d a = {1.0, 2.0}; | ||
__m128d b = {3.0, 4.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lsx_vftintrz_w_d(a, b)); | ||
PRINT(vftintrz_w_d(a, b)); | ||
assert(vftintrz_w_d(a, b) == __lsx_vftintrz_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
for (int i = 0; i < 2; i++) { | ||
dst.dword[i] = (i < 1) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
for (int i = 0; i < 4; i++) { | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v256 xvftintrm_w_d(v256 a, v256 b) { | ||
v256 dst; | ||
#include "xvftintrm_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m256d a = {1.0, 2.0, 3.0, 4.0}; | ||
__m256d b = {5.0, 6.0, 7.0, 8.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lasx_xvftintrm_w_d(a, b)); | ||
PRINT(xvftintrm_w_d(a, b)); | ||
assert(xvftintrm_w_d(a, b) == __lasx_xvftintrm_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
for (int i = 0; i < 4; i++) { | ||
dst.dword[i] = (i < 2) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} | ||
for (int i = 4; i < 8; i++) { | ||
dst.word[i] = (i < 6) | ||
? (s64)b.fp64[i - 2] | ||
: (s64)a.fp64[i - 4]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v256 xvftintrne_w_d(v256 a, v256 b) { | ||
v256 dst; | ||
#include "xvftintrne_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m256d a = {1.0, 2.0, 3.0, 4.0}; | ||
__m256d b = {5.0, 6.0, 7.0, 8.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lasx_xvftintrne_w_d(a, b)); | ||
PRINT(xvftintrne_w_d(a, b)); | ||
assert(xvftintrne_w_d(a, b) == __lasx_xvftintrne_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
for (int i = 0; i < 4; i++) { | ||
dst.dword[i] = (i < 2) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} | ||
for (int i = 4; i < 8; i++) { | ||
dst.word[i] = (i < 6) | ||
? (s64)b.fp64[i - 2] | ||
: (s64)a.fp64[i - 4]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v256 xvftintrp_w_d(v256 a, v256 b) { | ||
v256 dst; | ||
#include "xvftintrp_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m256d a = {1.0, 2.0, 3.0, 4.0}; | ||
__m256d b = {5.0, 6.0, 7.0, 8.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lasx_xvftintrp_w_d(a, b)); | ||
PRINT(xvftintrp_w_d(a, b)); | ||
assert(xvftintrp_w_d(a, b) == __lasx_xvftintrp_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
for (int i = 0; i < 4; i++) { | ||
dst.dword[i] = (i < 2) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} | ||
for (int i = 4; i < 8; i++) { | ||
dst.word[i] = (i < 6) | ||
? (s64)b.fp64[i - 2] | ||
: (s64)a.fp64[i - 4]; // rounding mode is not expressed in C | ||
} |
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,19 @@ | ||
#include "common.h" | ||
|
||
v256 xvftintrz_w_d(v256 a, v256 b) { | ||
v256 dst; | ||
#include "xvftintrz_w_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
{ | ||
__m256d a = {1.0, 2.0, 3.0, 4.0}; | ||
__m256d b = {5.0, 6.0, 7.0, 8.0}; | ||
PRINT(a); | ||
PRINT(b); | ||
PRINT(__lasx_xvftintrz_w_d(a, b)); | ||
PRINT(xvftintrz_w_d(a, b)); | ||
assert(xvftintrz_w_d(a, b) == __lasx_xvftintrz_w_d(a, 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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
for (int i = 0; i < 4; i++) { | ||
dst.dword[i] = (i < 2) | ||
? (s64)a.fp64[i] | ||
: (s64)b.fp64[i]; // rounding mode is not expressed in C | ||
dst.word[i] = (i < 2) | ||
? (s64)b.fp64[i] | ||
: (s64)a.fp64[i - 2]; // rounding mode is not expressed in C | ||
} | ||
for (int i = 4; i < 8; i++) { | ||
dst.word[i] = (i < 6) | ||
? (s64)b.fp64[i - 2] | ||
: (s64)a.fp64[i - 4]; // rounding mode is not expressed in C | ||
} |