From: dusan.milosavljevic Date: Thu, 30 Apr 2015 16:43:00 +0000 (-0700) Subject: MIPS: Add min/max suffixed variants. X-Git-Tag: upstream/4.7.83~2859 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76ddd58cff4bc5bcb93578ffd050e4a38a1edcd1;p=platform%2Fupstream%2Fv8.git MIPS: Add min/max suffixed variants. TEST= BUG= Review URL: https://codereview.chromium.org/1118693002 Cr-Commit-Position: refs/heads/master@{#28181} --- diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc index 237b4f42b..3e7ec15b0 100644 --- a/src/mips/assembler-mips.cc +++ b/src/mips/assembler-mips.cc @@ -2344,6 +2344,46 @@ void Assembler::maxa(SecondaryField fmt, FPURegister fd, FPURegister fs, } +void Assembler::min_s(FPURegister fd, FPURegister fs, FPURegister ft) { + min(S, fd, fs, ft); +} + + +void Assembler::min_d(FPURegister fd, FPURegister fs, FPURegister ft) { + min(D, fd, fs, ft); +} + + +void Assembler::max_s(FPURegister fd, FPURegister fs, FPURegister ft) { + max(S, fd, fs, ft); +} + + +void Assembler::max_d(FPURegister fd, FPURegister fs, FPURegister ft) { + max(D, fd, fs, ft); +} + + +void Assembler::mina_s(FPURegister fd, FPURegister fs, FPURegister ft) { + mina(S, fd, fs, ft); +} + + +void Assembler::mina_d(FPURegister fd, FPURegister fs, FPURegister ft) { + mina(D, fd, fs, ft); +} + + +void Assembler::maxa_s(FPURegister fd, FPURegister fs, FPURegister ft) { + maxa(S, fd, fs, ft); +} + + +void Assembler::maxa_d(FPURegister fd, FPURegister fs, FPURegister ft) { + maxa(D, fd, fs, ft); +} + + void Assembler::cvt_s_w(FPURegister fd, FPURegister fs) { GenInstrRegister(COP1, W, f0, fs, fd, CVT_S_W); } diff --git a/src/mips/assembler-mips.h b/src/mips/assembler-mips.h index 374afc00d..6cdfcfdab 100644 --- a/src/mips/assembler-mips.h +++ b/src/mips/assembler-mips.h @@ -931,6 +931,14 @@ class Assembler : public AssemblerBase { void mina(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft); void max(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft); void maxa(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft); + void min_s(FPURegister fd, FPURegister fs, FPURegister ft); + void min_d(FPURegister fd, FPURegister fs, FPURegister ft); + void max_s(FPURegister fd, FPURegister fs, FPURegister ft); + void max_d(FPURegister fd, FPURegister fs, FPURegister ft); + void mina_s(FPURegister fd, FPURegister fs, FPURegister ft); + void mina_d(FPURegister fd, FPURegister fs, FPURegister ft); + void maxa_s(FPURegister fd, FPURegister fs, FPURegister ft); + void maxa_d(FPURegister fd, FPURegister fs, FPURegister ft); void cvt_s_w(FPURegister fd, FPURegister fs); void cvt_s_l(FPURegister fd, FPURegister fs); diff --git a/src/mips64/assembler-mips64.cc b/src/mips64/assembler-mips64.cc index f83dd571d..ee2daa45b 100644 --- a/src/mips64/assembler-mips64.cc +++ b/src/mips64/assembler-mips64.cc @@ -2100,6 +2100,46 @@ void Assembler::movf(Register rd, Register rs, uint16_t cc) { } +void Assembler::min_s(FPURegister fd, FPURegister fs, FPURegister ft) { + min(S, fd, fs, ft); +} + + +void Assembler::min_d(FPURegister fd, FPURegister fs, FPURegister ft) { + min(D, fd, fs, ft); +} + + +void Assembler::max_s(FPURegister fd, FPURegister fs, FPURegister ft) { + max(S, fd, fs, ft); +} + + +void Assembler::max_d(FPURegister fd, FPURegister fs, FPURegister ft) { + max(D, fd, fs, ft); +} + + +void Assembler::mina_s(FPURegister fd, FPURegister fs, FPURegister ft) { + mina(S, fd, fs, ft); +} + + +void Assembler::mina_d(FPURegister fd, FPURegister fs, FPURegister ft) { + mina(D, fd, fs, ft); +} + + +void Assembler::maxa_s(FPURegister fd, FPURegister fs, FPURegister ft) { + maxa(S, fd, fs, ft); +} + + +void Assembler::maxa_d(FPURegister fd, FPURegister fs, FPURegister ft) { + maxa(D, fd, fs, ft); +} + + void Assembler::sel(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft) { DCHECK(kArchVariant == kMips64r6); diff --git a/src/mips64/assembler-mips64.h b/src/mips64/assembler-mips64.h index 4e434f2f0..bb7fac460 100644 --- a/src/mips64/assembler-mips64.h +++ b/src/mips64/assembler-mips64.h @@ -962,6 +962,14 @@ class Assembler : public AssemblerBase { void mina(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft); void max(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft); void maxa(SecondaryField fmt, FPURegister fd, FPURegister fs, FPURegister ft); + void min_s(FPURegister fd, FPURegister fs, FPURegister ft); + void min_d(FPURegister fd, FPURegister fs, FPURegister ft); + void max_s(FPURegister fd, FPURegister fs, FPURegister ft); + void max_d(FPURegister fd, FPURegister fs, FPURegister ft); + void mina_s(FPURegister fd, FPURegister fs, FPURegister ft); + void mina_d(FPURegister fd, FPURegister fs, FPURegister ft); + void maxa_s(FPURegister fd, FPURegister fs, FPURegister ft); + void maxa_d(FPURegister fd, FPURegister fs, FPURegister ft); void cvt_s_w(FPURegister fd, FPURegister fs); void cvt_s_l(FPURegister fd, FPURegister fs); diff --git a/test/cctest/test-assembler-mips.cc b/test/cctest/test-assembler-mips.cc index 1dc3e4ef4..7d0e10540 100644 --- a/test/cctest/test-assembler-mips.cc +++ b/test/cctest/test-assembler-mips.cc @@ -1425,8 +1425,8 @@ TEST(MIPS17) { __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); - __ min(D, f10, f4, f8); - __ max(D, f12, f4, f8); + __ min_d(f10, f4, f8); + __ max_d(f12, f4, f8); __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, d))); __ jr(ra); diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc index c3c56e82e..a6673d8e1 100644 --- a/test/cctest/test-assembler-mips64.cc +++ b/test/cctest/test-assembler-mips64.cc @@ -1535,8 +1535,8 @@ TEST(MIPS18) { __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); - __ min(D, f10, f4, f8); - __ max(D, f12, f4, f8); + __ min_d(f10, f4, f8); + __ max_d(f12, f4, f8); __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, d))); __ jr(ra); diff --git a/test/cctest/test-disasm-mips.cc b/test/cctest/test-disasm-mips.cc index 8762537a5..b66554e55 100644 --- a/test/cctest/test-disasm-mips.cc +++ b/test/cctest/test-disasm-mips.cc @@ -536,8 +536,8 @@ TEST(Type1) { COMPARE(seleqz(D, f3, f4, f5), "462520d4 seleqz.d f3, f4, f5"); COMPARE(selnez(D, f3, f4, f5), "462520d7 selnez.d f3, f4, f5"); - COMPARE(min(D, f3, f4, f5), "462520dc min.d f3, f4, f5"); - COMPARE(max(D, f3, f4, f5), "462520de max.d f3, f4, f5"); + COMPARE(min_d(f3, f4, f5), "462520dc min.d f3, f4, f5"); + COMPARE(max_d(f3, f4, f5), "462520de max.d f3, f4, f5"); COMPARE(rint_d(f8, f6), "4620321a rint.d f8, f6"); VERIFY_RUN(); diff --git a/test/cctest/test-disasm-mips64.cc b/test/cctest/test-disasm-mips64.cc index 5634861e8..492265b2e 100644 --- a/test/cctest/test-disasm-mips64.cc +++ b/test/cctest/test-disasm-mips64.cc @@ -683,8 +683,8 @@ TEST(Type1) { COMPARE(seleqz(D, f3, f4, f5), "462520d4 seleqz.d f3, f4, f5"); COMPARE(selnez(D, f3, f4, f5), "462520d7 selnez.d f3, f4, f5"); - COMPARE(min(D, f3, f4, f5), "462520dc min.d f3, f4, f5"); - COMPARE(max(D, f3, f4, f5), "462520de max.d f3, f4, f5"); + COMPARE(min_d(f3, f4, f5), "462520dc min.d f3, f4, f5"); + COMPARE(max_d(f3, f4, f5), "462520de max.d f3, f4, f5"); COMPARE(rint_d(f8, f6), "4620321a rint.d f8, f6"); VERIFY_RUN(); }