Advanced Micro Devices beat Wall Street expectations on earnings and revenue by a small margin, sending shares of the semiconductor firm tumbling in after-hours trading.