This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add CX16 flag to asm


On Wed, Sep 19, 2012 at 2:46 PM, Michael Zolotukhin
<michael.v.zolotukhin@gmail.com> wrote:
> Here is a patch with the tests - I didn't add new tests to arch-10.s,
> as CMPXCHG16B is available only on 64 bits.
>
> Changelogs:
> gas/Changelog:
> 2012-09-19  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>
>
>         * config/tc-i386.c: Add CX16 flag.
>         * doc/c-i386.texi: Document the new flag.
>
> opcodes/Changelog:
> 2012-09-19  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>
>
>         * i386-gen.c (cpu_flag_init): Add CpuCX16 and add the flag to
>         CPU_NOCONA_FLAGS, CPU_CORE_FLAGS, CPU_CORE2_FLAGS, CPU_COREI7_FLAGS,
>         CPU_BDVER1_FLAGS, CPU_BDVER2_FLAGS, CPU_BTVER1_FLAGS,
>         CPU_BTVER2_FLAGS.
>         (cpu_flags): Add CpuCX16.
>         * i386-opc.h: Add CpuCX16.
>         * i386-opc.tbl: Use new flag in CMPXCHG16B.
>         * i386-tbl.h: Regenerate.
>         * i386-init.h: Likewise.
>
> gas/testsuite/Changelog:
> 2012-09-19  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>
>
>         * gas/i386/x86-64-arch-2.s: Add test for CMPXCHG16B.
>         * gas/i386/x86-64-arch-2.d: Update correspondingly.
>         * gas/i386/x86-64-arch-2-bdver2.d: Likewise.
>         * gas/i386/x86-64-arch-2-btver1.d: Likewise.
>         * gas/i386/x86-64-arch-2-btver2.d: Likewise.
>         * gas/i386/x86-64-arch-2-lzcnt.d: Likewise.
>         * gas/i386/x86-64-arch-2-prefetchw.d: Likewise.
>         * gas/i386/ilp32/x86-64-arch-2.d: Likewise.
>

I checked in this patch to add 2 new tests.


-- 
H.J.
--
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 07c73e0..47baaff 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* gas/i386/i386.exp: Run x86-64-arch-2-1 and x86-64-arch-2-2.
+
+	* gas/i386/x86-64-arch-2-1.l: New file.
+	* gas/i386/x86-64-arch-2-1.s: Likewise.
+	* gas/i386/x86-64-arch-2-2.l: Likewise.
+	* gas/i386/x86-64-arch-2-2.s: Likewise.
+
 2012-09-20  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>

 	* gas/i386/x86-64-arch-2.s: Add test for cmpxchg16b.
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 2cfe8ec..76eef34 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -399,6 +399,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget
"x86_64-*-*"]) && [gas_64_check]] t
     run_dump_test "x86-64-arch-2-bdver2"
     run_dump_test "x86-64-arch-2-btver1"
     run_dump_test "x86-64-arch-2-btver2"
+    run_list_test "x86-64-arch-2-1" "-march=generic64 -I${srcdir}/$subdir -al"
+    run_list_test "x86-64-arch-2-2" "-march=generic64+cx16
-I${srcdir}/$subdir -al"
     run_dump_test "x86-64-xsave"
     run_dump_test "x86-64-xsave-intel"
     run_dump_test "x86-64-aes"
