blob: 7928085221ae97cde0de54dbc02b05af2cd4634f [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
31#pragma GCC diagnostic warning "-Wunused-function"