1. 23 May, 2014 1 commit
    • Fix x86 floating-point constant emission. · f61d5b22
      Jim Stichnoth authored
      Previously, the basis of constant pooling was implemented, but two things were lacking:
      
      1. The constant pools were not being emitted in the asm file.
      
      2. A direct FP value was emitted in an FP instruction, e.g. "addss xmm0, 1.0000e00".  Curiously, at least for some FP constants, llvm-mc was accepting this syntax.
      
      BUG= none
      R=jfb@chromium.org
      
      Review URL: https://codereview.chromium.org/291213003
  2. 22 May, 2014 2 commits
    • Add Makefiles to support building along with LLVM · bc643135
      Derek Schuff authored
      This change now supports building subzero as part of the LLVM build (instead
      of in a separate build step). It is modeled on clang's Makefiles.
      
      The existing Makefile has been renamed and can still be used manually, e.g.
      Make -f Makefile.standalone
      
      It does not yet support running tests, just building.
      
      R=stichnot@chromium.org, jvoung@chromium.org
      BUG=
      
      Review URL: https://codereview.chromium.org/293983007
    • Add Om1 lowering with no optimizations. · 5bc2b1d1
      Jim Stichnoth authored
      This adds infrastructure for low-level x86-32 instructions, and the target lowering patterns.
      
      Practically no optimizations are performed.  Optimizations to be introduced later include liveness analysis, dead-code elimination, global linear-scan register allocation, linear-scan based stack slot coalescing, and compare/branch fusing.  One optimization that is present is simple coalescing of stack slots for variables that are only live within a single basic block.
      
      There are also some fairly comprehensive cross tests.  This testing infrastructure translates bitcode using both Subzero and llc, and a testing harness calls both versions with a variety of "interesting" inputs and compares the results.  Specifically, Arithmetic, Icmp, Fcmp, and Cast instructions are tested this way, across all PNaCl primitive types.
      
      BUG=
      R=jvoung@chromium.org
      
      Review URL: https://codereview.chromium.org/265703002
  3. 19 May, 2014 1 commit
  4. 29 Apr, 2014 1 commit
    • Initial skeleton of Subzero. · f7c9a141
      Jim Stichnoth authored
      This includes just enough code to build the high-level ICE IR and dump it back out again.  There is a script szdiff.py that does a fuzzy diff of the input and output for verification.  See the comment in szdiff.py for a description of the fuzziness.
      
      Building llvm2ice requires LLVM headers, libs, and tools (e.g. FileCheck) to be present.  These default to something like llvm_i686_linux_work/Release+Asserts/ based on the checked-out and built pnacl-llvm code; I'll try to figure out how to more automatically detect the build configuration.
      
      "make check" runs the lit tests.
      
      This CL has under 2000 lines of "interesting" Ice*.{h,cpp} code, plus 600 lines of llvm2ice.cpp driver code, and the rest is tests.
      
      Here is the high-level mapping of source files to functionality:
      
      IceDefs.h, IceTypes.h, IceTypes.cpp:
      Commonly used types and utilities.
      
      IceCfg.h, IceCfg.cpp:
      Operations at the function level.
      
      IceCfgNode.h, IceCfgNode.cpp:
      Operations on basic blocks (nodes).
      
      IceInst.h, IceInst.cpp:
      Operations on instructions.
      
      IceOperand.h, IceOperand.cpp:
      Operations on operands, such as stack locations, physical registers, and constants.
      
      BUG= none
      R=jfb@chromium.org
      
      Review URL: https://codereview.chromium.org/205613002
  5. 19 Mar, 2014 2 commits