aboutsummaryrefslogtreecommitdiff
path: root/unix/as.vax/ishift.s
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /unix/as.vax/ishift.s
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'unix/as.vax/ishift.s')
-rw-r--r--unix/as.vax/ishift.s57
1 files changed, 57 insertions, 0 deletions
diff --git a/unix/as.vax/ishift.s b/unix/as.vax/ishift.s
new file mode 100644
index 00000000..1319556f
--- /dev/null
+++ b/unix/as.vax/ishift.s
@@ -0,0 +1,57 @@
+# IAND, IOR, ISHIFT -- Bitwise boolean integer functions for the NCAR
+# package. The shift function must rotate the bits left and around
+# if the nbits to shift argument is positive.
+
+ .data # Bitwise boolean AND
+ .text
+ .align 1
+ .globl _iand_
+_iand_:
+ .word L12
+ jbr L14
+L15:
+ mcoml *8(ap),r0
+ bicl3 r0,*4(ap),r0
+ ret
+ ret
+ .set L12,0x0
+L14:
+ jbr L15
+
+
+ .data # Bitwise boolean OR
+ .text
+ .align 1
+ .globl _ior_
+_ior_:
+ .word L17
+ jbr L19
+L20:
+ bisl3 *8(ap),*4(ap),r0
+ ret
+ ret
+ .set L17,0x0
+L19:
+ jbr L20
+
+
+ .data # Bitwise SHIFT
+ .text
+ .align 1
+ .globl _ishift_
+_ishift_:
+ .word L22
+ jbr L24
+L25:
+ movl *8(ap),r11
+ jlss L26
+ rotl r11,*4(ap),r0 # left rotate longword
+ ret
+L26:
+ ashl r11,*4(ap),r0 # right shift with sign extension
+ ret
+ ret
+ .set L22,0x800
+L24:
+ jbr L25
+ .data