qemu-devel
[Top][All Lists]

## Re: [PATCH v5 38/60] target/riscv: vector floating-point compare instruc

 From: LIU Zhiwei Subject: Re: [PATCH v5 38/60] target/riscv: vector floating-point compare instructions Date: Sat, 14 Mar 2020 17:11:03 +0800 User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

```

On 2020/3/14 17:08, Richard Henderson wrote:
```
```On 3/12/20 7:58 AM, LIU Zhiwei wrote:
```
```+static uint8_t float16_eq_quiet(uint16_t a, uint16_t b, float_status *s)
+{
+    int compare = float16_compare_quiet(a, b, s);
+    if (compare == float_relation_equal) {
+        return 1;
+    } else {
+        return 0;
+    }
+}
```
```You really need remember that boolean results in C are 1 and 0.
You do not need to keep translating true to 1 and false to 0.
```
```Got it. I was not very sure it is 1 or non 0 for true before.

Zhiwei
```
```+static uint8_t vmfne16(uint16_t a, uint16_t b, float_status *s)
+{
+    int compare = float16_compare_quiet(a, b, s);
+    if (compare != float_relation_equal &&
+            compare != float_relation_unordered) {
```
```Indentation.

```
```+static uint8_t float16_le(uint16_t a, uint16_t b, float_status *s)
+{
+    int compare = float16_compare(a, b, s);
+    if (compare == float_relation_less ||
+            compare == float_relation_equal) {
+        return 1;
```
```Indentation.

r~
```
```

```