lowlevel-6809.s: Fix some ashlsi3 brokenness
authorTormod Volden <debian.tormod@gmail.com>
Thu, 4 Jun 2015 21:58:20 +0000 (23:58 +0200)
committerAlan Cox <alan@linux.intel.com>
Thu, 4 Jun 2015 22:10:59 +0000 (23:10 +0100)
This was broken in "upstream" gcc 6809. A shift by more
than 7 would give wrong results in most cases.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Kernel/lowlevel-6809.s

index 963bd5c..eafae91 100644 (file)
@@ -585,11 +585,18 @@ ___ashlsi3:
        ; Shift by 16
        ldu     2,x
        stu     ,x
+       ldu     #0
+       stu     2,x
 try8:
        cmpb    #8
        blt     try_rest
        subb    #8
        ; Shift by 8
+       ldu     1,x
+       stu     ,x
+       lda     3,x
+       sta     2,x
+       clr     3,x
 
 try_rest:
        tstb