Etienne Carriere | 7514117 | 2020-05-16 11:58:23 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: BSD-2-Clause |
Jens Wiklander | 246184a | 2015-12-11 08:28:59 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015, Linaro Limited |
| 4 | * All rights reserved. |
Jens Wiklander | 246184a | 2015-12-11 08:28:59 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include "test_float_subj.h" |
| 8 | |
| 9 | double test_float_dadd(double a, double b) |
| 10 | { |
| 11 | return a + b; |
| 12 | } |
| 13 | |
| 14 | double test_float_ddiv(double n, double d) |
| 15 | { |
| 16 | return n / d; |
| 17 | } |
| 18 | |
| 19 | double test_float_dmul(double a, double b) |
| 20 | { |
| 21 | return a * b; |
| 22 | } |
| 23 | |
| 24 | double test_float_drsub(double a, double b) |
| 25 | { |
| 26 | return b - a; |
| 27 | } |
| 28 | |
| 29 | double test_float_dsub(double a, double b) |
| 30 | { |
| 31 | return a - b; |
| 32 | } |
| 33 | |
| 34 | int test_float_dcmpeq(double a, double b) |
| 35 | { |
| 36 | return a == b; |
| 37 | } |
| 38 | |
| 39 | int test_float_dcmplt(double a, double b) |
| 40 | { |
| 41 | return a < b; |
| 42 | } |
| 43 | |
| 44 | int test_float_dcmple(double a, double b) |
| 45 | { |
| 46 | return a <= b; |
| 47 | } |
| 48 | |
| 49 | int test_float_dcmpge(double a, double b) |
| 50 | { |
| 51 | return a >= b; |
| 52 | } |
| 53 | |
| 54 | int test_float_dcmpgt(double a, double b) |
| 55 | { |
| 56 | return a > b; |
| 57 | } |
| 58 | |
| 59 | float test_float_fadd(float a, float b) |
| 60 | { |
| 61 | return a + b; |
| 62 | } |
| 63 | |
| 64 | float test_float_fdiv(float n, float d) |
| 65 | { |
| 66 | return n / d; |
| 67 | } |
| 68 | |
| 69 | float test_float_fmul(float a, float b) |
| 70 | { |
| 71 | return a * b; |
| 72 | } |
| 73 | |
| 74 | float test_float_frsub(float a, float b) |
| 75 | { |
| 76 | return b - a; |
| 77 | } |
| 78 | |
| 79 | float test_float_fsub(float a, float b) |
| 80 | { |
| 81 | return a - b; |
| 82 | } |
| 83 | |
| 84 | int test_float_fcmpeq(float a, float b) |
| 85 | { |
| 86 | return a == b; |
| 87 | } |
| 88 | |
| 89 | int test_float_fcmplt(float a, float b) |
| 90 | { |
| 91 | return a < b; |
| 92 | } |
| 93 | |
| 94 | int test_float_fcmple(float a, float b) |
| 95 | { |
| 96 | return a <= b; |
| 97 | } |
| 98 | |
| 99 | int test_float_fcmpge(float a, float b) |
| 100 | { |
| 101 | return a >= b; |
| 102 | } |
| 103 | |
| 104 | int test_float_fcmpgt(float a, float b) |
| 105 | { |
| 106 | return a > b; |
| 107 | } |
| 108 | |
| 109 | int test_float_d2iz(double a) |
| 110 | { |
| 111 | return a; |
| 112 | } |
| 113 | |
| 114 | unsigned test_float_d2uiz(double a) |
| 115 | { |
| 116 | return a; |
| 117 | } |
| 118 | |
| 119 | long long test_float_d2lz(double a) |
| 120 | { |
| 121 | return a; |
| 122 | } |
| 123 | |
| 124 | unsigned long long test_float_d2ulz(double a) |
| 125 | { |
| 126 | return a; |
| 127 | } |
| 128 | |
| 129 | int test_float_f2iz(float a) |
| 130 | { |
| 131 | return a; |
| 132 | } |
| 133 | |
| 134 | unsigned test_float_f2uiz(float a) |
| 135 | { |
| 136 | return a; |
| 137 | } |
| 138 | |
| 139 | long long test_float_f2lz(float a) |
| 140 | { |
| 141 | return a; |
| 142 | } |
| 143 | |
| 144 | unsigned long long test_float_f2ulz(float a) |
| 145 | { |
| 146 | return a; |
| 147 | } |
| 148 | |
| 149 | float test_float_d2f(double a) |
| 150 | { |
| 151 | return a; |
| 152 | } |
| 153 | |
| 154 | double test_float_f2d(float a) |
| 155 | { |
| 156 | return a; |
| 157 | } |
| 158 | |
| 159 | double test_float_i2d(int a) |
| 160 | { |
| 161 | return a; |
| 162 | } |
| 163 | |
| 164 | double test_float_ui2d(unsigned a) |
| 165 | { |
| 166 | return a; |
| 167 | } |
| 168 | |
| 169 | double test_float_l2d(long long a) |
| 170 | { |
| 171 | return a; |
| 172 | } |
| 173 | |
| 174 | double test_float_ul2d(unsigned long long a) |
| 175 | { |
| 176 | return a; |
| 177 | } |
| 178 | |
| 179 | float test_float_i2f(int a) |
| 180 | { |
| 181 | return a; |
| 182 | } |
| 183 | |
| 184 | float test_float_ui2f(unsigned a) |
| 185 | { |
| 186 | return a; |
| 187 | } |
| 188 | |
| 189 | float test_float_l2f(long long a) |
| 190 | { |
| 191 | return a; |
| 192 | } |
| 193 | |
| 194 | float test_float_ul2f(unsigned long long a) |
| 195 | { |
| 196 | return a; |
| 197 | } |