* riscv64: Move `is_null`/`is_invalid` to ISLE * riscv64: Fix `is_invalid` codegen * Implement review suggestions Thanks! Co-authored-by: Jamey Sharp <jamey@minilop.net> --------- Co-authored-by: Jamey Sharp <jamey@minilop.net>
29 lines
652 B
Plaintext
29 lines
652 B
Plaintext
test run
|
|
target aarch64
|
|
target x86_64
|
|
target s390x
|
|
target riscv64gc
|
|
; the interpreter does not support bitcasting to/from references
|
|
|
|
function %bitcast_ir64(i64) -> i8 {
|
|
block0(v0: i64):
|
|
v1 = bitcast.r64 v0
|
|
v2 = is_null v1
|
|
return v2
|
|
}
|
|
; run: %bitcast_ir64(0) == 1
|
|
; run: %bitcast_ir64(18446744073709551615) == 0
|
|
; run: %bitcast_ir64(-1) == 0
|
|
; run: %bitcast_ir64(127) == 0
|
|
|
|
function %bitcast_ri64(i64) -> i64 {
|
|
block0(v0: i64):
|
|
v1 = bitcast.r64 v0
|
|
v2 = bitcast.i64 v1
|
|
return v2
|
|
}
|
|
; run: %bitcast_ri64(0) == 0
|
|
; run: %bitcast_ri64(18446744073709551615) == 18446744073709551615
|
|
; run: %bitcast_ri64(-1) == -1
|
|
; run: %bitcast_ri64(127) == 127
|