summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-19 06:30:36 +0000
committerChris Lattner <sabre@nondot.org>2005-01-19 06:30:36 +0000
commit892336a1b5df876c1a427ea1348f1ec61b84d69b (patch)
tree4f9382883f81f9046face01d3219560b1b2dda3e
parent41fe201b61956decdf54f7ba4245e1b31c72fdbd (diff)
downloadbcm5719-llvm-892336a1b5df876c1a427ea1348f1ec61b84d69b.tar.gz
bcm5719-llvm-892336a1b5df876c1a427ea1348f1ec61b84d69b.zip
Ensure that each these functions generates a sh[rl]d instruction.
llvm-svn: 19682
-rw-r--r--llvm/test/Regression/CodeGen/X86/shift-double.llx22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Regression/CodeGen/X86/shift-double.llx b/llvm/test/Regression/CodeGen/X86/shift-double.llx
new file mode 100644
index 00000000000..ee3bc1e9925
--- /dev/null
+++ b/llvm/test/Regression/CodeGen/X86/shift-double.llx
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel -disable-pattern-isel=0 | grep sh[lr]d | wc -l | grep 4
+
+long %test1(long %X, ubyte %C) {
+ %Y = shl long %X, ubyte %C
+ ret long %Y
+}
+long %test2(long %X, ubyte %C) {
+ %Y = shr long %X, ubyte %C
+ ret long %Y
+}
+ulong %test3(ulong %X, ubyte %C) {
+ %Y = shr ulong %X, ubyte %C
+ ret ulong %Y
+}
+
+uint %test4(uint %A, uint %B, ubyte %C) {
+ %X = shl uint %A, ubyte %C
+ %Cv = sub ubyte 32, %C
+ %Y = shr uint %B, ubyte %Cv
+ %Z = or uint %Y, %X
+ ret uint %Z
+}
OpenPOWER on IntegriCloud