llvm-6502/utils
Chandler Carruth 7cd7154421 [x86] Fix a pretty horrible bug and inconsistency in the x86 asm
parsing (and latent bug in the instruction definitions).

This is effectively a revert of r136287 which tried to address
a specific and narrow case of immediate operands failing to be accepted
by x86 instructions with a pretty heavy hammer: it introduced a new kind
of operand that behaved differently. All of that is removed with this
commit, but the test cases are both preserved and enhanced.

The core problem that r136287 and this commit are trying to handle is
that gas accepts both of the following instructions:

  insertps $192, %xmm0, %xmm1
  insertps $-64, %xmm0, %xmm1

These will encode to the same byte sequence, with the immediate
occupying an 8-bit entry. The first form was fixed by r136287 but that
broke the prior handling of the second form! =[ Ironically, we would
still emit the second form in some cases and then be unable to
re-assemble the output.

The reason why the first instruction failed to be handled is because
prior to r136287 the operands ere marked 'i32i8imm' which forces them to
be sign-extenable. Clearly, that won't work for 192 in a single byte.
However, making thim zero-extended or "unsigned" doesn't really address
the core issue either because it breaks negative immediates. The correct
fix is to make these operands 'i8imm' reflecting that they can be either
signed or unsigned but must be 8-bit immediates. This patch backs out
r136287 and then changes those places as well as some others to use
'i8imm' rather than one of the extended variants.

Naturally, this broke something else. The custom DAG nodes had to be
updated to have a much more accurate type constraint of an i8 node, and
a bunch of Pat immediates needed to be specified as i8 values.

The fallout didn't end there though. We also then ceased to be able to
match the instruction-specific intrinsics to the instructions so
modified. Digging, this is because they too used i32 rather than i8 in
their signature. So I've also switched those intrinsics to i8 arguments
in line with the instructions.

In order to make the intrinsic adjustments of course, I also had to add
auto upgrading for the intrinsics.

I suspect that the intrinsic argument types may have led everything down
this rabbit hole. Pretty happy with the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217310 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-06 10:00:01 +00:00
..
bugpoint
buildit ARM64: initial backend import 2014-03-29 10:18:08 +00:00
count Install three utils, "FileCheck", "count", and "not", for now to appease llvmlab dragonegg builder. 2013-12-20 06:25:37 +00:00
crosstool
emacs IR: Implement uselistorder assembly directives 2014-08-19 21:30:15 +00:00
FileCheck Return a std::unique_ptr when creating a new MemoryBuffer. 2014-08-27 20:03:13 +00:00
fpcmp Don't use PathV1.h in FileUtilities.h. 2013-06-13 20:41:00 +00:00
git [utils] Update find-rev utility to take a branch argument (name of the git-svn 2013-01-17 18:57:21 +00:00
git-svn Use 'git svn find-rev' in git-svnrevert instead of shell script fu. 2013-04-26 03:27:39 +00:00
jedit
kate Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
KillTheDoctor Remove broken include. 2014-06-13 15:21:50 +00:00
lint
lit [LIT] Move display of unsupported and xfail tests to summary. 2014-08-16 02:16:25 +00:00
llvm-build Reinstate "Nuke the old JIT." 2014-09-02 22:28:02 +00:00
llvm-lit [testing]: lld generally lives in tools/, so fix llvm-lit. 2014-07-07 15:26:53 +00:00
Misc Patch that forces MergeFunctions pass for clang. 2013-09-24 20:06:31 +00:00
not not: Only consider exit code 3 to be a crash with --crash 2014-06-23 22:54:33 +00:00
PerfectShuffle [C++11] Use 'nullptr'. 2014-06-08 22:29:17 +00:00
release Use 'xz' compression instead of 'gz'. 2014-08-26 08:11:22 +00:00
TableGen [x86] Fix a pretty horrible bug and inconsistency in the x86 asm 2014-09-06 10:00:01 +00:00
Target/ARM
testgen [MC] bundle alignment: prevent padding instructions from crossing bundle boundaries 2013-01-31 17:00:03 +00:00
textmate Add highlighting for "int" keyword 2013-01-08 16:23:02 +00:00
unittest Reverted r203879. 2014-03-14 01:56:55 +00:00
valgrind llvm/utils/valgrind/x86_64-pc-linux-gnu.supp: Add /usr/bin/cmp. 2013-01-20 15:30:29 +00:00
vim IR: Implement uselistorder assembly directives 2014-08-19 21:30:15 +00:00
yaml-bench Remove some calls to std::move. 2014-08-01 14:31:55 +00:00
bisect Add a small utility called bisect that enables commandline bisecting on a counter. 2014-08-02 01:39:08 +00:00
check-each-file
clang-parse-diagnostics-file [utils] Tweak utils/clang-parse-diagnostics-file to ignore autoconf diagnostics. 2012-12-22 00:47:06 +00:00
codegen-diff
countloc.sh
DSAclean.py
DSAextract.py Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 2012-09-27 10:14:43 +00:00
findmisopt
findoptdiff
findsym.pl
GenLibDeps.pl Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00
GetRepositoryPath Fix the build for git repositories with multiple remotes. 2013-09-16 09:25:49 +00:00
GetSourceVersion
getsrcs.sh
lldbDataFormatters.py utils: Teach lldbDataFormatters to load automatically 2014-05-28 05:45:17 +00:00
llvm-compilers-check Remove bogus configure check 2014-06-19 19:31:11 +00:00
llvm-native-gxx
llvm.grm Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
llvm.natvis Use correct memeber when displaying StringMap's size. 2014-07-09 05:34:24 +00:00
LLVMBuild.txt
llvmdo
llvmgrep
Makefile Delete utils/FileUpdate. 2014-06-23 17:58:39 +00:00
makellvm
shuffle_fuzz.py [shuffle] Teach the shufflevector fuzzer to support fixed element types. 2014-08-17 00:40:31 +00:00
sort_includes.py Teach sort_includes.py to drop duplicated includes. 2012-12-21 18:00:08 +00:00
test_debuginfo.pl test_debuginfo.pl: Make failures easier to debug by printing the debugger 2014-02-20 19:55:44 +00:00
UpdateCMakeLists.pl Generalize matching of add_executable to add_XXX_executable. 2012-11-22 07:48:52 +00:00
wciia.py Fix known typos 2014-01-24 17:20:08 +00:00