[llvm-commits] [llvm] r91973 - /llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
Chris Lattner
clattner at apple.com
Tue Dec 22 17:48:51 PST 2009
On Dec 22, 2009, at 5:32 PM, Sean Callanan wrote:
> Author: spyffe
> Date: Tue Dec 22 19:32:29 2009
> New Revision: 91973
>
> URL: http://llvm.org/viewvc/llvm-project?rev=91973&view=rev
> Log:
> More fixes for Visual C++. Replaced several very small
> static inline functions with macros.
Please make these static functions. Compilers inline static functions
too. Anton has a good point though, why is this a C file?
-Chris
>
> Modified:
> llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
>
> Modified: llvm/trunk/lib/Target/X86/Disassembler/
> X86DisassemblerDecoder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h?rev=91973&r1=91972&r2=91973&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
> (original)
> +++ llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
> Tue Dec 22 19:32:29 2009
> @@ -34,16 +34,16 @@
> /*
> * Accessor functions for various fields of an Intel instruction
> */
> -static inline uint8_t modFromModRM(uint8_t modRM){ return (modRM &
> 0xc0) >> 6; }
> -static inline uint8_t regFromModRM(uint8_t modRM){ return (modRM &
> 0x38) >> 3; }
> -static inline uint8_t rmFromModRM(uint8_t modRM) { return (modRM &
> 0x7); }
> -static inline uint8_t scaleFromSIB(uint8_t sib) { return (sib &
> 0xc0) >> 6; }
> -static inline uint8_t indexFromSIB(uint8_t sib) { return (sib &
> 0x38) >> 3; }
> -static inline uint8_t baseFromSIB(uint8_t sib) { return (sib &
> 0x7); }
> -static inline uint8_t wFromREX(uint8_t rex) { return (rex &
> 0x8) >> 3; }
> -static inline uint8_t rFromREX(uint8_t rex) { return (rex &
> 0x4) >> 2; }
> -static inline uint8_t xFromREX(uint8_t rex) { return (rex &
> 0x2) >> 1; }
> -static inline uint8_t bFromREX(uint8_t rex) { return (rex &
> 0x1); }
> +#define modFromModRM(modRM) ((modRM & 0xc0) >> 6)
> +#define regFromModRM(modRM) ((modRM & 0x38) >> 3)
> +#define rmFromModRM(modRM) (modRM & 0x7)
> +#define scaleFromSIB(sib) ((sib & 0xc0) >> 6)
> +#define indexFromSIB(sib) ((sib & 0x38) >> 3)
> +#define baseFromSIB(sib) (sib & 0x7)
> +#define wFromREX(rex) ((rex & 0x8) >> 3)
> +#define rFromREX(rex) ((rex & 0x4) >> 2)
> +#define xFromREX(rex) ((rex & 0x2) >> 1)
> +#define bFromREX(rex) (rex & 0x1)
>
> /*
> * These enums represent Intel registers for use by the decoder.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list