From 017d66ed0baccade719b2ec43b043f0b9696789d Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 26 Sep 2005 00:43:28 +0000 Subject: [PATCH] * x86id.re (yasm_x86__parse_check_insn): Implement GAS versions of pushf, popf, and conversion instructions (cbw, etc). Add test case for conversion instructions. svn path=/trunk/yasm/; revision=1244 --- modules/arch/x86/tests/gas64/Makefile.inc | 3 + modules/arch/x86/tests/gas64/gas-cbw.asm | 12 + modules/arch/x86/tests/gas64/gas-cbw.errwarn | 0 modules/arch/x86/tests/gas64/gas-cbw.hex | 528 +++++++++++++++++++ modules/arch/x86/x86id.re | 22 +- 5 files changed, 563 insertions(+), 2 deletions(-) create mode 100644 modules/arch/x86/tests/gas64/gas-cbw.asm create mode 100644 modules/arch/x86/tests/gas64/gas-cbw.errwarn create mode 100644 modules/arch/x86/tests/gas64/gas-cbw.hex diff --git a/modules/arch/x86/tests/gas64/Makefile.inc b/modules/arch/x86/tests/gas64/Makefile.inc index 087b6d7c..4ad4ccca 100644 --- a/modules/arch/x86/tests/gas64/Makefile.inc +++ b/modules/arch/x86/tests/gas64/Makefile.inc @@ -3,6 +3,9 @@ TESTS += modules/arch/x86/tests/gas64/x86_gas64_test.sh EXTRA_DIST += modules/arch/x86/tests/gas64/x86_gas64_test.sh +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-cbw.asm +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-cbw.errwarn +EXTRA_DIST += modules/arch/x86/tests/gas64/gas-cbw.hex EXTRA_DIST += modules/arch/x86/tests/gas64/gas-inout.asm EXTRA_DIST += modules/arch/x86/tests/gas64/gas-inout.errwarn EXTRA_DIST += modules/arch/x86/tests/gas64/gas-inout.hex diff --git a/modules/arch/x86/tests/gas64/gas-cbw.asm b/modules/arch/x86/tests/gas64/gas-cbw.asm new file mode 100644 index 00000000..4c96877e --- /dev/null +++ b/modules/arch/x86/tests/gas64/gas-cbw.asm @@ -0,0 +1,12 @@ +cbw +cdqe +cwde +cwd +cdq +cqo +cbtw +cltq +cwtl +cwtd +cltd +cqto diff --git a/modules/arch/x86/tests/gas64/gas-cbw.errwarn b/modules/arch/x86/tests/gas64/gas-cbw.errwarn new file mode 100644 index 00000000..e69de29b diff --git a/modules/arch/x86/tests/gas64/gas-cbw.hex b/modules/arch/x86/tests/gas64/gas-cbw.hex new file mode 100644 index 00000000..d421f372 --- /dev/null +++ b/modules/arch/x86/tests/gas64/gas-cbw.hex @@ -0,0 +1,528 @@ +7f +45 +4c +46 +02 +01 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +3e +00 +01 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +d0 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +40 +00 +05 +00 +01 +00 +66 +98 +48 +98 +98 +66 +99 +99 +48 +99 +66 +98 +48 +98 +98 +66 +99 +99 +48 +99 +00 +2e +74 +65 +78 +74 +00 +2e +73 +74 +72 +74 +61 +62 +00 +2e +73 +79 +6d +74 +61 +62 +00 +2e +73 +68 +73 +74 +72 +74 +61 +62 +00 +00 +00 +00 +00 +2d +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +04 +00 +f1 +ff +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +03 +00 +04 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +17 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +54 +00 +00 +00 +00 +00 +00 +00 +21 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +07 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +78 +00 +00 +00 +00 +00 +00 +00 +03 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +0f +00 +00 +00 +02 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +7c +00 +00 +00 +00 +00 +00 +00 +48 +00 +00 +00 +00 +00 +00 +00 +02 +00 +00 +00 +03 +00 +00 +00 +08 +00 +00 +00 +00 +00 +00 +00 +18 +00 +00 +00 +00 +00 +00 +00 +01 +00 +00 +00 +01 +00 +00 +00 +06 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +40 +00 +00 +00 +00 +00 +00 +00 +14 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +10 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 +00 diff --git a/modules/arch/x86/x86id.re b/modules/arch/x86/x86id.re index d3047c50..4f3ae6bf 100644 --- a/modules/arch/x86/x86id.re +++ b/modules/arch/x86/x86id.re @@ -3424,6 +3424,7 @@ yasm_x86__parse_check_insn(yasm_arch *arch, unsigned long data[4], S A H F { RET_INSN(4, onebyte, 0x009E, CPU_Any); } P U S H F { RET_INSN(5, onebyte, 0x009C, CPU_Any); } P U S H F D { RET_INSN_NONGAS(6, onebyte, 0x209C, CPU_386); } + P U S H F L { RET_INSN_GAS(6, onebyte, 0x209C, CPU_386); } P U S H F W { RET_INSN(6, onebyte, 0x109C, CPU_Any); } P U S H F Q { warn64 = 1; @@ -3432,7 +3433,11 @@ yasm_x86__parse_check_insn(yasm_arch *arch, unsigned long data[4], P O P F { RET_INSN(4, onebyte, 0x40009D, CPU_Any); } P O P F D { not64 = 1; - RET_INSN(5, onebyte, 0x00209D, CPU_386); + RET_INSN_NONGAS(5, onebyte, 0x00209D, CPU_386); + } + P O P F L { + not64 = 1; + RET_INSN_GAS(5, onebyte, 0x00209D, CPU_386); } P O P F W { RET_INSN(5, onebyte, 0x40109D, CPU_Any); } P O P F Q { @@ -3489,10 +3494,23 @@ yasm_x86__parse_check_insn(yasm_arch *arch, unsigned long data[4], } C W D { RET_INSN(3, onebyte, 0x1099, CPU_Any); } C D Q { RET_INSN(3, onebyte, 0x2099, CPU_386); } - C D O { + C Q O { warn64 = 1; RET_INSN(3, onebyte, 0x4099, CPU_Hammer|CPU_64); } + /* Conversion instructions - GAS / AT&T naming */ + C B T W { RET_INSN_GAS(4, onebyte, 0x1098, CPU_Any); } + C W T L { RET_INSN_GAS(4, onebyte, 0x2098, CPU_386); } + C L T Q { + warn64 = 1; + RET_INSN_GAS(4, onebyte, 0x4098, CPU_Hammer|CPU_64); + } + C W T D { RET_INSN_GAS(4, onebyte, 0x1099, CPU_Any); } + C L T D { RET_INSN_GAS(4, onebyte, 0x2099, CPU_386); } + C Q T O { + warn64 = 1; + RET_INSN_GAS(4, onebyte, 0x4099, CPU_Hammer|CPU_64); + } /* Multiplication and division */ M U L { RET_INSN(3, f6, 0x04, CPU_Any); } I M U L { RET_INSN(4, imul, 0, CPU_Any); } -- 2.40.0