From 07e8d93c1c9b260b004cbaa61a02cfd4b15e5936 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 30 Sep 2007 21:27:16 +0000 Subject: [PATCH] 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. --- gas/ChangeLog | 6 ++++++ gas/config/tc-i386.c | 14 ++++++++------ gas/testsuite/ChangeLog | 11 +++++++++++ gas/testsuite/gas/i386/simd-intel.d | 4 ++++ gas/testsuite/gas/i386/simd.d | 4 ++++ gas/testsuite/gas/i386/simd.s | 4 ++++ gas/testsuite/gas/i386/x86-64-simd-intel.d | 10 +++++++++- gas/testsuite/gas/i386/x86-64-simd.d | 10 +++++++++- gas/testsuite/gas/i386/x86-64-simd.s | 10 +++++++++- 9 files changed, 64 insertions(+), 9 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index db081b6d7f9..3bee322c4af 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 fd79330487d..0669c03542c 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 6f8d27d93c2..2f84c24c369 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 3e0084057f9..661856e1b58 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 41a06163558..110105ebc6b 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 18808c1a964..ac4f047b36d 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 732910e3a2c..d12190222a0 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 cbe1e5ccb9f..7dfc943fed6 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 e5bc395af30..08c2facebf4 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] -- 2.30.2