1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-04 03:00:20 +02:00
Commit graph

20 commits

Author SHA1 Message Date
Andy Wingo
1c36f036f6 push/pop of link register does not affect stack size on x86
* lightening/x86-cpu.c (pop_link_register, push_link_register): Don't
  record stack size changes here.
2019-06-20 10:53:12 +02:00
Andy Wingo
62183fb098 Add jmpi_with_link instruction
The existing calli / callr interface is for ABI calls.  Sometimes though
you want to call some of your own code, just to get the current return
address.  ARM's branch-and-link instructions are ideal for this but they
don't exist on x86; there we emulate them by adding corresponding
pop_link_register / push_link_register instructions that are no-ops on
ARM.

* lightening.h (FOR_EACH_INSTRUCTION): Add jit_jmpi_with_link,
  pop_link_register, push_link_register.
* lightening/arm-cpu.c:
* lightening/x86-cpu.c:
* lightening/aarch64-cpu.c (jmpi_with_link, push_link_register)
  (pop_link_register): Add implementations.
* lightening/arm.h:
* lightening/aarch64.h:
* lightening/x86.h (JIT_LR): New definition.
* tests/link-register.c: New test.
2019-06-20 10:13:37 +02:00
Andy Wingo
84b9ef087b Add breakpoint instruction 2019-05-27 18:29:26 +02:00
Andy Wingo
bcdde6656b Add atomic operations
These operations emit the same code that GCC does for corresponding
operations under the sequential consistency memory model.  It would be
possible to relax to acquire/release or something in the future.
2019-05-27 11:34:13 +02:00
Andy Wingo
0bfdcc7016 Refactor to add support for constant tables, shifted relocs 2019-05-14 15:53:25 +02:00
Andy Wingo
f7080facb4 Refactor to move temp register acquire to core 2019-05-09 16:02:39 +02:00
Andy Wingo
483e880b10 Fix byte stores on x86-32
Also on x86-32, use RBX as the tmp register, as it is byte-addressable.
2019-04-28 18:42:55 +02:00
Andy Wingo
e0cf51e482 Small bug fixes for ia32 2019-04-26 17:41:43 +02:00
Andy Wingo
42bc762d26 Add facility to enter and leave JIT ABI
This allows us to save and restore callee-save temporaries, i.e. RBP on
32-bit x86.  Otherwise it's a disaster shuffling stack arguments using
temporaries.
2019-04-26 17:28:29 +02:00
Andy Wingo
9906cd5f84 Remove most __X64_32 code
The x32 ABI (i.e., amd64 with 32-bit pointers) is mostly a C language
question.  From a JIT perspective it mostly looks just like amd64.  We
can fix any differences in a followup, but x32 is also a pretty dead
ABI, so I feel OK with this.
2019-04-26 17:19:16 +02:00
Andy Wingo
24950994ef Simplify 64/32 concerns in x86-cpu.c
* lightening/x86-cpu.c (il): Take a uint64_t.  It's only called this
  way.
(imovi): Remove some x64_32 conditions; they seem bogus.
2019-04-26 16:13:29 +02:00
Andy Wingo
bab1f40b5e Fix lightening to compile on 32-bit x86 2019-04-26 14:44:09 +02:00
Andy Wingo
04d89a7ce2 Implement reloc shortening, and remove unused functionality 2019-04-26 12:40:44 +02:00
Andy Wingo
c54c248bc9 Track frame size to more reliably align stack before calls 2019-04-26 09:56:46 +02:00
Andy Wingo
2602f17fb4 Simplify register representation again
There's only one flag, "callee-save".  Also the regno range is limited
to 0-63 inclusive, to allow for cheap register sets as uint64_t values.
2019-04-25 19:12:55 +02:00
Andy Wingo
99e5672726 Renumber x86 registers
Now that there's no hazard to using a register used for passing
arguments, renumber to give JIT_R/JIT_F/JIT_V names to all registers.

Choose a temp register that's not used for passing arguments.  Our
previous choice was an argument register (doh!) which made function
calls with many arguments fail.
2019-04-25 17:14:28 +02:00
Andy Wingo
ddd66a2f34 Simplify register representation
Instead of JIT_R0 being a wrapped index into a table which then gives
the regno and class, just have JIT_R0 be the wrapped regno and class.
2019-04-25 17:03:46 +02:00
Andy Wingo
4e1876f294 Support spilling args to stack 2019-04-04 17:06:57 +02:00
Andy Wingo
e95fb91b96 Fix reloc for jmpi and calli 2019-04-04 11:17:46 +02:00
Andy Wingo
f348b8ed6d Change headers and files to be named "lightening" instead of "jit"
This improves integration with other projects.  Like for example Guile
already has files named jit.c and jit.h; it's easier to manage if
lightening uses its own file names.
2019-04-03 13:57:48 +02:00
Renamed from jit/x86-cpu.c (Browse further)