Index: test/cctest/test-assembler-mips64.cc |
diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc |
index 0e46f2ca9b424710c6b2d2ed495c160bb9b15afb..ab88b069a25cc2c5f7e958e0207429ab5941ff8a 100644 |
--- a/test/cctest/test-assembler-mips64.cc |
+++ b/test/cctest/test-assembler-mips64.cc |
@@ -6057,4 +6057,74 @@ TEST(maddf_msubf_d) { |
}); |
} |
+TEST(MSA_fill_copy) { |
+ CcTest::InitializeVM(); |
+ Isolate* isolate = CcTest::i_isolate(); |
+ HandleScope scope(isolate); |
+ |
+ typedef struct { |
+ uint64_t u8; |
+ uint64_t u16; |
+ uint64_t u32; |
+ uint64_t s8; |
+ uint64_t s16; |
+ uint64_t s32; |
+ uint64_t s64; |
+ } T; |
+ T t; |
+ |
+ MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); |
+ if ((kArchVariant != kMips64r6) || !CpuFeatures::IsSupported(MIPS_SIMD)) |
+ return; |
+ |
+ { |
+ CpuFeatureScope fscope(&assm, MIPS_SIMD); |
+ |
+ __ li(t0, 0x9e7689aca512b683); |
+ |
+ __ fill_b(w0, t0); |
+ __ fill_h(w2, t0); |
+ __ fill_w(w4, t0); |
+ __ fill_d(w6, t0); |
+ __ copy_u_b(t1, w0, 11); |
+ __ sd(t1, MemOperand(a0, offsetof(T, u8))); |
+ __ copy_u_h(t1, w2, 6); |
+ __ sd(t1, MemOperand(a0, offsetof(T, u16))); |
+ __ copy_u_w(t1, w4, 3); |
+ __ sd(t1, MemOperand(a0, offsetof(T, u32))); |
+ |
+ __ copy_s_b(t1, w0, 8); |
+ __ sd(t1, MemOperand(a0, offsetof(T, s8))); |
+ __ copy_s_h(t1, w2, 5); |
+ __ sd(t1, MemOperand(a0, offsetof(T, s16))); |
+ __ copy_s_w(t1, w4, 1); |
+ __ sd(t1, MemOperand(a0, offsetof(T, s32))); |
+ __ copy_s_d(t1, w6, 0); |
+ __ sd(t1, MemOperand(a0, offsetof(T, s64))); |
+ |
+ __ jr(ra); |
+ __ nop(); |
+ } |
+ |
+ CodeDesc desc; |
+ assm.GetCode(&desc); |
+ Handle<Code> code = isolate->factory()->NewCode( |
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
+#ifdef OBJECT_PRINT |
+ code->Print(std::cout); |
+#endif |
+ F1 f = FUNCTION_CAST<F1>(code->entry()); |
+ |
+ Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
+ USE(dummy); |
+ |
+ CHECK_EQ(0x83u, t.u8); |
+ CHECK_EQ(0xb683u, t.u16); |
+ CHECK_EQ(0xa512b683u, t.u32); |
+ CHECK_EQ(0xffffffffffffff83u, t.s8); |
+ CHECK_EQ(0xffffffffffffb683u, t.s16); |
+ CHECK_EQ(0xffffffffa512b683u, t.s32); |
+ CHECK_EQ(0x9e7689aca512b683u, t.s64); |
+} |
+ |
#undef __ |