diff options
author | Calin Juravle <calin@google.com> | 2014-11-25 20:56:51 +0000 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-11-26 16:49:23 +0000 |
commit | fd861249f31ab360c12dd1ffb131d50f02b0bfc6 (patch) | |
tree | 1765db2b26337f8e96616ebfb769c95d7b421ad2 /compiler/utils/x86_64 | |
parent | fef1680241e85532919ecfaf42855d31ddb69361 (diff) | |
download | art-fd861249f31ab360c12dd1ffb131d50f02b0bfc6.zip art-fd861249f31ab360c12dd1ffb131d50f02b0bfc6.tar.gz art-fd861249f31ab360c12dd1ffb131d50f02b0bfc6.tar.bz2 |
[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}
- adds float comparison for arm, x86, x86_64 backends.
- adds ucomis{s,d} assembly to x86 and x86_64.
Change-Id: I232d2b6e9ecf373beb5cc63698dd97a658ff9c83
Diffstat (limited to 'compiler/utils/x86_64')
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.cc | 18 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.h | 2 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64_test.cc | 8 | ||||
-rw-r--r-- | compiler/utils/x86_64/constants_x86_64.h | 3 |
4 files changed, 30 insertions, 1 deletions
diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc index dff3849..2b7ec0f 100644 --- a/compiler/utils/x86_64/assembler_x86_64.cc +++ b/compiler/utils/x86_64/assembler_x86_64.cc @@ -700,6 +700,24 @@ void X86_64Assembler::comisd(XmmRegister a, XmmRegister b) { EmitXmmRegisterOperand(a.LowBits(), b); } +void X86_64Assembler::ucomiss(XmmRegister a, XmmRegister b) { + AssemblerBuffer::EnsureCapacity ensured(&buffer_); + EmitOptionalRex32(a, b); + EmitUint8(0x0F); + EmitUint8(0x2E); + EmitXmmRegisterOperand(a.LowBits(), b); +} + + +void X86_64Assembler::ucomisd(XmmRegister a, XmmRegister b) { + AssemblerBuffer::EnsureCapacity ensured(&buffer_); + EmitUint8(0x66); + EmitOptionalRex32(a, b); + EmitUint8(0x0F); + EmitUint8(0x2E); + EmitXmmRegisterOperand(a.LowBits(), b); +} + void X86_64Assembler::sqrtsd(XmmRegister dst, XmmRegister src) { AssemblerBuffer::EnsureCapacity ensured(&buffer_); diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h index ab1bc9e..929ed31 100644 --- a/compiler/utils/x86_64/assembler_x86_64.h +++ b/compiler/utils/x86_64/assembler_x86_64.h @@ -344,6 +344,8 @@ class X86_64Assembler FINAL : public Assembler { void comiss(XmmRegister a, XmmRegister b); void comisd(XmmRegister a, XmmRegister b); + void ucomiss(XmmRegister a, XmmRegister b); + void ucomisd(XmmRegister a, XmmRegister b); void sqrtsd(XmmRegister dst, XmmRegister src); void sqrtss(XmmRegister dst, XmmRegister src); diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index 14a98b9..c8e923c 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -660,6 +660,14 @@ TEST_F(AssemblerX86_64Test, Comisd) { DriverStr(RepeatFF(&x86_64::X86_64Assembler::comisd, "comisd %{reg2}, %{reg1}"), "comisd"); } +TEST_F(AssemblerX86_64Test, Ucomiss) { + DriverStr(RepeatFF(&x86_64::X86_64Assembler::ucomiss, "ucomiss %{reg2}, %{reg1}"), "ucomiss"); +} + +TEST_F(AssemblerX86_64Test, Ucomisd) { + DriverStr(RepeatFF(&x86_64::X86_64Assembler::ucomisd, "ucomisd %{reg2}, %{reg1}"), "ucomisd"); +} + TEST_F(AssemblerX86_64Test, Sqrtss) { DriverStr(RepeatFF(&x86_64::X86_64Assembler::sqrtss, "sqrtss %{reg2}, %{reg1}"), "sqrtss"); } diff --git a/compiler/utils/x86_64/constants_x86_64.h b/compiler/utils/x86_64/constants_x86_64.h index 2a5b43d..0c782d4 100644 --- a/compiler/utils/x86_64/constants_x86_64.h +++ b/compiler/utils/x86_64/constants_x86_64.h @@ -105,7 +105,8 @@ enum Condition { kZero = kEqual, kNotZero = kNotEqual, kNegative = kSign, - kPositive = kNotSign + kPositive = kNotSign, + kUnordered = kParityEven }; |