-
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
21 changed files
with
166 additions
and
10 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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
!*.h | ||
!*.cpp | ||
!*.sh | ||
!*.py |
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,32 @@ | ||
widths_all = ["b", "bu", "h", "hu", "w", "wu", "d", "du"] | ||
|
||
tb = { | ||
"vavg": (widths_all, "v128 a, v128 b") | ||
} | ||
|
||
for name in tb: | ||
t = tb[name] | ||
widths = t[0] | ||
args = t[1] | ||
|
||
for width in widths: | ||
inst_name = name + "_" + width | ||
|
||
fuzz_args = 0 | ||
for arg in args.split(', '): | ||
if 'v128' in arg: | ||
fuzz_args += 1 | ||
|
||
print(f'Saving {inst_name}.cpp') | ||
with open(f'{inst_name}.cpp', 'w') as f: | ||
print('#include "common.h"', file=f) | ||
print('', file=f) | ||
print(f'v128 {inst_name}({args}) {{', file=f) | ||
print(' v128 dst;', file=f) | ||
print(f'#include "{inst_name}.h"', file=f) | ||
print(' return dst;', file=f) | ||
print('}', file=f) | ||
print('', file=f) | ||
print('void test() {', file=f) | ||
print(f' FUZZ{fuzz_args}({inst_name});', file=f) | ||
print('}', file=f) |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_b(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_b.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_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,3 @@ | ||
for (int i = 0; i < 16; i++) { | ||
dst.byte[i] = ((s8)a.byte[i] >> 1) + ((s8)b.byte[i] >> 1) + (a.byte[i] & b.byte[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_bu(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_bu.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_bu); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 16; i++) { | ||
dst.byte[i] = ((u8)a.byte[i] >> 1) + ((u8)b.byte[i] >> 1) + (a.byte[i] & b.byte[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_d(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_d.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_d); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 2; i++) { | ||
dst.dword[i] = ((s64)a.dword[i] >> 1) + ((s64)b.dword[i] >> 1) + (a.dword[i] & b.dword[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_du(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_du.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_du); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 2; i++) { | ||
dst.dword[i] = ((u64)a.dword[i] >> 1) + ((u64)b.dword[i] >> 1) + (a.dword[i] & b.dword[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_h(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_h.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_h); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 8; i++) { | ||
dst.half[i] = ((s16)a.half[i] >> 1) + ((s16)b.half[i] >> 1) + (a.half[i] & b.half[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_hu(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_hu.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_hu); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 8; i++) { | ||
dst.half[i] = ((u16)a.half[i] >> 1) + ((u16)b.half[i] >> 1) + (a.half[i] & b.half[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_w(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_w.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_w); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 4; i++) { | ||
dst.word[i] = ((s32)a.word[i] >> 1) + ((s32)b.word[i] >> 1) + (a.word[i] & b.word[i] & 1); | ||
} |
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,11 @@ | ||
#include "common.h" | ||
|
||
v128 vavg_wu(v128 a, v128 b) { | ||
v128 dst; | ||
#include "vavg_wu.h" | ||
return dst; | ||
} | ||
|
||
void test() { | ||
FUZZ2(vavg_wu); | ||
} |
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,3 @@ | ||
for (int i = 0; i < 4; i++) { | ||
dst.word[i] = ((u32)a.word[i] >> 1) + ((u32)b.word[i] >> 1) + (a.word[i] & b.word[i] & 1); | ||
} |
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