• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14.function i32 main(){
15    # Check that fcmpg works fine
16
17    fldai.64 0.0
18    movi.64 v0, 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
19    fcmpg.64 v0
20    jlez exit_failure
21
22    fldai.64 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
23    fmovi.64 v0, 0.0
24    fcmpg.64 v0
25    jlez exit_failure
26
27    fldai.64 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
28    movi.64 v0, 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
29    fcmpg.64 v0
30    jlez exit_failure
31
32    # Check that fcmpl works fine
33
34    fldai.64 0.0
35    movi.64 v0, 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
36    fcmpl.64 v0
37    jgez exit_failure
38
39    fldai.64 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
40    fmovi.64 v0, 0.0
41    fcmpl.64 v0
42    jgez exit_failure
43
44    fldai.64 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
45    movi.64 v0, 0x7FFFFFFFFFFFFFFF # One of valid quiet NaN values as per IEEE 754
46    fcmpl.64 v0
47    jgez exit_failure
48
49    ldai 0
50    return
51exit_failure:
52    ldai 1
53    return
54}
55