aboutsummaryrefslogtreecommitdiff
path: root/tests/bitfield-load-unsigned.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-14 12:28:14 -0700
committerMichael Forney <mforney@mforney.org>2019-04-14 12:42:12 -0700
commitea4a14c7a4943498f49c26824d68a8d4776c5ddc (patch)
tree27c7b45778132a2badbecf9b3dc0b4d9ada4d44e /tests/bitfield-load-unsigned.qbe
parentc662950252c041e01b64b829921cb5e79a2e2bb6 (diff)
Initial support for loading/storing bit-fields
Diffstat (limited to 'tests/bitfield-load-unsigned.qbe')
-rw-r--r--tests/bitfield-load-unsigned.qbe14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/bitfield-load-unsigned.qbe b/tests/bitfield-load-unsigned.qbe
new file mode 100644
index 0000000..c4ea94b
--- /dev/null
+++ b/tests/bitfield-load-unsigned.qbe
@@ -0,0 +1,14 @@
+export
+function $f() {
+@start.1
+@body.2
+ %.1 =l copy $s
+ %.2 =l mul 0, 1
+ %.3 =l add %.1, %.2
+ %.4 =l copy %.3
+ %.5 =w loaduw %.4
+ %.6 =w shl %.5, 13
+ %.7 =w shr %.6, 17
+ ret
+}
+export data $s = align 4 { z 4 }