Index: test/cctest/test-assembler-mips.cc |
diff --git a/test/cctest/test-assembler-mips.cc b/test/cctest/test-assembler-mips.cc |
index 2283d4978c642fcd4e31663e76679a3d532a1f19..b339a2ea6c25e4b92561c2e528d801a0e0050b6b 100644 |
--- a/test/cctest/test-assembler-mips.cc |
+++ b/test/cctest/test-assembler-mips.cc |
@@ -5513,4 +5513,69 @@ TEST(maddf_msubf_d) { |
}); |
} |
+TEST(MSA_fill_copy) { |
+ CcTest::InitializeVM(); |
+ Isolate* isolate = CcTest::i_isolate(); |
+ HandleScope scope(isolate); |
+ |
+ typedef struct { |
+ uint32_t u8; |
+ uint32_t u16; |
+ uint32_t u32; |
+ uint32_t s8; |
+ uint32_t s16; |
+ uint32_t s32; |
+ } T; |
+ T t; |
+ |
+ MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); |
+ if (!IsMipsArchVariant(kMips32r6) || !CpuFeatures::IsSupported(MIPS_SIMD)) |
+ return; |
+ |
+ { |
+ CpuFeatureScope fscope(&assm, MIPS_SIMD); |
+ |
+ __ li(t0, 0xa512b683); |
+ |
+ __ fill_b(w0, t0); |
+ __ fill_h(w2, t0); |
+ __ fill_w(w4, t0); |
+ __ copy_u_b(t1, w0, 11); |
+ __ sw(t1, MemOperand(a0, offsetof(T, u8))); |
+ __ copy_u_h(t1, w2, 6); |
+ __ sw(t1, MemOperand(a0, offsetof(T, u16))); |
+ __ copy_u_w(t1, w4, 3); |
+ __ sw(t1, MemOperand(a0, offsetof(T, u32))); |
+ |
+ __ copy_s_b(t1, w0, 8); |
+ __ sw(t1, MemOperand(a0, offsetof(T, s8))); |
+ __ copy_s_h(t1, w2, 5); |
+ __ sw(t1, MemOperand(a0, offsetof(T, s16))); |
+ __ copy_s_w(t1, w4, 1); |
+ __ sw(t1, MemOperand(a0, offsetof(T, s32))); |
+ |
+ __ 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(0xffffff83u, t.s8); |
+ CHECK_EQ(0xffffb683u, t.s16); |
+ CHECK_EQ(0xa512b683u, t.s32); |
+} |
+ |
#undef __ |