From: H.J. Lu Date: Sun, 30 Sep 2007 21:27:16 +0000 (+0000) Subject: gas/ X-Git-Tag: sid-snapshot-20071001~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07e8d93c1c9b260b004cbaa61a02cfd4b15e5936;p=platform%2Fupstream%2Fbinutils.git gas/ 2007-09-30 H.J. Lu PR gas/5080 * config/tc-i386.c (check_long_reg): Also handle cvttss2si. (check_qword_reg): Also handle cvttsd2si. gas/testsuite/ 2007-09-30 H.J. Lu PR gas/5080 * gas/i386/simd-intel.d: Updated. * gas/i386/simd.d: Likewise. * gas/i386/x86-64-simd-intel.d: Likewise. * gas/i386/x86-64-simd.d: Likewise. * gas/i386/simd.s: Add new tests for cvttsd2si and cvttss2si. * gas/i386/x86-64-simd.s: Likewise. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index db081b6..3bee322 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2007-09-30 H.J. Lu + + PR gas/5080 + * config/tc-i386.c (check_long_reg): Also handle cvttss2si. + (check_qword_reg): Also handle cvttsd2si. + 2007-09-27 Kazu Hirata * config/m68k-parse.h (m68k_register): Use MBO instead of MBB. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index fd79330..0669c03 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -3686,11 +3686,12 @@ check_long_reg (void) || i.tm.operand_types[op].bitfield.acc)) { if (intel_syntax - && i.tm.base_opcode == 0xf30f2d + && (i.tm.base_opcode == 0xf30f2d + || i.tm.base_opcode == 0xf30f2c) && !i.types[0].bitfield.regxmm) { - /* cvtss2si converts DWORD memory to Reg64. We want - REX byte. */ + /* cvtss2si/cvttss2si convert DWORD memory to Reg64. We + want REX byte. */ i.suffix = QWORD_MNEM_SUFFIX; } else @@ -3733,11 +3734,12 @@ check_qword_reg (void) /* Prohibit these changes in the 64bit mode, since the lowering is more complicated. */ if (intel_syntax - && i.tm.base_opcode == 0xf20f2d + && (i.tm.base_opcode == 0xf20f2d + || i.tm.base_opcode == 0xf20f2c) && !i.types[0].bitfield.regxmm) { - /* cvtsd2si converts QWORD memory to Reg32. We don't want - REX byte. */ + /* cvtsd2si/cvttsd2si convert QWORD memory to Reg32. We + don't want REX byte. */ i.suffix = LONG_MNEM_SUFFIX; } else diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 6f8d27d..2f84c24 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2007-09-30 H.J. Lu + + PR gas/5080 + * gas/i386/simd-intel.d: Updated. + * gas/i386/simd.d: Likewise. + * gas/i386/x86-64-simd-intel.d: Likewise. + * gas/i386/x86-64-simd.d: Likewise. + + * gas/i386/simd.s: Add new tests for cvttsd2si and cvttss2si. + * gas/i386/x86-64-simd.s: Likewise. + 2007-09-27 H.J. Lu PR binutils/5072 diff --git a/gas/testsuite/gas/i386/simd-intel.d b/gas/testsuite/gas/i386/simd-intel.d index 3e00840..661856e 100644 --- a/gas/testsuite/gas/i386/simd-intel.d +++ b/gas/testsuite/gas/i386/simd-intel.d @@ -45,9 +45,11 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 2a 00 cvtpi2ps xmm0,QWORD PTR \[eax\] [ ]*[a-f0-9]+: 0f 2d 00 cvtps2pi mm0,QWORD PTR \[eax\] [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si eax,QWORD PTR \[eax\] +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si eax,QWORD PTR \[eax\] [ ]*[a-f0-9]+: f2 0f 5a 00 cvtsd2ss xmm0,QWORD PTR \[eax\] [ ]*[a-f0-9]+: f3 0f 5a 00 cvtss2sd xmm0,DWORD PTR \[eax\] [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si eax,DWORD PTR \[eax\] +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si eax,DWORD PTR \[eax\] [ ]*[a-f0-9]+: f2 0f 5e 00 divsd xmm0,QWORD PTR \[eax\] [ ]*[a-f0-9]+: f3 0f 5e 00 divss xmm0,DWORD PTR \[eax\] [ ]*[a-f0-9]+: f2 0f 5f 00 maxsd xmm0,QWORD PTR \[eax\] @@ -84,5 +86,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 38 35 00 pmovzxdq xmm0,QWORD PTR \[eax\] [ ]*[a-f0-9]+: 66 0f 3a 21 00 00 insertps xmm0,DWORD PTR \[eax\],0x0 [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si eax,DWORD PTR \[eax\] +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si eax,DWORD PTR \[eax\] [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si eax,QWORD PTR \[eax\] +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si eax,QWORD PTR \[eax\] #pass diff --git a/gas/testsuite/gas/i386/simd.d b/gas/testsuite/gas/i386/simd.d index 41a0616..110105e 100644 --- a/gas/testsuite/gas/i386/simd.d +++ b/gas/testsuite/gas/i386/simd.d @@ -44,9 +44,11 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 2a 00 cvtpi2ps \(%eax\),%xmm0 [ ]*[a-f0-9]+: 0f 2d 00 cvtps2pi \(%eax\),%mm0 [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si \(%eax\),%eax +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si \(%eax\),%eax [ ]*[a-f0-9]+: f2 0f 5a 00 cvtsd2ss \(%eax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 5a 00 cvtss2sd \(%eax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si \(%eax\),%eax +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si \(%eax\),%eax [ ]*[a-f0-9]+: f2 0f 5e 00 divsd \(%eax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 5e 00 divss \(%eax\),%xmm0 [ ]*[a-f0-9]+: f2 0f 5f 00 maxsd \(%eax\),%xmm0 @@ -83,5 +85,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 38 35 00 pmovzxdq \(%eax\),%xmm0 [ ]*[a-f0-9]+: 66 0f 3a 21 00 00 insertps \$0x0,\(%eax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si \(%eax\),%eax +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si \(%eax\),%eax [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si \(%eax\),%eax +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si \(%eax\),%eax #pass diff --git a/gas/testsuite/gas/i386/simd.s b/gas/testsuite/gas/i386/simd.s index 18808c1..ac4f047 100644 --- a/gas/testsuite/gas/i386/simd.s +++ b/gas/testsuite/gas/i386/simd.s @@ -38,9 +38,11 @@ _start: cvtpi2ps (%eax),%xmm0 cvtps2pi (%eax),%mm0 cvtsd2si (%eax),%eax + cvttsd2si (%eax),%eax cvtsd2ss (%eax),%xmm0 cvtss2sd (%eax),%xmm0 cvtss2si (%eax),%eax + cvttss2si (%eax),%eax divsd (%eax),%xmm0 divss (%eax),%xmm0 maxsd (%eax),%xmm0 @@ -80,4 +82,6 @@ _start: .intel_syntax noprefix cvtss2si eax,DWORD PTR [eax] + cvttss2si eax,DWORD PTR [eax] cvtsd2si eax,QWORD PTR [eax] + cvttsd2si eax,QWORD PTR [eax] diff --git a/gas/testsuite/gas/i386/x86-64-simd-intel.d b/gas/testsuite/gas/i386/x86-64-simd-intel.d index 732910e..d121902 100644 --- a/gas/testsuite/gas/i386/x86-64-simd-intel.d +++ b/gas/testsuite/gas/i386/x86-64-simd-intel.d @@ -48,10 +48,14 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 2d 00 cvtps2pi mm0,QWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si eax,QWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 48 0f 2d 00 cvtsd2si rax,QWORD PTR \[rax\] +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si eax,QWORD PTR \[rax\] +[ ]*[a-f0-9]+: f2 48 0f 2c 00 cvttsd2si rax,QWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 0f 5a 00 cvtsd2ss xmm0,QWORD PTR \[rax\] [ ]*[a-f0-9]+: f3 0f 5a 00 cvtss2sd xmm0,DWORD PTR \[rax\] -[ ]*[a-f0-9]+: f3 48 0f 2d 00 cvtss2si rax,DWORD PTR \[rax\] [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si eax,DWORD PTR \[rax\] +[ ]*[a-f0-9]+: f3 48 0f 2d 00 cvtss2si rax,DWORD PTR \[rax\] +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si eax,DWORD PTR \[rax\] +[ ]*[a-f0-9]+: f3 48 0f 2c 00 cvttss2si rax,DWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 0f 5e 00 divsd xmm0,QWORD PTR \[rax\] [ ]*[a-f0-9]+: f3 0f 5e 00 divss xmm0,DWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 0f 5f 00 maxsd xmm0,QWORD PTR \[rax\] @@ -89,6 +93,10 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 3a 21 00 00 insertps xmm0,DWORD PTR \[rax\],0x0 [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si eax,DWORD PTR \[rax\] [ ]*[a-f0-9]+: f3 48 0f 2d 00 cvtss2si rax,DWORD PTR \[rax\] +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si eax,DWORD PTR \[rax\] +[ ]*[a-f0-9]+: f3 48 0f 2c 00 cvttss2si rax,DWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si eax,QWORD PTR \[rax\] [ ]*[a-f0-9]+: f2 48 0f 2d 00 cvtsd2si rax,QWORD PTR \[rax\] +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si eax,QWORD PTR \[rax\] +[ ]*[a-f0-9]+: f2 48 0f 2c 00 cvttsd2si rax,QWORD PTR \[rax\] #pass diff --git a/gas/testsuite/gas/i386/x86-64-simd.d b/gas/testsuite/gas/i386/x86-64-simd.d index cbe1e5c..7dfc943 100644 --- a/gas/testsuite/gas/i386/x86-64-simd.d +++ b/gas/testsuite/gas/i386/x86-64-simd.d @@ -47,10 +47,14 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 2d 00 cvtps2pi \(%rax\),%mm0 [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si \(%rax\),%eax [ ]*[a-f0-9]+: f2 48 0f 2d 00 cvtsd2siq \(%rax\),%rax +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si \(%rax\),%eax +[ ]*[a-f0-9]+: f2 48 0f 2c 00 cvttsd2siq \(%rax\),%rax [ ]*[a-f0-9]+: f2 0f 5a 00 cvtsd2ss \(%rax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 5a 00 cvtss2sd \(%rax\),%xmm0 -[ ]*[a-f0-9]+: f3 48 0f 2d 00 cvtss2siq \(%rax\),%rax [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si \(%rax\),%eax +[ ]*[a-f0-9]+: f3 48 0f 2d 00 cvtss2siq \(%rax\),%rax +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si \(%rax\),%eax +[ ]*[a-f0-9]+: f3 48 0f 2c 00 cvttss2siq \(%rax\),%rax [ ]*[a-f0-9]+: f2 0f 5e 00 divsd \(%rax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 5e 00 divss \(%rax\),%xmm0 [ ]*[a-f0-9]+: f2 0f 5f 00 maxsd \(%rax\),%xmm0 @@ -88,6 +92,10 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 3a 21 00 00 insertps \$0x0,\(%rax\),%xmm0 [ ]*[a-f0-9]+: f3 0f 2d 00 cvtss2si \(%rax\),%eax [ ]*[a-f0-9]+: f3 48 0f 2d 00 cvtss2siq \(%rax\),%rax +[ ]*[a-f0-9]+: f3 0f 2c 00 cvttss2si \(%rax\),%eax +[ ]*[a-f0-9]+: f3 48 0f 2c 00 cvttss2siq \(%rax\),%rax [ ]*[a-f0-9]+: f2 0f 2d 00 cvtsd2si \(%rax\),%eax [ ]*[a-f0-9]+: f2 48 0f 2d 00 cvtsd2siq \(%rax\),%rax +[ ]*[a-f0-9]+: f2 0f 2c 00 cvttsd2si \(%rax\),%eax +[ ]*[a-f0-9]+: f2 48 0f 2c 00 cvttsd2siq \(%rax\),%rax #pass diff --git a/gas/testsuite/gas/i386/x86-64-simd.s b/gas/testsuite/gas/i386/x86-64-simd.s index e5bc395..08c2fac 100644 --- a/gas/testsuite/gas/i386/x86-64-simd.s +++ b/gas/testsuite/gas/i386/x86-64-simd.s @@ -41,10 +41,14 @@ _start: cvtps2pi (%rax),%mm0 cvtsd2si (%rax),%eax cvtsd2siq (%rax),%rax + cvttsd2si (%rax),%eax + cvttsd2siq (%rax),%rax cvtsd2ss (%rax),%xmm0 cvtss2sd (%rax),%xmm0 - cvtss2siq (%rax),%rax cvtss2si (%rax),%eax + cvtss2siq (%rax),%rax + cvttss2si (%rax),%eax + cvttss2siq (%rax),%rax divsd (%rax),%xmm0 divss (%rax),%xmm0 maxsd (%rax),%xmm0 @@ -85,5 +89,9 @@ _start: .intel_syntax noprefix cvtss2si eax,DWORD PTR [rax] cvtss2si rax,DWORD PTR [rax] + cvttss2si eax,DWORD PTR [rax] + cvttss2si rax,DWORD PTR [rax] cvtsd2si eax,QWORD PTR [rax] cvtsd2si rax,QWORD PTR [rax] + cvttsd2si eax,QWORD PTR [rax] + cvttsd2si rax,QWORD PTR [rax]