From 2421a179e4eadfa9fde7a1135186c9953b09f85d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 6 Oct 2006 17:39:34 +0000 Subject: [PATCH] ugly codegen llvm-svn: 30769 --- llvm/lib/Target/X86/README.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/llvm/lib/Target/X86/README.txt b/llvm/lib/Target/X86/README.txt index 9f22bab55d21..3ee32cce0558 100644 --- a/llvm/lib/Target/X86/README.txt +++ b/llvm/lib/Target/X86/README.txt @@ -711,4 +711,26 @@ bool %test(ulong %x) { into x.h == 0 +//===---------------------------------------------------------------------===// +We currently compile sign_extend_inreg into two shifts: + +long foo(long X) { + return (long)(signed char)X; +} + +becomes: + +_foo: + movl 4(%esp), %eax + shll $24, %eax + sarl $24, %eax + ret + +This could be: + +_foo: + movsbl 4(%esp),%eax + ret + +//===---------------------------------------------------------------------===//