compiler: Support the majority of the remaining VU VF instructions (#258)

* compiler: Support the majority of the remaining VU VF instructions

- VWAIT
- VMADD variants
- VMSUB variants
- VSQRT
- VDIV
- outer product (VOPMULA + VOPMSUB)

* compiler: Fix some bugs / optimize some instructions

* tests/compiler: Add test coverage for new instructions

* docs: Add documentation for new inline assembly functions

* lint: Formatting / fix failing test

* Remove my comment about ftf/fsf encoding, it's been fixed

* address review feedback

* correct VSQRTPS implementation
This commit is contained in:
Tyler Wilding
2021-02-16 18:41:33 -08:00
committed by GitHub
parent f1a93886e7
commit cdce4d9612
15 changed files with 1546 additions and 514 deletions
+34
View File
@@ -11,6 +11,13 @@ TEST(EmitterAVX, VF_NOP) {
EXPECT_EQ(tester.dump_to_hex_string(true), "D9D0");
}
TEST(EmitterAVX, WAIT_VF) {
CodeTester tester;
tester.init_code_buffer(1024);
tester.emit(IGen::wait_vf());
EXPECT_EQ(tester.dump_to_hex_string(true), "9B");
}
TEST(EmitterAVX, MOV_VF) {
CodeTester tester;
tester.init_code_buffer(10000);
@@ -281,6 +288,33 @@ TEST(EmitterAVX, BlendVF) {
"43110CED03");
}
TEST(EmitterAVX, DivVF) {
CodeTester tester;
tester.init_code_buffer(1024);
tester.emit(IGen::div_vf(XMM0 + 3, XMM0 + 3, XMM0 + 3));
tester.emit(IGen::div_vf(XMM0 + 3, XMM0 + 3, XMM0 + 13));
tester.emit(IGen::div_vf(XMM0 + 3, XMM0 + 13, XMM0 + 3));
tester.emit(IGen::div_vf(XMM0 + 3, XMM0 + 13, XMM0 + 13));
tester.emit(IGen::div_vf(XMM0 + 13, XMM0 + 3, XMM0 + 3));
tester.emit(IGen::div_vf(XMM0 + 13, XMM0 + 3, XMM0 + 13));
tester.emit(IGen::div_vf(XMM0 + 13, XMM0 + 13, XMM0 + 3));
tester.emit(IGen::div_vf(XMM0 + 13, XMM0 + 13, XMM0 + 13));
EXPECT_EQ(tester.dump_to_hex_string(true),
"C5E05EDBC4C1605EDDC5905EDBC4C1105EDDC5605EEBC441605EEDC5105EEBC441105EED");
}
TEST(EmitterAVX, SqrtVF) {
CodeTester tester;
tester.init_code_buffer(1024);
tester.emit(IGen::sqrt_vf(XMM0 + 3, XMM0 + 4));
tester.emit(IGen::sqrt_vf(XMM0 + 3, XMM0 + 14));
tester.emit(IGen::sqrt_vf(XMM0 + 13, XMM0 + 4));
tester.emit(IGen::sqrt_vf(XMM0 + 13, XMM0 + 14));
EXPECT_EQ(tester.dump_to_hex_string(true), "C5F851DCC4C17851DEC57851ECC4417851EE");
}
TEST(EmitterAVX, RIP) {
CodeTester tester;
tester.init_code_buffer(1024);