ISLE: rewrite and/or of icmp (#6095)
* ISLE: rewrite `and`/`or` of `icmp` * Add `make-icmp-tests.sh` script * Remove unused changes
This commit is contained in:
3010
cranelift/filetests/filetests/egraph/icmp.clif
Normal file
3010
cranelift/filetests/filetests/egraph/icmp.clif
Normal file
File diff suppressed because it is too large
Load Diff
38
cranelift/filetests/filetests/egraph/make-icmp-tests.sh
Executable file
38
cranelift/filetests/filetests/egraph/make-icmp-tests.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
cd $(dirname "$0")
|
||||
out=icmp.clif
|
||||
CCS="eq ne ult ule ugt uge slt sle sgt sge"
|
||||
|
||||
function main {
|
||||
cat << EOF > $out
|
||||
test optimize precise-output
|
||||
set opt_level=speed
|
||||
set use_egraphs=true
|
||||
target x86_64
|
||||
|
||||
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
;; !!! GENERATED BY 'make-icmp-tests.sh' DO NOT EDIT !!!
|
||||
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
;; run with the 'CRANELIFT_TEST_BLESS=1' env var set to update this file
|
||||
|
||||
EOF
|
||||
for op in "and" "or"; do
|
||||
for cc1 in $CCS; do
|
||||
for cc2 in $CCS; do
|
||||
cat << EOF >> $out
|
||||
function %icmp_${op}_${cc1}_${cc2}(i32, i32) -> i8 {
|
||||
block0(v0: i32, v1: i32):
|
||||
v2 = icmp ${cc1} v0, v1
|
||||
v3 = icmp ${cc2} v0, v1
|
||||
v4 = b${op} v2, v3
|
||||
return v4
|
||||
}
|
||||
EOF
|
||||
done
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user