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:
Karl Meakin
2023-03-29 01:13:27 +01:00
committed by GitHub
parent 01b82adf0d
commit dcf0ea9ff3
3 changed files with 3098 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View 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