diff --git a/gas/testsuite/gas/i386/x86-64-arch-2-1.l
b/gas/testsuite/gas/i386/x86-64-arch-2-1.l
new file mode 100644
index 0000000..355b91c
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-arch-2-1.l
@@ -0,0 +1,97 @@
+.*: Assembler messages:
+.*:16: Error: .*
+.*:18: Error: .*
+.*:20: Error: .*
+.*:22: Error: .*
+.*:24: Error: .*
+.*:26: Error: .*
+.*:28: Error: .*
+.*:30: Error: .*
+.*:32: Error: .*
+.*:34: Error: .*
+.*:36: Error: .*
+.*:38: Error: .*
+.*:40: Error: .*
+.*:42: Error: .*
+.*:44: Error: .*
+.*:46: Error: .*
+.*:48: Error: .*
+.*:50: Error: .*
+.*:52: Error: .*
+.*:54: Error: .*
+.*:56: Error: .*
+.*:58: Error: .*
+.*:60: Error: .*
+.*:62: Error: .*
+.*:64: Error: .*
+GAS LISTING .*
+
+
+[ 	]*1[ 	]+\.include "x86-64-arch-2\.s"
+[ 	]*1[ 	]+\# Test -march=
+[ 	]*2[ 	]+\.text
+[ 	]*3[ 	]+\# cmov feature
+[ 	]*4[ 	]+\?\?\?\? 0F44D8   	cmove	%eax,%ebx
+[ 	]*5[ 	]+\# clflush
+[ 	]*6[ 	]+\?\?\?\? 0FAE38   	clflush \(%rax\)
+[ 	]*7[ 	]+\# SYSCALL
+[ 	]*8[ 	]+\?\?\?\? 0F05     	syscall
+[ 	]*9[ 	]+\# MMX
+[ 	]*10[ 	]+\?\?\?\? 0FFCDC   	paddb %mm4,%mm3
+[ 	]*11[ 	]+\# SSE
+[ 	]*12[ 	]+\?\?\?\? F30F58DC 	addss %xmm4,%xmm3
+[ 	]*13[ 	]+\# SSE2
+[ 	]*14[ 	]+\?\?\?\? F20F58DC 	addsd %xmm4,%xmm3
+[ 	]*15[ 	]+\# SSE3
+[ 	]*16[ 	]+addsubpd %xmm4,%xmm3
+[ 	]*17[ 	]+\# SSSE3
+[ 	]*18[ 	]+phaddw %xmm4,%xmm3
+[ 	]*19[ 	]+\# SSE4\.1
+[ 	]*20[ 	]+phminposuw  %xmm1,%xmm3
+[ 	]*21[ 	]+\# SSE4\.2
+[ 	]*22[ 	]+crc32   %ecx,%ebx
+[ 	]*23[ 	]+\# AVX
+[ 	]*24[ 	]+vzeroall
+[ 	]*25[ 	]+\# VMX
+[ 	]*26[ 	]+vmxoff
+[ 	]*27[ 	]+\# SMX
+[ 	]*28[ 	]+getsec
+[ 	]*29[ 	]+\# Xsave
+[ 	]*30[ 	]+xgetbv
+[ 	]*31[ 	]+\# Xsaveopt
+[ 	]*32[ 	]+xsaveopt \(%rcx\)
+[ 	]*33[ 	]+\# AES
+[ 	]*34[ 	]+aesenc  \(%rcx\),%xmm0
+[ 	]*35[ 	]+\# PCLMUL
+[ 	]*36[ 	]+pclmulqdq \$8,%xmm1,%xmm0
+[ 	]*37[ 	]+\# AES \+ AVX
+[ 	]*38[ 	]+vaesenc  \(%rcx\),%xmm0,%xmm2
+[ 	]*39[ 	]+\# PCLMUL \+ AVX
+[ 	]*40[ 	]+vpclmulqdq \$8,%xmm4,%xmm6,%xmm2
+[ 	]*41[ 	]+\# FMA
+[ 	]*42[ 	]+vfmadd132pd %xmm4,%xmm6,%xmm2
+[ 	]*43[ 	]+\# MOVBE
+[ 	]*44[ 	]+movbe   \(%rcx\),%ebx
+[ 	]*45[ 	]+\# CX16
+[ 	]*46[ 	]+cmpxchg16b \(%rsi\)
+[ 	]*47[ 	]+\# EPT
+[ 	]*48[ 	]+invept  \(%rcx\),%rbx
+[ 	]*49[ 	]+\# RDTSCP
+[ 	]*50[ 	]+rdtscp
+[ 	]*51[ 	]+\# 3DNow or PRFCHW
+[ 	]*52[ 	]+prefetchw   0x1000\(,%rsi,2\)
+[ 	]*53[ 	]+\# SSE4a
+[ 	]*54[ 	]+insertq %xmm2,%xmm1
+[ 	]*55[ 	]+\# SVME
+[ 	]*56[ 	]+vmload
+
 GAS LISTING .*
