14d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe/* 24d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * Copyright (C) 2014 The Android Open Source Project 34d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * 44d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * Licensed under the Apache License, Version 2.0 (the "License"); 54d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * you may not use this file except in compliance with the License. 64d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * You may obtain a copy of the License at 74d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * 84d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * http://www.apache.org/licenses/LICENSE-2.0 94d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * 104d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * Unless required by applicable law or agreed to in writing, software 114d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * distributed under the License is distributed on an "AS IS" BASIS, 124d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 134d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * See the License for the specific language governing permissions and 144d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe * limitations under the License. 154d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe */ 164d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe 174d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe#include "memcmp16.h" 184d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe 194d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe// This linked against by assembly stubs, only. 204d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe#pragma GCC diagnostic ignored "-Wunused-function" 214d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe 22277ccbd200ea43590dfc06a93ae184a765327ad0Andreas Gampeint32_t memcmp16_generic_static(const uint16_t* s0, const uint16_t* s1, size_t count); 234d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampeint32_t memcmp16_generic_static(const uint16_t* s0, const uint16_t* s1, size_t count) { 244d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe for (size_t i = 0; i < count; i++) { 254d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe if (s0[i] != s1[i]) { 264d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe return static_cast<int32_t>(s0[i]) - static_cast<int32_t>(s1[i]); 274d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe } 284d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe } 294d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe return 0; 304d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe} 314d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe 3229b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampenamespace art { 3329b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe 3429b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampenamespace testing { 3529b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe 3629b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampeint32_t MemCmp16Testing(const uint16_t* s0, const uint16_t* s1, size_t count) { 3729b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe return MemCmp16(s0, s1, count); 3829b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe} 3929b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe 4029b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe} 4129b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe 4229b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe} // namespace art 4329b3841ad8c1c18ee7ddd2d8cab85806b3d62eaaAndreas Gampe 444d0589c90971e19c25894414ae7da579269e1fe2Andreas Gampe#pragma GCC diagnostic warning "-Wunused-function" 45