OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2882 } | 2882 } |
2883 { | 2883 { |
2884 uint64_t strh = 0; | 2884 uint64_t strh = 0; |
2885 uint64_t str = 0; | 2885 uint64_t str = 0; |
2886 dummy = CALL_GENERATED_CODE(isolate, f, &strh, &str, 3, 0xfedcba98, 0); | 2886 dummy = CALL_GENERATED_CODE(isolate, f, &strh, &str, 3, 0xfedcba98, 0); |
2887 CHECK_EQ(UINT64_C(0x000000ba98000000), strh); | 2887 CHECK_EQ(UINT64_C(0x000000ba98000000), strh); |
2888 CHECK_EQ(UINT64_C(0x00fedcba98000000), str); | 2888 CHECK_EQ(UINT64_C(0x00fedcba98000000), str); |
2889 } | 2889 } |
2890 } | 2890 } |
2891 | 2891 |
| 2892 TEST(vswp) { |
| 2893 CcTest::InitializeVM(); |
| 2894 Isolate* isolate = CcTest::i_isolate(); |
| 2895 HandleScope scope(isolate); |
| 2896 Assembler assm(isolate, NULL, 0); |
| 2897 |
| 2898 typedef struct { |
| 2899 double result0; |
| 2900 double result1; |
| 2901 double result2; |
| 2902 double result3; |
| 2903 } T; |
| 2904 T t; |
| 2905 |
| 2906 __ vmov(d0, 1.0); |
| 2907 __ vmov(d1, -1.0); |
| 2908 __ vswp(d0, d1); |
| 2909 __ vstr(d0, r0, offsetof(T, result0)); |
| 2910 __ vstr(d1, r0, offsetof(T, result1)); |
| 2911 |
| 2912 if (CpuFeatures::IsSupported(VFP32DREGS)) { |
| 2913 __ vmov(d30, 1.0); |
| 2914 __ vmov(d31, -1.0); |
| 2915 __ vswp(d30, d31); |
| 2916 __ vstr(d30, r0, offsetof(T, result2)); |
| 2917 __ vstr(d31, r0, offsetof(T, result3)); |
| 2918 } |
| 2919 |
| 2920 __ bx(lr); |
| 2921 |
| 2922 CodeDesc desc; |
| 2923 assm.GetCode(&desc); |
| 2924 Handle<Code> code = isolate->factory()->NewCode( |
| 2925 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 2926 #ifdef DEBUG |
| 2927 OFStream os(stdout); |
| 2928 code->Print(os); |
| 2929 #endif |
| 2930 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 2931 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
| 2932 USE(dummy); |
| 2933 CHECK_EQ(-1.0, t.result0); |
| 2934 CHECK_EQ(1.0, t.result1); |
| 2935 if (CpuFeatures::IsSupported(VFP32DREGS)) { |
| 2936 CHECK_EQ(-1.0, t.result2); |
| 2937 CHECK_EQ(1.0, t.result3); |
| 2938 } |
| 2939 } |
| 2940 |
2892 TEST(regress4292_b) { | 2941 TEST(regress4292_b) { |
2893 CcTest::InitializeVM(); | 2942 CcTest::InitializeVM(); |
2894 Isolate* isolate = CcTest::i_isolate(); | 2943 Isolate* isolate = CcTest::i_isolate(); |
2895 HandleScope scope(isolate); | 2944 HandleScope scope(isolate); |
2896 | 2945 |
2897 Assembler assm(isolate, NULL, 0); | 2946 Assembler assm(isolate, NULL, 0); |
2898 Label end; | 2947 Label end; |
2899 __ mov(r0, Operand(isolate->factory()->infinity_value())); | 2948 __ mov(r0, Operand(isolate->factory()->infinity_value())); |
2900 for (int i = 0; i < 1020; ++i) { | 2949 for (int i = 0; i < 1020; ++i) { |
2901 __ b(hi, &end); | 2950 __ b(hi, &end); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2940 HandleScope scope(isolate); | 2989 HandleScope scope(isolate); |
2941 | 2990 |
2942 Assembler assm(isolate, NULL, 0); | 2991 Assembler assm(isolate, NULL, 0); |
2943 __ mov(r0, Operand(isolate->factory()->infinity_value())); | 2992 __ mov(r0, Operand(isolate->factory()->infinity_value())); |
2944 __ BlockConstPoolFor(1019); | 2993 __ BlockConstPoolFor(1019); |
2945 for (int i = 0; i < 1019; ++i) __ nop(); | 2994 for (int i = 0; i < 1019; ++i) __ nop(); |
2946 __ vldr(d0, MemOperand(r0, 0)); | 2995 __ vldr(d0, MemOperand(r0, 0)); |
2947 } | 2996 } |
2948 | 2997 |
2949 #undef __ | 2998 #undef __ |
OLD | NEW |