- May 19, 2013
-
-
Venkatraman Govindaraju authored
[Sparc] Rearrange integer registers' allocation order so that register allocator will use I and G registers before using L and O registers. Also, enable registers %g2-%g4 to be used in application and %g5 in 64 bit mode. llvm-svn: 182219
-
Jakob Stoklund Olesen authored
llvm-svn: 182216
-
- May 17, 2013
-
-
Venkatraman Govindaraju authored
This is to generate correct framesetup code when the function has variable sized allocas. llvm-svn: 182108
-
Venkatraman Govindaraju authored
llvm-svn: 182063
-
- May 13, 2013
-
-
Rafael Espindola authored
It was just a less powerful and more confusing version of MCCFIInstruction. A side effect is that, since MCCFIInstruction uses dwarf register numbers, calls to getDwarfRegNum are pushed out, which should allow further simplifications. I left the MachineModuleInfo::addFrameMove interface unchanged since this patch was already fairly big. llvm-svn: 181680
-
- May 10, 2013
-
-
Rafael Espindola authored
llvm-svn: 181618
-
- Apr 21, 2013
-
-
Jakob Stoklund Olesen authored
Arguments after the fixed arguments never use the floating point registers. llvm-svn: 179987
-
Jakob Stoklund Olesen authored
Don't ignore the high 32 bits of the immediate. llvm-svn: 179985
-
Jakob Stoklund Olesen authored
With a little help from the frontend, it looks like the standard va_* intrinsics can do the job. Also clean up an old bitcast hack in LowerVAARG that dealt with unaligned double loads. Load SDNodes can specify an alignment now. Still missing: Calling varargs functions with float arguments. llvm-svn: 179961
-
- Apr 20, 2013
-
-
Tim Northover authored
llvm-svn: 179939
-
- Apr 16, 2013
-
-
Jakob Stoklund Olesen authored
llvm-svn: 179582
-
- Apr 14, 2013
-
-
Jakob Stoklund Olesen authored
Test case by llvm-stress. llvm-svn: 179477
-
Jakob Stoklund Olesen authored
For when 16 TB just isn't enough. llvm-svn: 179474
-
Jakob Stoklund Olesen authored
This is the default model for non-PIC 64-bit code. It supports text+data+bss linked anywhere in the low 16 TB of the address space. llvm-svn: 179473
-
Jakob Stoklund Olesen authored
64-bit code models need multiple relocations that can't be inferred from the opcode like they can in 32-bit code. llvm-svn: 179472
-
Jakob Stoklund Olesen authored
Constant pool entries are accessed exactly the same way as global variables. llvm-svn: 179471
-
Jakob Stoklund Olesen authored
This fixes the pic32 code model for SPARC v9. llvm-svn: 179469
-
Jakob Stoklund Olesen authored
SDNodes and MachineOperands get target flags representing the %hi() and %lo() assembly annotations that eventually become relocations. Also define flags to be used by the 64-bit code models. llvm-svn: 179468
-
- Apr 13, 2013
-
-
Jakob Stoklund Olesen authored
Currently, only abs32 and pic32 are implemented. Add a test case for abs32 with 64-bit code. 64-bit PIC code is currently broken. llvm-svn: 179463
-
Jakob Stoklund Olesen authored
It doesn't seem like anybody is checking types this late in isel, so no test case. llvm-svn: 179462
-
- Apr 09, 2013
-
-
Jakob Stoklund Olesen authored
llvm-svn: 179086
-
Jakob Stoklund Olesen authored
The save area is twice as big and there is no struct return slot. The stack pointer is always 16-byte aligned (after adding the bias). Also eliminate the stack adjustment instructions around calls when the function has a reserved stack frame. llvm-svn: 179083
-
- Apr 07, 2013
-
-
Jakob Stoklund Olesen authored
There is still no support for byval arguments (which I don't think are needed) and varargs. llvm-svn: 178993
-
Jakob Stoklund Olesen authored
Integer return values are sign or zero extended by the callee, and structs up to 32 bytes in size can be returned in registers. The CC_Sparc64 CallingConv definition is shared between LowerFormalArguments_64 and LowerReturn_64. Function arguments and return values are passed in the same registers. The inreg flag is also used for return values. This is required to handle C functions returning structs containing floats and ints: struct ifp { int i; float f; }; struct ifp f(void); LLVM IR: define inreg { i32, float } @f() { ... ret { i32, float } %retval } The ABI requires that %retval.i is returned in the high bits of %i0 while %retval.f goes in %f1. Without the inreg return value attribute, %retval.i would go in %i0 and %retval.f would go in %f3 which is a more efficient way of returning %multiple values, but it is not ABI compliant for returning C structs. llvm-svn: 178966
-
- Apr 06, 2013
-
-
Jakob Stoklund Olesen authored
64-bit SPARC v9 processes use biased stack and frame pointers, so the current function's stack frame is located at %sp+BIAS .. %fp+BIAS where BIAS = 2047. This makes more local variables directly accessible via [%fp+simm13] addressing. llvm-svn: 178965
-
Jakob Stoklund Olesen authored
All arguments are formally assigned to stack positions and then promoted to floating point and integer registers. Since there are more floating point registers than integer registers, this can cause situations where floating point arguments are assigned to registers after integer arguments that where assigned to the stack. Use the inreg flag to indicate 32-bit fragments of structs containing both float and int members. The three-way shadowing between stack, integer, and floating point registers requires custom argument lowering. The good news is that return values are passed in the exact same way, and we can share the code. Still missing: - Update LowerReturn to handle structs returned in registers. - LowerCall. - Variadic functions. llvm-svn: 178958
-
- Apr 04, 2013
-
-
Jakob Stoklund Olesen authored
This requires v9 cmov instructions using the %xcc flags instead of the %icc flags. Still missing: - Select floats on %xcc flags. - Select i64 on %fcc flags. llvm-svn: 178737
-
- Apr 03, 2013
-
-
Jakob Stoklund Olesen authored
The same compare instruction is used for 32-bit and 64-bit compares. It sets two different sets of flags: icc and xcc. This patch adds a conditional branch instruction using the xcc flags for 64-bit compares. llvm-svn: 178621
-
- Apr 02, 2013
-
-
Jakob Stoklund Olesen authored
There is only a few new instructions, the rest is handled with patterns. llvm-svn: 178528
-
Jakob Stoklund Olesen authored
SPARC v9 extends all ALU instructions to 64 bits, so we simply need to add patterns to use them for both i32 and i64 values. llvm-svn: 178527
-
Jakob Stoklund Olesen authored
The last resort pattern produces 6 instructions, and there are still opportunities for materializing some immediates in fewer instructions. llvm-svn: 178526
-
Jakob Stoklund Olesen authored
SPARC v9 defines new 64-bit shift instructions. The 32-bit shift right instructions are still usable as zero and sign extensions. This adds new F3_Sr and F3_Si instruction formats that probably should be used for the 32-bit shifts as well. They don't really encode an simm13 field. llvm-svn: 178525
-
Jakob Stoklund Olesen authored
The 'sparc' architecture produces 32-bit code while 'sparcv9' produces 64-bit code. It is also possible to run 32-bit code using SPARC v9 instructions with: llc -march=sparc -mattr=+v9 llvm-svn: 178524
-
Jakob Stoklund Olesen authored
This is far from complete, but it is enough to make it possible to write test cases using i64 arguments. Missing features: - Floating point arguments. - Receiving arguments on the stack. - Calls. llvm-svn: 178523
-
Jakob Stoklund Olesen authored
We are going to use the same registers for 32-bit and 64-bit values, but in two different register classes. The I64Regs register class has a larger spill size and alignment. The addition of an i64 register class confuses TableGen's type inference, so it is necessary to clarify the type of some immediates and the G0 register. In 64-bit mode, pointers are i64 and should use the I64Regs register class. Implement getPointerRegClass() to dynamically provide the pointer register class depending on the subtarget. Use ptr_rc and iPTR for memory operands. Finally, add the i64 type to the IntRegs register class. This register class is not used to hold i64 values, I64Regs is for that. The type is required to appease TableGen's type checking in output patterns like this: def : Pat<(add i64:$a, i64:$b), (ADDrr $a, $b)>; SPARC v9 uses the same ADDrr instruction for i32 and i64 additions, and TableGen doesn't know to check the type of register sub-classes. llvm-svn: 178522
-
- Mar 24, 2013
-
-
Jakob Stoklund Olesen authored
The types of register variables no longer need to be specified in output patterns. llvm-svn: 177845
-
Jakob Stoklund Olesen authored
Also update the documentation since Sparc is the nicest backend, and used as an example in WritingAnLLVMBackend. llvm-svn: 177835
-
- Mar 23, 2013
-
-
Jakob Stoklund Olesen authored
The SelectionDAG graph has MVT type labels, not register classes, so this makes it clearer what is happening. This notation is also robust against adding more types to the IntRegs register class. llvm-svn: 177829
-
- Mar 14, 2013
-
-
Hal Finkel authored
Add the current PEI register scavenger as a parameter to the processFunctionBeforeFrameFinalized callback. This change is necessary in order to allow the PowerPC target code to set the register scavenger frame index after the save-area offset adjustments performed by processFunctionBeforeFrameFinalized. Only after these adjustments have been made is it possible to estimate the size of the stack frame. llvm-svn: 177108
-
- Mar 07, 2013
-
-
Benjamin Kramer authored
llvm-svn: 176648
-