+
+
+[ 	]*57[ 	]+\# ABM/LZCNT
+[ 	]*58[ 	]+lzcnt %ecx,%ebx
+[ 	]*59[ 	]+\# PadLock
+[ 	]*60[ 	]+xstorerng
+[ 	]*61[ 	]+\# BMI
+[ 	]*62[ 	]+blsr %ecx,%ebx
+[ 	]*63[ 	]+\# TBM
+[ 	]*64[ 	]+blcfill %ecx,%ebx
diff --git a/gas/testsuite/gas/i386/x86-64-arch-2-1.s
b/gas/testsuite/gas/i386/x86-64-arch-2-1.s
new file mode 100644
index 0000000..63544a1
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-arch-2-1.s
@@ -0,0 +1 @@
+.include "x86-64-arch-2.s"
diff --git a/gas/testsuite/gas/i386/x86-64-arch-2-2.l
b/gas/testsuite/gas/i386/x86-64-arch-2-2.l
new file mode 100644
index 0000000..2f8bf56
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-arch-2-2.l
@@ -0,0 +1,96 @@
+.*: Assembler messages:
+.*:16: Error: .*
+.*:18: Error: .*
+.*:20: Error: .*
+.*:22: Error: .*
+.*:24: Error: .*
+.*:26: Error: .*
+.*:28: Error: .*
+.*:30: Error: .*
+.*:32: Error: .*
+.*:34: Error: .*
+.*:36: Error: .*
+.*:38: Error: .*
+.*:40: Error: .*
+.*:42: Error: .*
+.*:44: Error: .*
+.*:48: Error: .*
+.*:50: Error: .*
+.*:52: Error: .*
+.*:54: Error: .*
+.*:56: Error: .*
+.*:58: Error: .*
+.*:60: Error: .*
+.*:62: Error: .*
+.*:64: Error: .*
+GAS LISTING .*
+
+
+[ 	]*1[ 	]+\.include "x86-64-arch-2\.s"
+[ 	]*1[ 	]+\# Test -march=
+[ 	]*2[ 	]+\.text
+[ 	]*3[ 	]+\# cmov feature
+[ 	]*4[ 	]+\?\?\?\? 0F44D8   	cmove	%eax,%ebx
+[ 	]*5[ 	]+\# clflush
+[ 	]*6[ 	]+\?\?\?\? 0FAE38   	clflush \(%rax\)
+[ 	]*7[ 	]+\# SYSCALL
+[ 	]*8[ 	]+\?\?\?\? 0F05     	syscall
+[ 	]*9[ 	]+\# MMX
+[ 	]*10[ 	]+\?\?\?\? 0FFCDC   	paddb %mm4,%mm3
+[ 	]*11[ 	]+\# SSE
+[ 	]*12[ 	]+\?\?\?\? F30F58DC 	addss %xmm4,%xmm3
+[ 	]*13[ 	]+\# SSE2
+[ 	]*14[ 	]+\?\?\?\? F20F58DC 	addsd %xmm4,%xmm3
+[ 	]*15[ 	]+\# SSE3
+[ 	]*16[ 	]+addsubpd %xmm4,%xmm3
+[ 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VME
+[ 	]*56[ 	]+vmload
+
 GAS LISTING .*
+
+
+[ 	]*57[ 	]+\# ABM/LZCNT
+[ 	]*58[ 	]+lzcnt %ecx,%ebx
+[ 	]*59[ 	]+\# PadLock
+[ 	]*60[ 	]+xstorerng
+[ 	]*61[ 	]+\# BMI
+[ 	]*62[ 	]+blsr %ecx,%ebx
+[ 	]*63[ 	]+\# TBM
+[ 	]*64[ 	]+blcfill %ecx,%ebx
diff --git a/gas/testsuite/gas/i386/x86-64-arch-2-2.s
b/gas/testsuite/gas/i386/x86-64-arch-2-2.s
new file mode 100644
index 0000000..63544a1
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-arch-2-2.s
@@ -0,0 +1 @@
+.include "x86-64-arch-2.s"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]