| Issue |
56454
|
| Summary |
Incorrect bitcast result for half-precision float on AArch64
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
topolarity
|
```llvm
; Function Attrs: nobuiltin nounwind
define external fastcc i1 @"_start"() unnamed_addr {
Entry:
%0 = bitcast half 0xH7C01 to i16
%1 = icmp ne i16 31745, %0
%2 = zext i1 %1 to i64
call i64 asm sideeffect "svc #0", "={x0},{x8},{x0},~{memory},~{cc}"(i64 94, i64 %2)
unreachable
}
```
This program should always return 0, but it returns 1 if compiled with `llc -O0`:
```
$ llc test.ll -o test.o -filetype=obj -mtriple=aarch64-linux-none -O2
$ ld.lld test.o -o test -m aarch64linux && qemu-aarch64 ./test
$ echo $?
0
$ llc test.ll -o test.o -filetype=obj -mtriple=aarch64-linux-none -O0
$ ld.lld test.o -o test -m aarch64linux && qemu-aarch64 ./test
$ echo $?
1
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs