Michael Munday
9da6ff7ea3
Implement more equality checks.
2016-12-21 13:21:12 -05:00
Michael Munday
8518df8e56
Implement some boolean operations.
2016-12-21 12:49:53 -05:00
Michael Munday
ae38a6913e
Add support for numeric equality checks.
2016-12-21 11:02:53 -05:00
Michael Munday
b5aa0d077c
Fix bug in division.
2016-12-20 17:26:33 -05:00
Michael Munday
eda56c9a44
Add support for if statements.
2016-12-20 17:10:38 -05:00
Michael Munday
90334d3be9
Add support for function definitions.
2016-12-20 15:49:21 -05:00
Michael Munday
e0e98f94d3
Add support for modulo (%) operations.
...
Only the slow path for now.
2016-12-20 14:54:26 -05:00
Michael Munday
d006b07127
Add support for division.
2016-12-20 13:37:42 -05:00
Michael Munday
d94f4ac079
Add support for multiplication.
...
Multiplication instructions don't set the overflow flag so we need
to manually check, which is why this is more complicated than
addition.
2016-12-20 13:14:53 -05:00
Michael Munday
d256d99659
Add support for floating point add/sub.
2016-12-20 12:09:32 -05:00
Michael Munday
5df5e1f144
Add support for integer add/subtract.
...
Still need to support floating point operations. Multiplication is a
little more complicated because it doesn't set the overflow flag.
2016-12-20 09:41:19 -05:00
Michael Munday
e467d784a9
Fix floating point fallback code for for loops.
...
Adds a dependency on clfi. Not sure how to work around (don't
really want to always introduce a temporary).
2016-12-19 16:03:21 -05:00
Michael Munday
299dc34db2
Add basic integer for loop support.
...
> for i=1,3 do print(i) end
1
2
3
2016-12-19 14:21:48 -05:00
Michael Munday
3330f6adc2
Fix KSHORT destination slot address.
2016-12-19 10:49:21 -05:00
Michael Munday
6a9855d988
Add support for print function call.
...
Hello world now works.
> print("hello world!")
hello world!
2016-12-17 19:56:56 -05:00
Michael Munday
bee112d431
Add support for global short assignments.
...
In other words 'a = 1' now works.
2016-12-16 17:23:46 -05:00
Michael Munday
24bdb7576d
Add debug options to Makefile.
...
We're going to need these for a while, so better to put in the
repository. Once we're happy things are working we can disable
the debug info and enable optimizations again.
2016-12-15 11:03:13 -05:00
Michael Munday
2dcbf5be3e
Implement more functions in the VM.
...
Also adds segmentation faults to stubbed out functions to make it
easier to work out what the control flow is.
2016-12-15 11:01:59 -05:00
Michael Munday
ee4b942c94
Add vm_call handling code.
...
Now prints the prompt (!).
2016-12-14 22:22:49 -05:00
Michael Munday
24f2ab48f5
Various fixes for vm_s390x.dasc.
2016-12-14 18:43:21 -05:00
Michael Munday
00d00e995f
Fix extern handling in host vm builder.
2016-12-14 16:31:52 -05:00
Michael Munday
7644f40b1a
Add more interpreter code.
...
Compilation is currently broken, a label is missing.
2016-12-13 18:31:43 -05:00
Michael Munday
0b120ac64b
Add partial implementation of vm_cpcall.
...
Currently works if the call returns 0. Haven't yet written the code
needed to handle the non-zero case.
2016-12-12 17:17:34 -05:00
Michael Munday
625aad5da0
Make LuaJIT compile on s390x.
...
I've disabled both the JIT and FFI for now. I've also stripped almost
all of the assembly out of vm_s390x.dasc, leaving only labels for the
most part. This is enough to get LuaJIT to compile but of course if
you try and run it it will explode.
The idea now is to re-add enough functionality to get a very basic
Lua program to run.
2016-12-09 16:28:39 -05:00
Michael Munday
052eb69750
Make host/buildvm_asm.c compile.
...
I've added a rough implementation of this code. It is untested but
does compile.
2016-12-09 14:32:02 -05:00
Michael Munday
53b627b21c
s/SP/sp/ in vm_s390x.dasc.
...
We support the pseudo-register sp now.
2016-12-06 12:47:23 -05:00
ketank-new
3288e547bf
Update vm_s390x.dasc
...
added definations to macros to test operand type refeered x86 definations
no JUMP instruction found for s390x used BRANCH RELATIVE on CONDITION instead (brc)
Not sure how the condition will be checked , need to discuss this
2016-11-24 14:58:52 +05:30
ketank-new
4ea7607e02
Update vm_s390x.dasc
...
added instructions to macros, referring macro defination of x86
for macro ins_ANDdid not find equivalent s390x replacement instruction for 'Not' hence have currently marked the place as '????'
'????' has to be replaced with s390x complement instruction
2016-11-24 14:02:50 +05:30
ketank-new
372f721e60
Update vm_s390x.dasc
...
used MOVE LONG EXTENDED in place of mov and
MOVE LONG instead of movzx
2016-11-24 11:25:07 +05:30
Michael Munday
5887962b0e
Add assembly for decoding instructions.
...
Still guessing at this point. This code will need to be changed.
2016-11-23 18:02:00 -05:00
Michael Munday
dbf789536c
Fix stack frame layout.
...
f8-f15 are callee-saved (not f0,f2,f4 and f6). There isn't space
for them in the caller's stack frame so we need to increase the
size of the interpreter's stack frame.
2016-11-23 17:30:10 -05:00
Michael Munday
5a69b4638a
Fixup the save/restore register macros.
...
I believe these macros obey the C calling convention, so we need to
allocate our stack frame and save all callee-save registers. We
can tune it later if it turns out we don't need all the registers.
2016-11-22 13:58:10 -05:00
Michael Munday
d505a0e0ba
Cleanup.
2016-11-22 13:47:35 -05:00
Michael Munday
d50f8aa92b
Add preliminary frame offsets.
...
These are educated guesses at this point. We might need more stack space because
we don't have many free registers available.
2016-11-22 13:36:46 -05:00
ketank-new
31c0e6016a
Update vm_s390x.dasc
...
Added definitions to macros savereg and restreg
used Store and Load instructions
to store and load register contents to n from memory
2016-11-22 10:20:56 +05:30
Michael Munday
e90d985d08
Look for s390x file rather than S390x file.
2016-11-18 13:06:31 -05:00
ketank-new
3ac644ecee
Update vm_s390x.dasc
...
Assigned general purpose register to existing macros
2016-11-18 17:09:20 +05:30
ketank-new
4aa1099d6a
Update vm_s390x.dasc
...
Referred arm dasc file have created slots wherein i have to replace them with s390x registers and instructions
2016-11-17 14:58:17 +05:30
ketank-new
c36895a872
Update lj_frame.h
...
Added CFrame definations for S390X
values un assigned as i am unsure of the values
2016-11-16 17:19:10 +05:30
ketank-new
547b158ba4
Update vm_s390x.dasc
...
made some changes like mentioning arch from x86 to S390x
removed some x86 specific code
2016-11-16 15:34:32 +05:30
ketank-new
777b0671d3
Update lj_target_s390x.h
...
Added s390x specific condition codes
2016-11-16 15:09:59 +05:30
ketank-new
498f028e69
Update lj_target_s390x.h
...
changed instruction opcode to 64bit
2016-11-16 11:50:46 +05:30
ketank-new
31fb648a50
Update lj_arch.h
...
Removing the gcc check for now .. missed micheal's comment earlier
2016-11-16 10:32:53 +05:30
ketank-new
3e472eb261
Update lj_arch.h
...
Added missing elif condition for s390x for GCC dependency
2016-11-16 10:31:34 +05:30
Michael Munday
820fa8a049
Delete gcc version check for now.
...
Stick to the default until we know what we actually need.
2016-11-15 14:53:00 -05:00
Michael Munday
71d40ba670
Add some s390x C calling convention constants.
...
Guesses for now based on the ELF ABI supplement for zSeries.
2016-11-15 14:44:36 -05:00
Michael Munday
2315613b38
Fix some s390x declarations.
...
s/S390x/S390X/
2016-11-15 14:44:13 -05:00
ketank-new
96afe3e331
Create vm_s390x.dasc
...
created vm_s390x.dasc file
its a copy of vm_x86.dasc
working on to change this specific to s390x
2016-11-15 10:42:11 +05:30
ketank-new
9c3c87bc61
Update lj_target_s390x.h
...
removed un replaced arm instructions
changed S390 to S390x
2016-11-11 12:13:30 +05:30
ketank-new
6dfbec84b9
Rename lj_target_s390.h to lj_target_s390x.h
...
changed file name
2016-11-11 12:09:32 +05:30
ketank-new
d093cff04a
Update Makefile
...
changed S390 to S390x
2016-11-11 12:08:47 +05:30
ketank-new
633376f0ca
Update lj_arch.h
...
changed S390 to S390x
2016-11-11 12:04:51 +05:30
ketank-new
be89c18b98
Update lj_arch.h
...
Added supporting lines for s390
Lines added using arm lines as reference
2016-11-10 10:42:51 +05:30
ketank-new
096a33d925
Update Makefile
...
Added condition for s390 in Makefile
2016-11-10 10:35:35 +05:30
ketank-new
8d336e1299
Create lj_target_s390.h
...
Adding file lj_target_s390.h
Few arm based instructions are changed with equivalent s390x instructions
2016-11-10 10:33:16 +05:30
Mike Pall
716f2daef8
LJ_GC64: Various followup fixes.
...
Contributed by Peter Cawley.
2016-10-20 20:55:12 +02:00
Mike Pall
bdcaf4bfd9
LJ_GC64: Fix HREF for pointers.
...
Contributed by Peter Cawley.
2016-10-19 09:48:38 +02:00
Mike Pall
6a25014c1c
LJ_FR2: Fix slot 1 handling.
...
Contributed by Peter Cawley.
2016-10-16 21:04:38 +02:00
Mike Pall
3f43f09413
Merge branch 'master' into v2.1
2016-10-13 18:38:22 +02:00
Mike Pall
a68c411857
Fix GC step size calculation.
...
Thanks to Igor Ehrlich.
2016-10-13 18:37:58 +02:00
Mike Pall
54b78e7c66
LJ_GC64: Various fixes.
...
Contributed by Peter Cawley.
2016-10-12 17:36:45 +02:00
Mike Pall
63465fe71d
LJ_GC64: Fix jit.on/off.
2016-10-08 11:30:01 +02:00
Mike Pall
cf80edbbba
Fix -jp=a mode for builtins.
2016-10-02 14:33:31 +02:00
Mike Pall
f27b2509e0
Merge branch 'master' into v2.1
2016-10-02 14:25:04 +02:00
Mike Pall
fcc8244899
ARM: Fix BLX encoding for Thumb interworking calls.
...
Thanks to Charles Baylis.
2016-10-02 14:24:04 +02:00
Mike Pall
4ca3909547
Merge branch 'master' into v2.1
2016-09-19 21:23:35 +02:00
Mike Pall
8ada57eb49
Looks like COLORTERM has gone out of fashion.
2016-09-19 21:22:19 +02:00
Mike Pall
1a9a264356
Merge branch 'master' into v2.1
2016-09-19 21:19:07 +02:00
Mike Pall
9910dedae4
Initialize uv->immutable for upvalues of loaded chunks.
...
Thanks to Peter Cawley.
2016-09-19 21:17:58 +02:00
Mike Pall
03b03ef683
Windows/x86: Add MSVC flags for debug build with exception interop.
2016-09-06 19:37:30 +02:00
Mike Pall
f6f838f840
Merge branch 'master' into v2.1
2016-07-31 13:42:49 +02:00
Mike Pall
02b9b55976
Revert "OSX: Switch to Clang as the default compiler."
...
It breaks cross-compilation to Android.
And host "gcc" aliases to "clang", anyway.
2016-07-31 13:39:55 +02:00
Mike Pall
972a1a4cc6
Fix exit status for 'luajit -b'.
2016-07-22 16:42:09 +02:00
Mike Pall
c98660c8c3
Must preserve J->fold.ins (fins) around call to lj_ir_ksimd().
2016-07-22 16:35:46 +02:00
Mike Pall
22e8e07969
Merge branch 'master' into v2.1
2016-07-17 16:25:37 +02:00
Mike Pall
d41469c124
Emit bytecode in .c/.h files with unsigned char type.
2016-07-17 16:24:30 +02:00
Mike Pall
92d9ff211a
Set arg table before evaluating LUA_INIT and -e chunks.
2016-07-17 16:23:49 +02:00
Mike Pall
6be5ffdf2b
Adjust comment with defines.
2016-07-17 16:05:25 +02:00
Mike Pall
7374046299
Merge branch 'master' into v2.1
2016-07-17 16:01:25 +02:00
Mike Pall
b74ddaf174
Fix for cdata vs. non-cdata arithmetics/comparisons.
...
Thanks to Vyacheslav Egorov.
2016-07-17 16:01:10 +02:00
Mike Pall
37b377dedf
Merge branch 'master' into v2.1
2016-07-17 14:38:26 +02:00
Mike Pall
1914de71c7
Fix unused vars etc. in internal Lua files.
...
Thanks to François Perrad.
2016-07-17 14:29:03 +02:00
Mike Pall
01e4754962
Properly clean up state before restart of trace assembly.
2016-06-27 15:46:09 +02:00
Mike Pall
ce30766b67
Merge branch 'master' into v2.1
2016-06-27 14:10:39 +02:00
Mike Pall
aef4edddba
Drop leftover regs in 'for' iterator assignment, too.
2016-06-27 14:09:36 +02:00
Mike Pall
287a5347cf
MIPS: Support MIPS16 interlinking.
2016-06-08 10:24:00 +02:00
Mike Pall
f5983437a6
x64/LJ_GC64: Fix code generation for IR_KNULL call argument.
2016-06-05 13:07:43 +02:00
Mike Pall
a88dc57995
Merge branch 'master' into v2.1
2016-06-05 12:54:53 +02:00
Mike Pall
a7bec69a75
Fix PHI remarking in SINK pass.
...
Thanks to Vyacheslav Egorov.
2016-06-05 12:53:37 +02:00
Mike Pall
ce1ad870c3
LJ_GC64: Set correct nil value when clearing a cdata finalizer.
...
Thanks to Stefan Pejic.
2016-06-03 06:54:06 +02:00
Mike Pall
cc05e79181
LJ_GC64: Ensure all IR slot fields are initialized.
2016-06-03 06:53:37 +02:00
Mike Pall
58ca165737
LJ_GC64: Allow optional use of the system memory allocator.
2016-06-03 06:52:53 +02:00
Mike Pall
7d43402304
Merge branch 'master' into v2.1
2016-06-03 06:40:48 +02:00
Mike Pall
3206307563
Fix Valgrind suppressions.
2016-06-03 06:39:52 +02:00
Mike Pall
1c0454c6ce
Merge branch 'master' into v2.1
2016-06-03 04:28:17 +02:00
Mike Pall
a5f8a4819f
Don't try to record outermost pcall() return to lower frame.
2016-06-03 04:26:08 +02:00
Mike Pall
384ce2f9ef
MIPS: Fix build failures and warnings.
2016-05-29 18:12:58 +02:00
Mike Pall
56fe899a06
Proper fix for LJ_GC64 changes to asm_href().
2016-05-28 13:36:14 +02:00
Mike Pall
d9986fbadb
MIPS64, part 1: Add MIPS64 support to interpreter.
...
Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
Sponsored by Cisco Systems, Inc.
2016-05-28 05:10:55 +02:00
Mike Pall
5e2b609b3f
Fix compiler warning.
2016-05-28 05:02:18 +02:00