mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
832254e1c2
This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
27 lines
982 B
LLVM
27 lines
982 B
LLVM
; RUN: llvm-as %s -o - | llvm-dis > %t.ll
|
|
; RUN: diff %t.ll %s.out
|
|
|
|
; test 31 bits
|
|
;
|
|
@b = constant i31 add(i31 2147483647, i31 1)
|
|
@c = constant i31 add(i31 2147483647, i31 2147483647)
|
|
@d = constant i31 add(i31 2147483640, i31 8)
|
|
@e = constant i31 sub(i31 0 , i31 1)
|
|
@f = constant i31 sub(i31 0 , i31 2147483647)
|
|
@g = constant i31 sub(i31 2 , i31 2147483647)
|
|
|
|
@h = constant i31 shl(i31 1 , i31 31)
|
|
@i = constant i31 shl(i31 1 , i31 30)
|
|
@j = constant i31 lshr(i31 2147483647 , i31 30)
|
|
@k = constant i31 lshr(i31 2147483647 , i31 31)
|
|
@l = constant i31 ashr(i31 2147483647 , i31 30)
|
|
@m = constant i31 ashr(i31 2147483647 , i31 31)
|
|
|
|
@n = constant i31 mul(i31 2147483647, i31 2)
|
|
@q = constant i31 sdiv(i31 -1, i31 1073741823)
|
|
@r = constant i31 udiv(i31 -1, i31 1073741823)
|
|
@s = constant i31 srem(i31 3, i31 2147483646)
|
|
@t = constant i31 urem(i31 2147483647,i31 -1)
|
|
@o = constant i31 trunc( i32 2147483648 to i31 )
|
|
@p = constant i31 trunc( i32 2147483647 to i31 )
|