blob: 5a3e73eebc4ab12495d5a57b1a3569d66fee304a [file] [log] [blame]
Andreas Gampe4d0589c2014-06-10 16:10:56 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "memcmp16.h"
18
19// This linked against by assembly stubs, only.
20#pragma GCC diagnostic ignored "-Wunused-function"
21
22int32_t memcmp16_generic_static(const uint16_t* s0, const uint16_t* s1, size_t count) {
23 for (size_t i = 0; i < count; i++) {
24 if (s0[i] != s1[i]) {
25 return static_cast<int32_t>(s0[i]) - static_cast<int32_t>(s1[i]);
26 }
27 }
28 return 0;
29}
30
Andreas Gampe29b38412014-08-13 00:15:43 -070031namespace art {
32
33namespace testing {
34
35int32_t MemCmp16Testing(const uint16_t* s0, const uint16_t* s1, size_t count) {
36 return MemCmp16(s0, s1, count);
37}
38
39}
40
41} // namespace art
42
Andreas Gampe4d0589c2014-06-10 16:10:56 -070043#pragma GCC diagnostic warning "-Wunused-function"