From ba5e86faf5151261a26f7b7a77459904e8bc208c Mon Sep 17 00:00:00 2001 From: jdh8d <jdh8d@git.zephyr-software.com> Date: Sat, 11 Jul 2015 13:13:56 +0000 Subject: [PATCH] Fixed scons to conditionally use iconv. decoder updates. Former-commit-id: ed98bd0e3aa5ede964bdf05e9dcc1ae57c9328f5 --- SConscript | 13 ++++++++-- .../Includes/instr_set/opcodes_MMX.c | 6 +++-- .../Includes/instr_set/opcodes_SSE.c | 21 ++++++++------- .../Includes/instr_set/opcodes_VEX.c | 26 +++++++++++++++++-- 4 files changed, 51 insertions(+), 15 deletions(-) diff --git a/SConscript b/SConscript index 79a031c1e..28ca7a4af 100644 --- a/SConscript +++ b/SConscript @@ -4,6 +4,9 @@ import tarfile Import('env') +(sysname, nodename, release, version, machine)=os.uname() + + if env.GetOption('clean'): if os.path.exists(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/ELFIO"): print 'Removing third_party/ELFIO' @@ -49,14 +52,20 @@ else: # check/install targ-config.h if not os.path.isfile(os.environ['SECURITY_TRANSFORMS_HOME']+"/include/targ-config.h"): - (sysname, nodename, release, version, machine)=os.uname() #print "uname=", sysname, " xx ", nodename, " xx ", release, " xx ", version, " xx ", machine shutil.copy( os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'],"include",machine,"config.h"), os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'],"include","targ-config.h")) -env['BASE_IRDB_LIBS']="IRDB-core", "pqxx", "pq", "beaEngine_s_d", "EXEIO", "pebliss", "iconv" +# setup libraries needed for linking +env['BASE_IRDB_LIBS']="IRDB-core", "pqxx", "pq", "BeaEngine_s_d", "EXEIO", "pebliss" + +# pebliss requires iconv, which needs to be explicit on cygwin. +if sysname == "Cygwin": + env['BASE_IRDB_LIBS'].append("iconv") + + Export('env') #print 'env=' #print env.Dump() diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c index b5d4bee87..cbae3a440 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_MMX.c @@ -214,15 +214,17 @@ void __bea_callspec__ movq_QP(PDISASM pMyDisasm) (*pMyDisasm).Instruction.Category = MMX_INSTRUCTION+DATA_TRANSFER; /* ========= 0xf3 */ if (GV.PrefRepe == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { - assert(!GV.VEX.has_vex); +// assert(!GV.VEX.has_vex); (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg1dqword; #ifndef BEA_LIGHT_DISASSEMBLY (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movdqu "); #endif - GV.SSE_ = 1; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; ExGx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } /* ========== 0x66 */ else if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==1)) { diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c index 8131a4f6d..8d4b0f2ef 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_SSE.c @@ -54,18 +54,18 @@ void __bea_callspec__ addps_VW(PDISASM pMyDisasm) #endif /* ========= 0xf2 */ if (GV.PrefRepne == 1 || (GV.VEX.has_vex && GV.VEX.implicit_prefixes==3)) { - assert(!GV.VEX.has_vex); +// assert(!GV.VEX.has_vex); (*pMyDisasm).Prefix.RepnePrefix = MandatoryPrefix; GV.MemDecoration = Arg2fword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+ARITHMETIC_INSTRUCTION; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "addsd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "addsd "); #endif } /* ========= 0xf3 */ else if (GV.PrefRepe == 1|| (GV.VEX.has_vex && GV.VEX.implicit_prefixes==2)) { - assert(!GV.VEX.has_vex); +// assert(!GV.VEX.has_vex); (*pMyDisasm).Prefix.RepPrefix = MandatoryPrefix; GV.MemDecoration = Arg2dword; (*pMyDisasm).Instruction.Category = SSE_INSTRUCTION+ARITHMETIC_INSTRUCTION; @@ -1541,17 +1541,18 @@ void __bea_callspec__ movaps_VW(PDISASM pMyDisasm) /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - assert(!GV.VEX.has_vex); /* FIXME */ GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg2dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movapd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movapd "); #endif - GV.SSE_ = 1; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; GxEx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } else { GV.MemDecoration = Arg2dqword; @@ -1578,17 +1579,19 @@ void __bea_callspec__ movaps_WV(PDISASM pMyDisasm) #endif /* ========== 0x66 */ if ((*pMyDisasm).Prefix.OperandSize == InUsePrefix) { - assert(!GV.VEX.has_vex); /* FIXME */ +// assert(!GV.VEX.has_vex); /* FIXME */ GV.OperandSize = GV.OriginalOperandSize; (*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; GV.MemDecoration = Arg1dqword; (*pMyDisasm).Instruction.Category = SSE2_INSTRUCTION+DATA_TRANSFER; #ifndef BEA_LIGHT_DISASSEMBLY - (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "movapd "); + (void) strcat ((*pMyDisasm).Instruction.Mnemonic, "movapd "); #endif - GV.SSE_ = 1; + GV.AVX_ = GV.VEX.length; + GV.SSE_ = !GV.VEX.length; ExGx(pMyDisasm); GV.SSE_ = 0; + GV.AVX_ = 0; } else { GV.MemDecoration = Arg1fword; diff --git a/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c b/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c index b9c9f48db..ee7602bdc 100644 --- a/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c +++ b/beaengine/beaengineSources/Includes/instr_set/opcodes_VEX.c @@ -531,8 +531,30 @@ void vbrdcstss (PDISASM pMyDisasm) /* vbroadcastsd -- shortened for table formatting reasons */ void vbrdcstsd (PDISASM pMyDisasm) { -assert(pMyDisasm); -assert(0); + int origOpSize=0; + + (*pMyDisasm).Instruction.Category = AVX_INSTRUCTION+PACKED_BLENDING_INSTRUCTION; + #ifndef BEA_LIGHT_DISASSEMBLY + (void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "vbroadcastsd "); + #endif + + if(!GV.VEX.has_vex) + FailDecode(pMyDisasm); + + origOpSize=GV.OperandSize; + GV.OperandSize=256; + + GV.AVX_=GV.VEX.length; + GV.SSE_=!GV.VEX.length; + + GV.MemDecoration=Arg2dword; + MOD_RM(&(*pMyDisasm).Argument2, pMyDisasm); + Reg_Opcode(&(*pMyDisasm).Argument1, pMyDisasm); + GV.EIP_ += GV.DECALAGE_EIP+2; + + GV.AVX_=0; + GV.SSE_=0; + GV.OperandSize=origOpSize; } /* 0f 3a 19 */ -- GitLab