2012-01-12 20:41:34 +08:00
|
|
|
; RUN: llc < %s -march=x86 | grep and | count 2
|
2009-09-09 07:54:48 +08:00
|
|
|
; RUN: llc < %s -march=x86-64 | not grep and
|
2008-08-30 10:03:58 +08:00
|
|
|
|
|
|
|
define i32 @t1(i32 %t, i32 %val) nounwind {
|
|
|
|
%shamt = and i32 %t, 31
|
|
|
|
%res = shl i32 %val, %shamt
|
|
|
|
ret i32 %res
|
|
|
|
}
|
|
|
|
|
2012-01-12 20:41:34 +08:00
|
|
|
define i32 @t2(i32 %t, i32 %val) nounwind {
|
|
|
|
%shamt = and i32 %t, 63
|
|
|
|
%res = shl i32 %val, %shamt
|
|
|
|
ret i32 %res
|
|
|
|
}
|
|
|
|
|
2008-08-30 10:03:58 +08:00
|
|
|
@X = internal global i16 0
|
|
|
|
|
2012-01-12 20:41:34 +08:00
|
|
|
define void @t3(i16 %t) nounwind {
|
2008-08-30 10:03:58 +08:00
|
|
|
%shamt = and i16 %t, 31
|
|
|
|
%tmp = load i16* @X
|
|
|
|
%tmp1 = ashr i16 %tmp, %shamt
|
|
|
|
store i16 %tmp1, i16* @X
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2012-01-12 20:41:34 +08:00
|
|
|
define i64 @t4(i64 %t, i64 %val) nounwind {
|
2008-08-30 10:03:58 +08:00
|
|
|
%shamt = and i64 %t, 63
|
|
|
|
%res = lshr i64 %val, %shamt
|
|
|
|
ret i64 %res
|
|
|
|
}
|
2012-01-12 20:41:34 +08:00
|
|
|
|
|
|
|
define i64 @t5(i64 %t, i64 %val) nounwind {
|
|
|
|
%shamt = and i64 %t, 191
|
|
|
|
%res = lshr i64 %val, %shamt
|
|
|
|
ret i64 %res
|
|
|
|
}
|