From f5b99d74480de210cc29aad1f2dd412ec8ac0247 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 30 Sep 2013 17:54:49 -0700 Subject: [PATCH] Fixing some altivec instruction decode issues. --- src/xenia/cpu/ppc/disasm_altivec.cc | 220 +++---------------------- src/xenia/cpu/ppc/instr.cc | 8 +- src/xenia/cpu/ppc/instr.h | 29 +++- src/xenia/cpu/ppc/instr_tables.h | 227 ++++++++++++-------------- src/xenia/cpu/x64/x64_emit_altivec.cc | 118 +------------ 5 files changed, 165 insertions(+), 437 deletions(-) diff --git a/src/xenia/cpu/ppc/disasm_altivec.cc b/src/xenia/cpu/ppc/disasm_altivec.cc index 37409c8df..ec27d7fd7 100644 --- a/src/xenia/cpu/ppc/disasm_altivec.cc +++ b/src/xenia/cpu/ppc/disasm_altivec.cc @@ -706,34 +706,16 @@ XEDISASMR(vcfpuxws128, VX128_3(6, 624), VX128_3)(InstrData& i, InstrDisasm& XEDISASMR(vcmpbfp, 0x100003C6, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpbfp", "Vector Compare Bounds Floating Point", - InstrDisasm::kVMX); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); return d.Finish(); } -XEDISASMR(vcmpbfp128, VX128(6, 384), VX128 )(InstrData& i, InstrDisasm& d) { +XEDISASMR(vcmpbfp128, VX128(6, 384), VX128_R)(InstrData& i, InstrDisasm& d) { d.Init("vcmpbfp128", "Vector128 Compare Bounds Floating Point", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpbfp_c, 0x100007C6, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpbfp", "Vector Compare Bounds Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpbfp128c, VX128(6, 448), VX128 )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpbfp128", "Vector128 Compare Equal-to Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VX128_R.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -742,46 +724,22 @@ XEDISASMR(vcmpbfp128c, VX128(6, 448), VX128 )(InstrData& i, InstrDisasm& XEDISASMR(vcmpeqfp, 0x100000C6, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpeqfp", "Vector Compare Equal-to Floating Point", - InstrDisasm::kVMX); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); return d.Finish(); } -XEDISASMR(vcmpeqfp128, VX128(6, 0), VX128 )(InstrData& i, InstrDisasm& d) { +XEDISASMR(vcmpeqfp128, VX128(6, 0), VX128_R)(InstrData& i, InstrDisasm& d) { d.Init("vcmpeqfp128", "Vector128 Compare Equal-to Floating Point", - InstrDisasm::kVMX); + InstrDisasm::kVMX | (i.VX128_R.Rc ? InstrDisasm::kRc : 0)); return GeneralVX128(i, d); } -XEDISASMR(vcmpeqfp_c, 0x100004C6, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpeqfp", "Vector Compare Equal-to Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); - return GeneralVX128(i, d); -} - -XEDISASMR(vcmpeqfp128c, VX128(6, 64), VX128 )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpeqfp128", "Vector Compare Equal-to Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - XEDISASMR(vcmpequb, 0x10000006, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpequb", "Vector Compare Equal-to Unsigned Byte", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpequb_c, 0x10000406, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpequb", "Vector Compare Equal-to Unsigned Byte", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -790,16 +748,7 @@ XEDISASMR(vcmpequb_c, 0x10000406, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpequh, 0x10000046, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpequh", "Vector Compare Equal-to Unsigned Half Word", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpequh_c, 0x10000446, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpequh", "Vector Compare Equal-to Unsigned Half Word", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -808,64 +757,31 @@ XEDISASMR(vcmpequh_c, 0x10000446, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpequw, 0x10000086, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpequw", "Vector Compare Equal-to Unsigned Word", - InstrDisasm::kVMX); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); return d.Finish(); } -XEDISASMR(vcmpequw128, VX128(6, 512), VX128 )(InstrData& i, InstrDisasm& d) { +XEDISASMR(vcmpequw128, VX128(6, 512), VX128_R)(InstrData& i, InstrDisasm& d) { d.Init("vcmpequw128", "Vector128 Compare Equal-to Unsigned Word", - InstrDisasm::kVMX); - return GeneralVX128(i, d); -} - -XEDISASMR(vcmpequw_c, 0x10000486, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpequw", "Vector Compare Equal-to Unsigned Word", - InstrDisasm::kVMX | InstrDisasm::kRc); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpequw128c, VX128(6, 576), VX128 )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpequw128", "Vector Compare Equal-to Unsigned Word", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VX128_R.Rc ? InstrDisasm::kRc : 0)); return GeneralVX128(i, d); } XEDISASMR(vcmpgefp, 0x100001C6, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgefp", "Vector Compare Greater-Than-or-Equal-to Floating Point", - InstrDisasm::kVMX); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); return d.Finish(); } -XEDISASMR(vcmpgefp128, VX128(6, 128), VX128 )(InstrData& i, InstrDisasm& d) { +XEDISASMR(vcmpgefp128, VX128(6, 128), VX128_R)(InstrData& i, InstrDisasm& d) { d.Init("vcmpgefp128", "Vector128 Compare Greater-Than-or-Equal-to Floating Point", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgefp_c, 0x100005C6, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgefp", "Vector Compare Greater-Than-or-Equal-to Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgefp128c, VX128(6, 192), VX128 )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgefp128", "Vector128 Compare Greater-Than-or-Equal-to Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VX128_R.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -874,34 +790,16 @@ XEDISASMR(vcmpgefp128c, VX128(6, 192), VX128 )(InstrData& i, InstrDisasm& XEDISASMR(vcmpgtfp, 0x100002C6, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtfp", "Vector Compare Greater-Than Floating Point", - InstrDisasm::kVMX); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); return d.Finish(); } -XEDISASMR(vcmpgtfp128, VX128(6, 256), VX128 )(InstrData& i, InstrDisasm& d) { +XEDISASMR(vcmpgtfp128, VX128(6, 256), VX128_R)(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtfp128", "Vector128 Compare Greater-Than Floating-Point", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtfp_c, 0x100006C6, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtfp", "Vector Compare Greater-Than Floating Point", - InstrDisasm::kVMX | InstrDisasm::kRc); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtfp128c, VX128(6, 320), VX128 )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtfp128", "Vector128 Compare Greater-Than Floating-Point", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VX128_R.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -910,16 +808,7 @@ XEDISASMR(vcmpgtfp128c, VX128(6, 320), VX128 )(InstrData& i, InstrDisasm& XEDISASMR(vcmpgtsb, 0x10000306, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtsb", "Vector Compare Greater-Than Signed Byte", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtsb_c, 0x10000706, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtsb", "Vector Compare Greater-Than Signed Byte", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -928,16 +817,7 @@ XEDISASMR(vcmpgtsb_c, 0x10000706, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpgtsh, 0x10000346, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtsh", "Vector Compare Greater-Than Signed Half Word", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtsh_c, 0x10000746, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtsh", "Vector Compare Greater-Than Signed Half Word", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -946,16 +826,7 @@ XEDISASMR(vcmpgtsh_c, 0x10000746, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpgtsw, 0x10000386, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtsw", "Vector Compare Greater-Than Signed Word", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtsw_c, 0x10000786, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtsw", "Vector Compare Greater-Than Signed Word", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -964,16 +835,7 @@ XEDISASMR(vcmpgtsw_c, 0x10000786, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpgtub, 0x10000206, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtub", "Vector Compare Greater-Than Unsigned Byte", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtub_c, 0x10000606, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtub", "Vector Compare Greater-Than Unsigned Byte", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -982,16 +844,7 @@ XEDISASMR(vcmpgtub_c, 0x10000606, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpgtuh, 0x10000246, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtuh", "Vector Compare Greater-Than Unsigned Half Word", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtuh_c, 0x10000646, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtuh", "Vector Compare Greater-Than Unsigned Half Word", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -1000,16 +853,7 @@ XEDISASMR(vcmpgtuh_c, 0x10000646, VXR )(InstrData& i, InstrDisasm& d) { XEDISASMR(vcmpgtuw, 0x10000286, VXR )(InstrData& i, InstrDisasm& d) { d.Init("vcmpgtuw", "Vector Compare Greater-Than Unsigned Word", - InstrDisasm::kVMX); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); - //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); - return d.Finish(); -} - -XEDISASMR(vcmpgtuw_c, 0x10000686, VXR )(InstrData& i, InstrDisasm& d) { - d.Init("vcmpgtuw", "Vector Compare Greater-Than Unsigned Word", - InstrDisasm::kVMX | InstrDisasm::kRc); + InstrDisasm::kVMX | (i.VXR.Rc ? InstrDisasm::kRc : 0)); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VD, InstrRegister::kWrite); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VA, InstrRegister::kRead); //d.AddRegOperand(InstrRegister::kVMX, i.VX.VB, InstrRegister::kRead); @@ -2473,40 +2317,22 @@ void RegisterDisasmCategoryAltivec() { XEREGISTERINSTR(vcfpuxws128, VX128_3(6, 624)); XEREGISTERINSTR(vcmpbfp, 0x100003C6); XEREGISTERINSTR(vcmpbfp128, VX128(6, 384)); - XEREGISTERINSTR(vcmpbfp_c, 0x100007C6); - XEREGISTERINSTR(vcmpbfp128c, VX128(6, 448)); XEREGISTERINSTR(vcmpeqfp, 0x100000C6); XEREGISTERINSTR(vcmpeqfp128, VX128(6, 0)); - XEREGISTERINSTR(vcmpeqfp_c, 0x100004C6); - XEREGISTERINSTR(vcmpeqfp128c, VX128(6, 64)); XEREGISTERINSTR(vcmpequb, 0x10000006); - XEREGISTERINSTR(vcmpequb_c, 0x10000406); XEREGISTERINSTR(vcmpequh, 0x10000046); - XEREGISTERINSTR(vcmpequh_c, 0x10000446); XEREGISTERINSTR(vcmpequw, 0x10000086); XEREGISTERINSTR(vcmpequw128, VX128(6, 512)); - XEREGISTERINSTR(vcmpequw_c, 0x10000486); - XEREGISTERINSTR(vcmpequw128c, VX128(6, 576)); XEREGISTERINSTR(vcmpgefp, 0x100001C6); XEREGISTERINSTR(vcmpgefp128, VX128(6, 128)); - XEREGISTERINSTR(vcmpgefp_c, 0x100005C6); - XEREGISTERINSTR(vcmpgefp128c, VX128(6, 192)); XEREGISTERINSTR(vcmpgtfp, 0x100002C6); XEREGISTERINSTR(vcmpgtfp128, VX128(6, 256)); - XEREGISTERINSTR(vcmpgtfp_c, 0x100006C6); - XEREGISTERINSTR(vcmpgtfp128c, VX128(6, 320)); XEREGISTERINSTR(vcmpgtsb, 0x10000306); - XEREGISTERINSTR(vcmpgtsb_c, 0x10000706); XEREGISTERINSTR(vcmpgtsh, 0x10000346); - XEREGISTERINSTR(vcmpgtsh_c, 0x10000746); XEREGISTERINSTR(vcmpgtsw, 0x10000386); - XEREGISTERINSTR(vcmpgtsw_c, 0x10000786); XEREGISTERINSTR(vcmpgtub, 0x10000206); - XEREGISTERINSTR(vcmpgtub_c, 0x10000606); XEREGISTERINSTR(vcmpgtuh, 0x10000246); - XEREGISTERINSTR(vcmpgtuh_c, 0x10000646); XEREGISTERINSTR(vcmpgtuw, 0x10000286); - XEREGISTERINSTR(vcmpgtuw_c, 0x10000686); XEREGISTERINSTR(vctsxs, 0x100003CA); XEREGISTERINSTR(vctuxs, 0x1000038A); XEREGISTERINSTR(vexptefp, 0x1000018A); diff --git a/src/xenia/cpu/ppc/instr.cc b/src/xenia/cpu/ppc/instr.cc index 50a77f4b1..c87c07f0c 100644 --- a/src/xenia/cpu/ppc/instr.cc +++ b/src/xenia/cpu/ppc/instr.cc @@ -417,8 +417,8 @@ InstrType* xe::cpu::ppc::GetInstrType(uint32_t code) { InstrType* slot = NULL; switch (code >> 26) { case 4: - // Opcode = 4, index = bits 11-0 (6) - slot = xe::cpu::ppc::tables::instr_table_4[XESELECTBITS(code, 0, 11)]; + // Opcode = 4, index = bits 10-0 (10) + slot = xe::cpu::ppc::tables::instr_table_4[XESELECTBITS(code, 0, 10)]; break; case 19: // Opcode = 19, index = bits 10-1 (10) @@ -460,9 +460,9 @@ InstrType* xe::cpu::ppc::GetInstrType(uint32_t code) { // Slow lookup via linear scan. // This is primarily due to laziness. It could be made fast like the others. - for (size_t n = 0; n < XECOUNT(xe::cpu::ppc::tables::instr_table_vx128); + for (size_t n = 0; n < XECOUNT(xe::cpu::ppc::tables::instr_table_scan); n++) { - slot = &(xe::cpu::ppc::tables::instr_table_vx128[n]); + slot = &(xe::cpu::ppc::tables::instr_table_scan[n]); if (slot->opcode == (code & slot->opcode_mask)) { return slot; } diff --git a/src/xenia/cpu/ppc/instr.h b/src/xenia/cpu/ppc/instr.h index bc26e304a..7f957b2ee 100644 --- a/src/xenia/cpu/ppc/instr.h +++ b/src/xenia/cpu/ppc/instr.h @@ -48,10 +48,13 @@ typedef enum { kXEPPCInstrFormatVX128_4 = 22, kXEPPCInstrFormatVX128_5 = 23, kXEPPCInstrFormatVX128_P = 24, - kXEPPCInstrFormatXDSS = 25, + kXEPPCInstrFormatVX128_R = 25, + kXEPPCInstrFormatXDSS = 26, } xe_ppc_instr_format_e; typedef enum { + kXEPPCInstrMaskVXR = 0xFC0003FF, + kXEPPCInstrMaskVXA = 0xFC00003F, kXEPPCInstrMaskVX128 = 0xFC0003D0, kXEPPCInstrMaskVX128_1 = 0xFC0007F3, kXEPPCInstrMaskVX128_2 = 0xFC000210, @@ -59,6 +62,7 @@ typedef enum { kXEPPCInstrMaskVX128_4 = 0xFC000730, kXEPPCInstrMaskVX128_5 = 0xFC000010, kXEPPCInstrMaskVX128_P = 0xFC000630, + kXEPPCInstrMaskVX128_R = 0xFC000390, } xe_ppc_instr_mask_e; typedef enum { @@ -249,6 +253,12 @@ typedef struct { } VX; // kXEPPCInstrFormatVXR struct { + uint32_t : 10; + uint32_t Rc : 1; + uint32_t VB : 5; + uint32_t VA : 5; + uint32_t VD : 5; + uint32_t : 6; } VXR; // kXEPPCInstrFormatVX128 struct { @@ -338,6 +348,23 @@ typedef struct { uint32_t VD128l : 5; uint32_t : 6; } VX128_P; + // kXEPPCInstrFormatVX128 + struct { + // VD128 = VD128l | (VD128h << 5) + // VA128 = VA128l | (VA128h << 5) | (VA128H << 6) + // VB128 = VB128l | (VB128h << 5) + uint32_t VB128h : 2; + uint32_t VD128h : 2; + uint32_t : 1; + uint32_t VA128h : 1; + uint32_t Rc : 1; + uint32_t : 3; + uint32_t VA128H : 1; + uint32_t VB128l : 5; + uint32_t VA128l : 5; + uint32_t VD128l : 5; + uint32_t : 6; + } VX128_R; // kXEPPCInstrFormatXDSS struct { } XDSS; diff --git a/src/xenia/cpu/ppc/instr_tables.h b/src/xenia/cpu/ppc/instr_tables.h index f8289bd52..0d43a0166 100644 --- a/src/xenia/cpu/ppc/instr_tables.h +++ b/src/xenia/cpu/ppc/instr_tables.h @@ -92,37 +92,10 @@ static InstrType instr_table_4_unprep[] = { INSTRUCTION(vavguw, 0x10000482, VX , General , 0), INSTRUCTION(vcfsx, 0x1000034A, VX , General , 0), INSTRUCTION(vcfux, 0x1000030A, VX , General , 0), - INSTRUCTION(vcmpbfp, 0x100003C6, VXR , General , 0), - INSTRUCTION(vcmpbfp_c, 0x100007C6, VXR , General , 0), - INSTRUCTION(vcmpeqfp, 0x100000C6, VXR , General , 0), - INSTRUCTION(vcmpeqfp_c, 0x100004C6, VXR , General , 0), - INSTRUCTION(vcmpequb, 0x10000006, VXR , General , 0), - INSTRUCTION(vcmpequb_c, 0x10000406, VXR , General , 0), - INSTRUCTION(vcmpequh, 0x10000046, VXR , General , 0), - INSTRUCTION(vcmpequh_c, 0x10000446, VXR , General , 0), - INSTRUCTION(vcmpequw, 0x10000086, VXR , General , 0), - INSTRUCTION(vcmpequw_c, 0x10000486, VXR , General , 0), - INSTRUCTION(vcmpgefp, 0x100001C6, VXR , General , 0), - INSTRUCTION(vcmpgefp_c, 0x100005C6, VXR , General , 0), - INSTRUCTION(vcmpgtfp, 0x100002C6, VXR , General , 0), - INSTRUCTION(vcmpgtfp_c, 0x100006C6, VXR , General , 0), - INSTRUCTION(vcmpgtsb, 0x10000306, VXR , General , 0), - INSTRUCTION(vcmpgtsb_c, 0x10000706, VXR , General , 0), - INSTRUCTION(vcmpgtsh, 0x10000346, VXR , General , 0), - INSTRUCTION(vcmpgtsh_c, 0x10000746, VXR , General , 0), - INSTRUCTION(vcmpgtsw, 0x10000386, VXR , General , 0), - INSTRUCTION(vcmpgtsw_c, 0x10000786, VXR , General , 0), - INSTRUCTION(vcmpgtub, 0x10000206, VXR , General , 0), - INSTRUCTION(vcmpgtub_c, 0x10000606, VXR , General , 0), - INSTRUCTION(vcmpgtuh, 0x10000246, VXR , General , 0), - INSTRUCTION(vcmpgtuh_c, 0x10000646, VXR , General , 0), - INSTRUCTION(vcmpgtuw, 0x10000286, VXR , General , 0), - INSTRUCTION(vcmpgtuw_c, 0x10000686, VXR , General , 0), INSTRUCTION(vctsxs, 0x100003CA, VX , General , 0), INSTRUCTION(vctuxs, 0x1000038A, VX , General , 0), INSTRUCTION(vexptefp, 0x1000018A, VX , General , 0), INSTRUCTION(vlogefp, 0x100001CA, VX , General , 0), - INSTRUCTION(vmaddfp, 0x1000002E, VXA , General , 0), INSTRUCTION(vmaxfp, 0x1000040A, VX , General , 0), INSTRUCTION(vmaxsb, 0x10000102, VX , General , 0), INSTRUCTION(vmaxsh, 0x10000142, VX , General , 0), @@ -130,8 +103,6 @@ static InstrType instr_table_4_unprep[] = { INSTRUCTION(vmaxub, 0x10000002, VX , General , 0), INSTRUCTION(vmaxuh, 0x10000042, VX , General , 0), INSTRUCTION(vmaxuw, 0x10000082, VX , General , 0), - INSTRUCTION(vmhaddshs, 0x10000020, VXA , General , 0), - INSTRUCTION(vmhraddshs, 0x10000021, VXA , General , 0), INSTRUCTION(vminfp, 0x1000044A, VX , General , 0), INSTRUCTION(vminsb, 0x10000302, VX , General , 0), INSTRUCTION(vminsh, 0x10000342, VX , General , 0), @@ -139,19 +110,12 @@ static InstrType instr_table_4_unprep[] = { INSTRUCTION(vminub, 0x10000202, VX , General , 0), INSTRUCTION(vminuh, 0x10000242, VX , General , 0), INSTRUCTION(vminuw, 0x10000282, VX , General , 0), - INSTRUCTION(vmladduhm, 0x10000022, VXA , General , 0), INSTRUCTION(vmrghb, 0x1000000C, VX , General , 0), INSTRUCTION(vmrghh, 0x1000004C, VX , General , 0), INSTRUCTION(vmrghw, 0x1000008C, VX , General , 0), INSTRUCTION(vmrglb, 0x1000010C, VX , General , 0), INSTRUCTION(vmrglh, 0x1000014C, VX , General , 0), INSTRUCTION(vmrglw, 0x1000018C, VX , General , 0), - INSTRUCTION(vmsummbm, 0x10000025, VXA , General , 0), - INSTRUCTION(vmsumshm, 0x10000028, VXA , General , 0), - INSTRUCTION(vmsumshs, 0x10000029, VXA , General , 0), - INSTRUCTION(vmsumubm, 0x10000024, VXA , General , 0), - INSTRUCTION(vmsumuhm, 0x10000026, VXA , General , 0), - INSTRUCTION(vmsumuhs, 0x10000027, VXA , General , 0), INSTRUCTION(vmulesb, 0x10000308, VX , General , 0), INSTRUCTION(vmulesh, 0x10000348, VX , General , 0), INSTRUCTION(vmuleub, 0x10000208, VX , General , 0), @@ -160,10 +124,8 @@ static InstrType instr_table_4_unprep[] = { INSTRUCTION(vmulosh, 0x10000148, VX , General , 0), INSTRUCTION(vmuloub, 0x10000008, VX , General , 0), INSTRUCTION(vmulouh, 0x10000048, VX , General , 0), - INSTRUCTION(vnmsubfp, 0x1000002F, VXA , General , 0), INSTRUCTION(vnor, 0x10000504, VX , General , 0), INSTRUCTION(vor, 0x10000484, VX , General , 0), - INSTRUCTION(vperm, 0x1000002B, VXA , General , 0), INSTRUCTION(vpkpx, 0x1000030E, VX , General , 0), INSTRUCTION(vpkshss, 0x1000018E, VX , General , 0), INSTRUCTION(vpkshus, 0x1000010E, VX , General , 0), @@ -182,10 +144,8 @@ static InstrType instr_table_4_unprep[] = { INSTRUCTION(vrlh, 0x10000044, VX , General , 0), INSTRUCTION(vrlw, 0x10000084, VX , General , 0), INSTRUCTION(vrsqrtefp, 0x1000014A, VX , General , 0), - INSTRUCTION(vsel, 0x1000002A, VXA , General , 0), INSTRUCTION(vsl, 0x100001C4, VX , General , 0), INSTRUCTION(vslb, 0x10000104, VX , General , 0), - INSTRUCTION(vsldoi, 0x1000002C, VXA , General , 0), INSTRUCTION(vslh, 0x10000144, VX , General , 0), INSTRUCTION(vslo, 0x1000040C, VX , General , 0), INSTRUCTION(vslw, 0x10000184, VX , General , 0), @@ -538,7 +498,7 @@ static InstrType** instr_table = instr_table_prep( // Altivec instructions. // TODO(benvanik): build a table like the other instructions. // This table is looked up via linear scan of opcodes. -#define VX128_INSTRUCTION(name, opcode, format, type, flag) { \ +#define SCAN_INSTRUCTION(name, opcode, format, type, flag) { \ opcode, \ kXEPPCInstrMask##format, \ kXEPPCInstrFormat##format, \ @@ -554,87 +514,110 @@ static InstrType** instr_table = instr_table_prep( #define VX128_4(op, xop) (OP(op) | (((uint32_t)(xop)) & 0x730)) #define VX128_5(op, xop) (OP(op) | (((uint32_t)(xop)) & 0x10)) #define VX128_P(op, xop) (OP(op) | (((uint32_t)(xop)) & 0x630)) -static InstrType instr_table_vx128[] = { - VX128_INSTRUCTION(lvsl128, VX128_1(4, 3), VX128_1 , General , 0), - VX128_INSTRUCTION(lvsr128, VX128_1(4, 67), VX128_1 , General , 0), - VX128_INSTRUCTION(lvewx128, VX128_1(4, 131), VX128_1 , General , 0), - VX128_INSTRUCTION(lvx128, VX128_1(4, 195), VX128_1 , General , 0), - VX128_INSTRUCTION(stvewx128, VX128_1(4, 387), VX128_1 , General , 0), - VX128_INSTRUCTION(stvx128, VX128_1(4, 451), VX128_1 , General , 0), - VX128_INSTRUCTION(lvxl128, VX128_1(4, 707), VX128_1 , General , 0), - VX128_INSTRUCTION(stvxl128, VX128_1(4, 963), VX128_1 , General , 0), - VX128_INSTRUCTION(lvlx128, VX128_1(4, 1027), VX128_1 , General , 0), - VX128_INSTRUCTION(lvrx128, VX128_1(4, 1091), VX128_1 , General , 0), - VX128_INSTRUCTION(stvlx128, VX128_1(4, 1283), VX128_1 , General , 0), - VX128_INSTRUCTION(stvrx128, VX128_1(4, 1347), VX128_1 , General , 0), - VX128_INSTRUCTION(lvlxl128, VX128_1(4, 1539), VX128_1 , General , 0), - VX128_INSTRUCTION(lvrxl128, VX128_1(4, 1603), VX128_1 , General , 0), - VX128_INSTRUCTION(stvlxl128, VX128_1(4, 1795), VX128_1 , General , 0), - VX128_INSTRUCTION(stvrxl128, VX128_1(4, 1859), VX128_1 , General , 0), - VX128_INSTRUCTION(vsldoi128, VX128_5(4, 16), VX128_5 , General , 0), - VX128_INSTRUCTION(vperm128, VX128_2(5, 0), VX128_2 , General , 0), - VX128_INSTRUCTION(vaddfp128, VX128(5, 16), VX128 , General , 0), - VX128_INSTRUCTION(vsubfp128, VX128(5, 80), VX128 , General , 0), - VX128_INSTRUCTION(vmulfp128, VX128(5, 144), VX128 , General , 0), - VX128_INSTRUCTION(vmaddfp128, VX128(5, 208), VX128 , General , 0), - VX128_INSTRUCTION(vmaddcfp128, VX128(5, 272), VX128 , General , 0), - VX128_INSTRUCTION(vnmsubfp128, VX128(5, 336), VX128 , General , 0), - VX128_INSTRUCTION(vmsum3fp128, VX128(5, 400), VX128 , General , 0), - VX128_INSTRUCTION(vmsum4fp128, VX128(5, 464), VX128 , General , 0), - VX128_INSTRUCTION(vpkshss128, VX128(5, 512), VX128 , General , 0), - VX128_INSTRUCTION(vand128, VX128(5, 528), VX128 , General , 0), - VX128_INSTRUCTION(vpkshus128, VX128(5, 576), VX128 , General , 0), - VX128_INSTRUCTION(vandc128, VX128(5, 592), VX128 , General , 0), - VX128_INSTRUCTION(vpkswss128, VX128(5, 640), VX128 , General , 0), - VX128_INSTRUCTION(vnor128, VX128(5, 656), VX128 , General , 0), - VX128_INSTRUCTION(vpkswus128, VX128(5, 704), VX128 , General , 0), - VX128_INSTRUCTION(vor128, VX128(5, 720), VX128 , General , 0), - VX128_INSTRUCTION(vpkuhum128, VX128(5, 768), VX128 , General , 0), - VX128_INSTRUCTION(vxor128, VX128(5, 784), VX128 , General , 0), - VX128_INSTRUCTION(vpkuhus128, VX128(5, 832), VX128 , General , 0), - VX128_INSTRUCTION(vsel128, VX128(5, 848), VX128 , General , 0), - VX128_INSTRUCTION(vpkuwum128, VX128(5, 896), VX128 , General , 0), - VX128_INSTRUCTION(vslo128, VX128(5, 912), VX128 , General , 0), - VX128_INSTRUCTION(vpkuwus128, VX128(5, 960), VX128 , General , 0), - VX128_INSTRUCTION(vsro128, VX128(5, 976), VX128 , General , 0), - VX128_INSTRUCTION(vpermwi128, VX128_P(6, 528), VX128_P , General , 0), - VX128_INSTRUCTION(vcfpsxws128, VX128_3(6, 560), VX128_3 , General , 0), - VX128_INSTRUCTION(vcfpuxws128, VX128_3(6, 624), VX128_3 , General , 0), - VX128_INSTRUCTION(vcsxwfp128, VX128_3(6, 688), VX128_3 , General , 0), - VX128_INSTRUCTION(vcuxwfp128, VX128_3(6, 752), VX128_3 , General , 0), - VX128_INSTRUCTION(vrfim128, VX128_3(6, 816), VX128_3 , General , 0), - VX128_INSTRUCTION(vrfin128, VX128_3(6, 880), VX128_3 , General , 0), - VX128_INSTRUCTION(vrfip128, VX128_3(6, 944), VX128_3 , General , 0), - VX128_INSTRUCTION(vrfiz128, VX128_3(6, 1008), VX128_3 , General , 0), - VX128_INSTRUCTION(vpkd3d128, VX128_4(6, 1552), VX128_4 , General , 0), - VX128_INSTRUCTION(vrefp128, VX128_3(6, 1584), VX128_3 , General , 0), - VX128_INSTRUCTION(vrsqrtefp128, VX128_3(6, 1648), VX128_3 , General , 0), - VX128_INSTRUCTION(vexptefp128, VX128_3(6, 1712), VX128_3 , General , 0), - VX128_INSTRUCTION(vlogefp128, VX128_3(6, 1776), VX128_3 , General , 0), - VX128_INSTRUCTION(vrlimi128, VX128_4(6, 1808), VX128_4 , General , 0), - VX128_INSTRUCTION(vspltw128, VX128_3(6, 1840), VX128_3 , General , 0), - VX128_INSTRUCTION(vspltisw128, VX128_3(6, 1904), VX128_3 , General , 0), - VX128_INSTRUCTION(vupkd3d128, VX128_3(6, 2032), VX128_3 , General , 0), - VX128_INSTRUCTION(vcmpeqfp128, VX128(6, 0), VX128 , General , 0), - VX128_INSTRUCTION(vcmpeqfp128c, VX128(6, 64), VX128 , General , 0), - VX128_INSTRUCTION(vrlw128, VX128(6, 80), VX128 , General , 0), - VX128_INSTRUCTION(vcmpgefp128, VX128(6, 128), VX128 , General , 0), - VX128_INSTRUCTION(vcmpgefp128c, VX128(6, 192), VX128 , General , 0), - VX128_INSTRUCTION(vslw128, VX128(6, 208), VX128 , General , 0), - VX128_INSTRUCTION(vcmpgtfp128, VX128(6, 256), VX128 , General , 0), - VX128_INSTRUCTION(vcmpgtfp128c, VX128(6, 320), VX128 , General , 0), - VX128_INSTRUCTION(vsraw128, VX128(6, 336), VX128 , General , 0), - VX128_INSTRUCTION(vcmpbfp128, VX128(6, 384), VX128 , General , 0), - VX128_INSTRUCTION(vcmpbfp128c, VX128(6, 448), VX128 , General , 0), - VX128_INSTRUCTION(vsrw128, VX128(6, 464), VX128 , General , 0), - VX128_INSTRUCTION(vcmpequw128, VX128(6, 512), VX128 , General , 0), - VX128_INSTRUCTION(vcmpequw128c, VX128(6, 576), VX128 , General , 0), - VX128_INSTRUCTION(vmaxfp128, VX128(6, 640), VX128 , General , 0), - VX128_INSTRUCTION(vminfp128, VX128(6, 704), VX128 , General , 0), - VX128_INSTRUCTION(vmrghw128, VX128(6, 768), VX128 , General , 0), - VX128_INSTRUCTION(vmrglw128, VX128(6, 832), VX128 , General , 0), - VX128_INSTRUCTION(vupkhsb128, VX128(6, 896), VX128 , General , 0), - VX128_INSTRUCTION(vupklsb128, VX128(6, 960), VX128 , General , 0), +#define VX128_R(op, xop) (OP(op) | (((uint32_t)(xop)) & 0x390)) +static InstrType instr_table_scan[] = { + SCAN_INSTRUCTION(vcmpbfp, 0x100003C6, VXR , General , 0), + SCAN_INSTRUCTION(vcmpeqfp, 0x100000C6, VXR , General , 0), + SCAN_INSTRUCTION(vcmpequb, 0x10000006, VXR , General , 0), + SCAN_INSTRUCTION(vcmpequh, 0x10000046, VXR , General , 0), + SCAN_INSTRUCTION(vcmpequw, 0x10000086, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgefp, 0x100001C6, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtfp, 0x100002C6, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtsb, 0x10000306, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtsh, 0x10000346, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtsw, 0x10000386, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtub, 0x10000206, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtuh, 0x10000246, VXR , General , 0), + SCAN_INSTRUCTION(vcmpgtuw, 0x10000286, VXR , General , 0), + SCAN_INSTRUCTION(vmaddfp, 0x1000002E, VXA , General , 0), + SCAN_INSTRUCTION(vmhaddshs, 0x10000020, VXA , General , 0), + SCAN_INSTRUCTION(vmhraddshs, 0x10000021, VXA , General , 0), + SCAN_INSTRUCTION(vmladduhm, 0x10000022, VXA , General , 0), + SCAN_INSTRUCTION(vmsummbm, 0x10000025, VXA , General , 0), + SCAN_INSTRUCTION(vmsumshm, 0x10000028, VXA , General , 0), + SCAN_INSTRUCTION(vmsumshs, 0x10000029, VXA , General , 0), + SCAN_INSTRUCTION(vmsumubm, 0x10000024, VXA , General , 0), + SCAN_INSTRUCTION(vmsumuhm, 0x10000026, VXA , General , 0), + SCAN_INSTRUCTION(vmsumuhs, 0x10000027, VXA , General , 0), + SCAN_INSTRUCTION(vnmsubfp, 0x1000002F, VXA , General , 0), + SCAN_INSTRUCTION(vperm, 0x1000002B, VXA , General , 0), + SCAN_INSTRUCTION(vsel, 0x1000002A, VXA , General , 0), + SCAN_INSTRUCTION(vsldoi, 0x1000002C, VXA , General , 0), + SCAN_INSTRUCTION(lvsl128, VX128_1(4, 3), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvsr128, VX128_1(4, 67), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvewx128, VX128_1(4, 131), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvx128, VX128_1(4, 195), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvewx128, VX128_1(4, 387), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvx128, VX128_1(4, 451), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvxl128, VX128_1(4, 707), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvxl128, VX128_1(4, 963), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvlx128, VX128_1(4, 1027), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvrx128, VX128_1(4, 1091), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvlx128, VX128_1(4, 1283), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvrx128, VX128_1(4, 1347), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvlxl128, VX128_1(4, 1539), VX128_1 , General , 0), + SCAN_INSTRUCTION(lvrxl128, VX128_1(4, 1603), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvlxl128, VX128_1(4, 1795), VX128_1 , General , 0), + SCAN_INSTRUCTION(stvrxl128, VX128_1(4, 1859), VX128_1 , General , 0), + SCAN_INSTRUCTION(vsldoi128, VX128_5(4, 16), VX128_5 , General , 0), + SCAN_INSTRUCTION(vperm128, VX128_2(5, 0), VX128_2 , General , 0), + SCAN_INSTRUCTION(vaddfp128, VX128(5, 16), VX128 , General , 0), + SCAN_INSTRUCTION(vsubfp128, VX128(5, 80), VX128 , General , 0), + SCAN_INSTRUCTION(vmulfp128, VX128(5, 144), VX128 , General , 0), + SCAN_INSTRUCTION(vmaddfp128, VX128(5, 208), VX128 , General , 0), + SCAN_INSTRUCTION(vmaddcfp128, VX128(5, 272), VX128 , General , 0), + SCAN_INSTRUCTION(vnmsubfp128, VX128(5, 336), VX128 , General , 0), + SCAN_INSTRUCTION(vmsum3fp128, VX128(5, 400), VX128 , General , 0), + SCAN_INSTRUCTION(vmsum4fp128, VX128(5, 464), VX128 , General , 0), + SCAN_INSTRUCTION(vpkshss128, VX128(5, 512), VX128 , General , 0), + SCAN_INSTRUCTION(vand128, VX128(5, 528), VX128 , General , 0), + SCAN_INSTRUCTION(vpkshus128, VX128(5, 576), VX128 , General , 0), + SCAN_INSTRUCTION(vandc128, VX128(5, 592), VX128 , General , 0), + SCAN_INSTRUCTION(vpkswss128, VX128(5, 640), VX128 , General , 0), + SCAN_INSTRUCTION(vnor128, VX128(5, 656), VX128 , General , 0), + SCAN_INSTRUCTION(vpkswus128, VX128(5, 704), VX128 , General , 0), + SCAN_INSTRUCTION(vor128, VX128(5, 720), VX128 , General , 0), + SCAN_INSTRUCTION(vpkuhum128, VX128(5, 768), VX128 , General , 0), + SCAN_INSTRUCTION(vxor128, VX128(5, 784), VX128 , General , 0), + SCAN_INSTRUCTION(vpkuhus128, VX128(5, 832), VX128 , General , 0), + SCAN_INSTRUCTION(vsel128, VX128(5, 848), VX128 , General , 0), + SCAN_INSTRUCTION(vpkuwum128, VX128(5, 896), VX128 , General , 0), + SCAN_INSTRUCTION(vslo128, VX128(5, 912), VX128 , General , 0), + SCAN_INSTRUCTION(vpkuwus128, VX128(5, 960), VX128 , General , 0), + SCAN_INSTRUCTION(vsro128, VX128(5, 976), VX128 , General , 0), + SCAN_INSTRUCTION(vpermwi128, VX128_P(6, 528), VX128_P , General , 0), + SCAN_INSTRUCTION(vcfpsxws128, VX128_3(6, 560), VX128_3 , General , 0), + SCAN_INSTRUCTION(vcfpuxws128, VX128_3(6, 624), VX128_3 , General , 0), + SCAN_INSTRUCTION(vcsxwfp128, VX128_3(6, 688), VX128_3 , General , 0), + SCAN_INSTRUCTION(vcuxwfp128, VX128_3(6, 752), VX128_3 , General , 0), + SCAN_INSTRUCTION(vrfim128, VX128_3(6, 816), VX128_3 , General , 0), + SCAN_INSTRUCTION(vrfin128, VX128_3(6, 880), VX128_3 , General , 0), + SCAN_INSTRUCTION(vrfip128, VX128_3(6, 944), VX128_3 , General , 0), + SCAN_INSTRUCTION(vrfiz128, VX128_3(6, 1008), VX128_3 , General , 0), + SCAN_INSTRUCTION(vpkd3d128, VX128_4(6, 1552), VX128_4 , General , 0), + SCAN_INSTRUCTION(vrefp128, VX128_3(6, 1584), VX128_3 , General , 0), + SCAN_INSTRUCTION(vrsqrtefp128, VX128_3(6, 1648), VX128_3 , General , 0), + SCAN_INSTRUCTION(vexptefp128, VX128_3(6, 1712), VX128_3 , General , 0), + SCAN_INSTRUCTION(vlogefp128, VX128_3(6, 1776), VX128_3 , General , 0), + SCAN_INSTRUCTION(vrlimi128, VX128_4(6, 1808), VX128_4 , General , 0), + SCAN_INSTRUCTION(vspltw128, VX128_3(6, 1840), VX128_3 , General , 0), + SCAN_INSTRUCTION(vspltisw128, VX128_3(6, 1904), VX128_3 , General , 0), + SCAN_INSTRUCTION(vupkd3d128, VX128_3(6, 2032), VX128_3 , General , 0), + SCAN_INSTRUCTION(vcmpeqfp128, VX128_R(6, 0), VX128_R , General , 0), + SCAN_INSTRUCTION(vrlw128, VX128(6, 80), VX128 , General , 0), + SCAN_INSTRUCTION(vcmpgefp128, VX128_R(6, 128), VX128_R , General , 0), + SCAN_INSTRUCTION(vslw128, VX128(6, 208), VX128 , General , 0), + SCAN_INSTRUCTION(vcmpgtfp128, VX128_R(6, 256), VX128_R , General , 0), + SCAN_INSTRUCTION(vsraw128, VX128(6, 336), VX128 , General , 0), + SCAN_INSTRUCTION(vcmpbfp128, VX128_R(6, 384), VX128_R , General , 0), + SCAN_INSTRUCTION(vsrw128, VX128(6, 464), VX128 , General , 0), + SCAN_INSTRUCTION(vcmpequw128, VX128_R(6, 512), VX128_R , General , 0), + SCAN_INSTRUCTION(vmaxfp128, VX128(6, 640), VX128 , General , 0), + SCAN_INSTRUCTION(vminfp128, VX128(6, 704), VX128 , General , 0), + SCAN_INSTRUCTION(vmrghw128, VX128(6, 768), VX128 , General , 0), + SCAN_INSTRUCTION(vmrglw128, VX128(6, 832), VX128 , General , 0), + SCAN_INSTRUCTION(vupkhsb128, VX128(6, 896), VX128 , General , 0), + SCAN_INSTRUCTION(vupklsb128, VX128(6, 960), VX128 , General , 0), }; #undef OP #undef VX128 diff --git a/src/xenia/cpu/x64/x64_emit_altivec.cc b/src/xenia/cpu/x64/x64_emit_altivec.cc index abbccb2d6..057b4fba3 100644 --- a/src/xenia/cpu/x64/x64_emit_altivec.cc +++ b/src/xenia/cpu/x64/x64_emit_altivec.cc @@ -430,17 +430,7 @@ XEEMITTER(vcmpbfp, 0x100003C6, VXR )(X64Emitter& e, X86Compiler& c, Instr return 1; } -XEEMITTER(vcmpbfp128, VX128(6, 384), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpbfp_c, 0x100007C6, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpbfp128c, VX128(6, 448), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { +XEEMITTER(vcmpbfp128, VX128(6, 384), VX128_R)(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } @@ -450,17 +440,7 @@ XEEMITTER(vcmpeqfp, 0x100000C6, VXR )(X64Emitter& e, X86Compiler& c, Instr return 1; } -XEEMITTER(vcmpeqfp128, VX128(6, 0), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpeqfp_c, 0x100004C6, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpeqfp128c, VX128(6, 64), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { +XEEMITTER(vcmpeqfp128, VX128(6, 0), VX128_R)(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } @@ -470,37 +450,17 @@ XEEMITTER(vcmpequb, 0x10000006, VXR )(X64Emitter& e, X86Compiler& c, Instr return 1; } -XEEMITTER(vcmpequb_c, 0x10000406, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpequh, 0x10000046, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpequh_c, 0x10000446, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpequw, 0x10000086, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpequw128, VX128(6, 512), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpequw_c, 0x10000486, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpequw128c, VX128(6, 576), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { +XEEMITTER(vcmpequw128, VX128(6, 512), VX128_R)(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } @@ -510,17 +470,7 @@ XEEMITTER(vcmpgefp, 0x100001C6, VXR )(X64Emitter& e, X86Compiler& c, Instr return 1; } -XEEMITTER(vcmpgefp128, VX128(6, 128), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpgefp_c, 0x100005C6, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpgefp128c, VX128(6, 192), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { +XEEMITTER(vcmpgefp128, VX128(6, 128), VX128_R)(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } @@ -530,17 +480,7 @@ XEEMITTER(vcmpgtfp, 0x100002C6, VXR )(X64Emitter& e, X86Compiler& c, Instr return 1; } -XEEMITTER(vcmpgtfp128, VX128(6, 256), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpgtfp_c, 0x100006C6, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - -XEEMITTER(vcmpgtfp128c, VX128(6, 320), VX128 )(X64Emitter& e, X86Compiler& c, InstrData& i) { +XEEMITTER(vcmpgtfp128, VX128(6, 256), VX128_R)(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } @@ -550,61 +490,31 @@ XEEMITTER(vcmpgtsb, 0x10000306, VXR )(X64Emitter& e, X86Compiler& c, Instr return 1; } -XEEMITTER(vcmpgtsb_c, 0x10000706, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpgtsh, 0x10000346, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpgtsh_c, 0x10000746, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpgtsw, 0x10000386, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpgtsw_c, 0x10000786, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpgtub, 0x10000206, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpgtub_c, 0x10000606, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpgtuh, 0x10000246, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpgtuh_c, 0x10000646, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vcmpgtuw, 0x10000286, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; } -XEEMITTER(vcmpgtuw_c, 0x10000686, VXR )(X64Emitter& e, X86Compiler& c, InstrData& i) { - XEINSTRNOTIMPLEMENTED(); - return 1; -} - XEEMITTER(vctsxs, 0x100003CA, VX )(X64Emitter& e, X86Compiler& c, InstrData& i) { XEINSTRNOTIMPLEMENTED(); return 1; @@ -1786,40 +1696,22 @@ void X64RegisterEmitCategoryAltivec() { XEREGISTERINSTR(vcfpuxws128, VX128_3(6, 624)); XEREGISTERINSTR(vcmpbfp, 0x100003C6); XEREGISTERINSTR(vcmpbfp128, VX128(6, 384)); - XEREGISTERINSTR(vcmpbfp_c, 0x100007C6); - XEREGISTERINSTR(vcmpbfp128c, VX128(6, 448)); XEREGISTERINSTR(vcmpeqfp, 0x100000C6); XEREGISTERINSTR(vcmpeqfp128, VX128(6, 0)); - XEREGISTERINSTR(vcmpeqfp_c, 0x100004C6); - XEREGISTERINSTR(vcmpeqfp128c, VX128(6, 64)); XEREGISTERINSTR(vcmpequb, 0x10000006); - XEREGISTERINSTR(vcmpequb_c, 0x10000406); XEREGISTERINSTR(vcmpequh, 0x10000046); - XEREGISTERINSTR(vcmpequh_c, 0x10000446); XEREGISTERINSTR(vcmpequw, 0x10000086); XEREGISTERINSTR(vcmpequw128, VX128(6, 512)); - XEREGISTERINSTR(vcmpequw_c, 0x10000486); - XEREGISTERINSTR(vcmpequw128c, VX128(6, 576)); XEREGISTERINSTR(vcmpgefp, 0x100001C6); XEREGISTERINSTR(vcmpgefp128, VX128(6, 128)); - XEREGISTERINSTR(vcmpgefp_c, 0x100005C6); - XEREGISTERINSTR(vcmpgefp128c, VX128(6, 192)); XEREGISTERINSTR(vcmpgtfp, 0x100002C6); XEREGISTERINSTR(vcmpgtfp128, VX128(6, 256)); - XEREGISTERINSTR(vcmpgtfp_c, 0x100006C6); - XEREGISTERINSTR(vcmpgtfp128c, VX128(6, 320)); XEREGISTERINSTR(vcmpgtsb, 0x10000306); - XEREGISTERINSTR(vcmpgtsb_c, 0x10000706); XEREGISTERINSTR(vcmpgtsh, 0x10000346); - XEREGISTERINSTR(vcmpgtsh_c, 0x10000746); XEREGISTERINSTR(vcmpgtsw, 0x10000386); - XEREGISTERINSTR(vcmpgtsw_c, 0x10000786); XEREGISTERINSTR(vcmpgtub, 0x10000206); - XEREGISTERINSTR(vcmpgtub_c, 0x10000606); XEREGISTERINSTR(vcmpgtuh, 0x10000246); - XEREGISTERINSTR(vcmpgtuh_c, 0x10000646); XEREGISTERINSTR(vcmpgtuw, 0x10000286); - XEREGISTERINSTR(vcmpgtuw_c, 0x10000686); XEREGISTERINSTR(vctsxs, 0x100003CA); XEREGISTERINSTR(vctuxs, 0x1000038A); XEREGISTERINSTR(vexptefp, 0x1000018A);