Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: test/cctest/test-assembler-arm64.cc

Issue 440303004: ARM64: Support arbitrary offset in load/store pair. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm64/macro-assembler-arm64-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after
2904 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, dst[6]); 2904 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, dst[6]);
2905 CHECK_EQUAL_64(src_base, x16); 2905 CHECK_EQUAL_64(src_base, x16);
2906 CHECK_EQUAL_64(dst_base, x17); 2906 CHECK_EQUAL_64(dst_base, x17);
2907 CHECK_EQUAL_64(src_base + 24, x18); 2907 CHECK_EQUAL_64(src_base + 24, x18);
2908 CHECK_EQUAL_64(dst_base + 56, x19); 2908 CHECK_EQUAL_64(dst_base + 56, x19);
2909 2909
2910 TEARDOWN(); 2910 TEARDOWN();
2911 } 2911 }
2912 2912
2913 2913
2914 TEST(ldp_stp_offset_wide) {
2915 INIT_V8();
2916 SETUP();
2917
2918 uint64_t src[3] = {0x0011223344556677, 0x8899aabbccddeeff,
2919 0xffeeddccbbaa9988};
2920 uint64_t dst[7] = {0, 0, 0, 0, 0, 0, 0};
2921 uintptr_t src_base = reinterpret_cast<uintptr_t>(src);
2922 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst);
2923 // Move base too far from the array to force multiple instructions
2924 // to be emitted.
2925 const int64_t base_offset = 1024;
2926
2927 START();
2928 __ Mov(x20, src_base - base_offset);
2929 __ Mov(x21, dst_base - base_offset);
2930 __ Mov(x18, src_base + base_offset + 24);
2931 __ Mov(x19, dst_base + base_offset + 56);
2932 __ Ldp(w0, w1, MemOperand(x20, base_offset));
2933 __ Ldp(w2, w3, MemOperand(x20, base_offset + 4));
2934 __ Ldp(x4, x5, MemOperand(x20, base_offset + 8));
2935 __ Ldp(w6, w7, MemOperand(x18, -12 - base_offset));
2936 __ Ldp(x8, x9, MemOperand(x18, -16 - base_offset));
2937 __ Stp(w0, w1, MemOperand(x21, base_offset));
2938 __ Stp(w2, w3, MemOperand(x21, base_offset + 8));
2939 __ Stp(x4, x5, MemOperand(x21, base_offset + 16));
2940 __ Stp(w6, w7, MemOperand(x19, -24 - base_offset));
2941 __ Stp(x8, x9, MemOperand(x19, -16 - base_offset));
2942 END();
2943
2944 RUN();
2945
2946 CHECK_EQUAL_64(0x44556677, x0);
2947 CHECK_EQUAL_64(0x00112233, x1);
2948 CHECK_EQUAL_64(0x0011223344556677UL, dst[0]);
2949 CHECK_EQUAL_64(0x00112233, x2);
2950 CHECK_EQUAL_64(0xccddeeff, x3);
2951 CHECK_EQUAL_64(0xccddeeff00112233UL, dst[1]);
2952 CHECK_EQUAL_64(0x8899aabbccddeeffUL, x4);
2953 CHECK_EQUAL_64(0x8899aabbccddeeffUL, dst[2]);
2954 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, x5);
2955 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, dst[3]);
2956 CHECK_EQUAL_64(0x8899aabb, x6);
2957 CHECK_EQUAL_64(0xbbaa9988, x7);
2958 CHECK_EQUAL_64(0xbbaa99888899aabbUL, dst[4]);
2959 CHECK_EQUAL_64(0x8899aabbccddeeffUL, x8);
2960 CHECK_EQUAL_64(0x8899aabbccddeeffUL, dst[5]);
2961 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, x9);
2962 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, dst[6]);
2963 CHECK_EQUAL_64(src_base - base_offset, x20);
2964 CHECK_EQUAL_64(dst_base - base_offset, x21);
2965 CHECK_EQUAL_64(src_base + base_offset + 24, x18);
2966 CHECK_EQUAL_64(dst_base + base_offset + 56, x19);
2967
2968 TEARDOWN();
2969 }
2970
2971
2914 TEST(ldnp_stnp_offset) { 2972 TEST(ldnp_stnp_offset) {
2915 INIT_V8(); 2973 INIT_V8();
2916 SETUP(); 2974 SETUP();
2917 2975
2918 uint64_t src[3] = {0x0011223344556677UL, 0x8899aabbccddeeffUL, 2976 uint64_t src[3] = {0x0011223344556677UL, 0x8899aabbccddeeffUL,
2919 0xffeeddccbbaa9988UL}; 2977 0xffeeddccbbaa9988UL};
2920 uint64_t dst[7] = {0, 0, 0, 0, 0, 0, 0}; 2978 uint64_t dst[7] = {0, 0, 0, 0, 0, 0, 0};
2921 uintptr_t src_base = reinterpret_cast<uintptr_t>(src); 2979 uintptr_t src_base = reinterpret_cast<uintptr_t>(src);
2922 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst); 2980 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst);
2923 2981
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 CHECK_EQUAL_64(dst_base + 16, x18); 3072 CHECK_EQUAL_64(dst_base + 16, x18);
3015 CHECK_EQUAL_64(src_base + 4, x19); 3073 CHECK_EQUAL_64(src_base + 4, x19);
3016 CHECK_EQUAL_64(dst_base + 4, x20); 3074 CHECK_EQUAL_64(dst_base + 4, x20);
3017 CHECK_EQUAL_64(src_base + 8, x21); 3075 CHECK_EQUAL_64(src_base + 8, x21);
3018 CHECK_EQUAL_64(dst_base + 24, x22); 3076 CHECK_EQUAL_64(dst_base + 24, x22);
3019 3077
3020 TEARDOWN(); 3078 TEARDOWN();
3021 } 3079 }
3022 3080
3023 3081
3082 TEST(ldp_stp_preindex_wide) {
3083 INIT_V8();
3084 SETUP();
3085
3086 uint64_t src[3] = {0x0011223344556677, 0x8899aabbccddeeff,
3087 0xffeeddccbbaa9988};
3088 uint64_t dst[5] = {0, 0, 0, 0, 0};
3089 uintptr_t src_base = reinterpret_cast<uintptr_t>(src);
3090 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst);
3091 // Move base too far from the array to force multiple instructions
3092 // to be emitted.
3093 const int64_t base_offset = 1024;
3094
3095 START();
3096 __ Mov(x24, src_base - base_offset);
3097 __ Mov(x25, dst_base + base_offset);
3098 __ Mov(x18, dst_base + base_offset + 16);
3099 __ Ldp(w0, w1, MemOperand(x24, base_offset + 4, PreIndex));
3100 __ Mov(x19, x24);
3101 __ Mov(x24, src_base - base_offset + 4);
3102 __ Ldp(w2, w3, MemOperand(x24, base_offset - 4, PreIndex));
3103 __ Stp(w2, w3, MemOperand(x25, 4 - base_offset, PreIndex));
3104 __ Mov(x20, x25);
3105 __ Mov(x25, dst_base + base_offset + 4);
3106 __ Mov(x24, src_base - base_offset);
3107 __ Stp(w0, w1, MemOperand(x25, -4 - base_offset, PreIndex));
3108 __ Ldp(x4, x5, MemOperand(x24, base_offset + 8, PreIndex));
3109 __ Mov(x21, x24);
3110 __ Mov(x24, src_base - base_offset + 8);
3111 __ Ldp(x6, x7, MemOperand(x24, base_offset - 8, PreIndex));
3112 __ Stp(x7, x6, MemOperand(x18, 8 - base_offset, PreIndex));
3113 __ Mov(x22, x18);
3114 __ Mov(x18, dst_base + base_offset + 16 + 8);
3115 __ Stp(x5, x4, MemOperand(x18, -8 - base_offset, PreIndex));
3116 END();
3117
3118 RUN();
3119
3120 CHECK_EQUAL_64(0x00112233, x0);
3121 CHECK_EQUAL_64(0xccddeeff, x1);
3122 CHECK_EQUAL_64(0x44556677, x2);
3123 CHECK_EQUAL_64(0x00112233, x3);
3124 CHECK_EQUAL_64(0xccddeeff00112233UL, dst[0]);
3125 CHECK_EQUAL_64(0x0000000000112233UL, dst[1]);
3126 CHECK_EQUAL_64(0x8899aabbccddeeffUL, x4);
3127 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, x5);
3128 CHECK_EQUAL_64(0x0011223344556677UL, x6);
3129 CHECK_EQUAL_64(0x8899aabbccddeeffUL, x7);
3130 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, dst[2]);
3131 CHECK_EQUAL_64(0x8899aabbccddeeffUL, dst[3]);
3132 CHECK_EQUAL_64(0x0011223344556677UL, dst[4]);
3133 CHECK_EQUAL_64(src_base, x24);
3134 CHECK_EQUAL_64(dst_base, x25);
3135 CHECK_EQUAL_64(dst_base + 16, x18);
3136 CHECK_EQUAL_64(src_base + 4, x19);
3137 CHECK_EQUAL_64(dst_base + 4, x20);
3138 CHECK_EQUAL_64(src_base + 8, x21);
3139 CHECK_EQUAL_64(dst_base + 24, x22);
3140
3141 TEARDOWN();
3142 }
3143
3144
3024 TEST(ldp_stp_postindex) { 3145 TEST(ldp_stp_postindex) {
3025 INIT_V8(); 3146 INIT_V8();
3026 SETUP(); 3147 SETUP();
3027 3148
3028 uint64_t src[4] = {0x0011223344556677UL, 0x8899aabbccddeeffUL, 3149 uint64_t src[4] = {0x0011223344556677UL, 0x8899aabbccddeeffUL,
3029 0xffeeddccbbaa9988UL, 0x7766554433221100UL}; 3150 0xffeeddccbbaa9988UL, 0x7766554433221100UL};
3030 uint64_t dst[5] = {0, 0, 0, 0, 0}; 3151 uint64_t dst[5] = {0, 0, 0, 0, 0};
3031 uintptr_t src_base = reinterpret_cast<uintptr_t>(src); 3152 uintptr_t src_base = reinterpret_cast<uintptr_t>(src);
3032 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst); 3153 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst);
3033 3154
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3069 CHECK_EQUAL_64(dst_base + 16, x18); 3190 CHECK_EQUAL_64(dst_base + 16, x18);
3070 CHECK_EQUAL_64(src_base + 4, x19); 3191 CHECK_EQUAL_64(src_base + 4, x19);
3071 CHECK_EQUAL_64(dst_base + 4, x20); 3192 CHECK_EQUAL_64(dst_base + 4, x20);
3072 CHECK_EQUAL_64(src_base + 8, x21); 3193 CHECK_EQUAL_64(src_base + 8, x21);
3073 CHECK_EQUAL_64(dst_base + 24, x22); 3194 CHECK_EQUAL_64(dst_base + 24, x22);
3074 3195
3075 TEARDOWN(); 3196 TEARDOWN();
3076 } 3197 }
3077 3198
3078 3199
3200 TEST(ldp_stp_postindex_wide) {
3201 INIT_V8();
3202 SETUP();
3203
3204 uint64_t src[4] = {0x0011223344556677, 0x8899aabbccddeeff, 0xffeeddccbbaa9988,
3205 0x7766554433221100};
3206 uint64_t dst[5] = {0, 0, 0, 0, 0};
3207 uintptr_t src_base = reinterpret_cast<uintptr_t>(src);
3208 uintptr_t dst_base = reinterpret_cast<uintptr_t>(dst);
3209 // Move base too far from the array to force multiple instructions
3210 // to be emitted.
3211 const int64_t base_offset = 1024;
3212
3213 START();
3214 __ Mov(x24, src_base);
3215 __ Mov(x25, dst_base);
3216 __ Mov(x18, dst_base + 16);
3217 __ Ldp(w0, w1, MemOperand(x24, base_offset + 4, PostIndex));
3218 __ Mov(x19, x24);
3219 __ Sub(x24, x24, base_offset);
3220 __ Ldp(w2, w3, MemOperand(x24, base_offset - 4, PostIndex));
3221 __ Stp(w2, w3, MemOperand(x25, 4 - base_offset, PostIndex));
3222 __ Mov(x20, x25);
3223 __ Sub(x24, x24, base_offset);
3224 __ Add(x25, x25, base_offset);
3225 __ Stp(w0, w1, MemOperand(x25, -4 - base_offset, PostIndex));
3226 __ Ldp(x4, x5, MemOperand(x24, base_offset + 8, PostIndex));
3227 __ Mov(x21, x24);
3228 __ Sub(x24, x24, base_offset);
3229 __ Ldp(x6, x7, MemOperand(x24, base_offset - 8, PostIndex));
3230 __ Stp(x7, x6, MemOperand(x18, 8 - base_offset, PostIndex));
3231 __ Mov(x22, x18);
3232 __ Add(x18, x18, base_offset);
3233 __ Stp(x5, x4, MemOperand(x18, -8 - base_offset, PostIndex));
3234 END();
3235
3236 RUN();
3237
3238 CHECK_EQUAL_64(0x44556677, x0);
3239 CHECK_EQUAL_64(0x00112233, x1);
3240 CHECK_EQUAL_64(0x00112233, x2);
3241 CHECK_EQUAL_64(0xccddeeff, x3);
3242 CHECK_EQUAL_64(0x4455667700112233UL, dst[0]);
3243 CHECK_EQUAL_64(0x0000000000112233UL, dst[1]);
3244 CHECK_EQUAL_64(0x0011223344556677UL, x4);
3245 CHECK_EQUAL_64(0x8899aabbccddeeffUL, x5);
3246 CHECK_EQUAL_64(0x8899aabbccddeeffUL, x6);
3247 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, x7);
3248 CHECK_EQUAL_64(0xffeeddccbbaa9988UL, dst[2]);
3249 CHECK_EQUAL_64(0x8899aabbccddeeffUL, dst[3]);
3250 CHECK_EQUAL_64(0x0011223344556677UL, dst[4]);
3251 CHECK_EQUAL_64(src_base + base_offset, x24);
3252 CHECK_EQUAL_64(dst_base - base_offset, x25);
3253 CHECK_EQUAL_64(dst_base - base_offset + 16, x18);
3254 CHECK_EQUAL_64(src_base + base_offset + 4, x19);
3255 CHECK_EQUAL_64(dst_base - base_offset + 4, x20);
3256 CHECK_EQUAL_64(src_base + base_offset + 8, x21);
3257 CHECK_EQUAL_64(dst_base - base_offset + 24, x22);
3258
3259 TEARDOWN();
3260 }
3261
3262
3079 TEST(ldp_sign_extend) { 3263 TEST(ldp_sign_extend) {
3080 INIT_V8(); 3264 INIT_V8();
3081 SETUP(); 3265 SETUP();
3082 3266
3083 uint32_t src[2] = {0x80000000, 0x7fffffff}; 3267 uint32_t src[2] = {0x80000000, 0x7fffffff};
3084 uintptr_t src_base = reinterpret_cast<uintptr_t>(src); 3268 uintptr_t src_base = reinterpret_cast<uintptr_t>(src);
3085 3269
3086 START(); 3270 START();
3087 __ Mov(x24, src_base); 3271 __ Mov(x24, src_base);
3088 __ Ldpsw(x0, x1, MemOperand(x24)); 3272 __ Ldpsw(x0, x1, MemOperand(x24));
(...skipping 7906 matching lines...) Expand 10 before | Expand all | Expand 10 after
10995 if (RelocInfo::IsVeneerPool(info->rmode())) { 11179 if (RelocInfo::IsVeneerPool(info->rmode())) {
10996 DCHECK(info->data() == veneer_pool_size); 11180 DCHECK(info->data() == veneer_pool_size);
10997 ++pool_count; 11181 ++pool_count;
10998 } 11182 }
10999 } 11183 }
11000 11184
11001 DCHECK(pool_count == 2); 11185 DCHECK(pool_count == 2);
11002 11186
11003 TEARDOWN(); 11187 TEARDOWN();
11004 } 11188 }
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698