From cf74a7c7625da3cf13a224ccb0b1e59704c33841 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 15 Jan 2006 10:05:20 +0000 Subject: [PATCH] Added patterns for 8-bit multiply git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25338 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrInfo.td | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index 5427e249d0f..1a5e7380125 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -682,14 +682,23 @@ def MOV32mr : I<0x89, MRMDestMem, (ops i32mem:$dst, R32:$src), // // Extra precision multiplication -def MUL8r : I<0xF6, MRM4r, (ops R8:$src), "mul{b} $src", []>, +def MUL8r : I<0xF6, MRM4r, (ops R8:$src), "mul{b} $src", + // FIXME: Used for 8-bit mul, ignore result upper 8 bits. + // This probably ought to be moved to a def : Pat<> if the + // syntax can be accepted. + [(set AL, (mul AL, R8:$src))]>, Imp<[AL],[AX]>; // AL,AH = AL*R8 def MUL16r : I<0xF7, MRM4r, (ops R16:$src), "mul{w} $src", []>, Imp<[AX],[AX,DX]>, OpSize; // AX,DX = AX*R16 def MUL32r : I<0xF7, MRM4r, (ops R32:$src), "mul{l} $src", []>, Imp<[EAX],[EAX,EDX]>; // EAX,EDX = EAX*R32 def MUL8m : I<0xF6, MRM4m, (ops i8mem :$src), - "mul{b} $src", []>, Imp<[AL],[AX]>; // AL,AH = AL*[mem8] + "mul{b} $src", + // FIXME: Used for 8-bit mul, ignore result upper 8 bits. + // This probably ought to be moved to a def : Pat<> if the + // syntax can be accepted. + [(set AL, (mul AL, (loadi8 addr:$src)))]>, + Imp<[AL],[AX]>; // AL,AH = AL*[mem8] def MUL16m : I<0xF7, MRM4m, (ops i16mem:$src), "mul{w} $src", []>, Imp<[AX],[AX,DX]>, OpSize; // AX,DX = AX*[mem16]