Browse Source

cleanup stage 1 for standalone sledge build

mntmn 8 years ago
parent
commit
906ac43063
100 changed files with 3 additions and 16010 deletions
  1. 3 6
      .gitignore
  2. 0 1034
      bjos/sledge/arm_emu.c
  3. 0 5
      bjos/sledge/arm_test.sh
  4. 0 7
      bjos/sledge/build-deps.sh
  5. 0 3
      bjos/sledge/build.sh
  6. 0 3
      bjos/sledge/build_rpi.sh
  7. 0 15
      bjos/sledge/fs/buffer
  8. 0 2
      bjos/sledge/fs/keymap
  9. 0 2
      bjos/sledge/fs/keymap-bm
  10. 0 0
      bjos/sledge/fs/unifont
  11. 0 67
      bjos/sledge/libBareMetal.h
  12. 0 1
      bjos/sledge/lightning/.deps/size.Po
  13. 0 1
      bjos/sledge/lightning/.gitattributes
  14. 0 33
      bjos/sledge/lightning/.gitignore
  15. 0 14
      bjos/sledge/lightning/AUTHORS
  16. 0 676
      bjos/sledge/lightning/COPYING
  17. 0 355
      bjos/sledge/lightning/COPYING.DOC
  18. 0 165
      bjos/sledge/lightning/COPYING.LESSER
  19. 0 3570
      bjos/sledge/lightning/ChangeLog
  20. 0 45
      bjos/sledge/lightning/Makefile.am
  21. 0 199
      bjos/sledge/lightning/NEWS
  22. 0 3
      bjos/sledge/lightning/README
  23. 0 18
      bjos/sledge/lightning/THANKS
  24. 0 28
      bjos/sledge/lightning/TODO
  25. 0 1040
      bjos/sledge/lightning/build/include/lightning.h
  26. 0 200
      bjos/sledge/lightning/build/include/lightning/jit_x86.h
  27. 0 18
      bjos/sledge/lightning/build/share/info/dir
  28. 0 1570
      bjos/sledge/lightning/build/share/info/lightning.info
  29. 0 22
      bjos/sledge/lightning/check/3to2.ok
  30. 0 118
      bjos/sledge/lightning/check/3to2.tst
  31. 0 307
      bjos/sledge/lightning/check/Makefile.am
  32. 0 1
      bjos/sledge/lightning/check/add.ok
  33. 0 35
      bjos/sledge/lightning/check/add.tst
  34. 0 1
      bjos/sledge/lightning/check/align.ok
  35. 0 28
      bjos/sledge/lightning/check/align.tst
  36. 0 413
      bjos/sledge/lightning/check/all.tst
  37. 0 2
      bjos/sledge/lightning/check/allocai.ok
  38. 0 100
      bjos/sledge/lightning/check/allocai.tst
  39. 0 360
      bjos/sledge/lightning/check/alu.inc
  40. 0 1
      bjos/sledge/lightning/check/alu_add.ok
  41. 0 47
      bjos/sledge/lightning/check/alu_add.tst
  42. 0 1
      bjos/sledge/lightning/check/alu_and.ok
  43. 0 36
      bjos/sledge/lightning/check/alu_and.tst
  44. 0 1
      bjos/sledge/lightning/check/alu_com.ok
  45. 0 33
      bjos/sledge/lightning/check/alu_com.tst
  46. 0 1
      bjos/sledge/lightning/check/alu_div.ok
  47. 0 83
      bjos/sledge/lightning/check/alu_div.tst
  48. 0 1
      bjos/sledge/lightning/check/alu_lsh.ok
  49. 0 57
      bjos/sledge/lightning/check/alu_lsh.tst
  50. 0 1
      bjos/sledge/lightning/check/alu_mul.ok
  51. 0 59
      bjos/sledge/lightning/check/alu_mul.tst
  52. 0 1
      bjos/sledge/lightning/check/alu_neg.ok
  53. 0 42
      bjos/sledge/lightning/check/alu_neg.tst
  54. 0 1
      bjos/sledge/lightning/check/alu_or.ok
  55. 0 36
      bjos/sledge/lightning/check/alu_or.tst
  56. 0 1
      bjos/sledge/lightning/check/alu_rem.ok
  57. 0 76
      bjos/sledge/lightning/check/alu_rem.tst
  58. 0 1
      bjos/sledge/lightning/check/alu_rsb.ok
  59. 0 49
      bjos/sledge/lightning/check/alu_rsb.tst
  60. 0 1
      bjos/sledge/lightning/check/alu_rsh.ok
  61. 0 85
      bjos/sledge/lightning/check/alu_rsh.tst
  62. 0 1
      bjos/sledge/lightning/check/alu_sub.ok
  63. 0 49
      bjos/sledge/lightning/check/alu_sub.tst
  64. 0 1
      bjos/sledge/lightning/check/alu_xor.ok
  65. 0 36
      bjos/sledge/lightning/check/alu_xor.tst
  66. 0 1
      bjos/sledge/lightning/check/alux_add.ok
  67. 0 49
      bjos/sledge/lightning/check/alux_add.tst
  68. 0 1
      bjos/sledge/lightning/check/alux_sub.ok
  69. 0 49
      bjos/sledge/lightning/check/alux_sub.tst
  70. 0 1
      bjos/sledge/lightning/check/bp.ok
  71. 0 46
      bjos/sledge/lightning/check/bp.tst
  72. 0 1
      bjos/sledge/lightning/check/branch.ok
  73. 0 563
      bjos/sledge/lightning/check/branch.tst
  74. 0 4
      bjos/sledge/lightning/check/call.ok
  75. 0 272
      bjos/sledge/lightning/check/call.tst
  76. 0 538
      bjos/sledge/lightning/check/carg.c
  77. 0 1
      bjos/sledge/lightning/check/carry.ok
  78. 0 186
      bjos/sledge/lightning/check/carry.tst
  79. 0 903
      bjos/sledge/lightning/check/ccall.c
  80. 0 15
      bjos/sledge/lightning/check/check.arm.sh
  81. 0 15
      bjos/sledge/lightning/check/check.arm.swf.sh
  82. 0 15
      bjos/sledge/lightning/check/check.arm4.swf.sh
  83. 0 15
      bjos/sledge/lightning/check/check.nodata.sh
  84. 0 15
      bjos/sledge/lightning/check/check.sh
  85. 0 15
      bjos/sledge/lightning/check/check.swf.sh
  86. 0 15
      bjos/sledge/lightning/check/check.x87.nodata.sh
  87. 0 15
      bjos/sledge/lightning/check/check.x87.sh
  88. 0 1
      bjos/sledge/lightning/check/clobber.ok
  89. 0 1050
      bjos/sledge/lightning/check/clobber.tst
  90. 0 123
      bjos/sledge/lightning/check/ctramp.c
  91. 0 1
      bjos/sledge/lightning/check/cvt.ok
  92. 0 380
      bjos/sledge/lightning/check/cvt.tst
  93. 0 6
      bjos/sledge/lightning/check/divi.ok
  94. 0 85
      bjos/sledge/lightning/check/divi.tst
  95. 0 1
      bjos/sledge/lightning/check/fib.ok
  96. 0 60
      bjos/sledge/lightning/check/fib.tst
  97. 0 1
      bjos/sledge/lightning/check/float.ok
  98. 0 367
      bjos/sledge/lightning/check/float.tst
  99. 0 1
      bjos/sledge/lightning/check/fop_abs.ok
  100. 0 31
      bjos/sledge/lightning/check/fop_abs.tst

+ 3 - 6
.gitignore

@@ -1,9 +1,6 @@
 .DS_Store
 obj/*.o
-bin/bmfs.image
-fs-notes.txt
 a.out
-sledge/udis86/
-bjos/rpi2/uspi/
-bjos/rootfs/grumpy.data
-bjos/sledge/sledge
+os/rootfs/grumpy.data
+sledge/sledge
+build/*.elf

+ 0 - 1034
bjos/sledge/arm_emu.c

@@ -1,1034 +0,0 @@
-/*
- * Arm Processor Emulator
- *
- *  Created on: Nov 12, 2012
- *      Author: mdixon
- *   Edited By: omufeed
- */
-
-// #include some headers you will be probably need
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-//Defines some types of our own. note: base these on platform independent types defined in <stdint.h>
-typedef uint64_t REGISTER;		//registers are 32 bits
-typedef uint64_t WORD;			//words are 32 bits
-typedef int32_t SWORD;			//swords are 32 bits
-typedef uint8_t BYTE;			//bytes are 8 bits
-typedef uint8_t BIT;			//define bit data type
-
-//Define the shift amount for specific bits
-#define POS_CONDCODE (28)//Condition code
-#define POS_INSTYPE (26)//Instruction type
-#define POS_OPCODE (21)//Operation code
-#define POS_I (25)//Immediate bit
-#define POS_L (24)//Link bit
-#define POS_S (20)//Status bit
-#define POS_REGN (16)//regN
-#define POS_REGDEST (12)//regDest
-#define POS_ISHIFT (8)//Shift amount for immediate value
-#define POS_SHIFT (4)//Shift amount for operand register
-#define POS_IOPERAND (0)//Immediate value
-#define POS_OPERAND (0)//Operand register
-#define POS_N (31)//Negative bit
-
-#define POS_BOFFSET (0)//Offset for branch
-
-#define POS_P (24)//Pre/Post bit
-#define POS_U (23)//Up/Down bit
-#define POS_B (22)//Byte/Word bit
-#define POS_W (21)//Writeback into base register bit
-#define POS_LS (20)//Load/Store bit
-
-#define POS_SWICODE (0)//Software interrupt code
-
-//Define mask amount size
-#define MASK_1BIT (0x1)
-#define MASK_2BIT (0x3)
-#define MASK_3BIT (0x7)
-#define MASK_4BIT (0xf)
-#define MASK_5BIT (0x1f)
-#define MASK_6BIT (0x3f)
-#define MASK_7BIT (0x7f)
-#define MASK_8BIT (0xff)
-#define MASK_24BIT (0xffffff)
-
-//Define each condition code.
-#define CC_EQ	(0x0)
-#define CC_NE	(0x1)
-#define CC_CS	(0x2)
-#define CC_CC	(0x3)
-#define CC_MI	(0x4)
-#define CC_PL	(0x5)
-#define CC_VS	(0x6)
-#define CC_VC	(0x7)
-#define CC_HI	(0x8)
-#define CC_LS	(0x9)
-#define CC_GE	(0xa)
-#define CC_LT	(0xb)
-#define CC_GT	(0xc)
-#define CC_LE	(0xd)
-#define CC_AL	(0xe)
-#define CC_NV	(0xf)
-
-// Define each instruction type code.
-#define IT_DP	(0x0)
-#define IT_DT	(0x1)
-#define IT_BR	(0x2)
-#define IT_SI	(0x3)
-
-// Define each status flag
-#define STAT_N	(1<<7)//Negative
-#define STAT_Z	(1<<6)//Zero
-#define STAT_C	(1<<5)//Carry
-#define STAT_V	(1<<4)//Overflow
-#define STAT_I	(1<<3)//Interrupt disabled
-#define STAT_F	(1<<2)//Fast interrupt disabled
-#define STAT_P	(3)//Processor operation mode, the last two bits. 00: User mode
-
-// Define each op code.
-#define OP_AND	(0x0)
-#define OP_EOR	(0x1)
-#define OP_SUB	(0x2)
-#define OP_RSB	(0x3)
-#define OP_ADD	(0x4)
-#define OP_ADC	(0x5)
-#define OP_SBC	(0x6)
-#define OP_RSC	(0x7)
-#define OP_TST	(0x8)
-#define OP_TEQ	(0x9)
-#define OP_CMP	(0xa)
-#define OP_CMN	(0xb)
-#define OP_ORR	(0xc)
-#define OP_MOV	(0xd)
-#define OP_BIC	(0xe)
-#define OP_MVN	(0xf)
-
-//custom SWI
-#define SYS_ADD10		(0x01)//Add 10 to R0
-
-#define SYS_POS_ADD10	(0x01)//Add 10 to R0
-
-//Define instruction handling result type, include further error types
-#define INST_VALID (1<<1)
-#define INST_CONDITIONNOTMET (1<<2)
-#define INST_INVALID (1<<3)
-#define INST_MULTIPLYBYZERO (1<<4)
-#define INST_RESTRICTEDMEMORYBLOCK (1<<5)
-
-int maxMemorySize = 4096;//Temporarily set the memory size to 140 to better monitor the data in memory during the output, increase this value as required.
-int userMemoryIndex = 120;//from 120 to maxMemorySize can be used by user to load/store data
-int stkMemoryIndex = 100;//next 20 are reserved for stack
-int instMemoryIndex = 52;//next 48 are reserved for user instructions. No access for user load/store data
-int swiMemoryIndex = 12;//next 40 are reserved for interrupt instructions. No access for user load/store data
-int swibMemoryIndex = 0;//First 12 rows are the interrupts branch instruction. No access for user load/store data
-
-//storing registers within array makes execution code simpler
-REGISTER registers[16];
-//4 kilobytes of RAM in this example (since 1 word = 4 bytes)
-WORD* memory = (WORD)0;
-//the variable to fetch the instruction into
-WORD inst;
-
-BYTE regStatus = 0;//status register
-
-int totalCycleCount = 0, instCycleCount = 0;
-
-BYTE instResult = INST_VALID;//Instruction result handler
-
-//Variables for data processing instructions
-BIT iBit = 0, sBit = 0, lBit = 0, pBit = 0, uBit = 0, bBit = 0, wBit = 0, lsBit = 0;
-BYTE opCode, regN, regDest, shiftAmount;
-WORD operand, offset, swiCode;
-
-//Turn on/off the debug mode; prints assisting data about the operation steps
-int debugEnabled = 1;
-
-//Turn on/off the instruction log; prints the type and input of the instruction
-int instructionLogEnabled = 1;
-
-//Listens to the keyboard input and is turned on if space is clicked. If it is on, an interrupt is fired
-int feedback = 0;
-
-//Get the negative value, use two's complement for negation
-WORD getNegative(WORD value){
-	return ~value + 1;
-}
-
-//Check if a specific value is negative, use two's complement for negation
-int isNegative(WORD value){
-	return (((value >> POS_N) & MASK_1BIT));
-}
-
-//Check if a specific value is positive
-int isPositive(WORD value){
-	return !(((value >> POS_N) & MASK_1BIT));
-}
-
-//Check if a specific 24 bit value is negative, use two's complement for negation. 24bit negative value is used for offset
-int isNegative24bit(WORD value){
-	return (((value >> (23)) & MASK_1BIT));
-}
-
-//Get the negative value, use two's complement for negation
-WORD getNegative24bit(WORD value){
-	return (~value & MASK_24BIT) + 1;
-}
-
-//The carry flag is set if the addition of two numbers causes a carry out of the most significant (leftmost) bits added.
-int isCarryAdd(WORD op1Value, WORD op2Value, WORD result)
-{
-	return ((isNegative(op1Value) && isNegative(op2Value)) || (isNegative(op1Value) && isPositive(result)) || (isNegative(op2Value) && isPositive(result)));
-}
-
-//The carry (borrow) flag is also set if the subtraction of two numbers requires a borrow into the most significant (leftmost) bits subtracted.
-int isCarrySub(WORD op1Value, WORD op2Value, WORD result){
-	return ((isNegative(op1Value) && isPositive(op2Value)) || (isNegative(op1Value) && isPositive(result)) || (isPositive(op2Value) && isPositive(result)));
-}
-
-//If the sum of two numbers with the sign bits off yields a result number with the sign bit on, the "overflow" flag is turned on.
-int isOverflowAdd(WORD op1Value, WORD op2Value, WORD result)
-{
-	return ((isNegative(op1Value) && isNegative(op2Value) && isPositive(result)) || (isPositive(op1Value) && isPositive(op2Value) && isNegative(result)));
-}
-
-//If the sum of two numbers with the sign bits on yields a result number with the sign bit off, the "overflow" flag is turned on.
-int isOverflowSub(WORD op1Value, WORD op2Value, WORD result){
-	return ((isNegative(op1Value) && isPositive(op2Value) && isPositive(result)) || (isPositive(op1Value) && isNegative(op2Value) && isNegative(result)));
-}
-
-//Provide some support functions to test condition of a specified SR flag
-int isSet(int flag)
-{
-	return (regStatus & flag) == flag;
-}
-
-int isClear(int flag)
-{
-	return ((~regStatus) & flag) == flag;
-}
-
-void setFlag(int flag)
-{
-	regStatus = regStatus | flag;
-}
-
-void clearFlag(int flag)
-{
-	regStatus = regStatus & (~flag);
-}
-
-//set the SR flags by examining the result. The previous value of flags get initiated as well.
-void setStatusReg(int isZ, int isN, int isC, int isV, int isI, int isF, int isP){
-	//Set or clear the Zero, Negative, Carry, Overflow, Interrupt disabled and Fast interrupt disabled flags
-	isN ? setFlag(STAT_N) : clearFlag(STAT_N);
-	isZ ? setFlag(STAT_Z) : clearFlag(STAT_Z);
-	isC ? setFlag(STAT_C) : clearFlag(STAT_C);
-	isV ? setFlag(STAT_V) : clearFlag(STAT_V);
-	isI ? setFlag(STAT_I) : clearFlag(STAT_I);
-	isF ? setFlag(STAT_F) : clearFlag(STAT_F);
-
-	//Check the processor operation mode and set the flags
-}
-
-// Write a function for each supported operation
-void doAnd(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: AND %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value & op2Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), 0, 0, 0, 0, 0);
-}
-
-void doOrr(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: ORR %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value | op2Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), 0, 0, 0, 0, 0);
-}
-
-void doEor(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: EOR %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value ^ op2Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), 0, 0, 0, 0, 0);
-}
-
-/*doAdd
- * Adds op1Value to op2Value and stores in the specified register
- *
- * enter: 	regNumber - the number of the destination register (0-15)
- * 			op1Value  - the first value to be added
- * 			op2Value  -  the second value to be added
- * 			setSR     - flag, if non-zero then the status register should be updated, else it shouldn't
- */
-void doAdd(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: ADD %d %d\n", op1Value, op2Value);
-	WORD result = op1Value + op2Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), isCarryAdd(op1Value, op2Value, result), isOverflowAdd(op1Value, op2Value, result), 0, 0, 0);
-}
-
-void doAdc(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: ADD %d %d\n", op1Value, op2Value);
-	WORD result = op1Value + op2Value + isSet(STAT_C);
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), isCarryAdd(op1Value, op2Value, result), isOverflowAdd(op1Value, op2Value, result), 0, 0, 0);
-}
-
-void doSub(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: SUB %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value - op2Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), isCarrySub(op1Value, op2Value, result), isOverflowSub(op1Value, op2Value, result), 0, 0, 0);
-}
-
-void doSbc(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: SUB %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value - op2Value - isClear(STAT_C);
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), isCarrySub(op1Value, op2Value, result), isOverflowSub(op1Value, op2Value, result), 0, 0, 0);
-}
-
-void doRsb(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: RSB %d %d\n", op1Value, op2Value);
-
-	WORD result = op2Value - op1Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), isCarrySub(op2Value, op1Value, result), isOverflowSub(op2Value, op1Value, result), 0, 0, 0);
-}
-
-void doRsc(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: RSB %d %d\n", op1Value, op2Value);
-
-	WORD result = op2Value - op1Value - isClear(STAT_C);
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), isCarrySub(op2Value, op1Value, result), isOverflowSub(op2Value, op1Value, result), 0, 0, 0);
-}
-
-void doMov(int regNumber, WORD opValue, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: MOV R%d %d\n", regNumber, opValue);
-
-	registers[regNumber] = opValue;
-
-	if (setSR) setStatusReg(opValue == 0, isNegative(opValue), 0, 0, 0, 0, 0);
-}
-
-void doMvn(int regNumber, WORD opValue, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: MVN R%d %d\n", regNumber, opValue);
-
-	registers[regNumber] = ~opValue;
-
-	if (setSR) setStatusReg(~opValue == 0, isNegative(~opValue), 0, 0, 0, 0, 0);
-}
-
-//The processor always assumes the status flag is set, either it is actually set or not
-void doCmp(WORD op1Value, WORD op2Value)
-{
-	if (instructionLogEnabled) printf("Operation: CMP %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value - op2Value;
-	setStatusReg(result == 0, isNegative(result), isCarrySub(op1Value, op2Value, result), isOverflowSub(op1Value, op2Value, result), 0, 0, 0);
-}
-
-//The processor always assumes the status flag is set, either it is actually set or not
-void doCmn(WORD op1Value, WORD op2Value)
-{
-	if (instructionLogEnabled) printf("Operation: CMN %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value + op2Value;
-
-	setStatusReg(result == 0, isNegative(result), isCarryAdd(op1Value, op2Value, result), isOverflowAdd(op1Value, op2Value, result), 0, 0, 0);
-}
-
-//The processor always assumes the status flag is set, either it is actually set or not
-void doTst(WORD op1Value, WORD op2Value)
-{
-	if (instructionLogEnabled) printf("Operation: TST %d %d\n", op1Value, op2Value);
-
-	setStatusReg((op1Value & op2Value) == 0, isNegative(op1Value & op2Value), 0, 0, 0, 0, 0);
-}
-
-//The processor always assumes the status flag is set, either it is actually set or not
-void doTeq(WORD op1Value, WORD op2Value)
-{
-	if (instructionLogEnabled) printf("Operation: TEQ %d %d\n", op1Value, op2Value);
-
-	setStatusReg((op1Value ^ op2Value) == 0, isNegative(op1Value ^ op2Value), 0, 0, 0, 0, 0);
-}
-
-void doBic(int regNumber, WORD op1Value, WORD op2Value, int setSR)
-{
-	if (instructionLogEnabled) printf("Operation: BIC %d %d\n", op1Value, op2Value);
-
-	WORD result = op1Value & ~op2Value;
-
-	registers[regNumber] = result;
-
-	if (setSR) setStatusReg(result == 0, isNegative(result), 0, 0, 0, 0, 0);
-}
-
-//Store a value of register regNumber into stack and increase the stack pointer
-void stkPush(int regNumber){
-	memory[registers[13]++] = registers[regNumber];
-}
-
-//Load a latest from stack into the register regNumber and decrease the stack pointer
-void stkPop(int regNumber){
-	registers[regNumber] = memory[registers[13]--];
-}
-
-//Decide whether the instruction should be executed by examining the appropriate status register flags, depending on condition code.
-int getConditionCode(WORD inst){
-	int exec = 0;
-	int conditionCode;
-	// Start by extracting the condition code
-	conditionCode = inst >> POS_CONDCODE;	// get the condition flags (top 4 bits of the instruction).
-
-	switch ( conditionCode ) {
-		case CC_EQ:
-			// check if zero flag is set
-			exec = isSet(STAT_Z);
-			break;
-		case CC_NE:
-			// check if zero flag is clear
-			exec = isClear(STAT_Z);
-			break;
-		case CC_CS:
-			exec = isSet(STAT_C);
-			break;
-		case CC_CC:
-			exec = isClear(STAT_C);
-			break;
-		case CC_MI:
-			exec = isSet(STAT_N);
-			break;
-		case CC_PL:
-			exec = isClear(STAT_N);
-			break;
-		case CC_VS:
-			exec = isSet(STAT_V);
-			break;
-		case CC_VC:
-			exec = isClear(STAT_V);
-			break;
-		case CC_HI:
-			//If C is set and Z is clear, means > for unsigned
-			exec = isSet(STAT_C) && isClear(STAT_Z);
-			break;
-		case CC_LS:
-			//<= unsigned
-			exec = isClear(STAT_C) && isSet(STAT_Z);
-			break;
-		case CC_GE:
-			//>= signed
-			exec = (isClear(STAT_N) && isClear(STAT_V)) || (isSet(STAT_N) && isSet(STAT_V));
-			break;
-		case CC_LT:
-			// < signed
-			exec = ( isSet( STAT_N ) && isClear( STAT_V ) ) || ( isClear(STAT_N) && isSet(STAT_V) ) ;
-			break;
-		case CC_GT:
-			// > signed
-			exec = isClear(STAT_Z) && ((isClear(STAT_N) && isClear(STAT_V)) || (isSet(STAT_N) && isSet(STAT_V)));
-			break;
-		case CC_LE:
-			// <= signed
-			exec = isSet(STAT_Z) || ( isSet( STAT_N ) && isClear( STAT_V ) ) || ( isClear(STAT_N) && isSet(STAT_V) ) ;
-			break;
-		case CC_AL:
-			exec = 1;
-			break;
-		case CC_NV:
-			exec = 0;
-			break;
-	}
-	return exec;
-}
-
-//Do the data processing type operations
-void doDataProcessing(WORD inst){
-	iBit = (inst >> POS_I) & MASK_1BIT;//Get Immediate bit
-	opCode = (inst >> POS_OPCODE) & MASK_4BIT;//Get Opcode, 4 bits
-	sBit = (inst >> POS_S) & MASK_1BIT;//Get Status bit
-	regN = (inst >> POS_REGN) & MASK_4BIT;//Get RegN, 4 bits
-	regDest = (inst >> POS_REGDEST) & MASK_4BIT;//Get RegDest, 4 bits
-
-	//Get the operand depending to the Immediate code
-	if(iBit){
-		shiftAmount = (inst >> POS_ISHIFT) & MASK_4BIT;//Immediate shift is 4 bits
-		operand = (inst >> POS_IOPERAND) & MASK_8BIT;//Immediate value is 8 bits
-	}
-	else{
-		shiftAmount = (inst >> POS_SHIFT) & MASK_8BIT;//Non-immediate shift is 8 bits
-		operand = registers[(inst >> POS_OPERAND) & MASK_4BIT];//Non-immediate register number is 4 bits
-	}
-
-	//Apply the shift amount to the operand
-	operand = operand << shiftAmount;
-
-	//Print the decoded instruction if debug is enabled
-	if (debugEnabled){
-		printf("Immediate bit: %01X\n", iBit);
-		printf("Op code: %01X\n", opCode);
-		printf("Status bit: %01X\n", sBit);
-		printf("RegN code: %01X\n", regN);
-		printf("RegDest code: %01X\n", regDest);
-		printf("operand : %d\n", operand);
-	}
-
-	switch(opCode)
-	{
-		case OP_AND:
-			doAnd(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_EOR:
-			doEor(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_SUB:
-			doSub(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_RSB:
-			doRsb(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_ADD:
-			doAdd(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_ADC:
-			doAdc(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_SBC:
-			doSbc(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_RSC:
-			doRsc(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_TST:
-			doTst(registers[regN], operand);
-			break;
-		case OP_TEQ:
-			doTeq(registers[regN], operand);
-			break;
-		case OP_CMP:
-			doCmp(registers[regN], operand);
-			break;
-		case OP_CMN:
-			doCmn(registers[regN], operand);
-			break;
-		case OP_ORR:
-			doOrr(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_MOV:
-			doMov(regDest, operand, sBit);
-			break;
-		case OP_BIC:
-			doBic(regDest, registers[regN], operand, sBit);
-			break;
-		case OP_MVN:
-			doMvn(regDest, operand, sBit);
-			break;
-		default:
-			instResult = INST_INVALID;
-			break;
-	}
-
-	//Update the cycle count. If regDest is PC the +2, otherwise 1 cycle.
-	instCycleCount = (regDest == 15) ? 3 : 1;
-}
-
-//Do the branch type operations
-void doBranch(WORD inst){
-	lBit = (inst >> POS_L) & MASK_1BIT;//Get Link bit
-	offset = (inst >> POS_BOFFSET) & MASK_24BIT;//Get the offset, 24 bits
-
-	if (instructionLogEnabled) printf("Operation: B %d\n", offset);
-
-	if(lBit){
-		//Check if there is already a link value in R14. Push to the stack if there is before overwriting it
-		if (registers[14] > 0) stkPush(14);
-
-		//Store the PC in link(R14)
-		registers[14] = registers[15];
-	}
-
-	//Check if the 24bit offset value is negative? if yes then subtract the positive value of the offset, otherwise add the offset value
-	if(isNegative24bit(offset)){
-		registers[15] -= getNegative24bit(offset) / 4;
-	}else{
-		registers[15] += offset / 4;
-	}
-
-	registers[15] += 4;//Add 4 to the PC, because of the pipeline
-
-	//Update the cycle count
-	instCycleCount = 3;
-}
-
-//Do the data transfer operation
-void doDataTransfer(WORD inst){
-
-	iBit = (inst >> POS_I) & MASK_1BIT;//Get Immediate bit
-	pBit = (inst >> POS_P) & MASK_1BIT;//Get Pre/Post bit
-	uBit = (inst >> POS_U) & MASK_1BIT;//Get Up/Down bit
-	bBit = (inst >> POS_B) & MASK_1BIT;//Get Byte/Word bit
-	wBit = (inst >> POS_W) & MASK_1BIT;//Get Writeback to base register bit
-	lsBit = (inst >> POS_LS) & MASK_1BIT;//Get Load/Store bit
-	regN = (inst >> POS_REGN) & MASK_4BIT;//Get RegN, 4 bits
-	regDest = (inst >> POS_REGDEST) & MASK_4BIT;//Get RegDest, 4 bits
-
-	//Get the operand depending to the Immediate code
-	if(iBit){
-		shiftAmount = (inst >> POS_ISHIFT) & MASK_4BIT;//Immediate shift is 4 bits
-		offset = (inst >> POS_IOPERAND) & MASK_8BIT;//Immediate value is 8 bits
-
-		if (debugEnabled) printf("Shift amount code: %01X\n", shiftAmount);
-	}
-	else{
-		shiftAmount = (inst >> POS_SHIFT) & MASK_8BIT;//Non-immediate shift is 8 bits
-		offset = registers[(inst >> POS_OPERAND) & MASK_4BIT];//Non-immediate register number is 4 bits
-
-		if (debugEnabled) printf("Shift amount code: %02X\n", shiftAmount);
-	}
-
-	if (instructionLogEnabled){
-		printf("Operation: ");
-		printf(lsBit ? "LDR" : "STR");
-		printf(" R%d R%d, %d\n", regDest, regN, offset);
-	}
-
-	//Print the decoded instruction if debug is enabled
-	if (debugEnabled){
-		printf("Immediate bit: %01X\n", iBit);
-		printf("Pre/Post bit: %01X\n", pBit);
-		printf("Up/Down bit: %01X\n", uBit);
-		printf("Byte/Word bit: %01X\n", bBit);
-		printf("Writeback to base register bit: %01X\n", wBit);
-		printf("Load/Store bit: %01X\n", lsBit);
-		printf("RegN code: %01X\n", regN);
-		printf("RegDest code: %01X\n", regDest);
-		printf("offset : %d\n", offset);
-	}
-
-	//Set the initial memory index
-	int memoryIndex = registers[regN];
-
-	//If the pre bit is set, add/subtract offset to the base register before the transfer
-	if(pBit) memoryIndex = (uBit) ? memoryIndex + offset :  memoryIndex - offset;
-
-	//Check if the instruction is trying to access the restricted memory blocks
-	if ((memoryIndex >= userMemoryIndex) && (memoryIndex <= maxMemorySize)){
-		//If load/store bit is set load, if not store
-		if(lsBit) registers[regDest] = (wBit) ? memory[memoryIndex] : memory[memoryIndex] & MASK_4BIT;//If the word/byte bit is set, load the least significant byte from the noted memory address
-		else memory[memoryIndex] = (wBit) ? registers[regDest] : registers[regDest] & MASK_4BIT;//If the word/byte bit is set, store the least significant byte from regDest
-
-		//If the pre bit is not set, add/subtract offset to the base register after the transfer
-		if(!pBit) memoryIndex = (uBit) ? memoryIndex + offset :  memoryIndex - offset;
-
-		//Set the base register value with the new index if the writeback is set
-		if(wBit) registers[regN] = memoryIndex;
-
-		//Update the cycle count. If it is LDR 3 cycles and +2 if regDest is PC. If it is STR then 2 cycles.
-		instCycleCount = (lsBit) ? (regDest == 15) ? 5 : 3 : 2;
-	}
-	else{
-		instResult = INST_RESTRICTEDMEMORYBLOCK;
-	}
-}
-
-//Handle the software interrupt
-void doSoftwareInterrupt(WORD inst){
-
-	swiCode = (inst >> POS_SWICODE) & MASK_24BIT;//Interrupt code value is 24 bits
-
-	if (instructionLogEnabled) printf("Interrup: SWI %d\n", swiCode);
-
-	registers[14] = registers[15];//Backup the PC from return from interrupt
-
-	registers[15] = swiCode + 4;//Jump to the branch address in vector table +4 for pipeline
-
-	//Update the cycle count
-	instCycleCount = 5;
-}
-
-// The main work will happen inside this function. It should decode then execute the passed instruction.
-void decodeAndExecute(WORD inst){
-	int insTypeCode;
-	int exec;
-
-	if (debugEnabled) printf("Decoding: %04X\n",inst);	// output the instruction being decoded
-
-	exec = getConditionCode(inst);
-
-	// only decode and execute the instruction if required to do so, i.e. condition satisfied.
-	if ( exec ) {
-
-		// next stage is to decode which type of instruction we have, so want to look at bits 27, 26
-		insTypeCode = (inst >> POS_INSTYPE) & MASK_2BIT;
-
-		if (debugEnabled) printf("Ins type code: %01X\n", insTypeCode);
-
-		// once we know the instruction we can execute it!
-		switch(insTypeCode){
-			case IT_DP:
-				doDataProcessing(inst);
-				break;
-			case IT_DT:
-				doDataTransfer(inst);
-				break;
-			case IT_BR:
-				doBranch(inst);
-				break;
-			case IT_SI:
-				doSoftwareInterrupt(inst);
-				break;
-			default:
-				instResult = INST_INVALID;
-				break;
-		}
-	}
-	else{
-		instResult = INST_CONDITIONNOTMET;
-	}
-}
-
-//Add delay and get feedback either to interrupt, exit or continue to next instruction
-void getFeedback(){
-	printf("Please enter (i)Interrupt, (x)Exit, (g)Continue: ");
-	feedback = getchar();
-	//Another getchar() to absorb the enter pressed after the value entered
-	getchar();
-
-	//if entered char = i(105) then set interrupt
-	if ((feedback == 105)){
-		//If hardware interrupt has happened, then execute the sample interrupt
-		doSoftwareInterrupt(0xEF000001);
-	}else if(feedback == 120){//if feedback is x(120)
-		memory[(registers[15] - 4)] = 0;//Set next instruction as 0, so the program will eixt
-	}
-}
-
-// Print the result of the registers, memory and the other required optputs
-void printOutput(){
-	if (instResult == INST_VALID){
-		//Print register values
-		printf("Registers\n");
-		int i;
-		for(i = 0; i<16; i++){
-			printf("-R%d: %d ", i, registers[i]);
-		}
-		printf("\n");
-
-		//Print only the user accessible memory values
-		printf("Memory\n");
-		for(i = userMemoryIndex; i < maxMemorySize; i++){
-			printf("-M[%d]: %d ", i, memory[i]);
-		}
-		printf("\n");
-
-		//Print the stack
-		printf("Stack\n");
-		for(i = stkMemoryIndex; i < userMemoryIndex; i++){
-			printf("-S[%d]: %d ", i, memory[i]);
-		}
-		printf("\n");
-
-		if (debugEnabled) printf("-Status Register: %X ", regStatus);//Print status register
-		//Print status flags
-		printf("Flags\n");
-		printf("-Negative: %d ", isSet(STAT_N));
-		printf("-Zero: %d ", isSet(STAT_Z));
-		printf("-Carry: %d ", isSet(STAT_C));
-		printf("-Overflow: %d ", isSet(STAT_V));
-		printf("-Interrupt disabled: %d ", isSet(STAT_I));
-		printf("-Fast interrupt disabled: %d ", isSet(STAT_F));
-		printf("-Processor operation mode: %d ", isSet(STAT_P));
-		printf("\n");
-
-	} else{
-		switch(instResult){
-			case INST_CONDITIONNOTMET:
-				printf("The condition is not met.\n");
-				break;
-			case INST_INVALID:
-				printf("The instruction is invalid.\n");
-				break;
-			case INST_MULTIPLYBYZERO:
-				printf("The instruction causes multiply by zero.\n");
-				break;
-			case INST_RESTRICTEDMEMORYBLOCK:
-				printf("Restricted memory block. End users have access to memory indexes greater then %d\n", (userMemoryIndex - 1) );
-				break;
-			default:
-				printf("Unexpected error happened.\n");
-				break;
-		}
-	}
-}
-
-int arm_emulate(uint64_t* binary) {
-  int isFinished = 0;
-	uint64_t* memoryIndex = (WORD)binary;//Initialise the memory index for the instructions block
-	int instCount = 0;
-  
-  int i = 0;
-	for(i = 0; i < 16; i++) {
-		registers[i] = 0;
-	}
-  registers[15] = binary+4;
-
-  printf("r15: %p\n",registers[15]);
-  printf("r15-4: %p\n",(WORD*)registers[15] - 4);
-
-  while(!isFinished)
-	{
-		//After each instruction is completed, get user feedback
-		getFeedback();
-
-		// fetch the next instruction. Subtract 4 from the PC, because of the pipeline PC points to 4 instructions forward
-    
-		inst = *((WORD*)registers[15] - 4) & 0xffffffff;
-
-		//increment the PC(register[15]) to point at the next instruction
-		registers[15]++;
-
-		//Initialise the instruction result values
-		instResult = INST_VALID;
-
-		//Initialise the instruction cycle count to 1, because it will take at least 1 cycle even if the condition is not met
-		instCycleCount = 1;
-
-		if ( inst != 0 ) {
-			printf("---------- Instruction %d ----------\n", instCount);
-			decodeAndExecute(inst);
-			printOutput();
-
-			//Update total cycle count
-			totalCycleCount += instCycleCount;
-
-			printf("---------- %d Cycles, end of instruction %d----------\n", instCycleCount, instCount);
-
-			//Increase the amount of instructions executed
-			instCount++;
-		}
-		else {
-			// found an instruction with the value 0
-			// finish once a 0 hit. Not correct behaviour but good for testing
-			isFinished = 1;
-
-			//Total instruction count doesn't include the finish instruction
-			printf("========== %d Total cycles for %d instructions ==========\n", totalCycleCount, instCount);
-			printf("Press enter to exit...\n");
-			getchar();
-		}
-	}
-	// all ok
-	return 0;
-}
-
-int arm_emu_main(void)
-{
-	int isFinished = 0;
-	int memoryIndex = instMemoryIndex;//Initialise the memory index for the instructions block
-	int instCount = 0;
-
-	//Technically the register values would be 0 anyway, yet this is a double check to make sure they are initialised
-	int i = 0;
-	for(i = 0; i < 16; i++){
-		registers[i] = 0;
-	}
-
-	//initialise the stack pointer to the initial index of stack memory
-	registers[13] = stkMemoryIndex;
-
-	//initialise the PC to start from the instruction memory index. Add 4 for pipeline
-	registers[15] = instMemoryIndex + 4;
-
-	/*Interrupt branch instructions*/
-	//B #28 		1110 1010 0000 0000 0000 0000 0001 1100 //branch to #13: Add 10 to R0. Jump to 11-4 next memory location, since PC is already showing the next instruction and another 4 because of pipeline
-	memory[swibMemoryIndex + SYS_ADD10] = 0xEA00001C;
-	//End Interrupt branch instructions
-
-	/*Interrupt instructions*/
-	//ADD R0,R0,#10 1110 0010 1000 0000 0000 0000 0000 1010 //Add 10 to R0
-	memory[swiMemoryIndex + SYS_POS_ADD10] = 0xE280000A;
-	//MOV R15,R14	1110 0001 1010 0000 1111 0000 0000 1110 //branch back to where interrupt was called
-	memory[swiMemoryIndex + SYS_POS_ADD10 + 1] = 0xE1A0F00E;
-	//End Interrupt instructions
-
-	//for testing purposes put some data into the memory. This data represents the instructions to be executed.
-
-	/*Math instructions
-	//MOV r0,#9    		1110 0011 1010 0000 0000 0000 0000 1001
-	memory[memoryIndex++] = 0xE3A00009;
-	//MOV r1,#8			1110 0011 1010 0000 0001 0000 0000 1000
-	memory[memoryIndex++] = 0xE3A01008;
-	//ADD r2,r0,r1		1110 0000 1000 0000 0010 0000 0000 0001
-	memory[memoryIndex++] = 0xE0802001;
-	//ADD r3,r0,#5		1110 0010 1000 0000 0011 0000 0000 0101
-	memory[memoryIndex++] = 0xE2803005;
-	//SUB r4,r2,#5		1110 0010 0100 0010 0100 0000 0000 0101
-	memory[memoryIndex++] = 0xE2424005;
-	//RSBS r5,r0,#5		1110 0010 0111 0000 0101 0000 0000 0101
-	memory[memoryIndex++] = 0xE2705005;
-	//ADDS r6,r0,#205	1110 0010 1001 0000 0110 0000 1100 1101
-	memory[memoryIndex++] = 0xE29060CD;
-	//BICS r7,r0,#1		1110 0011 1101 0000 0111 0000 0000 0001
-	memory[memoryIndex++] = 0xE3D07001;*/
-	//End Math instructions
-
-	/*Logic instructions
-	//MOVS r0,#9    	1110 0011 1011 0000 0000 0000 0000 1001
-	memory[memoryIndex++] = 0xE3B00009;
-	//MOVS r1,#12		1110 0011 1011 0000 0001 0000 0000 1100
-	memory[memoryIndex++] = 0xE3B0100C;
-	//MVNS r5,#2			1110 0011 1111 0000 0101 0000 0000 0010
-	//memory[memoryIndex++] = 0xE3F05002;
-	//AND r2,r0,r1		1110 0000 0000 0000 0010 0000 0000 0001
-	//memory[memoryIndex++] = 0xE0002001;
-	//ORR r3,r0,r1		1110 0001 1000 0000 0011 0000 0000 0001
-	//memory[memoryIndex++] = 0xE1803001;
-	//EOR r4,r0,r1		1110 0000 0010 0000 0100 0000 0000 0001
-	//memory[memoryIndex++] = 0xE0204001;
-	//CMP r2,#9			1110 0011 0101 0010 0000 0000 0000 1001
-	//memory[memoryIndex++] = 0xE3520009;
-	//CMN r5,#1			1110 0011 0111 0101 0000 0000 0000 0001
-	//memory[memoryIndex++] = 0xE3750001;
-	//TST r1,#0			1110 0011 0001 0001 0000 0000 0000 0000
-	memory[memoryIndex++] = 0xE3110000;
-	//TEQ r1,#12			1110 0011 0011 0001 0000 0000 0000 1100
-	memory[memoryIndex++] = 0xE331000C;
-	//End Logic instructions*/
-
-	/*Loop instructions*/
-	//MOV R4,#100 		1110 0011 1010 0000 0100 0000 0110 0100
-	memory[memoryIndex++] = 0xE3A04064;
-	//MOV R3,#0    		1110 0011 1010 0000 0011 0000 0000 0000
-	memory[memoryIndex++] = 0xE3A03000;
-	//SUB R4,R4,R3		1110 0000 0100 0100 0100 0000 0000 0011 //.strR4100
-	memory[memoryIndex++] = 0xE0444003;
-	//ADD R3,R3,#1		1110 0010 1000 0011 0011 0000 0000 0001
-	memory[memoryIndex++] = 0xE2833001;
-	//CMP R3,#100		1110 0011 0101 0011 0000 0000 0110 0100
-	memory[memoryIndex++] = 0xE3530064;
-	//BNE #-32			0001 1010 1111 1111 1111 1111 1110 0000 //return to .strR4100 if loop not completed. 4+4 instructions back, because of pipeline
-	memory[memoryIndex++] = 0x1AFFFFE0;
-	//End Loop instructions
-
-	/*Data transfer instructions
-	//MOV R0,#10 		1110 0011 1010 0000 0000 0000 0000 1010 //Counter for loop = 10
-	memory[memoryIndex++] = 0xE3A0000A;
-	//MOV R4,#100 		1110 0011 1010 0000 0100 0000 0110 0100
-	memory[memoryIndex++] = 0xE3A04064;
-	//MOV R3,#120    		1110 0011 1010 0000 0011 0000 0111 1000
-	memory[memoryIndex++] = 0xE3A03078;
-	//STR R4,R3,#1!   1110 0110 1110 0011 0100 0000 0000 0001 //Post bit set .strR4100
-	memory[memoryIndex++] = 0xE6E34001;
-	//SUBS R0,R0,#1		1110 0010 0101 0000 0000 0000 0000 0001 //Start loop counter
-	memory[memoryIndex++] = 0xE2500001;
-	//BNE #-28			0001 1010 1111 1111 1111 1111 1110 0100 //return to .strR4100 if loop not completed. 3+4 instructions back, because of pipeline
-	memory[memoryIndex++] = 0x1AFFFFE4;
-	//End Data transfer instructions*/
-
-	/*Software Interrupt instructions
-	//SWI #1			1110 1111 0000 0000 0000 0000 0000 0001 //SWI to Add 10 to R0
-	memory[memoryIndex++] = 0xEF000001;
-	//SUBS r0,r0,#10	1110 0010 0101 0000 0000 0000 0000 1010
-	memory[memoryIndex++] = 0xE250000A;
-	//End Software Interrupt instructions*/
-
-	/*Overflow and Carry instructions
-	//MOV r0,#9    						1110 0011 1010 0000 0000 0000 0000 1001
-	//memory[memoryIndex++] = 0xE3A00009;
-	//MOV r1,#255,LSL #15				1110 0011 1010 0000 0001 1111 1111 1111//r1 = 8355840 		00000000011111111000000000000000
-	memory[memoryIndex++] = 0xE3A01FFF;
-	//MOV r1,r1,LSL #8					1110 0001 1010 0000 0001 0000 1000 0001//r1 = 2139095040	01111111100000000000000000000000
-	memory[memoryIndex++] = 0xE1A01081;
-	//ADDS r2,r1,r1						1110 0000 1001 0001 0010 0000 0000 0001//r2 = 4278190080	11111111000000000000000000000000 //causes overflow
-	memory[memoryIndex++] = 0xE0912001;
-	//MOV r3,r1,LSL #1					1110 0001 1010 0000 0011 0000 0001 0001//r3 = 4278190080	11111111000000000000000000000000
-	memory[memoryIndex++] = 0xE1A03011;
-	//ADDS r4,r3,r1						1110 0000 1001 0011 0100 0000 0000 0001//r4 = 6417285120 (1)01111110100000000000000000000000 //causes carry
-	memory[memoryIndex++] = 0xE0934001;*/
-	//End Overflow and Carry instructions
-
-	//at the moment this will terminate the main loop (see comments below)
-	memory[memoryIndex++] = 0;
-
-	while(!isFinished)
-	{
-		//After each instruction is completed, get user feedback
-		getFeedback();
-
-		// fetch the next instruction. Subtract 4 from the PC, because of the pipeline PC points to 4 instructions forward
-		inst = memory[(registers[15] - 4)];
-
-		//increment the PC(register[15]) to point at the next instruction
-		registers[15]++;
-
-		//Initialise the instruction result values
-		instResult = INST_VALID;
-
-		//Initialise the instruction cycle count to 1, because it will take at least 1 cycle even if the condition is not met
-		instCycleCount = 1;
-
-		if ( inst != 0 ) {
-			printf("---------- Instruction %d ----------\n", instCount);
-			decodeAndExecute(inst);
-			printOutput();
-
-			//Update total cycle count
-			totalCycleCount += instCycleCount;
-
-			printf("---------- %d Cycles, end of instruction %d----------\n", instCycleCount, instCount);
-
-			//Increase the amount of instructions executed
-			instCount++;
-		}
-		else {
-			// found an instruction with the value 0
-			// finish once a 0 hit. Not correct behaviour but good for testing
-			isFinished = 1;
-
-			//Total instruction count doesn't include the finish instruction
-			printf("========== %d Total cycles for %d instructions ==========\n", totalCycleCount, instCount);
-			printf("Press enter to exit...\n");
-			getchar();
-		}
-	}
-	// all ok
-	return 0;
-}

+ 0 - 5
bjos/sledge/arm_test.sh

@@ -1,5 +0,0 @@
-set -e
-gcc --std=gnu99 jit_arm_test.c
-./a.out
-arm-none-eabi-objdump -D -b binary -m armv5 /tmp/test
-

+ 0 - 7
bjos/sledge/build-deps.sh

@@ -1,7 +0,0 @@
-
-cd lightning
-./configure --prefix=$(pwd)/build/
-make
-make install
-cd ..
-

+ 0 - 3
bjos/sledge/build.sh

@@ -1,3 +0,0 @@
-
-gcc -g -o sledge --std=gnu99 sledge.c reader.c writer.c alloc.c strmap.c stream.c sdl2.c dev_linuxfb.c -lm -lSDL2 -DCPU_X64 -DDEV_SDL2
-

+ 0 - 3
bjos/sledge/build_rpi.sh

@@ -1,3 +0,0 @@
-
-gcc -g -o sledge --std=gnu99 sledge.c reader.c writer.c alloc.c strmap.c stream.c sdl.c dev_linuxfb.c -lm -lSDL -DCPU_ARM -DDEV_LINUXFB
-

+ 0 - 15
bjos/sledge/fs/buffer

@@ -1,15 +0,0 @@
-(def color (+ color 177))
-
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            
-                                                            

+ 0 - 2
bjos/sledge/fs/keymap

@@ -1,2 +0,0 @@
-    abcdefghijklmnopqrstuvwxzy1234567890
-    ß'ü+# öä^,.- 123456789012                                                              ABCDEFGHIJKLMNOPQRSTUVWXZY!"§$%&/()=n    ?`Ü*' ÖÄ°;:_ 123456789012                        

+ 0 - 2
bjos/sledge/fs/keymap-bm

@@ -1,2 +0,0 @@
- ^1234567890ß'btqwertzuiopü+
- asdfghjklöä, #yxcvbnm,.-                                <                                          °!"§$[]/()=?`BTQWERTZUIOPÜ*R ASDFGHJKLÖÄ; 'YXCVBNM;:_                                >                                                    

File diff suppressed because it is too large
+ 0 - 0
bjos/sledge/fs/unifont


+ 0 - 67
bjos/sledge/libBareMetal.h

@@ -1,67 +0,0 @@
-// =============================================================================
-// BareMetal -- a 64-bit OS written in Assembly for x86-64 systems
-// Copyright (C) 2008-2014 Return Infinity -- see LICENSE.TXT
-//
-// The BareMetal OS C/C++ library header.
-//
-// Version 2.0
-//
-// This allows for a C/C++ program to access OS functions available in BareMetal OS
-// =============================================================================
-
-
-void b_output(const char *str);
-void b_output_chars(const char *str, unsigned long nbr);
-
-unsigned long b_input(unsigned char *str, unsigned long nbr);
-unsigned char b_input_key(void);
-
-unsigned long b_smp_enqueue(void *ptr, unsigned long var);
-unsigned long b_smp_dequeue(unsigned long *var);
-void b_smp_run(unsigned long ptr, unsigned long var);
-void b_smp_wait(void);
-
-unsigned long b_mem_allocate(unsigned long *mem, unsigned long nbr);
-unsigned long b_mem_release(unsigned long *mem, unsigned long nbr);
-
-void b_ethernet_tx(void *mem, unsigned long len);
-unsigned long b_ethernet_rx(void *mem);
-
-unsigned long b_file_open(const unsigned char *name);
-unsigned long b_file_close(unsigned long handle);
-unsigned long b_file_read(unsigned long handle, void *buf, unsigned int count);
-unsigned long b_file_write(unsigned long handle, const void *buf, unsigned int count);
-
-/*
-unsigned long b_file_seek(unsigned long handle, unsigned int offset, unsigned int whence);
-unsigned long b_file_query(const unsigned char *name);
-unsigned long b_file_create(const char *name, unsigned long size);
-unsigned long b_file_delete(const unsigned char *name);
-*/
-
-unsigned long b_system_config(unsigned long function, unsigned long var);
-void b_system_misc(unsigned long function, void* var1, void* var2);
-
-
-// Index for b_system_config calls
-#define timecounter 0
-#define config_argc 1
-#define config_argv 2
-#define networkcallback_get 3
-#define networkcallback_set 4
-#define clockcallback_get 5
-#define clockcallback_set 6
-#define statusbar 10
-
-
-// Index for b_system_misc calls
-#define smp_get_id 1
-#define smp_lock 2
-#define smp_unlock 3
-#define debug_dump_mem 4
-#define debug_dump_rax 5
-#define get_argc 6
-#define get_argv 7
-
-// =============================================================================
-// EOF

+ 0 - 1
bjos/sledge/lightning/.deps/size.Po

@@ -1 +0,0 @@
-# dummy

+ 0 - 1
bjos/sledge/lightning/.gitattributes

@@ -1 +0,0 @@
-ChangeLog merge=merge-changelog

+ 0 - 33
bjos/sledge/lightning/.gitignore

@@ -1,33 +0,0 @@
-+*
-autom4te.cache
-aclocal.m4
-depcomp
-INSTALL
-Makefile
-Makefile.in
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-install-sh
-libtool
-lightning-*.tar.*
-ltmain.sh
-missing
-size
-stamp-h1
-test-driver
-check/.deps
-doc/.deps
-lib/.deps
-m4/libtool.m4
-m4/lt~obsolete.m4
-m4/ltoptions.m4
-m4/ltsugar.m4
-m4/ltversion.m4
-doc/mdate-sh
-doc/texinfo.tex
-lightning.pc

+ 0 - 14
bjos/sledge/lightning/AUTHORS

@@ -1,14 +0,0 @@
-Paulo Cesar Pereira de Andrade <pcpa@gnu.org>
-
-Paolo Bonzini <bonzini@gnu.org>
-
-PPC assembler by Ian Piumarta <piumarta@inria.fr>
-
-i386 assembler by Ian Piumarta <piumarta@inria.fr>
-and Gwenole Beauchesne <gb.public@free.fr>
-
-x86-64 backend by Matthew Flatt <mflatt@cs.utah.edu>
-
-Major PPC contributions by Laurent Michel <ldm@thorgal.homelinux.org>
-
-Major SPARC contributions by Ludovic Courtes <ludo@chbouib.org>

+ 0 - 676
bjos/sledge/lightning/COPYING

@@ -1,676 +0,0 @@
-
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
- 
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-  
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-

+ 0 - 355
bjos/sledge/lightning/COPYING.DOC

@@ -1,355 +0,0 @@
-		GNU Free Documentation License
-		   Version 1.1, March 2000
-
- Copyright (C) 2000  Free Software Foundation, Inc.
-     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-written document "free" in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially.  Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense.  It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does.  But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book.  We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License.  The "Document", below, refers to any
-such manual or work.  Any member of the public is a licensee, and is
-addressed as "you".
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject.  (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.)  The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters.  A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent.  A copy that is
-not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification.  Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page.  For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License.  You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute.  However, you may accept
-compensation in exchange for copies.  If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover.  Both covers must also clearly and legibly identify
-you as the publisher of these copies.  The front cover must present
-the full title with all words of the title equally prominent and
-visible.  You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols.  If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it.  In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
-   from that of the Document, and from those of previous versions
-   (which should, if there were any, be listed in the History section
-   of the Document).  You may use the same title as a previous version
-   if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
-   responsible for authorship of the modifications in the Modified
-   Version, together with at least five of the principal authors of the
-   Document (all of its principal authors, if it has less than five).
-C. State on the Title page the name of the publisher of the
-   Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
-   adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
-   giving the public permission to use the Modified Version under the
-   terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
-   and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section entitled "History", and its title, and add to
-   it an item stating at least the title, year, new authors, and
-   publisher of the Modified Version as given on the Title Page.  If
-   there is no section entitled "History" in the Document, create one
-   stating the title, year, authors, and publisher of the Document as
-   given on its Title Page, then add an item describing the Modified
-   Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
-   public access to a Transparent copy of the Document, and likewise
-   the network locations given in the Document for previous versions
-   it was based on.  These may be placed in the "History" section.
-   You may omit a network location for a work that was published at
-   least four years before the Document itself, or if the original
-   publisher of the version it refers to gives permission.
-K. In any section entitled "Acknowledgements" or "Dedications",
-   preserve the section's title, and preserve in the section all the
-   substance and tone of each of the contributor acknowledgements
-   and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
-   unaltered in their text and in their titles.  Section numbers
-   or the equivalent are not considered part of the section titles.
-M. Delete any section entitled "Endorsements".  Such a section
-   may not be included in the Modified Version.
-N. Do not retitle any existing section as "Endorsements"
-   or to conflict in title with any Invariant Section.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant.  To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version.  Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity.  If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy.  If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections entitled "History"
-in the various original documents, forming one section entitled
-"History"; likewise combine any sections entitled "Acknowledgements",
-and any sections entitled "Dedications".  You must delete all sections
-entitled "Endorsements."
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation.  Such a compilation is called an "aggregate", and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections.  You may include a
-translation of this License provided that you also include the
-original English version of this License.  In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License.  Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License.  However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time.  Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.  See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation.  If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-      Copyright (c)  YEAR  YOUR NAME.
-      Permission is granted to copy, distribute and/or modify this document
-      under the terms of the GNU Free Documentation License, Version 1.1
-      or any later version published by the Free Software Foundation;
-      with the Invariant Sections being LIST THEIR TITLES, with the
-      Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-      A copy of the license is included in the section entitled "GNU
-      Free Documentation License".
-
-If you have no Invariant Sections, write "with no Invariant Sections"
-instead of saying which ones are invariant.  If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of
-"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.

+ 0 - 165
bjos/sledge/lightning/COPYING.LESSER

@@ -1,165 +0,0 @@
-		   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions. 
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version. 
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.

+ 0 - 3570
bjos/sledge/lightning/ChangeLog

@@ -1,3570 +0,0 @@
-2015-01-19 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Reorder documentation, making jit_frame
-	and jit_tramp the lightning response to the need of
-	trampolines, continuations and tail call optimizations.
-	A pseudo code example of a factorial function was added.
-	Also added a section for description of the available
-	predicates.
-
-	* doc/fact.c: New file, implementing a simple example of
-	a translation of a trivial, recursive, tail call optimization
-	into lightning calls. This is the conversion to functional C
-	code of the example in doc/body.texi.
-
-	* doc/Makefile.am: Update for the next test case.
-
-2015-01-17 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/jit_aarch64.c,
-	lib/jit_alpha.c, lib/jit_arm-vfp.c, lib/jit_arm.c,
-	lib/jit_hppa.c,	lib/jit_ia64.c, lib/jit_mips.c,
-	lib/jit_ppc.c, lib/jit_s390.c, lib/jit_sparc.c,
-	lib/jit_x86.c: Add the new jit_arg_register_p predicate.
-	The predicate is expected to be used to know if an
-	argument is in a register, what would need special
-	handling if code that can overwrite non callee save
-	registers is executed.
-
-	* check/carg.c: New test case to check consistency and
-	expected usage of jit_arg_register_p.
-
-	* check/Makefile.am: Update for new test case.
-
-2015-01-17 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_aarch64.h,
-	include/lightning/jit_alpha.h,
-	include/lightning/jit_arm.h,
-	include/lightning/jit_hppa.h,
-	include/lightning/jit_mips.h,
-	 include/lightning/jit_ppc.h,
-	include/lightning/jit_s390.h,
-	include/lightning/jit_sparc.h,
-	include/lightning/jit_x86.h,
-	lib/jit_aarch64.c, lib/jit_alpha.c,
-	lib/jit_arm.c, lib/jit_hppa.c,
-	lib/jit_ia64.c, lib/jit_mips.c,
-	lib/jit_ppc.c, lib/jit_s390.c,
-	lib/jit_sparc.c, lib/jit_x86.c: Remove jit_arg_reg_p and
-	jit_arg_f_reg_p from a public header, and define it only
-	on port specific files where an integer offset is used
-	to qualify an argument identifier. Exported code expects
-	an opaque pointer (but of jit_node_t* type) to "qualify"
-	an argument identifier.
-	This patch, and the code review/simplification done during
-	it also corrected some bugs:
-	o Inconsistent jit_arg_d value of double argument after 3
-	  integer arguments in arm for jit_functions; tested, C
-	  functions were being properly called.
-	o Inconsistent use of getarg_{f,d} and putarg*_{f,d} on
-	  s390 (32-bit) that happened to not have a proper test
-	  case, as it would only happen for jit functions, and
-	  tested, called C functions had proper arguments.
-	o Corrected a "last minute" correction that did not go
-	  to the committed version, and would not compile on hppa,
-	  due to bad _jit_putargi_d prototype definition.
-
-2015-01-17 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Correct wrong/outdated information for
-	hton*, pusharg* and ret*, and add missing documentation
-	for rsb*, qmul*, qdvi* and putarg*.
-
-2015-01-15 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac, lib/jit_disasm.c: Rewrite workaround
-	to apparent problem to initialize powerpc disassembler.
-
-2015-01-15 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/jit_aarch64.c,
-	lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
-	lib/jit_ia64.c, lib/jit_mips.c,	lib/jit_ppc.c,
-	lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c:
-	Implement jit_putarg*. It works as a mix of jit_getarg*
-	and jit_pusharg*, in the way that the first argument is
-	a register or immediate, and the second is a pointer
-	returned by jit_arg*. The use of the interface is to change
-	values of arguments to the current jit function.
-
-	* check/put.ok, check/put.tst: New test cases exercising
-	the new jit_putarg* interface.
-
-	* check/Makefile.am, check/lightning.c: Update for the
-	new test case and interface.
-
-2015-01-08 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_s390.h, lib/jit_s390-cpu.c,
-	lib/jit_s390-fpu.c, lib/jit_s390-sz.c, lib/jit_s390.c:
-	Renamed s390x* files to s390*.
-
-	* check/float.tst, check/lightning.c, configure.ac,
-	include/lightning.h, include/lightning/Makefile.am,
-	lib/Makefile.am, lib/jit_s390.c, lib/jit_size.c,
-	lib/lightning.c: Update for renamed files.
-
-2015-01-08 Paulo Andrade <pcpa@gnu.org>
-
-        * include/lightning.h, include/lightning/jit_private.h,
-        include/lightning/jit_s390x.h, lib/jit_disasm.c,
-        lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
-        lib/jit_s390x.c, lib/jit_size.c, lib/lightning.c:
-	Add support for generating jit for s390 32 bit. This change
-	also removed %f15 from the list of temporaries fpr registers;
-	it was not being used, but if were, it would corrupt the
-	stack frame because the spill address would overwrite grp
-	offsets.
-
-2014-12-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Correct some endianess issues
-	on the powerpc le backend.
-
-2014-12-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc-cpu.c: Add mcrxr instruction emulation,
-	as this instruction has been phased out, and should be
-	implemented as a kernel trap.
-
-2014-12-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Better check for need to flush constants
-	before the pool being no longer reachable.
-
-2014-12-25 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h: Split jit_htonr in the new 3 interfaces
-	jit_htonr_us, jit_htonr_ui and jit_htonr_ul, the later only
-	available on 64 bit. The plain/untyped jit_htonr macro call
-	maps to the wordsize one.
-	* lib/jit_aarch64-cpu.c,  lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
-	lib/jit_alpha-cpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c,
-	lib/jit_arm-cpu.c, lib/jit_arm-sz.c, lib/jit_arm.c,
-	lib/jit_hppa-cpu.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
-	lib/jit_ia64-cpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
-	lib/jit_mips-cpu.c, lib/jit_mips-sz.c, lib/jit_mips.c,
-	lib/jit_ppc-cpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
-	lib/jit_s390x-cpu.c, lib/jit_s390x-sz.c, lib/jit_s390x.c,
-	lib/jit_sparc-cpu.c, lib/jit_sparc-sz.c, lib/jit_sparc.c,
-	lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c:
-	Update backends for the new jit_htonr*.
-	* check/lightning.c, lib/jit_names.c, lib/lightning.c:
-	Update for the new jit_htonr* interfaces.
-	* check/Makefile.am: Update for new test cases.
-	* check/hton.ok, check/hton.tst: New test cases.
-
-2014-12-24 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, include/lightning/jit_x86.h,
-	lib/jit_disasm.c, lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
-	lib/jit_x86-sz.c, lib/jit_x86-x87.c, lib/jit_x86.c,
-	size.c: Implement support for the x32 abi. Built and
-	tested on Gentoo default/linux/amd64/13.0/x32 profile.
-
-2014-12-24 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_names.c: Add missing rsbi_f and rsbi_d strings.
-
-2014-12-21 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Call __clear_cache for every page.
-	This should only be required for older boards or
-	toolchain setup, but has been reported to be required
-	for lightning at some point.
-
-2014-12-21 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Correct check to guard overflow of index
-	of constants from program counter.
-
-2014-11-24 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Remove an optimization to calee save
-	registers that may incorrectly remove a jit_movr under
-	special conditions.
-
-2014-11-20 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c,
-	lib/jit_ppc.c: Add initial powerpc le support.
-
-2014-11-20 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_disasm.c: Change thumb or arm disassemble based on
-	jit code before disassembly.
-
-	* lib/jit_arm-cpu.c: Correct reversed arguments to LDRD and
-	STRD instructions, and correct checking for support of those.
-
-	* lib/jit_arm-swf.c: Correct wrong use of LDRD and STRD and
-	only use those if the register is even.
-
-	* check/check.arm.swf.sh, check/check.arm4.swf.sh: New files
-	to test LDRD and STRD, as well as the alternate code path
-	when those are not available, in the .arm4. test case.
-
-	* check/Makefile.am: Update for the new test cases.
-
-2014-11-08 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, lib/jit_aarch64.c,
-	lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
-	lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
-	lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c:
-	Implement a private jit_flush call, that flushes
-	the cache, if applicable, aligning down to the
-	previous and up to the next page boundary.
-
-2014-11-08 Paulo Andrade <pcpa@gnu.org>
-
-	* check/ctramp.c: New file. It just repeats the test
-	of tramp.tst, but using two jit_state_t, what should
-	test possible issues with two contexts, and also validate
-	jit_tramp works on backends with function descriptions.
-
-	* check/Makefile.am: Update for new test case.
-
-2014-11-03 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_mips.h: Do not make the t9 register
-	JIT_R11 (or JIT_R7 for n32 or n64 abi) available. Previously
-	it cause problems if one expects it to not be changed in a
-	function call. For example, calling a jit function, where it
-	really does not need to be changed.
-
-2014-10-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
-	lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
-	lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Add an
-	assertion to all code generation "drivers" to ensure
-	_jitc->regarg is empty or in an expected state, after
-	translation of a lightning instruction to native code.
-	This change was a brute force test to find out other cases
-	of a temporary not being release (like was happening with
-	_bmsi and _bmci on x86), but no other case was found,
-	after running make check, with assertions enabled, on all
-	backends.
-
-2014-10-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-cpu.c: Correct a register allocation leak in
-	_bmsi and _bmci.
-
-2014-10-25 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_disasm.c: Do not cause an fatal error if init_jit
-	fails in the jit_init_debug call.
-
-2014-10-24 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64.c, lib/jit_ppc.c: Correct handling of function
-	descriptor when first prolog is a jit_tramp prolog. The
-	test case was using the same jit_context_t, so was not
-	triggering this condition.
-
-	* lib/jit_ppc-cpu.c: Properly handle jump displacements that
-	do not fit on 24 powerpc. This required changing from previous
-	"mtlr reg, blr" to "mtctr reg, bctr" to properly handle
-	the logic to "hide" function descriptors, but that would
-	also be required as the proper jit_jmpr when/if implementing
-	optimizations to leaf functions (was working with blr because
-	it is saved/reloaded in prolog/epilog).
-
-2014-10-21 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/lightning.c: Add three predicates
-	to query information about labels. jit_forward_p(label)
-	will return non zero if the label is "forward", that is
-	need a call to jit_link(label), jit_indirect_p(label)
-	that returns non zero if the label was created with the
-	jit_indirect() call, and jit_target_p(label) that will
-	return non zero if there is at least one jump patched
-	to land at that label.
-
-2014-10-18 Paulo Andrade <pcpa@gnu.org>
-
-	* check/range.ok, check/range.tst: New test case designed
-	to catch incorrect code generation, usually due to incorrect
-	test of immediate size. The test checks a large amount of
-	encodings in "power of two" boundaries. This test exorcises
-	a significant amount of code paths that was previously not
-	tested.
-
-	* check/Makefile.am: Add range test to make check target.
-
-	* lib/jit_aarch64-cpu.c: Correct wrong address calculation
-	for stxi_c, stxi_s, stxi_i and stxi_l when the offset is
-	too large.
-
-        * lib/jit_mips-fpu.c: Correct wrong size test to check if
-	an immediate can be encoded in a float or double store.
-
-	* lib/jit_s390x-cpu.c: Correct inverted encoding to stxi_s
-	when the offset cannot be encoded, and fallbacks to an
-	alternate encoding in 2 instructions.
-
-2014-10-17 Paulo Andrade <pcpa@gnu.org>
-
-	* check/alu_rsb.ok, check/alu_rsb.tst: New files implementing
-	tests for jit_rsb*.
-
-	* check/Makefile.am, check/lightning.c, include/lightning.h,
-	lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c, lib/jit_aarch64-sz.c,
-	lib/jit_aarch64.c, lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c,
-	lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_arm-cpu.c,
-	lib/jit_arm-swf.c, lib/jit_arm-sz.c, lib/jit_arm-vfp.c,
-	lib/jit_arm.c, lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
-	lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-cpu.c,
-	lib/jit_ia64-fpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
-	lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips-sz.c,
-	lib/jit_mips.c, lib/jit_names.c, lib/jit_ppc-cpu.c,
-	lib/jit_ppc-fpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
-	lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
-	lib/jit_s390x.c, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
-	lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-cpu.c,
-	lib/jit_x86-sse.c, lib/jit_x86-sz.c, lib/jit_x86-x87.c,
-	lib/jit_x86.c, lib/lightning.c: Implement jit_rsb*. This
-	was a missing lightning 1.x interface, that on most
-	backends is synthesized, but on a few backends (hppa and ia64),
-	it can generate better code as on those there is, or the
-	only instruction with an immediate is in "rsb" format
-	(left operand).
-
-2014-10-17 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_names.c: New file with single definition of string
-	representation of lightning IR codes.
-
-	* size.c: Modified to append the code name in a C comment
-	after the maximum instruction size.
-
-	* lib/jit_print.c: Minor change to not duplicate jit_names.c
-	contents.
-
-	* lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_arm-sz.c,
-	lib/jit_hppa-sz.c, lib/jit_ia64-sz.c, lib/jit_mips-sz.c,
-	lib/jit_ppc-sz.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
-	lib/jit_x86-sz.c: Rewritten to add string representation of
-	IR codes in a C comment.
-
-2014-10-14 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
-	lib/jit_hppa-cpu.c, lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c,
-	lib/jit_sparc-cpu.c: Implement or correct the internal
-	nop(count) call that receives an argument that tells the
-	modulo bytes to align the code for the next instruction.
-
-	* include/lightning.h, lib/lightning.c, lib/jit_aarch64.c,
-	lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c,
-	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
-	lib/jit_x86.c: Implement the new jit_align() call that receive
-	an argument, that tells the modulo, in bytes, to align the
-	next instruction. In most backends the only value that makes
-	a difference is a value that matches sizeof(void*), as all
-	other values usually are already automatically aligned in
-	labels, but not guaranteed to be aligned at word size bytes.
-
-	* check/align.ok, check/align.tst: New files, implementing
-	a simple test for the new jit_align() interface.
-
-	* check/Makefile.am, check/lightning.c, lib/jit_aarch64-sz.c,
-	lib/jit_alpha-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
-	lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
-	lib/jit_print.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
-	lib/jit_x86-sz.c: Update for the new jit_code_align code and
-	the jit_align() interface.
-
-2014-10-13 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/jit_size.c, size.c: Use a
-	symbolic value for the last IR code.
-
-2014-10-12 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, include/lightning/jit_private.h,
-	lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
-	lib/jit_hppa-cpu.c, lib/jit_ia64-cpu.c, lib/jit_mips-cpu.c,
-	lib/jit_ppc-cpu.c, lib/jit_s390x-cpu.c, lib/jit_sparc-cpu.c,
-	lib/jit_x86-cpu.c, lib/lightning.c: Implement the new
-	jit_frame and jit_tramp interfaces, that allow writing
-	trampoline like calls, where a single dispatcher jit buffer
-	is written, and later other jit buffers are created, with
-	the same stack frame layout as the dispatcher. This is the
-	logic that GNU Smalltalk used in lightning 1.x, and is required
-	to make a sane port for lighting 2.x.
-
-	* jit_ia64-cpu.c: Implement support for jit_frame and jit_tramp,
-	and also correct wrong encoding for B4 instructions, that
-	implement jmpr, as well as correct reverse logic in _jmpr,
-	that was moving the branch register to the jump register,
-	and not vice-versa.
-	Also, if a stack frame is to be assumed, always assume it may
-	call a function with up to 8 arguments, regardless of the
-	hint frame argument.
-
-	* lib/jit_arm.c: Add a new must_align_p() interface to ensure
-	function prologs are always aligned. This condition was
-	previously always true, somewhat by accident, but with
-	jit_tramp it is not guaranteed.
-
-	* jit_ia64-cpu.c: lib/jit_ppc.c: Add minor special handling
-	required to implement jit_tramp, where a function descriptor
-	should not be added before a prolog, as jit_tramp means omit
-	prolog.
-
-	* check/lightning.c: Update test driver for the new interfaces.
-
-	* check/Makefile.am, check/tramp.tst, check/tramp.ok: Add
-	a simple test and example of the jit_frame and jit_tramp
-	usage implementing a simple Fibonacci function using a
-	simulation of an interpreter stack and how it would handle
-	state in language specific variables.
-
-	* doc/body.texi: Add documentation for jit_frame and
-	jit_tramp.
-
-2014-09-29 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
-	lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
-	lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
-	lib/jit_x86.c, lib/lightning.c: Allow jit_jmpi on a
-	target that is not a node. This may lead to hard to
-	debug code generation, but is a required feature for
-	certain generators, like the ones that used lightning
-	1.2x. Note that previously, but not really well
-	documented, it was instructed to use:
-	jit_movi(rn, addr); jit_jmpr(rn);
-	but now, plain:
-	jit_patch_abs(jit_jmpi(), addr);
-	should also work.
-
-2014-09-24 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-sz.c: Generate information about instruction
-	lengths for more precise calculation of buffer size on
-	Windows x64. This change is specially important because
-	the maximum instruction length is larger than other
-	systems, what could cause an out of bounds write on
-	special conditions without this update.
-
-2014-09-24 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c: Add workaround to conflicting global
-	optind variable in cygwin binutils that have an internal
-	getopt* implementation.
-
-	* lib/jit_x86-cpu.c: Add a simple define ffsl ffs if building
-	for 32 bit and there is no ffsl function.
-
-2014-09-24 Paulo Andrade <pcpa@gnu.org>
-
-        * check/lightning.c: Add a hopefully temporary kludge to not use
-	sprintf and sscanf returned by dlsym. This is required to pass
-	the varargs test.
-
-        * include/lightning/jit_private.h: Use symbolic name for first
-	integer register argument, as this is different in sysv and
-	win64 abi.
-
-        * include/lightning/jit_x86.h: Add conditionals and definitions
-	for Windows x64 (under __CYGWIN__ preprocessor conditional).
-
-        * lib/jit_x86-cpu.c: Correct one instruction encoding bug, that
-	was working by accident. Only use rax to rdx for some byte
-	operations to work on compatibility mode (that is, to generate
-	the proper encoding, instead of actually generating encoding
-	for high byte registers, e.g. %bh).
-	Add proper prolog and epilog for windows x64.
-
-        * lib/jit_x86-sse.c: Correct a swapped rex prefix for float
-	operations.
-
-        * lib/jit_x86.c: Adjust to support Windows x64 abi.
-
-	* check/check.x87.nodata.sh: New file, previously used but that
-	was missing git.
-
-2014-09-07 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Mark all registers advertised as live, as
-	per jit_callee_save_p as live whenever reaching a jump that
-	cannot be tracked. This is a rethink of the previous commit,
-	and is a better approach, otherwise there would not be much
-	sense on relying on jit_callee_save_p if it could not be
-	trusted.
-
-	* check/jmpr.tst, check/jmpr.ok: New files implementing a very
-	simple test case, that would actually cause an assertion on
-	code before the change to only mark as live when reaching a
-	jump that could not tracked, the actually advertised as callee
-	save registers.
-
-	check/Makefile.am: Update for new jmpr test case.
-
-2014-09-01 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Do not mark all registers in unknown state
-	as live on jit_jmpr, or jit_jmpi to an absolute address. Instead,
-	treat it as a function call, and only consider JIT_Vn registers
-	as possibly live.
-
-2014-08-29 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Add a proper info menu entry for
-	GNU lightning.
-
-	* doc/version.texi: Regenerate.
-
-2014-08-16 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
-	lib/jit_arm-cpu.c, lib/jit_arm-vfp.c,
-	lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
-	lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c,
-	lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
-	lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c,
-	lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c,
-	lib/jit_s390x.c, lib/jit_sparc-cpu.c,
-	lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
-	lib/jit_x86-x87.c: Review generation of all branch
-	instructions and always adds the jit_class_nospill
-	bitfield for temporary registers that cannot be	spilled
-	because the reload would be after a conditional jump; the
-	patch only adds an extra assertion. These conditions do
-	not happen on documented lightning usage, but can happen
-	if one uses the not exported jit_get_reg and jit_unget_reg
-	calls and cause enough register starvation.
-
-2014-08-16 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_alpha.c: Correct wrong bitmask of most argument
-	float register arguments, that were being set as callee
-	save instead of argument registers class.
-
-2014-08-16 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm-sz.c: Regenerate table of known maximum
-	instruction sizes for the software float fallback,
-	that implements "virtual" float registers in the stack
-	and operations as calls to libgcc.
-
-	* size.c: Correct typo in the generated jit_arm-sz.c file.
-
-2014-08-10 Paulo Andrade <pcpa@gnu.org>
-
-        * include/lightning/jit_alpha.h, lib/jit_alpha-cpu.c,
-        lib/jit_alpha-fpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c:
-	New files implementing a lightning Alpha port. Thanks
-	to Trent Nelson and snakebit.net staff for providing access
-	to an Alpha system.
-
-        * check/float.tst, check/lightning.c, configure.ac,
-        include/lightning.h, include/lightning/Makefile.am,
-        include/lightning/jit_private.h, lib/Makefile.am,
-        lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
-	Minor changes to adapt for the new Alpha port.
-
-2014-08-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Always mark JIT_RET and JIT_FRET as
-	live in a function epilog. This is required because
-	on some ports a complex sequence, allocating one or more
-	registers, may be required to jump from a ret* to the
-	epilog, and the lightning api does not have annotations
-	to know if a function returns a value, or the type of
-	the return value.
-
-2014-08-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Change the correct live bitmask of
-	return registers after a function call in jit_update.
-
-2014-08-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Change assertions to have an int
-	result and correct a bad bit mask assertion.
-
-2014-08-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64.c: Correct bad setup for assertion
-	of consistency before a patch.
-
-2014-08-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_mips-cpu.c: Correct typo in the jit_bmsr
-	implementation that was using the wrong test result
-	register.
-
-2014-07-28 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_memory.c: Do not call free on NULL pointers.
-
-	* include/lightning/jit_private.h, lib/jit_note.c,
-	lib/lightning.c: Add a wrapper to memcpy and memmove
-	to not actually call those functions with a zero size
-	argument, and likely also a null src or dst.
-
-2014-07-27 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, lib/jit_disasm.c,
-	lib/lightning.c: Remove the global jit_progname variable.
-	It was being only used in jit_init_debug, that is called
-	from init_jit, so, just pass an argument.
-
-2014-07-27 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Add note that jit_set_memory_functions
-	should be called before init_jit, because init_jit
-	itself may call the memory wrappers.
-
-2014-04-22 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Do not get confused with default settings
-	if /proc is not mounted on Linux specific code path.
-
-2014-04-09 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
-	include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
-	include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
-	include/lightning/jit_private.h, include/lightning/jit_s390x.h,
-	include/lightning/jit_sparc.h, include/lightning/jit_x86.h:
-	Do not add jit_regset_t, JIT_RA0, and JIT_FA0 to the installed
-	header file. These types and definitions are supposed to be
-	only used internally.
-
-2014-04-05 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm-cpu.c: Only adjust stack pointer in prolog if
-	need stack space, that is, do not emit a nop instruction
-	subtracting zero from the stack pointer.
-
-2014-04-04 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_disasm.c: Correct a crash in the doc/printf example
-	on arm due to releasing the data_info information in
-	jit_clear_state. This is a special case for arm only, and
-	actually, only armv5 or older uses the data_info buffer,
-	or when forcing arm instruction set mode besides thumb
-	available.
-
-2014-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Write detailed description and examples for
-	jit_get_memory_functions, jit_set_memory_functions,
-	jit_get_code, jit_set_code, jit_get_data and jit_set_data.
-
-2014-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, include/lightning/jit_private.h,
-	lib/lightning.c: Implement the new jit_set_data() interface,
-	and the new jit_get_data() helper. Like jit_set_code(),
-	jit_realize() should be called before jit_set_data().
-	The most common usage should be jit_set_data(JIT_DISABLE_DATA
-	| JIT_DISABLE_NOTE), to force synthesize any float/double
-	constant in the stack and not generate any debug information.
-
-	* lib/jit_note.c: Minor change to debug note generation as
-	now it uses an alternate temporary data buffer during constants
-	and debug generation to accommodate the possibility of the user
-	setting an alternate data buffer.
-
-	* lib/jit_hppa-fpu.c, lib/jit_s390x.c, lib/jit_s390x-cpu.c,
-	lib/jit_s390x-fpu.c, lib/jit_sparc.c, lib/jit_sparc-fpu.c,
-	lib/jit_x86-sse.c, lib/jit_x86-x87.c: Implement jit_set_data.
-
-	* lib/jit_hppa-sz.c, lib/jit_sparc-sz.c, lib/jit_x86-sz.c,
-	lib/jit_s390x-sz.c: Update for several instructions that now
-	have a different maximum length due to jit_set_data.
-
-	* lib/jit_mips-fpu.c: Implement jit_set_data, but missing
-	validation on n32 and n64 abis (and/or big endian).
-
-	* lib/jit_mips-sz.c: Update for changes in o32.
-
-	* lib/jit_ppc-fpu.c: Implement jit_set_data, but missing
-	validation on Darwin PPC.
-
-	* lib/jit_ppc-sz.c: Update for changes in powerpc 32 and
-	64 bit.
-
-	* lib/jit_ia64-fpu.c: Implement untested jit_set_data.
-
-	* TODO: Add note to list ports that were not tested for the
-	new jit_set_data() feature, due to no longer having access
-	to them.
-
-	* check/nodata.c: New file implementing a simple test exercising
-	several different conditions created by jit_set_data().
-
-	* check/check.nodata.sh: New file implementing a wrapper
-	over the existing *.tst files, that runs all tests without
-	using a data buffer for constants; only meaningful (and
-	enabled) on architectures that used to store float/double
-	constants on a read only data buffer.
-
-	* configure.ac, check/Makefile.am: Update for the new test
-	cases.
-
-	* check/lightning.c: Implement the new "-d" option that
-	sets an internal flag to call jit_set_data() disable
-	constants and debug, that is, using only a pure code
-	buffer.
-
-2014-11-03 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, include/lightning/jit_private.h,
-	lib/lightning.c: Implement the new jit_set_code() interface,
-	that allows instructing lightning to use an alternate code
-	buffer. The new jit_realize() function should be called
-	before jit_set_code(), and usually call jit_get_code()
-	to query the amount of bytes expected to be required for
-	the code.
-
-	* lib/jit_size.c: Minor update to have less chances of
-	miscalculating the code buffer by starting the counter
-	with the size of the longest instruction instead of zero,
-	as code emit fails if at any moment less than the longest
-	instruction bytes are available.
-
-	* check/setcode.c: New file implementing some basic tests
-	of the new jit_set_code() interface.
-
-	* check/Makefile.am: Update for newer test case.
-
-2014-06-03 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/lightning.c: Add the new
-	jit_indirect() call, that returns a special label node,
-	and tells lightning that the label may be the target of
-	an indirect jump.
-
-	* doc/body.texi: Document the new jit_indirect() call, and
-	add examples of different ways to create labels and branches.
-
-2014-23-02 Paulo Andrade <pcpa@gnu.org>
-
-	*  lib/jit_x86.c: Rewrite previous patch to inline save/restore
-	because clobbering %ebx in x86 is treated as an error
-	(jit_x86.c:239:5: error: PIC register clobbered by 'ebx' in 'asm').
-
-2014-19-02 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86.c: Rewrite incorrect inline assembly that could
-	truncate a variable in a callee save register. Now it simply
-	tells gcc that the register is clobbered, instead of using a
-	*32 bit* swap with a temporary variable. The problem only
-	happens when compiling with optimization.
-
-2014-19-02 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
-	include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
-	include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
-	include/lightning/jit_s390x.h, include/lightning/jit_sparc.h,
-	include/lightning/jit_x86.h: Change jit_regset_t to an
-	unsigned type, to allow safe right shift.
-
-	* lib/lightning.c: Rewrite jit_regset_scan1 to allow easier
-	compiler optimization.
-
-2013-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-x87.c: Correct wrong optimization when
-	loading the log(2) constant.
-
-2013-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-cpu.c: Use the emms instruction before
-	calling any function. This is particularly important
-	when using c99 complex functions as it can easily
-	overflow the x87 stack due to the way lightning uses
-	the x87 stack as a flat register file.
-
-2013-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-x87.c: Correct wrong code generation due
-	to comparing the base and not the value register with
-	%st(0) in stxi_f.
-
-2013-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
-	stack offset for float/double x87 to/from sse move.
-
-2013-11-27 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
-	changes that should at least allow building lightning
-	on Apple iOS7.
-
-2013-10-08 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc-cpu.c: Correct wrong shortcut for ldxi_l with
-	a zero offset, that was calling ldr_i instead of ldr_l.
-
-2013-10-08 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_arm.h, lib/jit_arm-cpu.c: Do not use
-	by default load/store instructions that map to ldrt/strt.
-	There is already the long displacement version for positive
-	offsets, and when using a (shorter) negative offset it does
-	not map to ldrt/strt. At least on qemu strt may cause
-	reproducible, but unexpected SIGILL.
-
-2013-10-08 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm-vfp.c: Correct wrong load/store offset
-	calculation when the displacement is constant but too
-	large to use an instruction with an immediate offset.
-
-2013-10-07 Paulo Andrade <pcpa@gnu.org>
-
-	* check/self.c: Extend tests to validate jit_callee_save_p
-	does not cause an assertion on valid arguments, and test
-	extra registers defined on some backends.
-
-	* configure.ac: Do not ignore environment CFLAGS when
-	checking if need to test runtime configurable options,
-	like use x87 when sse2 is available, arm instruction set
-	instead of thumb, etc.
-
-	* include/lightning/jit_arm.h: Correct wrong jit_f macro
-	definition.
-
-	* include/lightning/jit_ia64.h, include/lightning/jit_ppc.h: 
-	Correct wrong jit_r macro definition.
-
-	* lib/jit_x86-x87.c, lib/jit_x86.c: Actually use the
-	reserved stack space for integer to/from float conversion.
-	The stack space was also changed to ensure it is 8 bytes
-	aligned. Also, for Solaris x86 in 32 bit mode, an alternate
-	truncr_d was implemented because for some reason it is
-	failing with SIGILL if using the "fisttpl" instructions,
-	that must be available on p6 or newer, but for the sake of
-	making all tests pass, implement a 486 or newer sequence
-	if "sun" is defined.
-
-2013-10-03 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
-	lib/jit_mips-sz.c, lib/jit_mips.c, size: Build and
-	pass all test cases on Irix big endian mips using
-	the 64 bit abi.
-
-2013-10-02 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_mips.h: Add proper mips abi detection.
-
-2013-09-30 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_print.c: Do not crash if calling jit_print from
-	gdb before actually emitting code.
-
-	* lib/lightning.c: Correct misplaced check for already
-	visited blocks on conditional branches, what was preventing
-	proper merge live bit masks of forward blocks.
-
-2013-09-30 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-cpu.c: Correct not properly tested case of using
-	%r12 as index register, what was causing an invalid assertion.
-	%r12 is mapped to the "extra" JIT_R3 register, and test cases
-	only test "standard" lightning registers.
-
-2013-09-28 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64.c: Minor change to force collecting the maximum
-	instruction length in the --enable-devel-get-jit-size build
-	mode. The actual generated file did not change because the
-	sampling was large enough that it had already collected proper
-	information in the previously slightly buggy code (not forcing
-	a sync of the instructions that could be combined).
-
-2013-09-27 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Correct build when disassembler is
-	disabled.
-
-2013-09-25 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
-	off by one range checks (that were only accepting values
-	one less than the maximum allowed) and an invalid test
-	condition check that was forcing it to always use
-	indirect jumps even when reachable with an immediate
-	displacement.
-
-2013-09-24 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
-	lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
-	lib/jit_s390x-sz.c, lib/jit_size.c, lib/jit_sparc-sz.c,
-	lib/jit_x86-sz.c: New files implementing static tables
-	with longest known instructions length generated to match
-	a lightning instruction. These tables should make it easier
-	to make it very unlikely to ever miscalculate, or by too
-	much, the size of a code buffer.
-
-	* lib/jit_size.c: New file that aids to either collect
-	jit code size information, or use the information depending
-	on build options.
-
-	* size.c: New helper file that parses input for, and create
-	an initial jit_$arch-sz.c file, that needs some minor edit
-	for arches with multiple configurations.
-
-	* configure.ac, Makefile.am: Add the new, devel mode only
-	--enable-devel-get-jit-size configure option, that sets
-	compile time flags to collect jit code size information,
-	that will be used as input for the "noinst size program".
-
-	* lib/jit_aarch64.c, lib/jit_arm.c, lib/jit_disasm.c,
-	lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_memory.c,
-	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c,
-	lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c: Minor
-	changes for the --enable-devel-get-jit-size build mode,
-	as well as the "production build mode" with jit code
-	size information.
-
-2013-09-14 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/lightning.c: Add the new
-	jit_pointer_p interface, that returns a boolean value
-	telling if the pointer argument is inside the jit
-	code buffer. This is useful to avoid the need to add
-	extra labels and calls to jit_address to figure bounds
-	of code buffer, and still keep internal data private.
-
-2013-09-13 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, include/lightning/jit_private.h,
-	lib/jit_note.c: Change the code argument of jit_get_note
-	to a jit_pointer_t and make jit_get_note a public interface.
-	It was intended so since start, as a way to map an offset
-	in the code to a function name, file name and line number
-	mapping.
-
-2013-09-11 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Correct reversed arguments in example of
-	usage in a (possibly) multi threaded, multiple jit_state_t
-	environments.
-
-	* include/lightning/jit_arm.h, include/lightning/jit_private.h,
-	lib/jit_arm-cpu.c, lib/jit_arm.c: Make a previously, non
-	documented, global state private to the related jit_state_t
-	generating code.
-
-2013-09-10 Paulo Andrade <pcpa@gnu.org>
-
-	* check/self.c, check/self.ok: New files implementing simple
-	consistency check assertions. At first validating some macros
-	that use values from different sources agree.
-
-	* check/Makefile.am: Update for the new test case.
-
-	* include/lightning.h,  lib/lightning.c: Add the new
-	jit_callee_save_p() call, that is intended to be used when
-	writing complex code using lightning, so that one does not
-	need to verify what backend is being used, or have access to
-	private data, to query if a register is callee save or not;
-	on several backends the scratch registers are actually callee
-	save.
-
-	* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
-	include/lightning/jit_hppa.h, include/lightning/jit_mips.h,
-	include/lightning/jit_ppc.h, include/lightning/jit_sparc.h,
-	include/lightning/jit_x86.h: Add an explicit definition for
-	JIT_R3-JIT_Rn, JIT_V3-JIT_Vn and JIT_F6-JIT_Fn when applicable.
-	This allows one to write code based on "#if defined(JIT_XN)"
-	and therefore, not need to check what is the current backend
-	or have access to private data structures. This is particularly
-	useful when writing virtual machines with several specialized,
-	global registers.
-
-	* lib/jit_ia64.c: Properly flag the callee save general
-	purpose registers as such, so that jit_callee_save_p() works
-	as intended.
-
-2013-09-10 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c, configure.ac: Conditionally use the
-	code written to workaround a bug in the Hercules emulator,
-	as isnan and isinf are not available at least on HP-UX ia64.
-
-2013-09-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_s390x-cpu.c: Spill/reload correct callee save
-	float registers.
-
-2013-09-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_hppa-cpu.c: Correct code to call a function stored
-	in a register or a patched function address.
-
-2013-09-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64-cpu.c: Correct incorrect logic when restoring
-	the value of the "r2" callee save register.
-
-2013-08-29 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm-cpu.c, lib/jit_arm.c: Correct wrong test and update
-	of the thumb offset information, when checking if needing to
-	patch a jump from arm to thumb mode. The problem would happen when
-	remapping the code buffer, and the new address being lower than
-	the previous one.
-
-2013-08-26 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac: Extend FreeBSD test to also handle NetBSD.
-
-	* lib/jit_x86-cpu.c: Correct wrongly defined offset type of
-	ldxi_ui. Problem detected when building on NetBSD.
-
-	* lib/lightning.c: Adjust code to handle NetBSD mremap,
-	where arguments do not match Linux mremap.
-
-2013-08-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc.c: Correct C sequence point problem miscalculating
-	the actual function address in a function descriptor. Problem
-	happens with gcc 4.8.1 at least.
-
-2013-08-11 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_s390x-cpu.c: Correct code checking if immediate
-	fits instruction, but using the negated value.
-
-2013-07-28 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_s390x.h, lib/jit_s390x-cpu.c,
-	lib/jit_s390x-fpu.c, lib/jit_s390x.c: New files
-	implementing the new s390x port.
-
-	* configure.ac, include/lightning.h,
-	include/lightning/Makefile.am,
-	include/lightning/jit_private.h,
-	lib/Makefile.am, lib/jit_disasm.c, lib/lightning.c:
-	Minor adaptation for the new s390x backend.
-
-	* check/float.tst: Update for the s390x result of
-	truncating +Inf to integer.
-
-	* check/qalu_mul.tst: Add extra test cases to better test
-	high word of signed multiplication as the result is
-	adjust from unsigned multiplication on s390x.
-
-2013-07-28 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c: Do not assume casting a double NaN or
-	Inf to float will produce the expected float NaN or Inf.
-	This is not true at least under s390x.
-
-2013-07-28 Paulo Andrade <pcpa@gnu.org>
-
-	* check/check.arm.sh, check/check.sh, check/check.swf.sh,
-	check/check.x87.sh: Properly check test programs output,
-	not just rely on the test program self testing the results
-	and not crashing.
-
-2013-07-28 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_aarch64.c: Remove unused macros left from cut&paste
-	of jit_arm.c.
-
-2013-07-16 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_aarch64.h, lib/jit_aarch64-cpu.c,
-	lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: New files
-	implementing the new aarch64 port, as a new architecture,
-	not as an expansion of the existing armv[4-7] port.
-
-	* check/lightning.c: Add aarch64 support and a small
-	change to recognize character constants as immediate
-	values.
-
-	* check/float.tst: Add aarch64 preprocessor conditionals
-	to select proper expected value when converting [+-]Inf
-	and NaN to integer.
-
-	* include/lightning/jit_arm.h, lib/jit_arm.c: Minor changes
-	to better match the new aarch64 files.
-
-	* configure.ac, include/lightning.h,
-	include/lightning/Makefile.am, include/lightning/jit_private.h,
-	lib/Makefile.am, lib/lightning.c: Minor adjustments
-	for the aarch64 port.
-
-2013-07-08 Paulo Andrade <pcpa@gnu.org>
-
-	* NEWS, THANKS, configure.ac, doc/version.texi: Update for
-	the 1.99a second alpha release.
-
-2013-06-25 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_mips.c: Correct cut&paste error that caused wrong
-	stack offset calculation for double arguments in stack in
-	the o32 abi.
-	Correct typo in the __LITTLE_ENDIAN macro name, that came
-	from cut&paste error in the original typo in lib/jit_ppc.c.
-
-	* lib/jit_ia64.c, lib/jit_ppc.c: Correct typo in the
-	__LITTLE_ENDIAN macro name.
-
-2013-06-22 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c, configure.ac, include/lightning.h,
-	lib/lightning.c: Add tests and quirks to build/detect
-	and/or work on Irix.
-
-	* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
-	lib/jit_mips-fpu.c, lib/jit_mips.c: Adapt code to run
-	in big endian mips, using the n32 abi.
-
-2013-06-18 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h: Minor extra preprocessor testing
-	to "detect" byte order on x86 solaris, that now builds
-	and pass all test cases.
-
-2013-06-18 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_sparc-cpu.c: Correct compiler warning of value
-	used before assignment. The usage is bogus as the api
-	requires always patching jumps, but the random value used
-	could cause an assertion due to invalid displacement.
-
-	* lib/jit_sparc.c: Always load and store double arguments
-	in stack as 2 float loads or stores, for safety, as unaligned
-	access is not allowed in Sparc Solaris.
-
-2013-06-14 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac: Force -mlp64 to CFLAGS on HP-UX ia64 port.
-	It is the only supported mode, and expects gcc as C compiler.
-
-	* include/lightning.h, lib/jit_ia64-cpu.c, lib/jit_ia64.c:
-	Correct ia64 port to work on HP-UX that runs it in big endian
-	mode.
-
-2013-06-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_hppa.c: Sanitize the cache synchronization inline
-	assembly code that was doing twice the work and redundantly
-	flushing the end address every loop iteration.
-
-2013-06-09 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac, check/Makefile.am, doc/Makefile.am: Do not
-	explicitly link to -ldl, but instead autodetect the library
-	with dlopen, dlsym, etc.
-
-	* check/lightning.c: Add workaround to apparently buggy
-	getopt in HP-UX that sets optind to the wrong index, and
-	use RTLD_NEXT on HP-UX instead of RTLD_DEFAULT to dlsym
-	global symbols.
-
-	* include/lightning.h: Rework definitions of wordsize and
-	byte order to detect proper values on HP-UX.
-
-	* lib/lightning.c: Minor correction to use MAP_ANONYMOUS
-	instead of MAP_ANON on HP-UX.
-
-	* lib/jit_hppa.c: Float arguments must be passed on integer
-	registers on HP-UX, not only for varargs functions.
-	  Add code to properly clear instruction cache. This was
-	not required on Debian hppa port, but may have been working
-	by accident.
-
-	* lib/jit_hppa-cpu.c: Follow pattern of HP-UX binaries and
-	use bve,n instead of bv,n to return from functions.
-
-	* lib/jit_hppa-fpu.c: For some reason "fst? frX,rX,(rY)" did
-	not work on the tested computer	(HP-UX B.11.23 U 9000/785 HP-UX)
-	so the code was changed, at first for __hpux only to add the
-	base and offset register and use the instruction with an
-	immediate (zero) offset.
-
-2013-06-07 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c, lib/jit_disasm.c, lib/jit_ppc-cpu.c,
-	lib/jit_ppc-fpu.c, lib/jit_ppc.c, include/lightning.h,
-	include/lightning/jit_ppc.h, include/lightning/jit_private.h:
-	Adapt code to work on 32 bit AIX ppc using gcc. Most changes
-	are basically to adapt the elf64 logic to 32 bit, as it does
-	not use the same convention of 32 bit Darwin ppc.
-
-	* check/stack.tst: Add a fake memcpy function to the test
-	case if running under AIX, as it is not available to dlsym.
-
-	* configure.ac: Check for getopt.h header, not available in
-	AIX.
-
-2013-06-01 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_hppa.h, lib/jit_hppa-cpu.c,
-	lib/jit_hppa-fpu.c, lib/jit_hppa.c: New files implementing
-	the hppa port. Built on Debian Linux PA-RISC 2.0, 32 bit.
-
-	* check/float.tst: Add preprocessor for hppa expected
-	values when converting NaN and +-Inf to an integer.
-
-	* check/ldst.inc: Ensure double load/store tests use an
-	8 byte aligned address by default.
-
-	* lib/lightning.c: Correct a bug found during tests in
-	the new port, where qmul* and qdiv* were not properly
-	setting one of the result registers as modified in the
-	function, what would be a problem if the only "write"
-	usage were the qmul* or qdiv*.
-
-	* check/varargs.tst, check/varargs.ok: Add one extra
-	interleaved integer/double test to validate proper code
-	generation in the extra case.
-
-	* check/lightning.c, configure.ac, include/lightning.h,
-	include/lightning/Makefile.am,
-	include/lightning/jit_private.h, lib/Makefile.am,
-	lib/jit_disasm.c: Update for the hppa port.
-
-2013-04-27 Paulo Andrade <pcpa@gnu.org>
-
-	* check/varargs.tst: Correct misplaced .align directive
-	that was causing the double buffer to not be aligned at
-	8 bytes.
-	* lib/jit_ia64-cpu.c:
-	  Properly implement abi for excess arguments passed on
-	stack.
-	  Simplify load/store with immediate displacement argument
-	with zero value.
-	  Simplify some calls to "subi" changing to "addi" with
-	a negative argument.
-	  Remove some #if 0'ed code, that could be useful in
-	special conditions, but the most useful one would be
-	to "optimize" "static" jit functions, but for the sake
-	of simplicity, jit functions are implemented in a way
-	that can be passed back to C code as C function pointers.
-	  Add an attribute to prototypes of several unused functions.
-	These functions are defined for the sake of implementing all
-	Itanium documented instructions, but a significant amount of
-	them is not used by lightning.
-	* lib/jit_ia64-fpu.c: Simplify load/store with zero immediate
-	displacement and add unused attribute for functions not used
-	by lightning, but required to provide macros implementing all
-	Itanium documented instructions.
-	* lib/jit_ia64.c: Update for the properly implemented abi
-	for stack arguments.
-	* lib/lightning.c: Mark an unused function as such.
-
-2013-04-27 Paulo Andrade <pcpa@gnu.org>
-
-	lib/jit_ia64-cpu.c:
-	  Correct immediate range check of integer comparisons when
-	inverting arguments.
-	  Correct gei_u that was not decrementing immediate when
-	inverting arguments.
-	  Correct b?add* and b?sub* that were not properly updating
-	the result register.
-
-2013-04-27 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64-cpu.c: Correct wrong mapping of 2 instructions
-	in "M-, stop, M-, stop" translation, that was ignoring the
-	last stop (implemented as a nop I- stop).
-
-	* lib/jit_ia64-fpu.c: Properly implement fnorm.s and fnorm.d,
-	as well as the proper integer to float or double conversion.
-
-2013-04-27 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64-cpu.c: Correct bogus implementation of ldr_T
-	for signed integers, that was using ld1.s, ld2.s and ld4.s.
-	The ".s" stands for speculative load, not sign extend.
-
-	* lib/jit_ia64-fpu.c: Correct bogus implementation of ldxr_T
-	for float and double. The third (actually, second) argument
-	is indeed added to the base register, but the base register
-	is modified. The actual M7 implementation was already correct,
-	just the ldxr_f and ldxr_d implementation that was kept in
-	a prototype state, misinterpreting what M7 does.
-
-2013-04-27 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64-cpu.c: Correct X2 pattern matching by preventing
-	it to attempt to require a stop between the L and the X
-	instruction; that is, check the registers and predicates
-	before emitting the L instruction, not after.
-
-	* lib/jit_ia64-fpu.c: Slightly simplify and correct
-	divr_f and divrd_d implementation.
-
-	* check/lightning.c: Add __ia64__ preprocessor define
-	on Itanium. 
-
-	* check/alu.inc, check/clobber.tst, check/float.tst: Define
-	several macros conditionally to __ia64__. This is required
-	because __ia64__ jit generation can use way too many memory,
-	due to not implementing instruction reordering to avoid
-	as much as possible "stops", what causes way too many nops
-	to be generated, as well as the fact that division and
-	remainder requires function calls, and float division
-	requires significant code to implement.
-
-2013-04-27 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h: Add new backend specific movr_w_d,
-	movr_d_w and movi_d_w codes as helpers to ia64 varargs
-	functions arguments.
-
-	* lib/jit_ia64-cpu.c:
-	  Correct wrong encoding of A5 small integers.
-	  Correct define of "mux" instruction modifiers.
-	  Correct ordering of arguments and predicates of cmp_xy
-	implementation with immediate arguments; like most other
-	codes with an immediate, the immediate is the second, not
-	the third argument.
-
-	* lib/jit_ia64-fpu.c: Actual implementation of the code
-	to move to/from gpr to/from fpr, to implement varargs abi.
-
-	* lib/jit_ia64.c: Make fpr argument registers not allocatable
-	as temporaries, no need for the extra checks when there are
-	plenty registers.
-
-	* lib/jit_print.c, lib/lightning.c: Minor updates for the
-	new movr_w_d, movr_d_w and movi_d_w codes.
-
-2013-04-26 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct code to
-	also insert a stop to break an instruction group if a
-	register is written more than once in the same group.
-	This may happen if a register is argument and result of
-	some lightning call (not a real instruction). The most
-	common case should be code in the pattern:
-		movl rn=largenum
-		...
-		mov rn=smallnum
-	where "rn" would end up holding "largenum".
-	But the problem possibly could happen in other circumstances.
-
-2013-04-26 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
-	lib/jit_ia64-fpu.c, lib/jit_ia64.c:
-	  Relocate JIT_Rn registers to the local registers, as, like
-	float registers, div/rem and sqrt are implemented as function
-	calls, and may overwrite non saved scratch registers.
-	  Change patch_at to receive a jit_code_t instead of a
-	jit_node_t, so that it is easier to "inline" patches when
-	some instruction requires complex code to implement, e.g.
-	uneq and ltgt.
-	  Correct arguments to FMA and FMA like instructions that,
-	due to a cut&paste error were passing the wrong argument
-	to the related F- implementation function.
-	  Rewrite ltgt to return the proper result if one (or both)
-	of the arguments is unordered.
-
-2013-04-26 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_ia64.h, include/lightning/jit_private.h,
-	lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c,
-	lib/lightning.c: Rework code to detect need of a "stop" to
-	also handle predicates, as if a predicate is written, it
-	cannot be read in the same instruction group.
-	  Use a single jit_regset_t variable for all registers when
-	checking need for a stop (increment value by 128 for
-	float registers).
-	  Correct wrong "subi" implementation, as the code executed
-	is r0=im-r1, not r0=r1-im.
-	  Use standard lightning 6 fpr registers, and rework to
-	use callee save float registers, that may be spill/reloaded
-	in prolog/epilog. This is required because some jit
-	instructions implementations need to call functions; currently
-	integer div/mod and float sqrt, what may change the value of
-	scratch float registers.
-	  Rework point of "sync" of branches that need to return a
-	patch'able address, because the need for a "stop" before a
-	predicate read causes all branches to be the instruction
-	in slot 0, as there is no template to "stop" and branch
-	in the same instruction "bundle".
-
-2013-04-25 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
-	lib/jit_ia64-fpu.c, lib/jit_ia64.c: New files implementing
-	the basic infrastructure of an Itanium port. The code
-	compiles and can generate jit for basic hello world like
-	functions.
-
-	* check/lightning.c, configure.ac, include/lightning.h,
-	include/lightning/Makefile.am, include/lightning/jit_private.h,
-	lib/Makefile.am, lib/lightning.c: Update for the Itanium
-	port.
-
-	* lib/jit_mips-cpu.c, lib/jit_mips.c: Correct typo and
-	make the jit_carry register local to the jit_state_t.
-	This matches code reviewed in the Itanium port, that
-	should use the same base logic to handle carry/borrow.
-
-2013-04-10 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, lib/jit_arm.c,
-	lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c,
-	lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
-	lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
-	lib/lightning.c: Change all jit_regset macros to take
-	a pointer argument, to avoid structure copies when
-	adding a port to an architecture with more than 64
-	registers.
-
-2013-04-08 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache
-	aligning to the next page boundary the end argument. It may
-	actually truncate it.
-
-2013-03-29 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c,
-	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c,
-	lib/lightning.c: Do not start over jit generation if can grow
-	the code buffer with mremap without moving the base pointer.
-
-2013-03-29 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_memory.c: Implement a simple memory allocation wrapper
-	to allow overriding calls to malloc/calloc/realloc/free, as well
-	as ensuring all memory containing pointers is zero or points to
-	allocated memory.
-
-	* include/lightning.h, include/lightning/jit_private.h: Definitions
-	for the memory allocation wrapper.
-
-	* lib/Makefile.am: Update for new jit_memory.c file.
-
-	* lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_note.c,
-	lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c:
-	Use the new memory allocation wrapper code.
-
-2013-03-22 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac, include/lightning/jit_private.h, lib/lightning.c:
-	Remove dependency on gmp. Only a simple bitmap was required, and
-	that was not enough reason to force linking to gmp and possible
-	complications caused by it.
-
-2013-03-10 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h: Add check for __powerpc__ defined
-	in Linux, while Darwin defines __ppc__.
-
-	* include/lightning/jit_ppc.h: Adjust register definitions
-	for Darwin 32 bit and Linux 64 bit ppc usage and/or ABI.
-
-	* include/lightning/jit_private.h: Add proper check for
-	Linux __powerpc__ and an data definition for an workaround
-	to properly handle code that starts with a jump to a "main"
-	label.
-
-	* lib/jit_disasm.c: Add extra disassembler initialization
-	for __powerpc64__.
-
-	* lib/jit_ppc-cpu.c: Add extra macros and functions, and
-	correct/adapt previous ones to handle powerpc64.
-
-	* lib/jit_ppc-fpu.c: Adapt for 64 bit wordsize. Basically
-	add conversion from/to int32/int64 and proper handling of
-	load/store offsets too large for 32 bit.
-
-	* lib/jit_ppc.c: Add calls to 64 bit codes and adaptation
-	for the PowerPC 64 bit Linux ABI.
-
-	* lib/jit_arm.c, lib/jit_mips.c, lib/jit_sparc, lib/jit_x86.c,
-	lib/lightning.c: Correct off by one error when restarting jit
-	of a function due to finding too late that needs to spill/reload
-	some register. Problem was found by accident on a very special
-	condition during PowerPC 64 code adaptation.
-
-2013-03-08 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c: Add missing ppc preprocessor definition.
-
-2013-03-06 Paulo Andrade <pcpa@gnu.org>
-
-	* check/float.tst: Comment out the int to negative infinity
-	test in mips for the moment because not all Loongson agrees
-	on the result.
-
-	* lib/jit_disasm.c: Add a test instead of an assertion
-	when loading symbols for disassembly due to a failure with
-	a simple binutils build in Debian mipsel64.
-
-2013-03-06 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, lib/jit_arm-cpu.c,
-	lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips-cpu.c,
-	lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc-cpu.c,
-	lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
-	lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
-	lib/lightning.c: Add an extra structure for data storage
-	during jit generation, and release it after generating
-	jit, to reduce a bit memory usage, and also to make it
-	easier to understand what data is available during
-	jit runtime.
-
-2013-03-06 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Make data and code buffer readonly.
-
-2013-02-20 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Fool proof validate the examples of what
-	an assembly-language programmer would write and correct the
-	wrong sparc example.
-
-2013-02-19 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Add back the SPARC code generation example.
-
-2013-02-19 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c: Remove state flag to work with partial
-	sparc port, by just disassembling if there was incomplete
-	code generation.
-
-	* jit_sparc-cpu.c: Correct wrong range check for immediate
-	integer constants (off by one bit shift).
-	  Correct macro implementing equivalent "rd %y, rd" assembly.
-	  Implement qmul* and qdiv*.
-
-	* jit_sparc.c: Update for qmul* and qdiv* and remove logic
-	to handle incomplete code generation during sparc port.
-
-2013-02-18 Paulo Andrade <pcpa@gnu.org>
-
-	* check/float.tst: Add sparc to list of known NaN and +-Inf
-	to integer conversion.
-
-	* check/lightning.c: Define __sparc__ to preprocessor in
-	the sparc backend.
-
-	* include/lightning/jit_private.h: Correct wrong definition
-	of emit_stxi_d, that has lived for a long time, but would
-	cause problems whenever needing to spill/reload a float
-	register.
-
-	* include/lightning/jit_sparc.h: Can only use %g2,%g3,%g4
-	for scratch variables, as other "global" registers are
-	reserved for the system, e.g. libc.
-	  Reorder float register naming to make it easier to
-	access odd float registers, so that generating code for
-	pusharg and getarg is easier for the IR.
-
-	* lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c: Update to match
-	new code in jit_sparc-cpu.c. It must call jit_get_reg
-	with jit_class_nospill if using the register to move
-	an unconditional branch address to it, as the reload
-	will not happen (actually could happen in the delay
-	slot...)
-
-	* lib/jit_sparc-cpu.c: Correct wrong macro definition for
-	ldxr_s.
-	  Properly implement div* and implement rem. Div* needs
-	to use the y register, and rem* needs to be synthesized.
-	  Correct b?sub* macro definitions.
-
-	* lib/jit_sparc-fpu.c: Correct reversed float to/from double
-	conversion.
-	  Correct wrong jit_get_reg call asking for a gpr and then
-	using the fpr with that number.
-	  Correct wrong branch displacement computation for
-	conditional branches.
-
-	* lib/jit_sparc.c: Correct getarg_d and pushargi_d implementation.
-	  Add rem* entries to the switch converting IR to machine code.
-
-	* lib/lightning.c: Correct a problem detected when adding
-	the jit_class_nospill flag to jit_get_reg, that was caused
-	when having a branch to an "epilog" node, what would cause
-	the code to think all registers in unknown state were live,
-	while in truth, all registers in unknown state in the
-	"just after return" point are actually dead.
-
-2013-02-17 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c,
-	lib/jit_sparc-fpu.c, lib/jit_sparc.c: New files implementing
-	the basic framework of the sparc port.
-
-	* configure.ac, include/lightning.h, include/lightning/Makefile.am,
-	include/lightning/jit_private.h, lib/jit_disasm.c: Update
-	for the sparc port framework.
-
-	* lib/jit_mips.c: Correct reversed retr/reti logic.
-
-	* lib/jit_ppc.c: Correct misspelled __LITTLE_ENDIAN.
-
-	* lib/lightning.c: Always do byte hashing in hash_data, because
-	the logic to "compress" strings causes large pointers to not
-	be guaranteed aligned at 4 byte boundaries.
-	  Update for the sparc port framework.
-
-2013-02-11 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Correct jit_pushargi_f in the arm hardfp abi.
-	Most of the logic uses even numbered register numbers, so that
-	a float and a double can be used in the same register, but
-	the abi requires packing the float arguments, so jit_pushargi_f
-	needs to allocate a temporary register to modify only the
-	proper register argument (or be very smart to push two
-	immediate arguments if applicable).
-
-2013-02-11 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/lightning.c: Implement the new
-	jit_clear_state and jit_destroy_state calls. jit_clear_state
-	releases all memory not required during jit_execution; that
-	is, leaves only the mmap'ed data and code buffers allocated.
-	jit_destroy_state releases the mmap'ed buffers as well as
-	the jit_state_t object itself, that holds pointers to the
-	code and data buffers, as well as annotation pointers (for
-	disassembly or backtrace) in the data buffer.
-
-	* lib/jit_note.c: Correct invalid vector offset access.
-
-	* check/ccall.c, check/lightning.c, doc/ifib.c, doc/incr.c,
-	doc/printf.c, doc/rfib.c, doc/rpn.c: Use the new jit_clear_state
-	and jit_destroy_state calls, to demonstrate the new code to
-	release all jit memory.
-
-	* doc/body.texi: Add basic documentation and usage description
-	of jit_clear_state and jit_destroy_state.
-
-2013-02-11 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_private.h, lib/jit_note.c, lib/lightning.c:
-	  Store all annotation information in the mmap'ed area reserved for
-	read only data. This adds code to not allocate memory for jit_note_t
-	objects, and to	relocate jit_line_t objects and its contents after
-	calculating annotation information. The jit_line_t objects are
-	relocated because it is not possible to always calculate before
-	hand data layout because note information may be extended or
-	redundant entries removed, as well as allowed to be added in
-	non sequential order.
-	  A bug was also corrected in _jit_set_note, that was causing it
-	to allocate new jit_line_t objects when not needed. It was still
-	working correctly, but allocating way more memory than required.
-
-2013-02-05 Paulo Andrade <pcpa@gnu.org>
-
-	*include/lightning.h, lib/lightning.c: Add the new jit_live code
-	to explicitly mark a register as live. It is required to avoid
-	assuming functions always return a value in the gpr and fpr return
-	register, and to avoid the need of some very specialized codes
-	that vary too much from backend to backend, to instruct the
-	optimization code the return register is live.
-
-	* lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
-	lib/jit_x86.c: Update for the new jit_live code.
-
-	* check/ret.ok, check/ret.tst: New files implementing a simple
-	test case that would previously fail at least in ix86/x86_64.
-
-	* check/Makefile.am: Update for new "ret" test case.
-
-2013-02-05 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Validate and correct
-	problems in the qmul and qdiv ppc implementation.
-
-2013-02-04 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, include/lightning/jit_private.h,
-	lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_mips-cpu.c,
-	lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c,
-	lib/jit_x86-cpu.c, lib/jit_x86.c, lib/lightning.c:
-	Implement the new qmul and qdiv instructions that return signed
-	and unsigned lo/hi multiplication result and div/rem division result.
-	These should be useful for jit translation of code that needs to
-	know if a multiplication overflows (no branch opcode added) or if
-	a division is exact (easy check if remainder is zero).
-
-	* check/lightning.c, lib/jit_print.c, check/Makefile.am,
-	check/all.tst: Update for the new qmul and qdiv instructions.
-
-	* check/qalu.inc, check/qalu_div.ok, check/qalu_div.tst,
-	check/qalu_mul.ok, check/qalu_mul.tst: New files implementing
-	simple test cases for qmul and qdiv.
-
-2013-01-30 Paulo Andrade <pcpa@gnu.org>
-
-	* doc/body.texi: Correct "jmpi" description that incorrectly
-	told it was possible to pass any address as jump target. The
-	only way to do that is "movi+jmpr".
-
-2013-01-30 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-cpu.c: Correct undefined behavior code.
-	http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56143
-
-2013-01-29 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER
-	to have HAVE_CONFIG_H defined with latest aclocal.
-
-	* include/lightning/jit_private.h, lib/lightning.c: Add new
-	abstraction to use an heuristic to calculate amount of space
-	required for jit generation, and code to reallocate buffer if
-	did miscalculate it.
-
-	* lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c:
-	Update to use new code to estimate and resize of required buffer
-	for jit code.
-
-	* lib/jit_x86-cpu.c: Minor cosmetic change to avoid adding a
-	non required rex prefix when calling a function pointer stored
-	in a register.
-
-2013-01-24 Paulo Andrade <pcpa@gnu.org>
-
-	* check/Makefile.am: "make debug" target should pass only
-	the main test tool program as argument for running gdb
-
-	* configure.ac: Add the --enable-assertions options.
-
-	* doc/Makefile.am, doc/body.texi, doc/lightning.texi:
-	Major rewrite of the documentation to match the current
-	implementation.
-
-	* doc/version.texi: Automatic date update.
-
-	* doc/ifib.c, doc/incr.c, doc/printf.c, doc/rfib.c, doc/rpn.c:
-	Implementation of the documentation examples, that are also
-	compiled during a normal build.
-
-	* doc/p-lightning.texi, doc/porting.texi, doc/toc.texi,
-	doc/u-lightning.texi, doc/using.texi: These files were
-	renamed in the documentation rewrite, as the documentation
-	was significantly trimmed due to full removal of the porting
-	chapters. Better porting documentation should be added but
-	for the moment it was just removed the documentation not
-	matching the implementation.
-
-2013-01-18 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_note.c: Correct bounds check and wrong code keeping
-	a pointer that could be changed after a realloc call.
-
-2013-01-18 Paulo Andrade <pcpa@gnu.org>
-
-	* check/3to2.tst, check/add.tst, check/allocai.tst, check/bp.tst,
-	check/call.tst, check/ccall.c, check/clobber.tst, check/divi.tst,
-	check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst,
-	check/ldstxi-c.tst, check/ldstxi.tst, check/ldstxr-c.tst,
-	check/ldstxr.tst, check/lightning.c, check/rpn.tst, check/stack.tst,
-	check/varargs.tst, include/lightning.h,
-	include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_disasm.c,
-	lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc.c, lib/jit_print.c,
-	lib/jit_x86.c, lib/lightning.c:	Extend the "jit_note" abstraction
-	with the new "jit_name" call, that receives a string argument, and
-	should usually be called to mark boundaries of functions of code
-	generating jit (that is, it is not expected that the language
-	generating jit map its functions to jit functions).
-
-2013-01-17 Paulo Andrade <pcpa@gnu.org>
-
-	* check/add.tst, check/allocai.tst, check/bp.tst, check/divi.tst,
-	check/fib.tst, check/lightning.c, include/lightning/jit_arm.h,
-	include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
-	include/lightning/jit_private.h, include/lightning/jit_x86.h:
-	Make JIT_RET, JIT_FRET and JIT_SP private. These should not be
-	used in any operations due to frequently having special
-	constraints (usually JIT_FRET). JIT_FP must be made available
-	because it must be used as the base register to access stack
-	space allocated with jit_allocai.
-
-2013-01-14 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/lightning.c: Add an extra align
-	argument to the jit_data call (that should be made private),
-	so that it should not align strings at 8 bytes.
-	  Correct the jit_note call to include the null ending byte
-	when adding label/note names to the "jit data section".
-
-2013-01-11 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_note.c: New file implementing a simple string+integer
-	annotation, that should be used to map filename and line number
-	to offsets in the generated jit.
-
-	* include/lightning.h, lib/lightning.c: Update for the new
-	note code.
-	  Add an extra mandatory argument to init_jit, that is used
-	as argument to bfd_openr.
-	  Change from generic void* to char* the argument to jit_note
-	and add an extra integer argument, to map to filename and
-	line number.
-
-	* check/ccall.c, check/lightning.c, include/lightning/jit_private.h,
-	lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_ppc.c,
-	lib/jit_print.c, lib/jit_x86.c: lib/Makefile.am: Update for the
-	new annotation code.
-
-	* configure.ac, check/Makefile.am: Update to work with latest
-	automake.
-
-2013-01-09 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/jit_arm.c, jit_mips-fpu.c,
-	lib/jit_mips.c, lib/jit_print.c, lib/jit_x86.c, lib/lightning.c:
-	Remove the jit_code_getarg_{f,d} and jit_code_pusharg{i,r}_{f,d}
-	calls, replacing them with the new, internal only, jit_movr_w_f,
-	jit_mov{r,i}_f_w, jit_movr_ww_d, and jit_mov{i,r}_d_ww, that
-	better describe the operation being done, and allow removing
-	the hackish code to detect special conditions for arm when
-	moving from/to vfp from/to a grp register pair.
-	Rename jit_code_retval_{f,d} to jit_code_x86_retval_{f,d} as
-	it is specific to 32 bit x86, and used to move abi return
-	value in x87 register to a sse register.
-
-2013-01-05 Paulo Andrade <pcpa@gnu.org>
-
-	* check/cccall.c, check/ccall.ok: New test case to validate
-	interleaved calls from/to C code and jit.
-
-	* check/Makefile.am: Update for the new ccall test case.
-
-	* include/lightning.h, lib/lightning.c: Add the new jit_address
-	call that returns the real/final address of a "note" in the
-	generated jit. It requires a jit_node_t as returned by the
-	jit_note call, and is only valid after calling jit_emit.
-	  Add an intermediate solution to properly handle arm
-	soft and softfp modes that move a double to an integer register
-	pair. Currently it just adds extra tests for the condition,
-	but the proper solution should be to have extra lightning
-	codes for these conditions, codes which should be only used
-	by the backends that need it, and merged with the existing
-	jit_pusharg*_{f,d}.
-
-	* include/lightning/jit_private.h: Add new jit_state_t flag
-	to know it finished jit_emit, so that calls to jit_address
-	are valid.
-
-	* lib/jit_mips.c: Correct abi implementation so that the
-	new ccall test case pass. Major problem was using
-	_jit->function.self.arg{i,f} as boolean values, but that
-	would cause lightning.c:patch_registers() to incorrectly
-	assume only one register was used as argument when calling
-	jit_regarg_p(); _jit->function.self.arg{i,f} must be the
-	number of registers used as arguments (in all backends).
-
-	* lib/jit_x86.c: Add workaround, by marking %rax as used,
-	to a special condition, when running out of registers and the
-	allocator trying to spill and reload %rax, but %rax was used
-	as a pointer to a function, what would cause the reload to
-	destroy the return value. This condition can be better
-	generalized, but the current solution is good enough.
-
-	* include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c, lib/jit_ppc.c:
-	Rewrite logic to handle arguments, as the original code was
-	written based on a SysV pdf about the generic powerpc ABI,
-	what did "invent" a new abi for the previous test cases, but
-	failed in the new ccall test in Darwin PPC. Now it properly
-	handles 13 float registers for arguments, as well as proper
-	computation of stack offsets when running out of registers
-	for arguments.
-
-2013-01-02 Paulo Andrade <pcpa@gnu.org>
-
-	* check/float.tst: Correct test case to match ppc also
-	converting positive infinity to 0x7fffffff.
-
-	* lib/jit_arm-swf.c: Correct typos with double underscores.
-
-	* lib/lightning.c: Correct remaining wrong reverse jump logic.
-
-2012-12-29 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Correct both, wrong and confusing logic
-	to compute the reverse of a jump. Now it properly matches
-	C semantics for "eq" (==) and "ne" (!=) and correct computation
-	of reverse of "uneq" as "gt".
-
-	* check/branch.tst: Update "ne" float branch check that
-	previously happened to be wrongly tested with a NaN argument.
-
-2012-12-29 Paulo Andrade <pcpa@gnu.org>
-
-	* check/float.ok, check/float.tst: New test cases implementing
-	extensive validation of float comparison and branch code
-	generation as well as integer conversion, involving NaN and
-	[+-]Inf.
-
-	* lib/jit_arm-swf.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
-	Correct bugs found by new float test case.
-
-	* lib/jit_x86.c: Correct cut&paste error added in commit to
-	convert jit_arg* return value to a jit_node_t*,	that would
-	cause it to not properly handle double arguments in ix86.
-
-	* check/Makefile.am: Update for the new test case.
-
-2012-12-28 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c, include/lightning.h, lib/jit_arm.c,
-	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,	lib/jit_x86.c,
-	lib/lightning.c: Change return value of jit_arg{,_f,_d} to
-	a jit_node_t* object, that should be used as argument to
-	jit_getarg_{c,uc,s,us,i,ui,l,f,d}. This just requires changing
-	from jit_int32_t to jit_pointer_t (or jit_node_t*) the "handle"
-	for the getarg calls, with the benefit that it makes it easy
-	to implement patching of the stack address of non register
-	arguments, this way allowing to implement variable size stack
-	frames if applicable; useful if there are too many registers and
-	jit functions uses only a few callee save registers.
-
-2012-12-27 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
-	regressions when patching jit_calli for a forward function.
-
-	* lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
-	in jit_getarg_u{c,s} implementation.
-
-2012-12-23 Paulo Andrade <pcpa@gnu.org>
-
-	* check/call.ok, check/call.tst: New test cases to validate
-	simple typed argument and return values in function calls.
-
-	* check/lightning.c: Properly handle jit_movi of labels for
-	backward and forward code labels.
-
-	* check/Makefile.am: Update for new test case.
-
-2012-12-23 Paulo Andrade <pcpa@gnu.org>
-
-	* check/carry.ok, check/carry.tst: New test case to validate
-	carry condition handling.
-
-	* check/Makefile.am: Update for new test case.
-
-2012-12-22 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Implement logic for
-	jit_htonr for big endian, so that ppc (big endian) pass the
-	new clobber.tst test case.
-
-2012-12-22 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm.c: Correct use of wrong argument offset
-	variable in armv7l or float/double argument for varargs
-	function in armv7hl.
-	  Correct jit_getarg* logic in software float mode to
-	match expected behavior in other backends, that is, if
-	a function is not called, it is safe to use a few lightning
-	calls before a next jit_getarg* call, as done in the test
-	case check/stack.tst. The proper solution should be to
-	extend the parser in lib/lightning.c to check if there is
-	some float operation that will call some (libgcc?) function,
-	but software float arm should be a very uncommon backend for
-	lightning, so, just load the already in place arguments
-	saved to stack, assuming the register argument was clobbered
-	(what should not be the case most times...).
-
-2012-12-22 Paulo Andrade <pcpa@gnu.org>
-
-	* check/clobber.ok, check/clobber.tst: New test case doing
-	extensive validation tests to ensure registers not used in
-	a operation are not clobbered.
-
-	* check/Makefile.am: Update for new test case.
-
-2012-12-21 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/lightning.c: Partially rewrite/revert code to compute
-	initial	register live state at the start of a basic block.
-	The original logic was corrupted when adding optimizations
-	to do as few computations as possible in jit_update. The
-	reglive field must be always a known set of live registers
-	at the start of a basic block. The value that was incorrect
-	was the regmask field, that must be the set of registers
-	that are in unknown state, because they are not known live,
-	neither set (or possibly not set) in the basic block, and
-	*must* store the state at the start of the basic block.
-
-2012-12-20 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_ppc.h: Correct mismatch of JIT_F{1,5}
-	with enum codes, that were correct, and returned by jit_f().
-
-	* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: Properly
-	implement and better describe values when generating stack
-	frames.
-
-2012-12-18 Paulo Andrade <pcpa@gnu.org>
-
-	* check/stack.ok, check/stack.tst: New files to test data
-	integrity on a deep chain of stack frames.
-
-	* lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
-	lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
-	lib/jit_x86.c, lib/jit_x86-cpu.c: Calculate _jit->function->stack
-	in the emit stage, otherwise it will calculate it wrong if
-	need to jit_allocai space to spill registers.
-
-	* lib/lightning.c: Correct wrong offset when updating the
-	"current" jit function pointer in the code that may need to
-	allocate stack space to spill registers.
-
-	* check/lightning.c: Correct off by one data space check.
-
-	* check/Makefile.am: Update for new test case.
-
-2012-12-17 Paulo Andrade <pcpa@gnu.org>
-
-	* check/fop_abs.ok, check/fop_abs.tst, check/fop_sqrt.ok,
-	check/fop_sqrt.tst: New files implementing simple test cases
-	for the extra float operations.
-
-	* check/Makefile.am: Update for new test cases.
-
-	* check/alu.inc: Add an extra macro to check for unordered
-	equality on tests where it is expected to use NaN as an
-	argument.
-
-	* check/lightning.c: Minor change for proper/common argument
-	syntax handling ommiting arguments to options.
-
-2012-12-17 Paulo Andrade <pcpa@gnu.org>
-
-	* check/Makefile.am: Automatically generate pattern list
-	of tests with alternate jit generation options. This should
-	prevent typos and needing to change multiple places after
-	a change.
-
-2012-12-14 Paulo Andrade <pcpa@gnu.org>
-
-	* check/lightning.c: Remove the ".cpu name value" syntax,
-	as it was not able to do proper changes before the jit
-	internal data structure was initialized. Now it supports
-	several getopt options to force using different jit
-	generation options, effectively replacing the previous
-	syntax.
-
-	* check/run-test: Add simple extra logic to handle differently
-	named test scripts, used to test things like x87 coprocessor
-	in ix86, and arm instruction set or software float in armv7l.
-
-	* configure.ac: Add some AC_RUN_IFELSE calls to figure at
-	compile time if can test different code generation options,
-	and update Makefile generation accordingly.
-
-	* check/Makefile.am, lib/jit_arm.c, lib/jit_x86.c: Update to
-	properly work with the test tool updating the jit_cpu global
-	information.
-
-	* check/check.arm.sh, check/check.swf.sh, check/check.x87.sh:
-	New wrapper files passing -mthumb=0, mvfp=0 and -mx87=1 to
-	the test tool, if applicable, so that it can validate alternate
-	code generation options on test hosts that support them.
-
-2012-12-14 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-x87.c, lib/jit_x86.c: Correct test cases in ix86
-	when using the x87 coprocessor instead of sse2+.
-
-2012-12-14 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, include/lightning/jit_private.h,
-	lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c,
-	lib/lightning.c: Make jit_ellipsis implementation not
-	backend specific. It is not intended to handle va_list
-	like objects at runtime, as jit_arg* and jit_getarg*
-	return constant values resolved at parse time, so, effectively
-	it is not possible to create printf like jit functions, as
-	there is no va_start, va_arg, va_end, etc, abstraction. This
-	limitation should be kept for the sake of making new ports
-	easier.
-
-2012-12-14 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/lightning.c: Add two extra wrapper
-	functions to avoid need for excess pointer to/from word casts.
-
-	* check/lightning.c: Only need for pointer to/from word cast
-	now is jit_movi, update accordingly.
-
-2012-12-13 Paulo Andrade <pcpa@gnu.org>
-
-	* check/varargs.ok, check/varargs.tst: New test cases implementing
-	simple varargs calls with a large amount of arguments to exercise
-	excess arguments on stack.
-
-	* include/lightning.h: Include config.h if HAVE_CONFIG_H is
-	defined.
-
-	* lib/jit_arm.c: Allocate a fpr register, not a gpr one for
-	temporary when pushing varargs arguments in the stack.
-
-	* lib/jit_arm-swf.c: Correct code changing the wrong offset
-	in jit_absr_d and jit_negr_d in software float.
-
-	* lib/jit_mips.c: Correct calculation of offsets of arguments
-	on stack.
-
-	* lib/jit_ppc.c: Correct bogus logic for "next" offset of arguments
-	on stack and adjust for fixed offset of stack arguments.
-
-2012-12-12 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning.h, lib/jit_arm.c, lib/jit_mips.c,
-	lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Change jit_prepare
-	to no longer receive an argument. If receiving an argument, it
-	should be an ABI specifier, not a boolean if varargs or not,
-	and add the new jit_ellipsis call, to specify where the
-	ellipsis is in the C prototype of the function being called.
-	Note that currently it is not supported to define varargs
-	functions and it will be ignored if calling jit_ellipsis not
-	in a prepare/finish* block, but this should be addressed.
-
-	* check/allocai.tst, check/alu_add.tst, check/alu_and.tst,
-	check/alu_com.tst, check/alu_div.tst, check/alu_lsh.tst,
-	check/alu_mul.tst, check/alu_neg.tst, check/alu_or.tst,
-	check/alu_rem.tst, check/alu_rsh.tst, check/alu_sub.tst,
-	check/alu_xor.tst, check/alux_add.tst, check/alux_sub.tst,
-	check/bp.tst, check/branch.tst, check/cvt.tst, check/divi.tst,
-	check/fib.tst, check/ldsti.tst, check/ldstr-c.tst,
-	check/ldstr.tst, check/ldstxi-c.tst, check/ldstxi.tst,
-	check/ldstxr-c.tst, check/ldstxr.tst, check/rpn.tst,
-	check/lightning.c: Update for the change to jit_prepare and
-	addition of jit_ellipsis.
-
-2012-12-11 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc-cpu.c: Make movr a function that checks arguments
-	so that other code can safely assume it is a noop if src and dst
-	are the same register.
-	  Implement rem{r,i}{,_u} as a div{,u}/mul/sub.
-	  Correct ANDIS, ORIS and XORIS calls to cast the argument to
-	unsigned before the shift to avoid an assertion if the argument
-	had the topmost bit set.
-	  Implement lshi, rshi and rshi_u as functions to test for a
-	zero argument, that would otherwise trigger an assertion when
-	computing the shift value.
-	  Do a simple implementation of bm{s,c}{r,i} with a temporary,
-	"andr" of arguments and jump based on comparison with zero.
-	  Correct typo in ldxi_c.
-
-	* lib/jit_ppc-fpu.c: Correct wrong arguments to FDIV* and STF*.
-
-	* lib/jit_ppc.c: Correct wrong check for 6 instead of 8 integer
-	arguments in registers. If calling a varargs function and
-	passing a float or double argument, also either store the
-	value in the stack or in integer registers, as varargs functions
-	do not fetch it from float registers.
-	  Add "case" for new functions and incorrectly missing ones.
-	  Call libgcc's __clear_cache, that should know what to do
-	if the hardware needs flushing cache before execution.
-
-	* lib/lightning.c: Do a simple/trivial logic in jit_regset_scan1,
-	that should make it easier for the compiler to optimize it, and
-	that also corrects the previously wrong code for big endian, and
-	that was causing problems in ppc due to not saving all callee save
-	registers as it was not "finding" them in the regset due to the
-	little endian assumption bug.
-
-2012-12-11 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac: Only default to using the builtin disassembler
-	if on GNU/Linux. This should be temporary, due to requiring
-	/proc/self/exe.
-	  Correctly check $target_cpu for powerpc.
-
-	* include/lightning/jit_ppc.h: Correctly implement jit_v_num.
-
-	* include/lightning/jit_private.h: Declare proper prototype
-	for jit_init_debug and jit_finish_debug.
-
-	* lib/jit_ppc-cpu.c: Remove code to save/restore callee save
-	float registers, as it is not required since those float
-	registers are not usable currently.
-	  Change prolog and epilog generation to, at least comparing
-	code, match what gcc generates in "gcc -O0", but it is still
-	failing in Darwin PPC, apparently due to the __clear_cache
-	call not being enough, as frequently it will also fail to
-	execute, and the code buffer is all zeroes.
-
-	* lib/lightning.c: Do not fail in jit_regset_scan1 calls due
-	to passing 64 as argument on computers with 64 registers.
-
-2012-12-10 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_mips-cpu.c: Correct all current test cases.
-	  Call the "xori" not the "XORI" macro for jit_xori implementation,
-	as the XORI macro handles only 16 bit unsigned values.
-	  Call the "movr" macro, not the "movi" macro in the special
-	case of adding or subtracting zero.
-	  Use the proper temporary register in the jit_andr implementation.
-
-2012-12-09 Paulo Andrade <pcpa@gnu.org>
-
-	* check/alu.inc, check/alu_add.ok, check/alu_add.tst,
-	check/alu_and.ok, check/alu_and.tst, check/alu_com.ok,
-	check/alu_com.tst, check/alu_div.ok, check/alu_div.tst,
-	check/alu_lsh.ok, check/alu_lsh.tst, check/alu_mul.ok,
-	check/alu_mul.tst, check/alu_neg.ok, check/alu_neg.tst,
-	check/alu_or.ok, check/alu_or.tst, check/alu_rem.ok,
-	check/alu_rem.tst, check/alu_rsh.ok, check/alu_rsh.tst,
-	check/alu_sub.ok, check/alu_sub.tst, check/alu_xor.ok,
-	check/alu_xor.tst, check/alux_add.ok, check/alux_add.tst,
-	check/alux_sub.ok, check/alux_sub.tst, check/branch.ok,
-	check/branch.tst: New test cases for arithmetic and branch
-	tests.
-
-	* check/Makefile.am: Update for new test cases.
-
-	* include/lightning/jit_private.h: Make the jit_reg_free_p
-	macro shared by all backends. Previously was added for the
-	arm backend, but is useful in the x86_64 backend when checking
-	state of "special purpose register".
-	Also add the new jit_class_named register class, that must be
-	or'ed with the register value if calling jit_get_reg expecting
-	an specific value, because the specific register value may be
-	zero, that previously was treated as no register requested.
-
-	* lib/jit_arm-cpu.c: Correct argument order for T2_MVN.
-
-	* lib/jit_arm-swf.c: Call the proper function for double
-	divide. The "software float" implementation just calls
-	libgcc functions.
-
-	* lib/jit_arm.c: Return float/double values in the float
-	register if using the hard float ABI.
-
-	* lib/jit_x86-cpu.c: Change the can_sign_extend_int_p macro
-	to not include -0x80000000L, because there is code that
-	"abuses" it and thinks it can negate the immediate value
-	after calling that macro.
-	  Correct implementation of jit_subi that had a wrong code
-	patch logic doing subtraction with reversed arguments.
-	  Correct REX prefix calculation in the jit_muli implementation.
-	  Correct logic to get/unget %*ax and %*dx registers in divremr
-	and divremi.
-	  Correct divremi that was using the symbolic, unique %*ax
-	value in on place (not using the _REGNO name suffix).
-	  Correct cut&paste error causing it to use "xor" instead of
-	"or" in one code path of the jit_ori implementation.
-	  Correct several flaws when clobbering registers and/or when
-	one of the arguments was %*cx in the rotshr wrapper function
-	implementing most shift operations.
-
-	* lib/lightning.c: No longer expect that the backend be smart
-	enough to know what to do when asking for a named register
-	if that register is already an argument or is live. It fails
-	if it is an argument, or if register is live, fails if cannot
-	spill.
-	  No longer incorrectly assume that eqr_{f,d} and ltgr_{f,d} are
-	safe to inverse value tests in jump thread optimization.
-
-2012-12-05 Paulo Andrade <pcpa@gnu.org>
-
-	* check/Makefile.am, check/cvt.ok, check/cvt.tst: Add new
-	"cvt" test case to test conversion from/to int/float types.
-
-	* check/lightning.c: Only define truncr_{f,d}_l in 64 bit mode.
-
-	* include/lightning.h: Correct typo that caused it to define
-	jit_truncr_{f,d}_l in 32 bit mode.
-
-	* lib/jit_arm-cpu.c: Avoid assertion failure in the signed/unsigned
-	extend opcodes generation as it shares an interface for 3 argument
-	opcode generation.
-
-	* lib/jit_x86-cpu.c: Correct wrong argument passed to
-	jit_unget_reg in the andi implementation and wrong byte
-	unsigned extend code generation.
-
-	* lib/jit_x86-sse.c: Correct conversion from "word" to float or
-	double as is dependent on wordsize.
-
-2012-12-05 Paulo Andrade <pcpa@gnu.org>
-
-	* check/ldstr-c.ok, check/ldstr-c.tst, check/ldstxi-c.ok,
-	check/ldstxi-c.tst, check/ldstxr-c.ok, check/ldstxr-c.tst:
-	New test case files testing load clobbering the base and/or
-	index register;
-
-	* check/ldst.inc: New file with common definition for all the
-	ldst* test cases.
-
-	check/Makefile.am, check/ldsti.tst, check/ldstr.tst,
-	check/ldstxi.tst, check/ldstxr.tst: Update for new common
-	definitions file and new register clobber ldst tests.
-
-2012-12-05 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_mips-fpu.c: Correct wrong register order in stxr_{f,d}
-	in the mips backend.
-
-2012-12-05 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_arm-vfp.c: Correct regression found in armv7l with
-	latest test cases.
-
-2012-12-05 Paulo Andrade <pcpa@gnu.org>
-
-	* check/ldstxi.tst, check/ldstxr.tst: Correct wrong argument
-	order for 32 bit mode tests.
-
-	* configure.ac: Correct check for ix86 target_cpu.
-
-2012-12-05 Paulo Andrade <pcpa@gnu.org>
-
-	* check/ldstr.ok, check/ldstr.tst, check/ldsti.ok,
-	check/ldsti.tst, check/ldstxr.ok, check/ldstxr.tst,
-	check/ldstxi.ok, check/ldstxi.tst:
-	New test case files exercising a very large amount of
-	register combinations to verify load/store implementation.
-
-	* check/Makefile.am: Update for new test cases.
-
-	* lib/jit_x86-cpu.c: Correct wrong argument order when
-	computing REX prefix for {ld,st}r_T codes;
-
-2012-12-04 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_mips-fpu.c, lib/jit_mips.c: Implement missing mips
-	jit_sqrtr_{f,d} codes.
-
-	* check/all.tst, include/lightning.h, lib/jit_print.c: Change
-	declaration order and call order in all.tst of {add,sub}c and
-	{add,sub}x. *c must be called before to set the carry and *x
-	second to use the carry and keep it set. The wrong call order
-	was causing all.tst to fail in mips, where a register is
-	allocated to keep a global carry state.
-
-2012-12-04 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
-	lib/jit_mips-fpu.c, lib/jit_mips.c: Correct float/double
-	argument handling and make the mips backend pass the initial
-	test cases.
-
-	* include/lightning.h, ib/jit_print.c, lib/lightning.c:
-	Add extra enum values for argument handling functions that
-	could not be abstracted to the current codes, that is, when
-	float values need to move from/to gpr from/to fpr. It would
-	be more tempting to add such primitives, but they would have
-	wordsize limitations, and it is not expected to add codes
-	with one gpr argument for 64 bit and two for 32 bit.
-
-	* lib/jit_ppc.c: Check _jit->function before calling jit_epilog()
-	to avoid a runtime exception.
-
-2012-12-04 Paulo Andrade <pcpa@gnu.org>
-
-	* include/lightning/jit_mips.h, lib/jit_mips.c: Update to
-	make the mips backend compile in a qemu image.
-
-	* lib/jit_ppc.c: Minor adaptations to help in having the
-	ppc backend compilable.
-
-2012-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
-	lib/jit_arm-swf.c, lib/jit_arm.c, check/Makefile.am: Correct
-	implementation of the arm backend port to build and pass the
-	current test cases. Tested on armv7 with softfp abi.
-
-	* lib/jit_disasm.c: Rename and change prototype of static
-	disassemble function as in the arm backend it is required
-	to access state information stored in the jit_state_t object.
-
-	* check/3to2.tst, check/add.tst: Correct test case code assuming
-	JIT_RO and JIT_RET are the same, and even if they are the same,
-	the logic was incorrect because it must always call jit_retval*
-	to fetch a function call return before any other instruction.
-	The arm backend hash a special condition if jit_retval is not
-	called, because "r0" is not JIT_R0, but is JIT_RET and *also*
-	the first argument for a called function, so JIT_RET must be
-	only used as an argument to jit_retval.
-
-2012-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* check/all.tst, check/lightning.c: Only declare or use 64 bit
-	interfaces on 64 bit builds.
-
-	* check/fib.tst: Use simpler logic to not need preprocessor
-	conditionals for 32 or 64 bit.
-
-	* include/lightning.h: Only declare 64 bit macros on a 64 bit
-	build. Code using lightning must know about wordsize and the
-	jit generation limitations, also, this way it generates a
-	compile time failure, not a runtime assertion.
-
-	* include/lightning/jit_x86.h: Correct typo in macro name.
-
-	* lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
-	lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c, 
-	lib/jit_x86.c, lib/jit_x86-cpu.c: Correct wrong code to get
-	current jit function pointer.
-
-	* lib/lightning.c: Move call to the simplify() optimization
-	to after register liveness is known. Previous code did work
-	by accident but now with proper test cases the problem was
-	noticed.
-
-	* lib/jit_disasm.c: Always cast bfd_vma to long long when
-	passing it as printf argument.
-
-2012-12-03 Paulo Andrade <pcpa@gnu.org>
-
-	* configure.ac, check/Makefile.am, check/check.sh,
-	doc/Makefile.am, include/lightning/Makefile.am,
-	lib/Makefile.am: Correct make distcheck.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_ppc.c: Assign copyright ownership to FSF.
-
-	* lib/jit_x86-cpu.c: Correct integer multiplication that was
-	generating code with reversed register arguments.
-
-	* check/rpn.ok, check/rpn.tst: New test case file.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
-	Actually change copyright owner to FSF as avertised.
-
-	*  lib/jit_arm-cpu.c,  lib/jit_arm-swf.c,
-	lib/jit_arm-vfp.c, lib/jit_arm.c,
-	lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c,
-	lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: New
-	files implementing initial code different jit backends.
-
-	* include/lightning/jit_private.h: Add extra field to the
-	private jit_patch_t type, required by the arm port.
-
-	* lib/Makefile.am: Update for the new backend implementation
-	files.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* check/Makefile.am: Add proper "make clean" rule and missing
-	check.sh to EXTRA_DIST.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* .gitignore: Update pattern of ignored files.
-
-	* check/Makefile.am: Add rule to build liblightning.la dependency
-	in case of running "make check" before building the library.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* lightning/Makefile.am, lightning/asm-common.h,
-	lightning/core-common.h, lightning/fp-common.h,
-	lightning/funcs-common.h, lightning/i386/Makefile.frag,
-	lightning/i386/asm-32.h, lightning/i386/asm-64.h,
-	lightning/i386/asm.h, lightning/i386/core-32.h,
-	lightning/i386/core-64.h, lightning/i386/core.h,
-	lightning/i386/fp-32.h, lightning/i386/fp-64.h,
-	lightning/i386/fp.h, lightning/i386/funcs.h,
-	lightning/ppc/asm.h, lightning/ppc/core.h,
-	lightning/ppc/fp.h, lightning/ppc/funcs.h,
-	lightning/sparc/asm.h, lightning/sparc/core.h,
-	lightning/sparc/fp.h, lightning/sparc/funcs.h:
-	Removed. The core logic is used in the new code, and new mips
-	and arm ports will be added. At first, sparc will not be
-	supported as it has not yet been ported to the new engine.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-
-	* tests/Makefile.am, tests/3to2.c, tests/3to2.ok, tests/add.c,
-	tests/add.ok, tests/allocai.c, tests/allocai.ok, tests/bp.c,
-	tests/bp.ok, tests/divi.c, tests/divi.ok, tests/fib.c, tests/fib.ok,
-	tests/fibdelay.c, tests/fibdelay.ok, tests/fibit.c, tests/fibit.ok,
-	tests/funcfp.c, tests/funcfp.ok, tests/incr.c, tests/incr.ok,
-	tests/ldst.c, tests/ldst.ok, tests/ldxi.c, tests/ldxi.ok,
-	tests/modi.c, tests/modi.ok, tests/movi.c, tests/movi.ok,
-	tests/printf.c, tests/printf.ok, tests/printf2.c, tests/printf2.ok,
-	tests/ret.c, tests/ret.ok, tests/rpn.c, tests/rpn.ok, tests/rpnfp.c,
-	tests/rpnfp.ok, tests/sete.c, tests/sete.ok, tests/testfp.c,
-	tests/testfp.ok, tests-run-test: Removed previous test suite, in
-	favor of a newer one in the check subdirectory.
-
-	* check/3to2.ok, check/3to2.tst, check/add.ok, check/add.tst,
-	check/allocai.ok, check/allocai.tst, check/bp.ok, check/bp.tst,
-	check/divi.ok, check/divi.tst, check/fib.ok, check/fib.tst:
-	New sample input for the new test program, loosely matching
-	several of the previous test cases.
-
-	* check/Makefile.am: New test suite makefile.
-
-	* check/check.sh, check/run-test: New wrapper files for the
-	new test suite.
-
-	* check/lightning.c: New file. The main driver of the new test
-	suite, that compiles to a parser of a very simple assembly like
-	language, generates jit and executes it.
-
-	* check/all.tst: New file. A generic debug and sample test file
-	with a directive to prevent it from being executed, and useful to
-	read disassembly of all possible instructions, using a fixed set
-	of registers.
-
-	* include/Makefile.am, include/lightning.h,
-	include/lightning/Makefile.am, include/lightning/jit_arm.h,
-	include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
-	include/lightning/jit_private.h, include/lightning/jit_x86.h,
-	lib/Makefile.am, lib/jit_disasm.c, lib/jit_print.c,
-	lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c,
-	lib/jit_x86.c, lib/lightning.c: New files. These files are
-	written from scratch, only by <pcpa@gnu.org>, and have now
-	copyright assignment to the FSF. This is the core of the new
-	lightning rework. Previously it was integrated in code with
-	a garbage collector and several custom types like vectors and
-	hash tables, so this first code merge with lightning converts
-	that code into a library extracting only the jit bits, and at
-	first only for x86_64 GNU/Linux.
-
-	* lightning.h, m4/lightning.m4: Removed. These are no longer
-	required in the new lightning code.
-
-	.gitignore, Makefile.am, configure.ac: Update for the new
-	lightning code.
-
-2012-12-02 Paulo Andrade <pcpa@gnu.org>
-	* .cvsignore: Removed for extra cleanup.
-
-	* build-aux: Rename directory to m4.
-
-	* m4: Renamed to "default" name and for consistency with merge
-	with code rework to be imported in lightning.
-
-	* .gitignore, configure.ac, Makefile.am, doc/Makefile.am:
-	Update for build-aux to m4 rename.
-
-2012-12-01 Paulo Andrade <pcpa@gnu.org>
-
-	* opcode/Makefile.am, opcode/Makefile.in, opcode/ansidecl.h,
-	opcode/bfd.h, opcode/dis-asm.h, opcode/dis-buf.c, opcode/disass.c,
-	opcode/i386-dis.c, opcode/i386.h, opcode/ppc-dis.c, opcode/ppc-opc.c,
-	opcode/ppc.h, opcode/sparc-dis.c, opcode/sparc-opc.c, opcode/sparc.h,
-	opcode/sysdep.h: Removed. Do not bundle GNU binutils files.
-
-	* aclocal.m4, configure, Makefile.in, config.h.in, doc/Makefile.in,
-	lightning/Makefile.in, tests/Makefile.in: Removed. Do not maintain
-	autogenerated files that also generate too much diff noise when
-	regenerated in git.
-
-	* build-aux/help2man, build-aux/texinfo.tex, build-aux/texi2dvi:
-	Removed. Buildenvironment must have an up to date version from
-	upstream installed.
-
-	* build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
-	build-aux/install-sh build-aux/mdate-sh build-aux/missing: Removed.
-	Do not maintain a copy of automake files in git. Release tarballs
-	must use an up to date version.
-
-	* lightningize.in, doc/lightningize.1: Removed. Do not encourage
-	bundling lightning in other packages. It should use a system package
-	or a proper thirdy part subdirectory.
-
-	* INSTALL: Removed. Autoreconf removes it and creates a symlink
-	when regenerating files, so, avoid conflicts in git and let
-	automake create the symlink.
-
-	* .gitignore: Add INSTALL and autogenerated files.
-
-	* configure.ac, Makefile.am: Update for removal of opcode subdir,
-	auto generated files and lightningize.
-
-	* tests/Makefile.am, tests/3to2.c, tests/add.c, tests/bp.c,
-	tests/fib.c, tests/fibdelay.c, tests/fibit.c, tests/funcfp.c,
-	tests/incr.c, tests/printf.c, tests/rpn.c, tests/rpnfp.c,
-	tests/sete.c, tests/testfp.c: Update for removal of opcode subdir.
-
-	* doc/Makefile.am: Update for removal of lightningize.
-
-	* configure.ac, lightning/ppc/funcs.h, lightning/sparc/funcs.h,
-	lightning/i386/fp.h, lightning/i386/core.h, lightning/i386/asm.h,
-	tests/3to2.c, tests/add.c, tests/bp.c, tests/fib.c, tests/fibdelay.c,
-	tests/fibit.c, tests/funcfp.c, tests/incr.c, tests/printf.c,
-	tests/rpn.c, tests/rpnfp.c, tests/sete.c, tests/testfp.c:
-	Remove LIGHTNING_CROSS, it is half supported and incomplete.
-
-	* tests/3to2.c, tests/funcfp.c, tests/rpnfp.c: Remove preprocessor
-	check on JIT_FPR. If no hardware registers are available, the backend
-	must provide an alternative for software float.
-
-	* lightning/ppc/core.h, lightning/sparc/core.h, tests/Makefile.am:
-	Remove JIT_NEED_PUSH_POP. It is absolutely not trivial to implement
-	properly on some backends due to stack alignment constraints, and
-	whenever it is required, using jit_allocai and using a properly
-	aligned stack vector, or a heap buffer, is better.
-
-	* tests/push-pop.c, tests/push-pop.ok: Removed due to
-	JIT_NEED_PUSH_POP no longer available.
-
-2011-02-28  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_,
-	fix jit_mul{i,r}_{l,ul}.
-
-2010-08-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp-64.h: Return patch address from jit_bXYr_{f,d}.
-	Reported by Paulo César Pereira de Andrade.
-	* lightning/ppc/fp.h: Likewise.
-	* lightning/sparc/fp.h: Implement FP branches.
-
-2010-08-18  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp-64.h: Fix jp in jit_bner_{f,d}.
-
-2010-08-18  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp-32.h: Fix -D_ASM_SAFETY compilation.
-	Reported by Paulo César Pereira de Andrade.
-
-2010-08-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/ldst.c: Update.
-	* tests/Makefile.am: Use -ffloat-store to compile it.
-
-2010-08-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
-	jit_ldxr_s): Move...
-	* lightning/i386/core-32.h: ... here.
-	* lightning/i386/core-64.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
-	Use movsbq and movswq.
-
-2010-08-10  Paulo César Pereira de Andrade <pcpa@mandriva.com.br>
-
-	* lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir.
-	(jit_movbrm): Check index register as well.
-	* lightning/i386/fp-64.h: Add jit_extr_f_d and jit_extr_d_f.
-	* lightning/fp-common.h: Add jit_extr_f_d and jit_extr_d_f.
-
-2010-07-28  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/Makefile.am: Add ldst test.
-	* tests/Makefile.in: Regenerate.
-	* tests/ldst.c: New.
-	* tests/ldst.ok: New.
-
-2010-07-28  Paolo Bonzini  <bonzini@gnu.org>
-
-	* THANKS: Add Paulo Cesar Pereira de Andrade.
-	* doc/porting.texi: Fix ordering of arguments in jit_stxi.
-	* lightning/i386/core-32.h (jit_replace): Remove cmp argument.
-	* lightning/i386/fp-64.h (jit_movi_f): Fix.
-
-2010-07-26  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-32.h (jit_replace): Move here (removed
-	2009-03-01).
-
-2010-07-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* build-aux/lightning.m4: Always set and replace lightning_frag.
-	* Makefile.in: Regenerate.
-	* aclocal.m4: Regenerate.
-	* config.h.in: Regenerate.
-	* configure: Regenerate.
-	* doc/Makefile.in: Regenerate.
-	* doc/lightningize.1: Regenerate.
-	* doc/version.texi: Regenerate.
-	* lightning/Makefile.in: Regenerate.
-	* opcode/Makefile.in: Regenerate.
-	* tests/Makefile.in: Regenerate.
-
-2009-03-01  Paolo Bonzini  <bonzini@gnu.org>
-
-        * lightning/i386/core-64.h: Use Mike's macros for x86-64 too.
-        * lightning/i386/core.h: Remove jit_replace.
-
-	2009-02-27  Mike Spivey  <mike@comlab.ox.ac.uk>
-
-        * lightning/i386/core.h: Rewrite shift-handling macros.
-        * lightning/fp-common.h: Fix jit_extr_{f_d,d_f}.
-
-2009-02-17  Mike Spivey  <mike@comlab.ox.ac.uk>
-
-	* lightning/i386/core.h: Fix blunder in operand order.
-
-2009-02-17  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp-32.h: Another fix to jit_fp_btest.
-
-2009-02-17  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/fp-common.h: Define double branches if missing.
-	* lightning/i386/asm.h: Define JC and JNC mnemonics.
-	* lightning/i386/fp-32.h: Fix jit_fp_btest.  All reported
-	by Mike Spivey.
-
-2008-10-09  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/funcs.h (jit_flush_code): Subtract 1 from end.
-	Reported by Eli Barzilay and Matthew Flatt.
-
-2008-08-23  Nix  <nix@esperi.org.uk>
-
-	* lightning/i386/Makefile.frag: fp-32.h and fp-64.h are target files.
-
-2008-07-02  Laurent Michel  <ldm@engr.uconn.edu>
-
-	* lightning/ppc/funcs.h (jit_flush_code): modified the computation
-	of start/end. The pointer arithmetic was done without casting. It
-	prevented compilation with recent gcc versions. 
-	* lightning/ppc/core.h (jit_pushr_i): The offset for the store was
-	incorrect. Should have been 4 bytes below SP (not above).
-	* lightning/ppc/core.h (jit_popr_i): The offset for the load was 
-	incorrect. Should have been 0 (not +8). 
-
-2008-06-17  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-64.h: Forward IMULQir to IMULQirr,
-	fix REXQ order for IMULQirr.
-
-2008-06-17  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: Fix _rN vs. _rR.
-
-2008-06-16  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: Use jit_save in jit_replace.  Move JIT_R
-	definition...
-	* lightning/i386/core-32.h: ... here; define jit_save so that
-	the core.h has no effect on the 32-bit backend.
-	* lightning/i386/core-64.h: Place JIT_R1/JIT_R2 in R10/R11,
-	place outgoing arguments in the right spot from the beginning,
-	define jit_save, fix jit_reg8/jit_reg16.
-
-2008-06-15  Paolo Bonzini  <bonzini@gnu.org>
-
-        * lightning/i386/core-64.h: Rewrite argument passing to
-	support up to 6 arguments and generate less code.
-
-2008-06-14  Laurent Michel  <ldm@thorgal.homelinux.org>
-
-	* lightning/i386/core-64.h (jit_movi_l): When the operand is 0,
-	the XOR should be on a quadword.
-	* lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack
-	alignment.
-	(jit_ret): Always use LEAVE.
-
-2008-06-13  Laurent Michel  <ldm@thorgal.homelinux.org>
-
-	* lightning/i386/core-64.h: Add (void) casts for C++ compatibility.
-	* lightning/i386/asm.h: Likewise.
-
-2008-06-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: Move JIT_V definition...
-	* lightning/i386/core-32.h: ... here.
-	* lightning/i386/core-64.h: ... and here.  Avoid dancing between
-	RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13.
-
-2008-06-11  Paolo Bonzini  <bonzini@gnu.org>
-
-	* build-aux/lightning.m4: Adjust LIGHTNING_BACKENDS, don't
-	use suffix support to distinguish i386/x86_64.
-	* lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES
-	to distribute *-32.h and *-64.h files now.
-	* lightning/i386/asm-i386: Moved to...
-	* lightning/i386/asm.h: Include the appropriate subtarget file.
-	* lightning/i386/core-i386: Moved to...
-	* lightning/i386/core.h: Include the appropriate subtarget file.
-	* lightning/i386/fp.h: New, include the appropriate subtarget file.
-	* lightning/i386/asm-32: Do not include asm-i386.h.
-	* lightning/i386/asm-64.h: Likewise.
-	* lightning/i386/core-32: Do not include core-i386.h.
-	* lightning/i386/core-64.h: Likewise.
-	* lightning/Makefile.am: Adjust for renamed files.
-
-	* configure.ac: Define LIGHTNING_TARGET here.
-	* opcode/disass.c: Change list of valid LIGHTNING_TARGET values.
-
-	* lightningize.in: Robustify against missing subtarget files.
-
-2008-06-11  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-32.h: Use MOVLir instead of jit_movi_l
-	to implement jit_movi_p.
-
-2008-06-11  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-32.h: Use separate __APPLE__ and SysV
-	prolog/ret macros.  Subtract 12 bytes in __APPLE__ case to
-	keep stack aligned, and always use LEAVE in the epilog.
-
-2008-06-11  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-i386.h: Fix C++ incompatibility.
-
-2008-06-10  Laurent Michel  <ldm@engr.uconn.edu>
-
-	* lightning/i386/core-i386.h: Fix jit_replace8 for
-	case when one of the operands is _EAX.
-
-2008-05-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/run-test: Avoid CRLF issues on mingw.
-
-2008-03-21  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Fix jit_{ld,st}{,x}i_{i,l}.
-	Remove jit_ld{,x}i_ul.
-	* lightning/core-common.h: Make jit_ld{,x}{i,r}_ul
-	always a synonym of the _l variant.
-	* doc/porting.texi: Document this.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Fix uses of jit_qop_.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Add boolean operations.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-64.h: Add LEAQmr.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Misc bugfixes.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-i386.c: Remove jit_ldr_i, jit_ldxr_i.
-	* lightning/i386/core-32.h: Add jit_ldr_i, jit_ldxr_i.
-	* lightning/i386/core-64.h: Add jit_ld{r,xr,i,xi}_{ui,l,ul};
-	move jit_ldr_i, jit_ldxr_i, jit_str_l, jit_stxr_l with others.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/asm-common.h: Add _s32P.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Implement long mul/div/mod.
-
-2008-03-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h: Cast memory address to long for JCCim.
-
-2008-03-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/asm-common.h: Add underscores around __unused__
-	attribute.
-
-2008-03-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/core.h: Avoid some "value computed is not used"
-	warnings.
-	* lightnings/tests/allocai.c: Silence other warnings.
-
-2008-03-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightningize.in: Fix some problems (not all).
-
-2008-03-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-32.h: Avoid some "value computed is not used"
-	warnings; reported by Sam Steingold.
-
-2008-03-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-32.h: Fix stxr_c(_EAX, _EBX, _ESI).
-
-2008-02-13  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-32.h: Avoid redefinition of _r1, reported by
-	Sam Steingold.
-	* lightning/i386/asm-64.h: Likewise.
-
-2008-02-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h: Don't define _VOID, reported
-	by Reini Urban.
-
-2008-02-03  Paolo Bonzini  <bonzini@gnu.org>
-
-	* build-aux/lightning.m4: Add --with-lightning-prefix option, suggested
-	by Sam Steingold.
-
-2008-01-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-64.h: Use CALLsr, not CALLLsr.
-
-2008-01-13  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-i386.h: Move jit_calli and jit_callr...
-	* lightning/i386/core-32.h: ... here.
-	* lightning/i386/core-64.h: Redefine them.
-
-2008-01-05  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp-32.h: Fix sub(a,0,a).
-	* lightning/tests/3to2.c: Add new testcases.
-	* lightning/tests/3to2.ok: Add new testcases.
-
-2008-01-02  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp-32.h: Fix sub(a,b,a) with a ~= JIT_FPR0.
-	* lightning/tests/3to2.c: New.
-	* lightning/tests/3to2.ok: New.
-
-2007-11-07  Paolo Bonzini  <bonzini@gnu.org>
-
-	* opcode/Makefile.am: Fix AM_CPPFLAGS.
-
-2007-08-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-i386.h: Improve encoding of set* instructions.
-	* lightning/i386/core-64.h: Fix jit_bra_l.
-	* tests/sete.c: New.
-	* tests/sete.ok: New.
-
-2007-06-29  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/bp.c: Upgrade to GPL/LGPLv3.
-	* lightning/i386/asm-32.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/asm-64.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/core-32.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/core-64.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/fp-64.h: Upgrade to GPL/LGPLv3.
-	* lightning/sparc/asm.h: Upgrade to GPL/LGPLv3.
-	* lightning/sparc/core.h: Upgrade to GPL/LGPLv3.
-	* lightning/sparc/fp.h: Upgrade to GPL/LGPLv3.
-	* lightning/sparc/funcs.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/asm-i386.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/core-i386.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/fp-32.h: Upgrade to GPL/LGPLv3.
-	* lightning/i386/funcs.h: Upgrade to GPL/LGPLv3.
-	* lightning/ppc/asm.h: Upgrade to GPL/LGPLv3.
-	* lightning/ppc/core.h: Upgrade to GPL/LGPLv3.
-	* lightning/ppc/fp.h: Upgrade to GPL/LGPLv3.
-	* lightning/ppc/funcs.h: Upgrade to GPL/LGPLv3.
-	* lightning.h: Upgrade to GPL/LGPLv3.
-	* tests/add.c: Upgrade to GPL/LGPLv3.
-	* tests/fib.c: Upgrade to GPL/LGPLv3.
-	* tests/testfp.c: Upgrade to GPL/LGPLv3.
-	* tests/fibdelay.c: Upgrade to GPL/LGPLv3.
-	* tests/fibit.c: Upgrade to GPL/LGPLv3.
-	* tests/funcfp.c: Upgrade to GPL/LGPLv3.
-	* tests/incr.c: Upgrade to GPL/LGPLv3.
-	* tests/printf.c: Upgrade to GPL/LGPLv3.
-	* tests/printf2.c: Upgrade to GPL/LGPLv3.
-	* tests/rpn.c: Upgrade to GPL/LGPLv3.
-	* tests/rpnfp.c: Upgrade to GPL/LGPLv3.
-	* lightning/asm-common.h: Upgrade to GPL/LGPLv3.
-	* lightning/core-common.h: Upgrade to GPL/LGPLv3.
-	* lightning/fp-common.h: Upgrade to GPL/LGPLv3.
-	* lightning/funcs-common.h: Upgrade to GPL/LGPLv3.
-	* opcode/dis-buf.c: Upgrade to GPL/LGPLv3.
-	* opcode/disass.c: Upgrade to GPL/LGPLv3.
-	* opcode/i386-dis.c: Upgrade to GPL/LGPLv3.
-	* opcode/sparc-dis.c: Upgrade to GPL/LGPLv3.
-	* opcode/sparc-opc.c: Upgrade to GPL/LGPLv3.
-	* lightningize.in: Upgrade to GPL/LGPLv3.
-	* opcode/bfd.h: Upgrade to GPL/LGPLv3.
-	* opcode/i386.h: Upgrade to GPL/LGPLv3.
-	* opcode/sparc.h: Upgrade to GPL/LGPLv3.
-
-2007-01-26  Thomas Girard  <thomas.g.girard@free.fr>
-
-	* lightning/Makefile.am: Add clean-local target.
-
-2006-12-02  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h: Add CVTTS?2SIL.
-	* lightning/i386/asm-64.h: Add CVTTS?2SIQ.
-	* lightning/i386/fp-64.h: Use it.
-
-	* lightning/Makefile.am: Place files in nodist_lightning_HEADERS.
-
-2006-11-23  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/core-common.h: Add casts in "*i_p" variants.
-	* lightning/i386/asm-32.h: Add _r1.
-	* lightning/i386/asm-64.h: Likewise, and add SSE instructions.
-	* lightning/i386/asm-i386.h: Merge SSE instructions from Gwenole.
-	Use short form for 16-bit AX instructions.  Remove _r1
-	* lightning/i386/core-64.h: Add FP ABI support in its infancy.
-	* lightning/i386/core-i386.h: Move jit_arg_f and jit_arg_d...
-	* lightning/i386/core-32.h: ... and jit_prepare_f and jit_prepare_d...
-	* lightning/i386/fp-32.h: ... here.
-	* lightning/i386/fp-64.h: Write the code.
-	* lightning/sparc/fp.h: Fix jit_extr_{f_d,d_f} register order.
-	
-2006-11-22  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h: Move x86-64 instructions...
-	* lightning/i386/asm-64.h: ... here.
-	* lightning/i386/fp-32.h: Fix bugfixes worked around in froofyJIT.
-	Add JIT_FPRET.
-	* lightning/sparc/fp.h: Likewise.
-	* lightning/ppc/fp.h: Likewise.
-	* lightning/fp-common.h: Adjust for JIT_FPRET.
-	* tests/funcfp.c: Adjust for JIT_FPRET.
-	* tests/rpnfp.c: Adjust for JIT_FPRET.
-
-2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h:  Add an underscore to macros without
-	a parameter.
-
-2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core-i386.h: Move jit_movip, jit_check8, jit_reg8,
-	jit_reg16, jit_movbrm...
-	* lightning/i386/core-32.h: ... here.
-	* lightning/i386/core-64.h: Redefine them.  Fix other bugs.
-
-	* tests/printf.c: Do not do a varargs call.
-
-2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h: Check in rewrite from Basilisk II.
-	* lightning/i386/asm-32.h: Adjust.
-	* lightning/i386/asm-64.h: Adjust.
-	* lightning/i386/fp-32.h: Adjust.
-
-	* lightning/i386/core-32.h: Adjust.  Add jit_{ld,ldx,st,stx}i*.
-	* lightning/i386/core-64.h: Adjust.  Add jit_{ld,ldx,st,stx}i*.
-	* lightning/i386/core-i386.h: Adjust. Remove these patterns.
-
-2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm-i386.h: Merge 64-bit cleanliness changes from
-	mzscheme.
-	Add SSE.
-	* lightning/i386/asm-64.h: Likewise.
-
-2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
-	    Ludovic Courtes  <ludo@chbouib.org>
-
-	* lightning/i386/core-32.h: Disable jit_push and jit_pop if stack not
-	needed.
-	* lightning/i386/core-64.h: Disable jit_push and jit_pop if stack not
-	needed.
-	* lightning/sparc/core.h: Merge final implementation of jit_pushr and
-	jit_popr.
-	* lightning/ppc/core.h: Fix implementation of jit_pushr and jit_popr to
-	work (more or less) across function calls.
-
-	* tests/push-pop.c, tests/push-pop.ok: New test.
-	* tests/Makefile.am: Run it.
-
-2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/asm-common.h: Make 64-bit safe.
-	* lightning/i386/funcs.h: Make 64-bit safe.
-
-	* lightning/i386/asm-64.h: More merge from mzscheme.
-	* lightning/i386/asm-i386.h: More merge from mzscheme.
-	* lightning/i386/core-32.h: More merge from mzscheme.
-	* lightning/i386/core-64.h: More merge from mzscheme.
-	* lightning/i386/core-i386.h: More merge from mzscheme.
-
-	* tests/rpnfp.c, tests/testfp.c, tests/funcfp.c: Skip if no
-	floating-point support.
-
-2006-11-04  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/rpn.c: Remove pushr/popr.
-
-2006-11-04  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.
-	* lightning/ppc/funcs.h: Store frame size into _jitl.  Store R1 before
-	the STMW, so that the offset is unchanged when we patch the STMW.
-	* lightning/i386/core.h: Define JIT_FP to be EBP.
-	* lightning/i386/core-32.h: Implement jit_allocai, put LEAVE in the
-	epilog if jit_allocai was used.
-	* lightning/i386/core-64.h: Implement jit_allocai, put LEAVE in the
-	epilog if jit_allocai was used.
-
-2006-11-04  Ludovic Courtes  <ludo@chbouib.org>
-
-	* lightning/sparc/core.h: Implement jit_allocai.
-	* tests/allocai.c: New.
-	* tests/Makefile.am: Point to new tests.
-
-2006-11-03  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/core.h: Fix jit_bms using BNE rather than BGT.
-	"AND." does signed comparisons.
-
-2006-10-31  Paolo Bonzini  <bonzini@gnu.org>
-
-	* doc/porting.texi: Rename JIT_FP to JIT_AP.
-	* lightning/core-common.h: Likewise.
-	* lightning/i386/core-i386.h: Likewise.
-	* lightning/fp-common.h: Provide default versions of jit_getarg_[fd].
-	* lightning/i386/fp-32.h: Don't provide jit_getarg_[fd].
-	* lightning/ppc/fp.h: Likewise.
-
-2006-10-31  Ludovic Courtes  <ludo@chbouib.org>
-
-        * doc/using.texi (The instruction set): Clarified the use of `JIT_RET' and
-        documented `jit_retval'.
-        * tests/ret.c (generate_function_proxy): After `jit_finish', use
-        `jit_retval_i' to move FUNC's return value into the correct register.
-
-2006-10-31  Paolo Bonzini  <bonzini@gnu.org>
-	    Ludovic Courtes  <ludo@chbouib.org>
-
-	* tests/divi.c, tests/divi.ok, tests/movi.c, tests/movi.ok: New.
-	* tests/ldxi.c: Ensure large pointer is generated.
-	* tests/Makefile.am: Point to new tests.
-	* lightning.h: Include funcs-common.h before funcs.h.
-	* lightning/sparc/core.h: Fix bugs in modi/divi.
-
-2006-10-30  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/Makefile.am: Use "ln -sf".
-	* lightning/core-common.h: Define jit_negr_l if necessary.
-
-2006-10-30  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm.h (MOVS*, MOVZ*): Use correct _r[124] macros.
-
-2006-10-29  Paolo Bonzini  <bonzini@gnu.org>
-
-	* configure.ac: Use lightning.m4 macros.
-	* lightning.m4: Refactor to use common code in configure.ac.  Move...
-	* build-aux/lightning.m4: ... here.
-	* lightningize.in: Support suffixes.
-	* opcode/disass.in: Adapt to changes in configure.ac.
-
-	* lightning/ppc/funcs.h: Use __APPLE__ instead of _CALL_DARWIN.
-	* lightning/i386/core-32.h: Likewise.
-
-2006-10-26  Paolo Bonzini  <bonzini@gnu.org>
-
-	* configure.ac: Fix compilation test.
-	* lightning/Makefile.am: Symlink LIGHTNING_TARGET_FILES in
-	non-distribution mode.
-	* lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES.
-
-2006-10-26  Paolo Bonzini  <bonzini@gnu.org>
-
-	* configure.ac: Subst cpu.
-	* lightning/core-common.h: Make tests pass on i386.
-	* lightning/i386/asm-32.h: Make tests pass on i386.
-	* lightning/i386/asm-64.h: Make tests pass on i386.
-	* lightning/i386/asm-i386.h: Make tests pass on i386.
-	* lightning/i386/core-32.h: Make tests pass on i386.
-	* lightning/i386/core-64.h: Make tests pass on i386.
-	* lightning/i386/core-i386.h: Make tests pass on i386.
-	* tests/Makefile.am: Include files from cpu directory.
-
-2006-10-26  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm.h: Move to asm-i386.h
-	* lightning/i386/asm-32.h: New, from Matthew Flatt.
-	* lightning/i386/asm-64.h: New, from Matthew Flatt.
-	* lightning/i386/core.h: Move to core-i386.h
-	* lightning/i386/core-32.h: New, from Matthew Flatt.
-	* lightning/i386/core-64.h: New, from Matthew Flatt.
-	* lightning/i386/fp.h: Move to fp-32.h
-	* lightning/i386/fp-64.h: New, dummy.
-	* lightning/i386/Makefile.frag: New.
-	* lightning/Makefile.am: Support per-target Makefile fragments.
-	* configure.ac: Support per-target Makefile fragments and CPU suffixes.
-
-2006-10-16  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/i386.h (jit_flush_code): Fix syntax error. :-(
-
-2006-07-06  Paolo Bonzini  <bonzini@gnu.org>
-	    Ludovic Courtes  <ludovic.courtes@laas.fr>
-
-	* doc/using.texi: Clarify "Using autoconf" section
-	and rename it to "Bundling lightning"
-	* lightning.m4: Work also if lightning is not bundled.
-
-2006-07-06  Paolo Bonzini  <bonzini@gnu.org>
-	    Ludovic Courtes  <ludovic.courtes@laas.fr>
-
-	* lightning/ppc/core.h (_jit_mod): Replace with...
-	(_jit_mod_big, _jit_mod_small): ... these.
-	(jit_modi_i, jit_modi_ui): Rewrite.
-	* tests/modi.c, tests/modi.ok: New tests.
-
-2006-05-18  Matthew Flatt  <mflatt@cs.utah.edu>
-
-	* lightning/i386/asm.h: Fix test for extending the mprotect area
-	towards lower addresses.
-
-2006-05-16  Bruno Haible  <bruno@clisp.org>
-
-	* lightning/asm-common.h: Don't use __func__ nor __FUNCTION__ if
-	not compiling with GNU C.
-
-2006-02-16  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/core.h: Fix jit_ldxi_* with big displacement.
-
-2006-01-23  Paolo Bonzini  <bonzini@gnu.org>
-
-	* configure.ac: Fix comments in config.h.in.
-	
-2005-11-25  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/sparc/fp.h: Fix header comment.
-	* lightning/ppc/fp.h: Fix header comment.
-
-2005-04-27  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/asm.h (JCm, JCSm, JNCm, JNCSm): New.
-
-2004-11-26  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/funcs.h (_jit_epilog): Remove unused variable.
-
-2004-11-13  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/funcs.h [__linux__]: Include sys/mman.h.
-
-2004-11-09  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/sparc/fp.h: Fix fp-to-integer conversions.
-	* lightning/ppc/testfp.c: Test fp-to-integer conversions
-	of integer numbers.
-	* lightning/ppc/testfp.ok: Adjust for the above.
-
-2004-11-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/testfp.c: Always flush code before
-	testing it.
-
-2004-11-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/fp.h: Do not clobber f31.
-
-2004-11-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning.h: New name of...
-	* lightning-inst.h: ... this file.
-	* lightning.h.in: Removed.
-
-	* opcodes/disass.c: Include config.h.
-	* tests/add.c: Include config.h.
-	* tests/bp.c: Include config.h.
-	* tests/fib.c: Include config.h.
-	* tests/fibdelay.c: Include config.h.
-	* tests/fibit.c: Include config.h.
-	* tests/funcfp.c: Include config.h.
-	* tests/incr.c: Include config.h.
-	* tests/printf.c: Include config.h.
-	* tests/printf2.c: Include config.h.
-	* tests/rpn.c: Include config.h.
-	* tests/rpnfp.c: Include config.h.
-	* tests/testfp.c: Include config.h.
-
-2004-10-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp.h: Fix bugs in conditional branches.
-
-2004-10-10  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/funcs.h: Fix pasto in jit_flush_code.
-
-2004-10-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/fp.h: Optimized conditional branches.
-
-2004-09-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/asm.h: Fix more typos.
-
-2004-09-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/asm.h: Fix typos, replace `26' with JIT_AUX.
-
-2004-09-20  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/fp.h: Added conditional branches.
-
-2004-09-18  Laurent Michel  <ldm@thorgal.homelinux.org>
-
-	* lightning/ppc/fp.h (jit_unler_d, jit_unltr_d, jit_unger_d,
-	jit_ungtr_d, jit_ltgt_d, jit_uneq_d): Implemented missing tests
-	to fully support testfp.
-	(jit_floorr_d_i, jit_ceilr_d_i, jit_roundr_d_i, jit_truncr_d_i):
-	New macros.
-	* lightning/ppc/asm.h: Added missing opcodes FCTIWZ and MTFSFI.
-	* lightning/ppc/funcs.h (_jit_prolog): Fixed minor mistake in
-	the initialization of _jitl.nextarg_geti, relying on the
-	JIT_AUX macro as well to get the register offset.
-
-2004-09-07  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/funcs.h: Fix typo.
-
-2004-09-06  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/funcfp.c: Use %g.  Remove C99 variable declarations.
-	* tests/testfp.c: Don't use __builtin_nan.
-
-	* lightning/ppc/core.h: Add three V registers.
-	* lightning/ppc/funcs.h: Adjust.
-
-	* lightning/sparc/core.h: Some fixes related to FP argument passing.
-	Move R0 to %g2, use %o7 for JIT_BIG2.
-	* lightning/sparc/fp.h: Some fixes related to FP argument passing.
-
-2004-09-02  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/sparc/core.h: Add another V register,
-	move R0 to %o7.
-
-2004-07-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/funcs.h: Implement jit_flush_code,
-	in order to support Fedora's exec-shield.
-
-2004-07-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/core-common.h: Add more jit_extr_*_* macros.
-	* lightning/doc/using.texi: Be clearer about the order
-	of arguments in jit_extr_*_*.
-	* lightning/doc/porting.texi: Add more jit_extr_*_* macros.
-	* lightning/i386/fp.h: Fix typo in jit_extr_i_d.
-
-2004-07-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/funcs.h: Adjust offset of LR into
-	stack frame if running under the Darwin ABI.
-
-2004-07-13  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp.h: Rename jit_exti_d to jit_extr_i_d.
-
-2004-07-13  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/core.h: Fix thinko.
-
-	* lightning/i386/core.h: Fix jit_lti_ui.
-	* lightning/core-common.h: Add missing macros.
-
-	* lightning/ppc/fp.h: Rename jit_neg_* to jit_negr_*.
-	* lightning/i386/fp.h: Rename jit_neg_* to jit_negr_*.
-	* lightning/sparc/fp.h: Rename jit_neg_* to jit_negr_*.
-	* lightning/fp-common.h: Rename jit_neg_* to jit_negr_*.
-	* doc/porting.texi: Add undocumented macros.
-
-2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* doc/porting.texi: Add missing macros.
-
-2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/funcs.h: Don't generate trampolines.
-	Separate prolog and epilog generation.
-	* lightning/ppc/core.h: Generate epilog explicitly.
-	Don't reserve r31 anymore.
-	* lightning/core-common.h: Remove call to jit_setup_code.
-
-2004-07-09  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/lightning.h.in: Avoid preprocessor warnings.
-	* lightning/lightning-inst.h: Likewise.
-
-	* lightning/i386/core.h: Define JIT_R, JIT_R_NUM, JIT_V,
-	JIT_V_NUM.
-	* lightning/ppc/core.h: Likewise.
-	* lightning/sparc/core.h: Likewise.
-	* lightning/i386/fp.h: Define JIT_FPR, JIT_FPR_NUM.
-	* lightning/ppc/fp.h: Likewise.
-	* lightning/sparc/fp.h: Likewise.
-	* lightning/core-common.h: Define fixed register names.
-	* lightning/fp-common.h: Likewise for FP regs.
-
-2004-07-09  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/ppc/funcs.h: Fix location where return address
-	is stored.
-	* lightning/i386/asm.h: Add a trailing _ to opcodes without
-	any parameter.
-	* lightning/i386/core.h: Adjust for the above.
-
-2004-04-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/fp.h: Change "and" to "_and"
-	to satisfy C++ compilers.
-
-2004-04-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/sparc/fp.h: Use memcpy to implement jit_movi.
-	* lightning/ppc/fp.h: Use memcpy to implement jit_movi.
-	Move floating-point opcodes...
-	* lightning/ppc/asm.h: ... here.
-
-2004-04-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/core-common.h: Add jit_finishr.
-	* lightning/ppc/core.h: Add jit_callr and jit_finishr.
-	* lightning/i386/core.h: Add jit_callr.
-	* lightning/sparc/core.h: Add jit_callr.  Fix typo.
-
-2004-04-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: Fix pasto in jit_b*_ui.
-
-2004-03-30  Laurent Michel
-
-	* lightning/ppc: Implement PowerPC floating point
-	(ChangeLog entry missing).
-
-2004-03-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/fp-common.h: Load/store macros are not the
-	same for floats and doubles anywhere, but jit_retval may be.
-	* lightning/i386/asm.h: Fix = mistaken for == in ESCrri.
-	* lightning/i386/core.h: Fix typo in jit_prepare_[fd].
-	* lightning/i386/fp.h: Rewritten.
-	* tests/testfp.c: Add tests for unordered comparisons.
-	* tests/testfp.ok: Add results.
-
-2004-03-15  Paolo Bonzini  <bonzini@gnu.org>
-
-	Merge changes from Laurent Michel.
-
-	* lightning/asm-common.h: Add _jit_I_noinc.
-	* lightning/core-common.h: Support jit_init,
-	jit_setup_code, jit_patch_at.  Return patchable IP from
-	jit_movi_p.
-	* lightning/funcs-common.h: Provide defaults
-	for jit_setup_code, jit_start_pfx, jit_end_pfx
-	* lightning/i386/core.h: Add jit_patch_at, jit_patch_movi.
-	* lightning/ppc/core.h: Likewise.
-	* lightning/sparc/core.h: Likewise.
-	* lightning/ppc/asm.h: Fix generation of branch destination
-	displacements in _FB and _BB
-	* lightning/ppc/core.h: Generate trampolines in the user
-	area.
-	* lightning/ppc/funcs.h: Add a few casts.
-	* tests/bc.c: New testcase.
-
-	* lightning/i386/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
-	* lightning/ppc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
-	* lightning/sparc/asm.h: Wrap into #ifndef LIGHTNING_DEBUG.
-
-
-2004-03-09  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/sparc/fp.h: Rewrite.  Move macros for
-	FP code generation...
-	* lightning/sparc/asm.h: ... here.
-	* lightning/sparc/core.h: Rename jit_prepare to
-	jit_prepare_i, jit_retval to jit_retval_i.
-	* lightning/ppc/core.h: Rename jit_prepare to
-	jit_prepare_i, jit_retval to jit_retval_i.
-	* lightning/i386/core.h: Rename jit_prepare to
-	jit_prepare_i, jit_retval to jit_retval_i.
-	* lightning/core-common.h: Provide backwards
-	compatible synonyms for the above.
-	* lightning/fp-common.h: Rewrite.
-	* lightning-inst.h: Include fp unconditionally.
-	* lightning.h.in: Include fp unconditionally.
-	* tests/Makefile.am: Enable fp tests.
-	* tests/fib.c: Use jit_retval_i.
-	* tests/fibit.c: Cast codeBuffer to char *.
-	* tests/funcfp.c: Use new fp macros.
-	* tests/printf.c: Use jit_retval_i.
-	* tests/rpnfp.c: Use new fp macros.
-	* tests/testfp.c: Use new fp macros.
-
-2004-03-02  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: generate correct code when
-	doing lt/le/ge/etc. on ESI and EDI.  Use MOVZX/MOVSX
-	where possible.
-	* lightning/i386/asm.h: Add macros for MOVZX/MOVSX.
-	Move macros for x87 here, and add many of them.
-	* lightning/i386/fp.h: Use new macros for x87.
-
-2004-02-06  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: avoid generating MOV reg, reg.
-	* lightning/sparc/core.h: fix several bugs.
-	* lightning/ppc/core.h: fix several bugs.
-	* tests/rpn.c: rewritten.
-
-2004-01-08  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/rpnfp.c: new example, suggested by Basile
-	Starynkevitch.
-	* tests/rpnfp.ok: new example.
-
-2003-12-12  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/add.c: new test, suggested by Steve Dekorte.
-	* tests/add.c: new test.
-
-2003-11-14  Paolo Bonzini  <bonzini@gnu.org>
-	    John Redford <eirenik@hotmail.com>
-
-	* lightning/asm-common.h: change the 'pc' field of _jit to
-	be a union of various data types, because ISO C99 doesn't
-	permit using ++ on a = cast.  Change the incremented casts of
-	_jit.pc to be _jit.x.uc_pc, _jit.x.us_pc, etc.
-	* all files: change all non-cast instances of _jit.pc to be
-	_jit.x.pc.
-	* lightning/i386/core.h: remove casts from jit_might.
-
-2003-05-25  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: use JITSORRY in jit_replace
-	* lightning/asm-common.h: define JITSORRY
-
-2003-05-14  Paolo Bonzini  <bonzini@gnu.org>
-
-	* lightning/i386/core.h: fix missing comma in several
-	load/store macros.
-	* lightning/core-common.h: fix long/unsigned long/pointer
-	jit_pushr/jit_popr.
-	* lightning/ppc/funcs.h: correctly align stack pointer
-
-No changelogs for the assemblers (lightning directory) until 1.0
-	
-2003-03-27  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/printf2.c: new test
-
-2001-05-03  Paolo Bonzini  <bonzini@gnu.org>
-
-	* tests/printf.c: made the message platform independent
-
-2001-01-19  Paolo Bonzini  <bonzini@gnu.org>
-
-	* configure.in: support cross-assembling
-	
-	* disass/bfd.h, disass/dis-asm.h, disass/dis-buf.c,
-	disass/i386-dis.c, disass/i386.h, disass/ppc-dis.c,
-	disass/ppc.h, disass/ppc-opc.c, disass/sparc-dis.c,
-	disass/sparc.h, disass/sparc-opc.c: new files, from GDB
-
-	* disass/disass.c, disass/Makefile.am: new files
-
-	* tests/fib.c, tests/fibit.c, tests/incr.c, tests/printf.c,
-	tests/rpn.c, tests/testfp.c, tests/Makefile.am: support
-	disassembling

+ 0 - 45
bjos/sledge/lightning/Makefile.am

@@ -1,45 +0,0 @@
-#
-# Copyright 2000, 2001, 2002, 2012, 2013 Free Software Foundation, Inc.
-#
-# This file is part of GNU lightning.
-#
-# GNU lightning is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published
-# by the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU lightning is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-# License for more details.
-#
-
-ACLOCAL_AMFLAGS = -I m4
-
-SUBDIRS =		\
-	check		\
-	doc		\
-	include		\
-	lib
-
-pkgconfiglibdir = $(libdir)/pkgconfig
-pkgconfiglib_DATA = lightning.pc
-
-if get_jit_size
-JIT_SIZE_PATH = "$(top_builddir)/jit_$(cpu)-sz.c"
-AM_CPPFLAGS=-DGET_JIT_SIZE=1 -DJIT_SIZE_PATH='$(JIT_SIZE_PATH)'
-AM_CFLAGS = -I$(top_srcdir)/include -D_GNU_SOURCE $(LIGHTNING_CFLAGS)
-
-noinst_PROGRAMS = size
-size_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-size_SOURCES = size.c
-
-get_jit_size::	$(JIT_SIZE_PATH)
-
-$(JIT_SIZE_PATH):
-	make clean
-	make CFLAGS='-O0 -g3' check
-	$(top_builddir)/size
-
-CLEANFILES = $(JIT_SIZE_PATH)
-endif

+ 0 - 199
bjos/sledge/lightning/NEWS

@@ -1,199 +0,0 @@
-NEWS FROM 1.99 TO 1.99a
-
-o   Lightning now builds and pass all test cases on AIX 7.1 powerpc,
-    HP-UX 11iv2 hppa, HP-UX 11iv3 ia64, Solaris 10 Sparc, Solaris 11
-    x86_64, and Irix 6.5.30 mips (using n32 abi).
-
-NEWS FROM VERSION 1.3 TO 1.99
-
-o   The 1.99 version is a major lightning redesign and an
-    alpha version.
-
-o   Unless for some special power users usage, the major
-    difference in the rework is that now function calls push
-    arguments from left to right, what is both, more natural for
-    programers, and also more natural to implement for architectures
-    that pass arguments in registers and have alignment constraints,
-    usually for 64 bit double arguments.
-
-o   Add mips backend, implementing the o32 abi.
-
-o   Added arm backend implementing all combinations of software float,
-    vfp, neon, arm and thumb instruction sets, softfp and hardp abis,
-    armv5, armv6, and armv7.
-
-o   Added sse2+ code generation for the 32 bit x86 backend.
-
-o   Added sse3 and sse4.x optional code generation for the 64 bit
-    x86 backend, code generation based on detected cpu.
-
-o   Reworked and added full lightning instruction set to ppc 32;
-    tested on ppc64 hardware and Darwin 32 operating system.
-
-o   Added ppc64 backend, built and tested on Fedora ppc.
-
-o   Reworked the sparc backend, built and tested on Debian sparc.
-
-o   Added an ia64 backend, built and tested on Debian ia64.
-
-o   Added an hppa backend, built and tested on Debian hppa.
-
----
-
-NEWS FROM VERSION 1.2 TO 1.3
-
-o   Initial support for x86-64 back-end (mostly untested).
-
-o   lightning is more strict on casts from integer to pointer.
-    Be sure to use the _p variants when your immediates are
-    of pointer type.  This was done to ease 64-bit cleanliness
-    tests.
-
-o   Many bug fixes.
-
-o   JIT_FPRET is used as JIT_RET to move return values.
-    jit_retval_[fd] is used to retrieve return values.
-
-o   jit_pushr/jit_popr are deprecated, you need to #define
-    JIT_NEED_PUSH_POP prior to including lightning.h if you
-    want to use them.
-
-o   Support for stack-allocated variables.  Because of this,
-    backends defining JIT_FP should now rename it to JIT_AP.
-    JIT_FP is now a user-visible register used in ldxi/ldxr
-    to access stack-allocated variables.
-
-
----
-
-NEWS FROM VERSION 1.1.2 TO 1.2
-
-o   Floating-point interface rewritten, uses a register file
-    architecture rather than a stack.
-
-o   Many bug fixes.
-
-o   jit_prepare and jit_retval are now jit_prepare_i and
-    jit_retval_i.
-
-o   Support for Fedora Core 1's exec-shield feature.
-
-o   PPC supports both SysV and Darwin ABIs.
-
-o   More (and more complete) examples provided.
-
----
-
-NEWS FROM VERSION 1.1.1 TO 1.1.2
-
-o   This release fixes the bugs in PowerPC cache flushing and in
-    SPARC testing.
-
----
-
-NEWS FROM VERSION 1.1 TO 1.1.1
-
-o   Merge changes from Debian
-
-This version was released to have a distributable version of lightning
-after the recent crack of the GNU FTP machines.  It does not fix
-outstanding bugs; I apologize for the inconvenience.
-
----
-
-NEWS FROM VERSION 1.0 TO 1.1
-
-o   Several bug fixes
-
-o   improved infrastructure for embedding GNU lightning (lightningize
-    script)
-    
----
-
-NEWS FROM VERSION 0.99 TO 1.0
-
-o   SPARC backend tested on GNU Smalltalk
-
-
----
-
-NEWS FROM VERSION 0.98 TO 0.99
-
-o   Added floating point function support (thanks to Laurent Michel);
-    unfortunately this broke even more the PPC and SPARC floating point
-    stuff :-(
-
----
-
-NEWS FROM VERSION 0.97 to 0.98
-
-o   PPC backend tested on GNU Smalltalk
-
-o   switched to autoconf 2.50
-
-o   new (much faster) PPC cache flushing code by John McIntosh
-
----
-
-NEWS FROM VERSION 0.96 to 0.97
-
-o   support for cross-assembling and for disassembling the code that the tests
-    generate
-
-o   PPC microtests pass (tested directly by me), SPARC was said to work
-
----
-
-NEWS FROM VERSION 0.95 to 0.96
-
-o   fixed implementation of delay slots to be coherent with the manual
-
----
-
-NEWS FROM VERSION 0.94 to 0.95
-
-o   adc/sbc replaced with addc/addx/subc/subx to allow for more optimization
-    (inspired by the PPC instruction set).
-
-o   A few fixes and much less warnings from the compiler
-
-o   Automake-ized everything
-
-o   i386 backend generates smaller code for bms/bmc/or/xor by using byte
-    or word versions if possible
-
-o   Moved backends to separate directories
-
----
-
-NEWS FROM VERSION 0.93 to 0.94
-
-o   Manual builds as DVI file.
-
----
-
-NEWS FROM VERSION 0.92 to 0.93
-
-o   Floating-point front-end (began supporting PPC & SPARC).
-
----
-
-NEWS FROM VERSION 0.91 to 0.92
-
-o   Floating-point front-end (only x86 supported).
-
----
-
-NEWS FROM VERSION 0.9 to 0.91
-
-o   Carrying supported in addition/subtraction.
-
-o   insn type changed to jit_insn.
-
-o   Misc bug fixes.
-
-o   Reentrancy supported.
-
-o   SPARC run-time assembler rewritten.
-
-o   The run-time assembler can be disabled for debugging purposes.

+ 0 - 3
bjos/sledge/lightning/README

@@ -1,3 +0,0 @@
-GNU lightning is a library to aid in making portable programs
-that compile assembly code at run time.  For more information,
-look at the info documentation.

+ 0 - 18
bjos/sledge/lightning/THANKS

@@ -1,18 +0,0 @@
-Thanks to all the following people for their help in
-improving GNU lightning:
-
-Paolo Bonzini                   <bonzini@gnu.org>
-Eli Barzilay                    <eli@barzilay.org>
-Ludovic Courtes                 <ludo@chbouib.org>
-Matthew Flatt			<mflatt@cs.utah.edu>
-Laurent Michel                  <ldm@thorgal.homelinux.org>
-Paulo Cesar Pereira de Andrade  <pcpa@gnu.org>
-Mike Spivey                     <mike@comlab.ox.ac.uk>
-Basile Starynkevitch            <basile@starynkevitch.net>
-Sam Steingold			<sds@gnu.org>
-Jens Troeger                    <savage@light-speed.de>
-Tom Tromey                      <tromey@redhat.com>
-Trent Nelson                    <trent@snakebite.org>
-Vitaly Magerya                  <vmagerya@gmail.com>
-Brandon Invergo                 <brandon@gnu.org>
-Holger Hans Peter Freyther      <holger@moiji-mobile.com>

+ 0 - 28
bjos/sledge/lightning/TODO

@@ -1,28 +0,0 @@
-	* Validate that divrem in jit_x86-cpu.c is not modifying
-	the non result arguments. This is not verified by clobber.tst,
-	as it only checks registers not involved in the operation
-	(because it does not know about values being set as input
-	for the the operation).
-
-	* Write a simple higher level language implementation generating
-	jit with lightning, that could be some lisp or C like language.
-
-	* rerun ./configure --enable-devel-get-jit-size and regenerate
-	the related jit_$arch-sz.c for the ports where nodata is
-	meaningful:
-	hppa		(done)
-	i586		(done)
-	ia64
-	mips o32	(done)
-	mips n32
-	mips n64
-	powerpc 32	(done)
-	powerpc 64	(done)
-	ppc
-	s390x		(done)
-	sparc		(done)
-	x86_64		(done)
-	Missing ones are due to no longer (remote) access to such hosts
-	and may be broken with jit_set_data(..., JIT_DISABLE_DATA).
-	(ia64 hp-ux or linx), (irix mips for 32 or 64 abi), and
-	(darwin ppc).

+ 0 - 1040
bjos/sledge/lightning/build/include/lightning.h

@@ -1,1040 +0,0 @@
-/*
- * Copyright (C) 2012, 2013  Free Software Foundation, Inc.
- *
- * This file is part of GNU lightning.
- *
- * GNU lightning is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU lightning is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * Authors:
- *	Paulo Cesar Pereira de Andrade
- */
-
-#ifndef _lightning_h
-#define _lightning_h
-
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <unistd.h>
-#include <stdlib.h>
-#if HAVE_STDINT_H
-#  include <stdint.h>
-#endif
-#include <string.h>
-
-#if defined(__hpux) && defined(__hppa__)
-#  include <machine/param.h>
-#endif
-#if defined(__alpha__) && defined(__osf__)
-#  include <machine/endian.h>
-#endif
-
-#ifndef __WORDSIZE
-#  if defined(WORDSIZE)				/* ppc darwin */
-#    define __WORDSIZE		WORDSIZE
-#  elif defined(__SIZEOF_POINTER__)		/* ppc aix */
-#    define __WORDSIZE		(__SIZEOF_POINTER__ << 3)
-#  elif defined(_ILP32)				/* hppa hp-ux */
-#    define __WORDSIZE		32
-#  elif defined(_LP64)				/* ia64 hp-ux (with cc +DD64) */
-#    define __WORDSIZE		64
-#  elif defined(_MIPS_SZPTR)			/* mips irix */
-#    if _MIPS_SZPTR == 32
-#      define __WORDSIZE	32
-#    else
-#      define __WORDSIZE	64
-#    endif
-#  else						/* From FreeBSD 9.1 stdint.h */
-#    if defined(UINTPTR_MAX) && defined(UINT64_MAX) && \
-	(UINTPTR_MAX == UINT64_MAX)
-#      define __WORDSIZE	64
-#    else
-#      define __WORDSIZE	32
-#    endif
-#  endif
-#endif
-#ifndef __LITTLE_ENDIAN
-#  if defined(LITTLE_ENDIAN)			/* ppc darwin */
-#    define __LITTLE_ENDIAN	LITTLE_ENDIAN
-#  elif defined(__ORDER_LITTLE_ENDIAN__)	/* ppc aix */
-#    define __LITTLE_ENDIAN	__ORDER_LITTLE_ENDIAN__
-#  else
-#    define __LITTLE_ENDIAN	1234
-#  endif
-#endif
-#ifndef __BIG_ENDIAN
-#  if defined(BIG_ENDIAN)			/* ppc darwin */
-#    define __BIG_ENDIAN	BIG_ENDIAN
-#  elif defined(__ORDER_BIG_ENDIAN__)		/* ppc aix */
-#    define __BIG_ENDIAN	__ORDER_BIG_ENDIAN__
-#  else
-#    define __BIG_ENDIAN	4321
-#  endif
-#endif
-#ifndef __BYTE_ORDER
-#  if defined(BYTE_ORDER)			/* ppc darwin */
-#    define __BYTE_ORDER	BYTE_ORDER
-#  elif defined(__BYTE_ORDER__)			/* ppc aix */
-#    define __BYTE_ORDER	__BYTE_ORDER__
-#  elif defined(_BIG_ENDIAN)			/* hppa hp-ux */
-#    define __BYTE_ORDER	__BIG_ENDIAN
-#  elif defined(__BIG_ENDIAN__)			/* ia64 hp-ux */
-#    define __BYTE_ORDER	__BIG_ENDIAN
-#  elif defined(__i386__)			/* 32 bit x86 solaris */
-#    define __BYTE_ORDER	__LITTLE_ENDIAN
-#  elif defined(__x86_64__)			/* 64 bit x86 solaris */
-#    define __BYTE_ORDER	__LITTLE_ENDIAN
-#  elif defined(__MIPSEB)			/* mips irix */
-#    define __BYTE_ORDER	__BIG_ENDIAN
-#  else
-#    error cannot figure __BYTE_ORDER
-#  endif
-#endif
-
-typedef signed char		jit_int8_t;
-typedef unsigned char		jit_uint8_t;
-typedef signed short		jit_int16_t;
-typedef unsigned short		jit_uint16_t;
-typedef signed int		jit_int32_t;
-typedef unsigned int		jit_uint32_t;
-#if __WORDSIZE == 32
-typedef signed long long	jit_int64_t;
-typedef unsigned long long	jit_uint64_t;
-typedef jit_int32_t		jit_word_t;
-typedef jit_uint32_t		jit_uword_t;
-#else
-typedef signed long		jit_int64_t;
-typedef unsigned long		jit_uint64_t;
-typedef jit_int64_t		jit_word_t;
-typedef jit_uint64_t		jit_uword_t;
-#endif
-typedef float			jit_float32_t;
-typedef double			jit_float64_t;
-typedef void*			jit_pointer_t;
-typedef jit_int32_t		jit_bool_t;
-typedef jit_int32_t		jit_gpr_t;
-typedef jit_int32_t		jit_fpr_t;
-
-#if defined(__i386__) || defined(__x86_64__)
-#  include <lightning/jit_x86.h>
-#elif defined(__mips__)
-#  include <lightning/jit_mips.h>
-#elif defined(__arm__)
-#  include <lightning/jit_arm.h>
-#elif defined(__ppc__) || defined(__powerpc__)
-#  include <lightning/jit_ppc.h>
-#elif defined(__sparc__)
-#  include <lightning/jit_sparc.h>
-#elif defined(__ia64__)
-#  include <lightning/jit_ia64.h>
-#elif defined(__hppa__)
-#  include <lightning/jit_hppa.h>
-#elif defined(__aarch64__)
-#  include <lightning/jit_aarch64.h>
-#elif defined(__s390__) || defined(__s390x__)
-#  include <lightning/jit_s390.h>
-#elif defined(__alpha__)
-#  include <lightning/jit_alpha.h>
-#endif
-
-#define jit_flag_node		0x00000001 /* patch node not absolute */
-#define jit_flag_patch		0x00000002 /* jump already patched */
-#define jit_flag_data		0x00000004 /* data in the constant pool */
-#define jit_flag_use		0x00000008 /* do not remove marker label */
-#define jit_flag_head		0x00100000 /* label reached by normal flow */
-
-#define JIT_R(index)		jit_r(index)
-#define JIT_V(index)		jit_v(index)
-#define JIT_F(index)		jit_f(index)
-#define JIT_R_NUM		jit_r_num()
-#define JIT_V_NUM		jit_v_num()
-#define JIT_F_NUM		jit_f_num()
-
-#define JIT_DISABLE_DATA	1	/* force synthesize of constants */
-#define JIT_DISABLE_NOTE	2	/* disable debug info generation */
-
-#define jit_class_chk		0x02000000	/* just checking */
-#define jit_class_arg		0x08000000	/* argument register */
-#define jit_class_sav		0x10000000	/* callee save */
-#define jit_class_gpr		0x20000000	/* general purpose */
-#define jit_class_fpr		0x40000000	/* float */
-#define jit_class(reg)		((reg) & 0xffff0000)
-#define jit_regno(reg)		((reg) & 0x00007fff)
-
-typedef struct jit_node		jit_node_t;
-typedef struct jit_state	jit_state_t;
-
-typedef enum {
-    jit_code_data,
-#define jit_live(u)		jit_new_node_w(jit_code_live, u)
-#define jit_align(u)		jit_new_node_w(jit_code_align, u)
-    jit_code_live,		jit_code_align,
-    jit_code_save,		jit_code_load,
-#define jit_name(u)		_jit_name(_jit,u)
-    jit_code_name,
-#define jit_note(u, v)		_jit_note(_jit, u, v)
-#define jit_label()		_jit_label(_jit)
-#define jit_forward()		_jit_forward(_jit)
-#define jit_indirect()		_jit_indirect(_jit)
-#define jit_link(u)		_jit_link(_jit,u)
-    jit_code_note,		jit_code_label,
-
-#define jit_prolog()		_jit_prolog(_jit)
-    jit_code_prolog,
-
-#define jit_ellipsis()		_jit_ellipsis(_jit)
-#define jit_allocai(u)		_jit_allocai(_jit,u)
-
-#define jit_arg()		_jit_arg(_jit)
-#define jit_getarg_c(u,v)	_jit_getarg_c(_jit,u,v)
-#define jit_getarg_uc(u,v)	_jit_getarg_uc(_jit,u,v)
-#define jit_getarg_s(u,v)	_jit_getarg_s(_jit,u,v)
-#define jit_getarg_us(u,v)	_jit_getarg_us(_jit,u,v)
-#define jit_getarg_i(u,v)	_jit_getarg_i(_jit,u,v)
-#if __WORDSIZE == 32
-#  define jit_getarg(u,v)	jit_getarg_i(u,v)
-#else
-#  define jit_getarg(u,v)	jit_getarg_l(u,v)
-#  define jit_getarg_ui(u,v)	_jit_getarg_ui(_jit,u,v)
-#  define jit_getarg_l(u,v)	_jit_getarg_l(_jit,u,v)
-#endif
-#  define jit_putargr(u,v)	_jit_putargr(_jit,u,v)
-#  define jit_putargi(u,v)	_jit_putargi(_jit,u,v)
-    jit_code_arg,
-
-#define jit_addr(u,v,w)		jit_new_node_www(jit_code_addr,u,v,w)
-#define jit_addi(u,v,w)		jit_new_node_www(jit_code_addi,u,v,w)
-    jit_code_addr,		jit_code_addi,
-#define jit_addcr(u,v,w)	jit_new_node_www(jit_code_addcr,u,v,w)
-#define jit_addci(u,v,w)	jit_new_node_www(jit_code_addci,u,v,w)
-    jit_code_addcr,		jit_code_addci,
-#define jit_addxr(u,v,w)	jit_new_node_www(jit_code_addxr,u,v,w)
-#define jit_addxi(u,v,w)	jit_new_node_www(jit_code_addxi,u,v,w)
-    jit_code_addxr,		jit_code_addxi,
-#define jit_subr(u,v,w)		jit_new_node_www(jit_code_subr,u,v,w)
-#define jit_subi(u,v,w)		jit_new_node_www(jit_code_subi,u,v,w)
-    jit_code_subr,		jit_code_subi,
-#define jit_subcr(u,v,w)	jit_new_node_www(jit_code_subcr,u,v,w)
-#define jit_subci(u,v,w)	jit_new_node_www(jit_code_subci,u,v,w)
-    jit_code_subcr,		jit_code_subci,
-#define jit_subxr(u,v,w)	jit_new_node_www(jit_code_subxr,u,v,w)
-#define jit_subxi(u,v,w)	jit_new_node_www(jit_code_subxi,u,v,w)
-    jit_code_subxr,		jit_code_subxi,
-#define jit_rsbr(u,v,w)		jit_subr(u,w,v)
-#define jit_rsbi(u,v,w)		jit_new_node_www(jit_code_rsbi,u,v,w)
-    jit_code_rsbi,
-#define jit_mulr(u,v,w)		jit_new_node_www(jit_code_mulr,u,v,w)
-#define jit_muli(u,v,w)		jit_new_node_www(jit_code_muli,u,v,w)
-    jit_code_mulr,		jit_code_muli,
-#define jit_qmulr(l,h,v,w)	jit_new_node_qww(jit_code_qmulr,l,h,v,w)
-#define jit_qmuli(l,h,v,w)	jit_new_node_qww(jit_code_qmuli,l,h,v,w)
-    jit_code_qmulr,		jit_code_qmuli,
-#define jit_qmulr_u(l,h,v,w)	jit_new_node_qww(jit_code_qmulr_u,l,h,v,w)
-#define jit_qmuli_u(l,h,v,w)	jit_new_node_qww(jit_code_qmuli_u,l,h,v,w)
-    jit_code_qmulr_u,		jit_code_qmuli_u,
-#define jit_divr(u,v,w)		jit_new_node_www(jit_code_divr,u,v,w)
-#define jit_divi(u,v,w)		jit_new_node_www(jit_code_divi,u,v,w)
-    jit_code_divr,		jit_code_divi,
-#define jit_divr_u(u,v,w)	jit_new_node_www(jit_code_divr_u,u,v,w)
-#define jit_divi_u(u,v,w)	jit_new_node_www(jit_code_divi_u,u,v,w)
-    jit_code_divr_u,		jit_code_divi_u,
-#define jit_qdivr(l,h,v,w)	jit_new_node_qww(jit_code_qdivr,l,h,v,w)
-#define jit_qdivi(l,h,v,w)	jit_new_node_qww(jit_code_qdivi,l,h,v,w)
-    jit_code_qdivr,		jit_code_qdivi,
-#define jit_qdivr_u(l,h,v,w)	jit_new_node_qww(jit_code_qdivr_u,l,h,v,w)
-#define jit_qdivi_u(l,h,v,w)	jit_new_node_qww(jit_code_qdivi_u,l,h,v,w)
-    jit_code_qdivr_u,		jit_code_qdivi_u,
-#define jit_remr(u,v,w)		jit_new_node_www(jit_code_remr,u,v,w)
-#define jit_remi(u,v,w)		jit_new_node_www(jit_code_remi,u,v,w)
-    jit_code_remr,		jit_code_remi,
-#define jit_remr_u(u,v,w)	jit_new_node_www(jit_code_remr_u,u,v,w)
-#define jit_remi_u(u,v,w)	jit_new_node_www(jit_code_remi_u,u,v,w)
-    jit_code_remr_u,		jit_code_remi_u,
-
-#define jit_andr(u,v,w)		jit_new_node_www(jit_code_andr,u,v,w)
-#define jit_andi(u,v,w)		jit_new_node_www(jit_code_andi,u,v,w)
-    jit_code_andr,		jit_code_andi,
-#define jit_orr(u,v,w)		jit_new_node_www(jit_code_orr,u,v,w)
-#define jit_ori(u,v,w)		jit_new_node_www(jit_code_ori,u,v,w)
-    jit_code_orr,		jit_code_ori,
-#define jit_xorr(u,v,w)		jit_new_node_www(jit_code_xorr,u,v,w)
-#define jit_xori(u,v,w)		jit_new_node_www(jit_code_xori,u,v,w)
-    jit_code_xorr,		jit_code_xori,
-
-#define jit_lshr(u,v,w)		jit_new_node_www(jit_code_lshr,u,v,w)
-#define jit_lshi(u,v,w)		jit_new_node_www(jit_code_lshi,u,v,w)
-    jit_code_lshr,		jit_code_lshi,
-#define jit_rshr(u,v,w)		jit_new_node_www(jit_code_rshr,u,v,w)
-#define jit_rshi(u,v,w)		jit_new_node_www(jit_code_rshi,u,v,w)
-    jit_code_rshr,		jit_code_rshi,
-#define jit_rshr_u(u,v,w)	jit_new_node_www(jit_code_rshr_u,u,v,w)
-#define jit_rshi_u(u,v,w)	jit_new_node_www(jit_code_rshi_u,u,v,w)
-    jit_code_rshr_u,		jit_code_rshi_u,
-
-#define jit_negr(u,v)		jit_new_node_ww(jit_code_negr,u,v)
-#define jit_comr(u,v)		jit_new_node_ww(jit_code_comr,u,v)
-    jit_code_negr,		jit_code_comr,
-
-#define jit_ltr(u,v,w)		jit_new_node_www(jit_code_ltr,u,v,w)
-#define jit_lti(u,v,w)		jit_new_node_www(jit_code_lti,u,v,w)
-    jit_code_ltr,		jit_code_lti,
-#define jit_ltr_u(u,v,w)	jit_new_node_www(jit_code_ltr_u,u,v,w)
-#define jit_lti_u(u,v,w)	jit_new_node_www(jit_code_lti_u,u,v,w)
-    jit_code_ltr_u,		jit_code_lti_u,
-#define jit_ler(u,v,w)		jit_new_node_www(jit_code_ler,u,v,w)
-#define jit_lei(u,v,w)		jit_new_node_www(jit_code_lei,u,v,w)
-    jit_code_ler,		jit_code_lei,
-#define jit_ler_u(u,v,w)	jit_new_node_www(jit_code_ler_u,u,v,w)
-#define jit_lei_u(u,v,w)	jit_new_node_www(jit_code_lei_u,u,v,w)
-    jit_code_ler_u,		jit_code_lei_u,
-#define jit_eqr(u,v,w)		jit_new_node_www(jit_code_eqr,u,v,w)
-#define jit_eqi(u,v,w)		jit_new_node_www(jit_code_eqi,u,v,w)
-    jit_code_eqr,		jit_code_eqi,
-#define jit_ger(u,v,w)		jit_new_node_www(jit_code_ger,u,v,w)
-#define jit_gei(u,v,w)		jit_new_node_www(jit_code_gei,u,v,w)
-    jit_code_ger,		jit_code_gei,
-#define jit_ger_u(u,v,w)	jit_new_node_www(jit_code_ger_u,u,v,w)
-#define jit_gei_u(u,v,w)	jit_new_node_www(jit_code_gei_u,u,v,w)
-    jit_code_ger_u,		jit_code_gei_u,
-#define jit_gtr(u,v,w)		jit_new_node_www(jit_code_gtr,u,v,w)
-#define jit_gti(u,v,w)		jit_new_node_www(jit_code_gti,u,v,w)
-    jit_code_gtr,		jit_code_gti,
-#define jit_gtr_u(u,v,w)	jit_new_node_www(jit_code_gtr_u,u,v,w)
-#define jit_gti_u(u,v,w)	jit_new_node_www(jit_code_gti_u,u,v,w)
-    jit_code_gtr_u,		jit_code_gti_u,
-#define jit_ner(u,v,w)		jit_new_node_www(jit_code_ner,u,v,w)
-#define jit_nei(u,v,w)		jit_new_node_www(jit_code_nei,u,v,w)
-    jit_code_ner,		jit_code_nei,
-
-#define jit_movr(u,v)		jit_new_node_ww(jit_code_movr,u,v)
-#define jit_movi(u,v)		jit_new_node_ww(jit_code_movi,u,v)
-    jit_code_movr,		jit_code_movi,
-#define jit_extr_c(u,v)		jit_new_node_ww(jit_code_extr_c,u,v)
-#define jit_extr_uc(u,v)	jit_new_node_ww(jit_code_extr_uc,u,v)
-    jit_code_extr_c,		jit_code_extr_uc,
-#define jit_extr_s(u,v)		jit_new_node_ww(jit_code_extr_s,u,v)
-#define jit_extr_us(u,v)	jit_new_node_ww(jit_code_extr_us,u,v)
-    jit_code_extr_s,		jit_code_extr_us,
-#if __WORDSIZE == 64
-#  define jit_extr_i(u,v)	jit_new_node_ww(jit_code_extr_i,u,v)
-#  define jit_extr_ui(u,v)	jit_new_node_ww(jit_code_extr_ui,u,v)
-#endif
-    jit_code_extr_i,		jit_code_extr_ui,
-
-#define jit_htonr_us(u,v)	jit_new_node_ww(jit_code_htonr_us,u,v)
-#define jit_ntohr_us(u,v)	jit_new_node_ww(jit_code_htonr_us,u,v)
-    jit_code_htonr_us,
-#define jit_htonr_ui(u,v)	jit_new_node_ww(jit_code_htonr_ui,u,v)
-#define jit_ntohr_ui(u,v)	jit_new_node_ww(jit_code_htonr_ui,u,v)
-#if __WORDSIZE == 32
-#  define jit_htonr(u,v)	jit_new_node_ww(jit_code_htonr_ui,u,v)
-#  define jit_ntohr(u,v)	jit_new_node_ww(jit_code_htonr_ui,u,v)
-#else
-#define jit_htonr_ul(u,v)	jit_new_node_ww(jit_code_htonr_ul,u,v)
-#define jit_ntohr_ul(u,v)	jit_new_node_ww(jit_code_htonr_ul,u,v)
-#  define jit_htonr(u,v)	jit_new_node_ww(jit_code_htonr_ul,u,v)
-#  define jit_ntohr(u,v)	jit_new_node_ww(jit_code_htonr_ul,u,v)
-#endif
-    jit_code_htonr_ui,		jit_code_htonr_ul,
-
-#define jit_ldr_c(u,v)		jit_new_node_ww(jit_code_ldr_c,u,v)
-#define jit_ldi_c(u,v)		jit_new_node_wp(jit_code_ldi_c,u,v)
-    jit_code_ldr_c,		jit_code_ldi_c,
-#define jit_ldr_uc(u,v)		jit_new_node_ww(jit_code_ldr_uc,u,v)
-#define jit_ldi_uc(u,v)		jit_new_node_wp(jit_code_ldi_uc,u,v)
-    jit_code_ldr_uc,		jit_code_ldi_uc,
-#define jit_ldr_s(u,v)		jit_new_node_ww(jit_code_ldr_s,u,v)
-#define jit_ldi_s(u,v)		jit_new_node_wp(jit_code_ldi_s,u,v)
-    jit_code_ldr_s,		jit_code_ldi_s,
-#define jit_ldr_us(u,v)		jit_new_node_ww(jit_code_ldr_us,u,v)
-#define jit_ldi_us(u,v)		jit_new_node_wp(jit_code_ldi_us,u,v)
-    jit_code_ldr_us,		jit_code_ldi_us,
-#define jit_ldr_i(u,v)		jit_new_node_ww(jit_code_ldr_i,u,v)
-#define jit_ldi_i(u,v)		jit_new_node_wp(jit_code_ldi_i,u,v)
-    jit_code_ldr_i,		jit_code_ldi_i,
-#if __WORDSIZE == 32
-#  define jit_ldr(u,v)		jit_ldr_i(u,v)
-#  define jit_ldi(u,v)		jit_ldi_i(u,v)
-#else
-#  define jit_ldr(u,v)		jit_ldr_l(u,v)
-#  define jit_ldi(u,v)		jit_ldi_l(u,v)
-#  define jit_ldr_ui(u,v)	jit_new_node_ww(jit_code_ldr_ui,u,v)
-#  define jit_ldi_ui(u,v)	jit_new_node_wp(jit_code_ldi_ui,u,v)
-#define jit_ldr_l(u,v)		jit_new_node_ww(jit_code_ldr_l,u,v)
-#define jit_ldi_l(u,v)		jit_new_node_wp(jit_code_ldi_l,u,v)
-#endif
-    jit_code_ldr_ui,		jit_code_ldi_ui,
-    jit_code_ldr_l,		jit_code_ldi_l,
-
-#define jit_ldxr_c(u,v,w)	jit_new_node_www(jit_code_ldxr_c,u,v,w)
-#define jit_ldxi_c(u,v,w)	jit_new_node_www(jit_code_ldxi_c,u,v,w)
-    jit_code_ldxr_c,		jit_code_ldxi_c,
-#define jit_ldxr_uc(u,v,w)	jit_new_node_www(jit_code_ldxr_uc,u,v,w)
-#define jit_ldxi_uc(u,v,w)	jit_new_node_www(jit_code_ldxi_uc,u,v,w)
-    jit_code_ldxr_uc,		jit_code_ldxi_uc,
-#define jit_ldxr_s(u,v,w)	jit_new_node_www(jit_code_ldxr_s,u,v,w)
-#define jit_ldxi_s(u,v,w)	jit_new_node_www(jit_code_ldxi_s,u,v,w)
-    jit_code_ldxr_s,		jit_code_ldxi_s,
-#define jit_ldxr_us(u,v,w)	jit_new_node_www(jit_code_ldxr_us,u,v,w)
-#define jit_ldxi_us(u,v,w)	jit_new_node_www(jit_code_ldxi_us,u,v,w)
-    jit_code_ldxr_us,		jit_code_ldxi_us,
-#define jit_ldxr_i(u,v,w)	jit_new_node_www(jit_code_ldxr_i,u,v,w)
-#define jit_ldxi_i(u,v,w)	jit_new_node_www(jit_code_ldxi_i,u,v,w)
-    jit_code_ldxr_i,		jit_code_ldxi_i,
-#if __WORDSIZE == 32
-#  define jit_ldxr(u,v,w)	jit_ldxr_i(u,v,w)
-#  define jit_ldxi(u,v,w)	jit_ldxi_i(u,v,w)
-#else
-#  define jit_ldxr_ui(u,v,w)	jit_new_node_www(jit_code_ldxr_ui,u,v,w)
-#  define jit_ldxi_ui(u,v,w)	jit_new_node_www(jit_code_ldxi_ui,u,v,w)
-#  define jit_ldxr_l(u,v,w)	jit_new_node_www(jit_code_ldxr_l,u,v,w)
-#  define jit_ldxi_l(u,v,w)	jit_new_node_www(jit_code_ldxi_l,u,v,w)
-#  define jit_ldxr(u,v,w)	jit_ldxr_l(u,v,w)
-#  define jit_ldxi(u,v,w)	jit_ldxi_l(u,v,w)
-#endif
-    jit_code_ldxr_ui,		jit_code_ldxi_ui,
-    jit_code_ldxr_l,		jit_code_ldxi_l,
-
-#define jit_str_c(u,v)		jit_new_node_ww(jit_code_str_c,u,v)
-#define jit_sti_c(u,v)		jit_new_node_pw(jit_code_sti_c,u,v)
-    jit_code_str_c,		jit_code_sti_c,
-#define jit_str_s(u,v)		jit_new_node_ww(jit_code_str_s,u,v)
-#define jit_sti_s(u,v)		jit_new_node_pw(jit_code_sti_s,u,v)
-    jit_code_str_s,		jit_code_sti_s,
-#define jit_str_i(u,v)		jit_new_node_ww(jit_code_str_i,u,v)
-#define jit_sti_i(u,v)		jit_new_node_pw(jit_code_sti_i,u,v)
-    jit_code_str_i,		jit_code_sti_i,
-#if __WORDSIZE == 32
-#  define jit_str(u,v)		jit_str_i(u,v)
-#  define jit_sti(u,v)		jit_sti_i(u,v)
-#else
-#  define jit_str(u,v)		jit_str_l(u,v)
-#  define jit_sti(u,v)		jit_sti_l(u,v)
-#  define jit_str_l(u,v)	jit_new_node_ww(jit_code_str_l,u,v)
-#  define jit_sti_l(u,v)	jit_new_node_pw(jit_code_sti_l,u,v)
-#endif
-    jit_code_str_l,		jit_code_sti_l,
-
-#define jit_stxr_c(u,v,w)	jit_new_node_www(jit_code_stxr_c,u,v,w)
-#define jit_stxi_c(u,v,w)	jit_new_node_www(jit_code_stxi_c,u,v,w)
-    jit_code_stxr_c,		jit_code_stxi_c,
-#define jit_stxr_s(u,v,w)	jit_new_node_www(jit_code_stxr_s,u,v,w)
-#define jit_stxi_s(u,v,w)	jit_new_node_www(jit_code_stxi_s,u,v,w)
-    jit_code_stxr_s,		jit_code_stxi_s,
-#define jit_stxr_i(u,v,w)	jit_new_node_www(jit_code_stxr_i,u,v,w)
-#define jit_stxi_i(u,v,w)	jit_new_node_www(jit_code_stxi_i,u,v,w)
-    jit_code_stxr_i,		jit_code_stxi_i,
-#if __WORDSIZE == 32
-#  define jit_stxr(u,v,w)	jit_stxr_i(u,v,w)
-#  define jit_stxi(u,v,w)	jit_stxi_i(u,v,w)
-#else
-#  define jit_stxr(u,v,w)	jit_stxr_l(u,v,w)
-#  define jit_stxi(u,v,w)	jit_stxi_l(u,v,w)
-#  define jit_stxr_l(u,v,w)	jit_new_node_www(jit_code_stxr_l,u,v,w)
-#  define jit_stxi_l(u,v,w)	jit_new_node_www(jit_code_stxi_l,u,v,w)
-#endif
-    jit_code_stxr_l,		jit_code_stxi_l,
-
-#define jit_bltr(v,w)		jit_new_node_pww(jit_code_bltr,NULL,v,w)
-#define jit_blti(v,w)		jit_new_node_pww(jit_code_blti,NULL,v,w)
-    jit_code_bltr,		jit_code_blti,
-#define jit_bltr_u(v,w)		jit_new_node_pww(jit_code_bltr_u,NULL,v,w)
-#define jit_blti_u(v,w)		jit_new_node_pww(jit_code_blti_u,NULL,v,w)
-    jit_code_bltr_u,		jit_code_blti_u,
-#define jit_bler(v,w)		jit_new_node_pww(jit_code_bler,NULL,v,w)
-#define jit_blei(v,w)		jit_new_node_pww(jit_code_blei,NULL,v,w)
-    jit_code_bler,		jit_code_blei,
-#define jit_bler_u(v,w)		jit_new_node_pww(jit_code_bler_u,NULL,v,w)
-#define jit_blei_u(v,w)		jit_new_node_pww(jit_code_blei_u,NULL,v,w)
-    jit_code_bler_u,		jit_code_blei_u,
-#define jit_beqr(v,w)		jit_new_node_pww(jit_code_beqr,NULL,v,w)
-#define jit_beqi(v,w)		jit_new_node_pww(jit_code_beqi,NULL,v,w)
-    jit_code_beqr,		jit_code_beqi,
-#define jit_bger(v,w)		jit_new_node_pww(jit_code_bger,NULL,v,w)
-#define jit_bgei(v,w)		jit_new_node_pww(jit_code_bgei,NULL,v,w)
-    jit_code_bger,		jit_code_bgei,
-#define jit_bger_u(v,w)		jit_new_node_pww(jit_code_bger_u,NULL,v,w)
-#define jit_bgei_u(v,w)		jit_new_node_pww(jit_code_bgei_u,NULL,v,w)
-    jit_code_bger_u,		jit_code_bgei_u,
-#define jit_bgtr(v,w)		jit_new_node_pww(jit_code_bgtr,NULL,v,w)
-#define jit_bgti(v,w)		jit_new_node_pww(jit_code_bgti,NULL,v,w)
-    jit_code_bgtr,		jit_code_bgti,
-#define jit_bgtr_u(v,w)		jit_new_node_pww(jit_code_bgtr_u,NULL,v,w)
-#define jit_bgti_u(v,w)		jit_new_node_pww(jit_code_bgti_u,NULL,v,w)
-    jit_code_bgtr_u,		jit_code_bgti_u,
-#define jit_bner(v,w)		jit_new_node_pww(jit_code_bner,NULL,v,w)
-#define jit_bnei(v,w)		jit_new_node_pww(jit_code_bnei,NULL,v,w)
-    jit_code_bner,		jit_code_bnei,
-
-#define jit_bmsr(v,w)		jit_new_node_pww(jit_code_bmsr,NULL,v,w)
-#define jit_bmsi(v,w)		jit_new_node_pww(jit_code_bmsi,NULL,v,w)
-    jit_code_bmsr,		jit_code_bmsi,
-#define jit_bmcr(v,w)		jit_new_node_pww(jit_code_bmcr,NULL,v,w)
-#define jit_bmci(v,w)		jit_new_node_pww(jit_code_bmci,NULL,v,w)
-    jit_code_bmcr,		jit_code_bmci,
-
-#define jit_boaddr(v,w)		jit_new_node_pww(jit_code_boaddr,NULL,v,w)
-#define jit_boaddi(v,w)		jit_new_node_pww(jit_code_boaddi,NULL,v,w)
-    jit_code_boaddr,		jit_code_boaddi,
-#define jit_boaddr_u(v,w)	jit_new_node_pww(jit_code_boaddr_u,NULL,v,w)
-#define jit_boaddi_u(v,w)	jit_new_node_pww(jit_code_boaddi_u,NULL,v,w)
-    jit_code_boaddr_u,		jit_code_boaddi_u,
-#define jit_bxaddr(v,w)		jit_new_node_pww(jit_code_bxaddr,NULL,v,w)
-#define jit_bxaddi(v,w)		jit_new_node_pww(jit_code_bxaddi,NULL,v,w)
-    jit_code_bxaddr,		jit_code_bxaddi,
-#define jit_bxaddr_u(v,w)	jit_new_node_pww(jit_code_bxaddr_u,NULL,v,w)
-#define jit_bxaddi_u(v,w)	jit_new_node_pww(jit_code_bxaddi_u,NULL,v,w)
-    jit_code_bxaddr_u,		jit_code_bxaddi_u,
-#define jit_bosubr(v,w)		jit_new_node_pww(jit_code_bosubr,NULL,v,w)
-#define jit_bosubi(v,w)		jit_new_node_pww(jit_code_bosubi,NULL,v,w)
-    jit_code_bosubr,		jit_code_bosubi,
-#define jit_bosubr_u(v,w)	jit_new_node_pww(jit_code_bosubr_u,NULL,v,w)
-#define jit_bosubi_u(v,w)	jit_new_node_pww(jit_code_bosubi_u,NULL,v,w)
-    jit_code_bosubr_u,		jit_code_bosubi_u,
-#define jit_bxsubr(v,w)		jit_new_node_pww(jit_code_bxsubr,NULL,v,w)
-#define jit_bxsubi(v,w)		jit_new_node_pww(jit_code_bxsubi,NULL,v,w)
-    jit_code_bxsubr,		jit_code_bxsubi,
-#define jit_bxsubr_u(v,w)	jit_new_node_pww(jit_code_bxsubr_u,NULL,v,w)
-#define jit_bxsubi_u(v,w)	jit_new_node_pww(jit_code_bxsubi_u,NULL,v,w)
-    jit_code_bxsubr_u,		jit_code_bxsubi_u,
-
-#define jit_jmpr(u)		jit_new_node_w(jit_code_jmpr,u)
-#define jit_jmpi()		jit_new_node_p(jit_code_jmpi,NULL)
-    jit_code_jmpr,		jit_code_jmpi,
-#define jit_callr(u)		jit_new_node_w(jit_code_callr,u)
-#define jit_calli(u)		jit_new_node_p(jit_code_calli,u)
-    jit_code_callr,		jit_code_calli,
-
-#define jit_prepare()		_jit_prepare(_jit)
-#define jit_pushargr(u)		_jit_pushargr(_jit,u)
-#define jit_pushargi(u)		_jit_pushargi(_jit,u)
-#define jit_finishr(u)		_jit_finishr(_jit,u)
-#define jit_finishi(u)		_jit_finishi(_jit,u)
-#define jit_ret()		_jit_ret(_jit)
-#define jit_retr(u)		_jit_retr(_jit,u)
-#define jit_reti(u)		_jit_reti(_jit,u)
-#define jit_retval_c(u)		_jit_retval_c(_jit,u)
-#define jit_retval_uc(u)	_jit_retval_uc(_jit,u)
-#define jit_retval_s(u)		_jit_retval_s(_jit,u)
-#define jit_retval_us(u)	_jit_retval_us(_jit,u)
-#define jit_retval_i(u)		_jit_retval_i(_jit,u)
-#if __WORDSIZE == 32
-#  define jit_retval(u)		jit_retval_i(u)
-#else
-#  define jit_retval(u)		jit_retval_l(u)
-#  define jit_retval_ui(u)	_jit_retval_ui(_jit,u)
-#  define jit_retval_l(u)	_jit_retval_l(_jit,u)
-#endif
-    /* Usually should not need to call directly, but useful if need
-     * to get a label just before a jit_prolog() call */
-#define jit_epilog()		_jit_epilog(_jit)
-    jit_code_epilog,
-
-#define jit_arg_f()		_jit_arg_f(_jit)
-#define jit_getarg_f(u,v)	_jit_getarg_f(_jit,u,v)
-#define jit_putargr_f(u,v)	_jit_putargr_f(_jit,u,v)
-#define jit_putargi_f(u,v)	_jit_putargi_f(_jit,u,v)
-    jit_code_arg_f,
-
-#define jit_addr_f(u,v,w)	jit_new_node_www(jit_code_addr_f,u,v,w)
-#define jit_addi_f(u,v,w)	jit_new_node_wwf(jit_code_addi_f,u,v,w)
-    jit_code_addr_f,		jit_code_addi_f,
-#define jit_subr_f(u,v,w)	jit_new_node_www(jit_code_subr_f,u,v,w)
-#define jit_subi_f(u,v,w)	jit_new_node_wwf(jit_code_subi_f,u,v,w)
-    jit_code_subr_f,		jit_code_subi_f,
-#define jit_rsbr_f(u,v,w)	jit_subr_f(u,w,v)
-#define jit_rsbi_f(u,v,w)	jit_new_node_wwf(jit_code_rsbi_f,u,v,w)
-    jit_code_rsbi_f,
-#define jit_mulr_f(u,v,w)	jit_new_node_www(jit_code_mulr_f,u,v,w)
-#define jit_muli_f(u,v,w)	jit_new_node_wwf(jit_code_muli_f,u,v,w)
-    jit_code_mulr_f,		jit_code_muli_f,
-#define jit_divr_f(u,v,w)	jit_new_node_www(jit_code_divr_f,u,v,w)
-#define jit_divi_f(u,v,w)	jit_new_node_wwf(jit_code_divi_f,u,v,w)
-    jit_code_divr_f,		jit_code_divi_f,
-#define jit_negr_f(u,v)		jit_new_node_ww(jit_code_negr_f,u,v)
-#define jit_absr_f(u,v)		jit_new_node_ww(jit_code_absr_f,u,v)
-#define jit_sqrtr_f(u,v)	jit_new_node_ww(jit_code_sqrtr_f,u,v)
-    jit_code_negr_f,		jit_code_absr_f,	jit_code_sqrtr_f,
-
-#define jit_ltr_f(u,v,w)	jit_new_node_www(jit_code_ltr_f,u,v,w)
-#define jit_lti_f(u,v,w)	jit_new_node_wwf(jit_code_lti_f,u,v,w)
-    jit_code_ltr_f,		jit_code_lti_f,
-#define jit_ler_f(u,v,w)	jit_new_node_www(jit_code_ler_f,u,v,w)
-#define jit_lei_f(u,v,w)	jit_new_node_wwf(jit_code_lei_f,u,v,w)
-    jit_code_ler_f,		jit_code_lei_f,
-#define jit_eqr_f(u,v,w)	jit_new_node_www(jit_code_eqr_f,u,v,w)
-#define jit_eqi_f(u,v,w)	jit_new_node_wwf(jit_code_eqi_f,u,v,w)
-    jit_code_eqr_f,		jit_code_eqi_f,
-#define jit_ger_f(u,v,w)	jit_new_node_www(jit_code_ger_f,u,v,w)
-#define jit_gei_f(u,v,w)	jit_new_node_wwf(jit_code_gei_f,u,v,w)
-    jit_code_ger_f,		jit_code_gei_f,
-#define jit_gtr_f(u,v,w)	jit_new_node_www(jit_code_gtr_f,u,v,w)
-#define jit_gti_f(u,v,w)	jit_new_node_wwf(jit_code_gti_f,u,v,w)
-    jit_code_gtr_f,		jit_code_gti_f,
-#define jit_ner_f(u,v,w)	jit_new_node_www(jit_code_ner_f,u,v,w)
-#define jit_nei_f(u,v,w)	jit_new_node_wwf(jit_code_nei_f,u,v,w)
-    jit_code_ner_f,		jit_code_nei_f,
-#define jit_unltr_f(u,v,w)	jit_new_node_www(jit_code_unltr_f,u,v,w)
-#define jit_unlti_f(u,v,w)	jit_new_node_wwf(jit_code_unlti_f,u,v,w)
-    jit_code_unltr_f,		jit_code_unlti_f,
-#define jit_unler_f(u,v,w)	jit_new_node_www(jit_code_unler_f,u,v,w)
-#define jit_unlei_f(u,v,w)	jit_new_node_wwf(jit_code_unlei_f,u,v,w)
-    jit_code_unler_f,		jit_code_unlei_f,
-#define jit_uneqr_f(u,v,w)	jit_new_node_www(jit_code_uneqr_f,u,v,w)
-#define jit_uneqi_f(u,v,w)	jit_new_node_wwf(jit_code_uneqi_f,u,v,w)
-    jit_code_uneqr_f,		jit_code_uneqi_f,
-#define jit_unger_f(u,v,w)	jit_new_node_www(jit_code_unger_f,u,v,w)
-#define jit_ungei_f(u,v,w)	jit_new_node_wwf(jit_code_ungei_f,u,v,w)
-    jit_code_unger_f,		jit_code_ungei_f,
-#define jit_ungtr_f(u,v,w)	jit_new_node_www(jit_code_ungtr_f,u,v,w)
-#define jit_ungti_f(u,v,w)	jit_new_node_wwf(jit_code_ungti_f,u,v,w)
-    jit_code_ungtr_f,		jit_code_ungti_f,
-#define jit_ltgtr_f(u,v,w)	jit_new_node_www(jit_code_ltgtr_f,u,v,w)
-#define jit_ltgti_f(u,v,w)	jit_new_node_wwf(jit_code_ltgti_f,u,v,w)
-    jit_code_ltgtr_f,		jit_code_ltgti_f,
-#define jit_ordr_f(u,v,w)	jit_new_node_www(jit_code_ordr_f,u,v,w)
-#define jit_ordi_f(u,v,w)	jit_new_node_wwf(jit_code_ordi_f,u,v,w)
-    jit_code_ordr_f,		jit_code_ordi_f,
-#define jit_unordr_f(u,v,w)	jit_new_node_www(jit_code_unordr_f,u,v,w)
-#define jit_unordi_f(u,v,w)	jit_new_node_wwf(jit_code_unordi_f,u,v,w)
-    jit_code_unordr_f,		jit_code_unordi_f,
-
-#define jit_truncr_f_i(u,v)	jit_new_node_ww(jit_code_truncr_f_i,u,v)
-    jit_code_truncr_f_i,
-#if __WORDSIZE == 32
-#  define jit_truncr_f(u,v)	jit_truncr_f_i(u,v)
-#else
-#  define jit_truncr_f(u,v)	jit_truncr_f_l(u,v)
-#  define jit_truncr_f_l(u,v)	jit_new_node_ww(jit_code_truncr_f_l,u,v)
-#endif
-    jit_code_truncr_f_l,
-#define jit_extr_f(u,v)		jit_new_node_ww(jit_code_extr_f,u,v)
-#define jit_extr_d_f(u,v)	jit_new_node_ww(jit_code_extr_d_f,u,v)
-    jit_code_extr_f,		jit_code_extr_d_f,
-#define jit_movr_f(u,v)		jit_new_node_ww(jit_code_movr_f,u,v)
-#define jit_movi_f(u,v)		jit_new_node_wf(jit_code_movi_f,u,v)
-    jit_code_movr_f,		jit_code_movi_f,
-
-#define jit_ldr_f(u,v)		jit_new_node_ww(jit_code_ldr_f,u,v)
-#define jit_ldi_f(u,v)		jit_new_node_wp(jit_code_ldi_f,u,v)
-    jit_code_ldr_f,		jit_code_ldi_f,
-#define jit_ldxr_f(u,v,w)	jit_new_node_www(jit_code_ldxr_f,u,v,w)
-#define jit_ldxi_f(u,v,w)	jit_new_node_www(jit_code_ldxi_f,u,v,w)
-    jit_code_ldxr_f,		jit_code_ldxi_f,
-#define jit_str_f(u,v)		jit_new_node_ww(jit_code_str_f,u,v)
-#define jit_sti_f(u,v)		jit_new_node_pw(jit_code_sti_f,u,v)
-    jit_code_str_f,		jit_code_sti_f,
-#define jit_stxr_f(u,v,w)	jit_new_node_www(jit_code_stxr_f,u,v,w)
-#define jit_stxi_f(u,v,w)	jit_new_node_www(jit_code_stxi_f,u,v,w)
-    jit_code_stxr_f,		jit_code_stxi_f,
-
-#define jit_bltr_f(v,w)		jit_new_node_pww(jit_code_bltr_f,NULL,v,w)
-#define jit_blti_f(v,w)		jit_new_node_pwf(jit_code_blti_f,NULL,v,w)
-    jit_code_bltr_f,		jit_code_blti_f,
-#define jit_bler_f(v,w)		jit_new_node_pww(jit_code_bler_f,NULL,v,w)
-#define jit_blei_f(v,w)		jit_new_node_pwf(jit_code_blei_f,NULL,v,w)
-    jit_code_bler_f,		jit_code_blei_f,
-#define jit_beqr_f(v,w)		jit_new_node_pww(jit_code_beqr_f,NULL,v,w)
-#define jit_beqi_f(v,w)		jit_new_node_pwf(jit_code_beqi_f,NULL,v,w)
-    jit_code_beqr_f,		jit_code_beqi_f,
-#define jit_bger_f(v,w)		jit_new_node_pww(jit_code_bger_f,NULL,v,w)
-#define jit_bgei_f(v,w)		jit_new_node_pwf(jit_code_bgei_f,NULL,v,w)
-    jit_code_bger_f,		jit_code_bgei_f,
-#define jit_bgtr_f(v,w)		jit_new_node_pww(jit_code_bgtr_f,NULL,v,w)
-#define jit_bgti_f(v,w)		jit_new_node_pwf(jit_code_bgti_f,NULL,v,w)
-    jit_code_bgtr_f,		jit_code_bgti_f,
-#define jit_bner_f(v,w)		jit_new_node_pww(jit_code_bner_f,NULL,v,w)
-#define jit_bnei_f(v,w)		jit_new_node_pwf(jit_code_bnei_f,NULL,v,w)
-    jit_code_bner_f,		jit_code_bnei_f,
-#define jit_bunltr_f(v,w)	jit_new_node_pww(jit_code_bunltr_f,NULL,v,w)
-#define jit_bunlti_f(v,w)	jit_new_node_pwf(jit_code_bunlti_f,NULL,v,w)
-    jit_code_bunltr_f,		jit_code_bunlti_f,
-#define jit_bunler_f(v,w)	jit_new_node_pww(jit_code_bunler_f,NULL,v,w)
-#define jit_bunlei_f(v,w)	jit_new_node_pwf(jit_code_bunlei_f,NULL,v,w)
-    jit_code_bunler_f,		jit_code_bunlei_f,
-#define jit_buneqr_f(v,w)	jit_new_node_pww(jit_code_buneqr_f,NULL,v,w)
-#define jit_buneqi_f(v,w)	jit_new_node_pwf(jit_code_buneqi_f,NULL,v,w)
-    jit_code_buneqr_f,		jit_code_buneqi_f,
-#define jit_bunger_f(v,w)	jit_new_node_pww(jit_code_bunger_f,NULL,v,w)
-#define jit_bungei_f(v,w)	jit_new_node_pwf(jit_code_bungei_f,NULL,v,w)
-    jit_code_bunger_f,		jit_code_bungei_f,
-#define jit_bungtr_f(v,w)	jit_new_node_pww(jit_code_bungtr_f,NULL,v,w)
-#define jit_bungti_f(v,w)	jit_new_node_pwf(jit_code_bungti_f,NULL,v,w)
-    jit_code_bungtr_f,		jit_code_bungti_f,
-#define jit_bltgtr_f(v,w)	jit_new_node_pww(jit_code_bltgtr_f,NULL,v,w)
-#define jit_bltgti_f(v,w)	jit_new_node_pwf(jit_code_bltgti_f,NULL,v,w)
-    jit_code_bltgtr_f,		jit_code_bltgti_f,
-#define jit_bordr_f(v,w)	jit_new_node_pww(jit_code_bordr_f,NULL,v,w)
-#define jit_bordi_f(v,w)	jit_new_node_pwf(jit_code_bordi_f,NULL,v,w)
-    jit_code_bordr_f,		jit_code_bordi_f,
-#define jit_bunordr_f(v,w)	jit_new_node_pww(jit_code_bunordr_f,NULL,v,w)
-#define jit_bunordi_f(v,w)	jit_new_node_pwf(jit_code_bunordi_f,NULL,v,w)
-    jit_code_bunordr_f,		jit_code_bunordi_f,
-
-#define jit_pushargr_f(u)	_jit_pushargr_f(_jit,u)
-#define jit_pushargi_f(u)	_jit_pushargi_f(_jit,u)
-#define jit_retr_f(u)		_jit_retr_f(_jit,u)
-#define jit_reti_f(u)		_jit_reti_f(_jit,u)
-#define jit_retval_f(u)		_jit_retval_f(_jit,u)
-
-#define jit_arg_d()		_jit_arg_d(_jit)
-#define jit_getarg_d(u,v)	_jit_getarg_d(_jit,u,v)
-#define jit_putargr_d(u,v)	_jit_putargr_d(_jit,u,v)
-#define jit_putargi_d(u,v)	_jit_putargi_d(_jit,u,v)
-    jit_code_arg_d,
-
-#define jit_addr_d(u,v,w)	jit_new_node_www(jit_code_addr_d,u,v,w)
-#define jit_addi_d(u,v,w)	jit_new_node_wwd(jit_code_addi_d,u,v,w)
-    jit_code_addr_d,		jit_code_addi_d,
-#define jit_subr_d(u,v,w)	jit_new_node_www(jit_code_subr_d,u,v,w)
-#define jit_subi_d(u,v,w)	jit_new_node_wwd(jit_code_subi_d,u,v,w)
-    jit_code_subr_d,		jit_code_subi_d,
-#define jit_rsbr_d(u,v,w)	jit_subr_d(u,w,v)
-#define jit_rsbi_d(u,v,w)	jit_new_node_wwd(jit_code_rsbi_d,u,v,w)
-    jit_code_rsbi_d,
-#define jit_mulr_d(u,v,w)	jit_new_node_www(jit_code_mulr_d,u,v,w)
-#define jit_muli_d(u,v,w)	jit_new_node_wwd(jit_code_muli_d,u,v,w)
-    jit_code_mulr_d,		jit_code_muli_d,
-#define jit_divr_d(u,v,w)	jit_new_node_www(jit_code_divr_d,u,v,w)
-#define jit_divi_d(u,v,w)	jit_new_node_wwd(jit_code_divi_d,u,v,w)
-    jit_code_divr_d,		jit_code_divi_d,
-
-#define jit_negr_d(u,v)		jit_new_node_ww(jit_code_negr_d,u,v)
-#define jit_absr_d(u,v)		jit_new_node_ww(jit_code_absr_d,u,v)
-#define jit_sqrtr_d(u,v)	jit_new_node_ww(jit_code_sqrtr_d,u,v)
-    jit_code_negr_d,		jit_code_absr_d,	jit_code_sqrtr_d,
-
-#define jit_ltr_d(u,v,w)	jit_new_node_www(jit_code_ltr_d,u,v,w)
-#define jit_lti_d(u,v,w)	jit_new_node_wwd(jit_code_lti_d,u,v,w)
-    jit_code_ltr_d,		jit_code_lti_d,
-#define jit_ler_d(u,v,w)	jit_new_node_www(jit_code_ler_d,u,v,w)
-#define jit_lei_d(u,v,w)	jit_new_node_wwd(jit_code_lei_d,u,v,w)
-    jit_code_ler_d,		jit_code_lei_d,
-#define jit_eqr_d(u,v,w)	jit_new_node_www(jit_code_eqr_d,u,v,w)
-#define jit_eqi_d(u,v,w)	jit_new_node_wwd(jit_code_eqi_d,u,v,w)
-    jit_code_eqr_d,		jit_code_eqi_d,
-#define jit_ger_d(u,v,w)	jit_new_node_www(jit_code_ger_d,u,v,w)
-#define jit_gei_d(u,v,w)	jit_new_node_wwd(jit_code_gei_d,u,v,w)
-    jit_code_ger_d,		jit_code_gei_d,
-#define jit_gtr_d(u,v,w)	jit_new_node_www(jit_code_gtr_d,u,v,w)
-#define jit_gti_d(u,v,w)	jit_new_node_wwd(jit_code_gti_d,u,v,w)
-    jit_code_gtr_d,		jit_code_gti_d,
-#define jit_ner_d(u,v,w)	jit_new_node_www(jit_code_ner_d,u,v,w)
-#define jit_nei_d(u,v,w)	jit_new_node_wwd(jit_code_nei_d,u,v,w)
-    jit_code_ner_d,		jit_code_nei_d,
-#define jit_unltr_d(u,v,w)	jit_new_node_www(jit_code_unltr_d,u,v,w)
-#define jit_unlti_d(u,v,w)	jit_new_node_wwd(jit_code_unlti_d,u,v,w)
-    jit_code_unltr_d,		jit_code_unlti_d,
-#define jit_unler_d(u,v,w)	jit_new_node_www(jit_code_unler_d,u,v,w)
-#define jit_unlei_d(u,v,w)	jit_new_node_wwd(jit_code_unlei_d,u,v,w)
-    jit_code_unler_d,		jit_code_unlei_d,
-#define jit_uneqr_d(u,v,w)	jit_new_node_www(jit_code_uneqr_d,u,v,w)
-#define jit_uneqi_d(u,v,w)	jit_new_node_wwd(jit_code_uneqi_d,u,v,w)
-    jit_code_uneqr_d,		jit_code_uneqi_d,
-#define jit_unger_d(u,v,w)	jit_new_node_www(jit_code_unger_d,u,v,w)
-#define jit_ungei_d(u,v,w)	jit_new_node_wwd(jit_code_ungei_d,u,v,w)
-    jit_code_unger_d,		jit_code_ungei_d,
-#define jit_ungtr_d(u,v,w)	jit_new_node_www(jit_code_ungtr_d,u,v,w)
-#define jit_ungti_d(u,v,w)	jit_new_node_wwd(jit_code_ungti_d,u,v,w)
-    jit_code_ungtr_d,		jit_code_ungti_d,
-#define jit_ltgtr_d(u,v,w)	jit_new_node_www(jit_code_ltgtr_d,u,v,w)
-#define jit_ltgti_d(u,v,w)	jit_new_node_wwd(jit_code_ltgti_d,u,v,w)
-    jit_code_ltgtr_d,		jit_code_ltgti_d,
-#define jit_ordr_d(u,v,w)	jit_new_node_www(jit_code_ordr_d,u,v,w)
-#define jit_ordi_d(u,v,w)	jit_new_node_wwd(jit_code_ordi_d,u,v,w)
-    jit_code_ordr_d,		jit_code_ordi_d,
-#define jit_unordr_d(u,v,w)	jit_new_node_www(jit_code_unordr_d,u,v,w)
-#define jit_unordi_d(u,v,w)	jit_new_node_wwd(jit_code_unordi_d,u,v,w)
-    jit_code_unordr_d,		jit_code_unordi_d,
-
-#define jit_truncr_d_i(u,v)	jit_new_node_ww(jit_code_truncr_d_i,u,v)
-    jit_code_truncr_d_i,
-#if __WORDSIZE == 32
-#  define jit_truncr_d(u,v)	jit_truncr_d_i(u,v)
-#else
-#  define jit_truncr_d(u,v)	jit_truncr_d_l(u,v)
-#  define jit_truncr_d_l(u,v)	jit_new_node_ww(jit_code_truncr_d_l,u,v)
-#endif
-    jit_code_truncr_d_l,
-#define jit_extr_d(u,v)		jit_new_node_ww(jit_code_extr_d,u,v)
-#define jit_extr_f_d(u,v)	jit_new_node_ww(jit_code_extr_f_d,u,v)
-    jit_code_extr_d,		jit_code_extr_f_d,
-#define jit_movr_d(u,v)		jit_new_node_ww(jit_code_movr_d,u,v)
-#define jit_movi_d(u,v)		jit_new_node_wd(jit_code_movi_d,u,v)
-    jit_code_movr_d,		jit_code_movi_d,
-
-#define jit_ldr_d(u,v)		jit_new_node_ww(jit_code_ldr_d,u,v)
-#define jit_ldi_d(u,v)		jit_new_node_wp(jit_code_ldi_d,u,v)
-    jit_code_ldr_d,		jit_code_ldi_d,
-#define jit_ldxr_d(u,v,w)	jit_new_node_www(jit_code_ldxr_d,u,v,w)
-#define jit_ldxi_d(u,v,w)	jit_new_node_www(jit_code_ldxi_d,u,v,w)
-    jit_code_ldxr_d,		jit_code_ldxi_d,
-#define jit_str_d(u,v)		jit_new_node_ww(jit_code_str_d,u,v)
-#define jit_sti_d(u,v)		jit_new_node_pw(jit_code_sti_d,u,v)
-    jit_code_str_d,		jit_code_sti_d,
-#define jit_stxr_d(u,v,w)	jit_new_node_www(jit_code_stxr_d,u,v,w)
-#define jit_stxi_d(u,v,w)	jit_new_node_www(jit_code_stxi_d,u,v,w)
-    jit_code_stxr_d,		jit_code_stxi_d,
-
-#define jit_bltr_d(v,w)		jit_new_node_pww(jit_code_bltr_d,NULL,v,w)
-#define jit_blti_d(v,w)		jit_new_node_pwd(jit_code_blti_d,NULL,v,w)
-    jit_code_bltr_d,		jit_code_blti_d,
-#define jit_bler_d(v,w)		jit_new_node_pww(jit_code_bler_d,NULL,v,w)
-#define jit_blei_d(v,w)		jit_new_node_pwd(jit_code_blei_d,NULL,v,w)
-    jit_code_bler_d,		jit_code_blei_d,
-#define jit_beqr_d(v,w)		jit_new_node_pww(jit_code_beqr_d,NULL,v,w)
-#define jit_beqi_d(v,w)		jit_new_node_pwd(jit_code_beqi_d,NULL,v,w)
-    jit_code_beqr_d,		jit_code_beqi_d,
-#define jit_bger_d(v,w)		jit_new_node_pww(jit_code_bger_d,NULL,v,w)
-#define jit_bgei_d(v,w)		jit_new_node_pwd(jit_code_bgei_d,NULL,v,w)
-    jit_code_bger_d,		jit_code_bgei_d,
-#define jit_bgtr_d(v,w)		jit_new_node_pww(jit_code_bgtr_d,NULL,v,w)
-#define jit_bgti_d(v,w)		jit_new_node_pwd(jit_code_bgti_d,NULL,v,w)
-    jit_code_bgtr_d,		jit_code_bgti_d,
-#define jit_bner_d(v,w)		jit_new_node_pww(jit_code_bner_d,NULL,v,w)
-#define jit_bnei_d(v,w)		jit_new_node_pwd(jit_code_bnei_d,NULL,v,w)
-    jit_code_bner_d,		jit_code_bnei_d,
-#define jit_bunltr_d(v,w)	jit_new_node_pww(jit_code_bunltr_d,NULL,v,w)
-#define jit_bunlti_d(v,w)	jit_new_node_pwd(jit_code_bunlti_d,NULL,v,w)
-    jit_code_bunltr_d,		jit_code_bunlti_d,
-#define jit_bunler_d(v,w)	jit_new_node_pww(jit_code_bunler_d,NULL,v,w)
-#define jit_bunlei_d(v,w)	jit_new_node_pwd(jit_code_bunlei_d,NULL,v,w)
-    jit_code_bunler_d,		jit_code_bunlei_d,
-#define jit_buneqr_d(v,w)	jit_new_node_pww(jit_code_buneqr_d,NULL,v,w)
-#define jit_buneqi_d(v,w)	jit_new_node_pwd(jit_code_buneqi_d,NULL,v,w)
-    jit_code_buneqr_d,		jit_code_buneqi_d,
-#define jit_bunger_d(v,w)	jit_new_node_pww(jit_code_bunger_d,NULL,v,w)
-#define jit_bungei_d(v,w)	jit_new_node_pwd(jit_code_bungei_d,NULL,v,w)
-    jit_code_bunger_d,		jit_code_bungei_d,
-#define jit_bungtr_d(v,w)	jit_new_node_pww(jit_code_bungtr_d,NULL,v,w)
-#define jit_bungti_d(v,w)	jit_new_node_pwd(jit_code_bungti_d,NULL,v,w)
-    jit_code_bungtr_d,		jit_code_bungti_d,
-#define jit_bltgtr_d(v,w)	jit_new_node_pww(jit_code_bltgtr_d,NULL,v,w)
-#define jit_bltgti_d(v,w)	jit_new_node_pwd(jit_code_bltgti_d,NULL,v,w)
-    jit_code_bltgtr_d,		jit_code_bltgti_d,
-#define jit_bordr_d(v,w)	jit_new_node_pww(jit_code_bordr_d,NULL,v,w)
-#define jit_bordi_d(v,w)	jit_new_node_pwd(jit_code_bordi_d,NULL,v,w)
-    jit_code_bordr_d,		jit_code_bordi_d,
-#define jit_bunordr_d(v,w)	jit_new_node_pww(jit_code_bunordr_d,NULL,v,w)
-#define jit_bunordi_d(v,w)	jit_new_node_pwd(jit_code_bunordi_d,NULL,v,w)
-    jit_code_bunordr_d,		jit_code_bunordi_d,
-
-#define jit_pushargr_d(u)	_jit_pushargr_d(_jit,u)
-#define jit_pushargi_d(u)	_jit_pushargi_d(_jit,u)
-#define jit_retr_d(u)		_jit_retr_d(_jit,u)
-#define jit_reti_d(u)		_jit_reti_d(_jit,u)
-#define jit_retval_d(u)		_jit_retval_d(_jit,u)
-
-    /* Special internal backend specific codes */
-    jit_code_movr_w_f,		jit_code_movr_ww_d,	/* w* -> f|d */
-#define jit_movr_w_f(u, v)	jit_new_node_ww(jit_code_movr_w_f, u, v)
-#define jit_movr_ww_d(u, v, w)	jit_new_node_www(jit_code_movr_ww_d, u, v, w)
-    jit_code_movr_w_d,					/* w -> d */
-#define jit_movr_w_d(u, v)	jit_new_node_ww(jit_code_movr_w_d, u, v)
-
-    jit_code_movr_f_w,		jit_code_movi_f_w,	/* f|d -> w* */
-#define jit_movr_f_w(u, v)	jit_new_node_ww(jit_code_movr_f_w, u, v)
-#define jit_movi_f_w(u, v)	jit_new_node_wf(jit_code_movi_f_w, u, v)
-    jit_code_movr_d_ww,		jit_code_movi_d_ww,
-#define jit_movr_d_ww(u, v, w)	jit_new_node_www(jit_code_movr_d_ww, u, v, w)
-#define jit_movi_d_ww(u, v, w)	jit_new_node_wwd(jit_code_movi_d_ww, u, v, w)
-
-    jit_code_movr_d_w,		jit_code_movi_d_w,	/* d -> w */
-#define jit_movr_d_w(u, v)	jit_new_node_ww(jit_code_movr_d_w, u, v)
-#define jit_movi_d_w(u, v)	jit_new_node_wd(jit_code_movi_d_w, u, v)
-
-    jit_code_x86_retval_f,	jit_code_x86_retval_d,
-#define jit_code_last_code	jit_code_x86_retval_d
-} jit_code_t;
-
-typedef void* (*jit_alloc_func_ptr)	(size_t);
-typedef void* (*jit_realloc_func_ptr)	(void*, size_t);
-typedef void  (*jit_free_func_ptr)	(void*);
-
-/*
- * Prototypes
- */
-extern void init_jit(const char*);
-extern void finish_jit(void);
-
-extern jit_state_t *jit_new_state(void);
-#define jit_clear_state()	_jit_clear_state(_jit)
-extern void _jit_clear_state(jit_state_t*);
-#define jit_destroy_state()	_jit_destroy_state(_jit)
-extern void _jit_destroy_state(jit_state_t*);
-
-#define jit_address(node)	_jit_address(_jit, node)
-extern jit_pointer_t _jit_address(jit_state_t*, jit_node_t*);
-extern jit_node_t *_jit_name(jit_state_t*, const char*);
-extern jit_node_t *_jit_note(jit_state_t*, const char*, int);
-extern jit_node_t *_jit_label(jit_state_t*);
-extern jit_node_t *_jit_forward(jit_state_t*);
-extern jit_node_t *_jit_indirect(jit_state_t*);
-extern void _jit_link(jit_state_t*, jit_node_t*);
-#define jit_forward_p(u)	_jit_forward_p(_jit,u)
-extern jit_bool_t _jit_forward_p(jit_state_t*,jit_node_t*);
-#define jit_indirect_p(u)	_jit_indirect_p(_jit,u)
-extern jit_bool_t _jit_indirect_p(jit_state_t*,jit_node_t*);
-#define jit_target_p(u)		_jit_target_p(_jit,u)
-extern jit_bool_t _jit_target_p(jit_state_t*,jit_node_t*);
-
-extern void _jit_prolog(jit_state_t*);
-
-extern jit_int32_t _jit_allocai(jit_state_t*, jit_int32_t);
-extern void _jit_ellipsis(jit_state_t*);
-
-extern jit_node_t *_jit_arg(jit_state_t*);
-extern void _jit_getarg_c(jit_state_t*, jit_gpr_t, jit_node_t*);
-extern void _jit_getarg_uc(jit_state_t*, jit_gpr_t, jit_node_t*);
-extern void _jit_getarg_s(jit_state_t*, jit_gpr_t, jit_node_t*);
-extern void _jit_getarg_us(jit_state_t*, jit_gpr_t, jit_node_t*);
-extern void _jit_getarg_i(jit_state_t*, jit_gpr_t, jit_node_t*);
-#if __WORDSIZE == 64
-extern void _jit_getarg_ui(jit_state_t*, jit_gpr_t, jit_node_t*);
-extern void _jit_getarg_l(jit_state_t*, jit_gpr_t, jit_node_t*);
-#endif
-extern void _jit_putargr(jit_state_t*, jit_gpr_t, jit_node_t*);
-extern void _jit_putargi(jit_state_t*, jit_word_t, jit_node_t*);
-
-extern void _jit_prepare(jit_state_t*);
-extern void _jit_ellipsis(jit_state_t*);
-extern void _jit_pushargr(jit_state_t*, jit_gpr_t);
-extern void _jit_pushargi(jit_state_t*, jit_word_t);
-extern void _jit_finishr(jit_state_t*, jit_gpr_t);
-extern jit_node_t *_jit_finishi(jit_state_t*, jit_pointer_t);
-extern void _jit_ret(jit_state_t*);
-extern void _jit_retr(jit_state_t*, jit_gpr_t);
-extern void _jit_reti(jit_state_t*, jit_word_t);
-extern void _jit_retval_c(jit_state_t*, jit_gpr_t);
-extern void _jit_retval_uc(jit_state_t*, jit_gpr_t);
-extern void _jit_retval_s(jit_state_t*, jit_gpr_t);
-extern void _jit_retval_us(jit_state_t*, jit_gpr_t);
-extern void _jit_retval_i(jit_state_t*, jit_gpr_t);
-#if __WORDSIZE == 64
-extern void _jit_retval_ui(jit_state_t*, jit_gpr_t);
-extern void _jit_retval_l(jit_state_t*, jit_gpr_t);
-#endif
-extern void _jit_epilog(jit_state_t*);
-
-#define jit_patch(u)		_jit_patch(_jit,u)
-extern void _jit_patch(jit_state_t*, jit_node_t*);
-#define jit_patch_at(u,v)	_jit_patch_at(_jit,u,v)
-extern void _jit_patch_at(jit_state_t*, jit_node_t*, jit_node_t*);
-#define jit_patch_abs(u,v)	_jit_patch_abs(_jit,u,v)
-extern void _jit_patch_abs(jit_state_t*, jit_node_t*, jit_pointer_t);
-#define jit_realize()		_jit_realize(_jit)
-extern void _jit_realize(jit_state_t*);
-#define jit_get_code(u)		_jit_get_code(_jit,u)
-extern jit_pointer_t _jit_get_code(jit_state_t*, jit_word_t*);
-#define jit_set_code(u,v)	_jit_set_code(_jit,u,v)
-extern void _jit_set_code(jit_state_t*, jit_pointer_t, jit_word_t);
-#define jit_get_data(u,v)	_jit_get_data(_jit,u,v)
-extern jit_pointer_t _jit_get_data(jit_state_t*, jit_word_t*, jit_word_t*);
-#define jit_set_data(u,v,w)	_jit_set_data(_jit,u,v,w)
-extern void _jit_set_data(jit_state_t*, jit_pointer_t, jit_word_t, jit_word_t);
-#define jit_frame(u)		_jit_frame(_jit,u)
-extern void _jit_frame(jit_state_t*, jit_int32_t);
-#define jit_tramp(u)		_jit_tramp(_jit,u)
-extern void _jit_tramp(jit_state_t*, jit_int32_t);
-#define jit_emit()		_jit_emit(_jit)
-extern jit_pointer_t _jit_emit(jit_state_t*);
-
-#define jit_print()		_jit_print(_jit)
-extern void _jit_print(jit_state_t*);
-
-extern jit_node_t *_jit_arg_f(jit_state_t*);
-extern void _jit_getarg_f(jit_state_t*, jit_fpr_t, jit_node_t*);
-extern void _jit_putargr_f(jit_state_t*, jit_fpr_t, jit_node_t*);
-extern void _jit_putargi_f(jit_state_t*, jit_float32_t, jit_node_t*);
-extern void _jit_pushargr_f(jit_state_t*, jit_fpr_t);
-extern void _jit_pushargi_f(jit_state_t*, jit_float32_t);
-extern void _jit_retr_f(jit_state_t*, jit_fpr_t);
-extern void _jit_reti_f(jit_state_t*, jit_float32_t);
-extern void _jit_retval_f(jit_state_t*, jit_fpr_t);
-
-extern jit_node_t *_jit_arg_d(jit_state_t*);
-extern void _jit_getarg_d(jit_state_t*, jit_fpr_t, jit_node_t*);
-extern void _jit_putargr_d(jit_state_t*, jit_fpr_t, jit_node_t*);
-extern void _jit_putargi_d(jit_state_t*, jit_float64_t, jit_node_t*);
-extern void _jit_pushargr_d(jit_state_t*, jit_fpr_t);
-extern void _jit_pushargi_d(jit_state_t*, jit_float64_t);
-extern void _jit_retr_d(jit_state_t*, jit_fpr_t);
-extern void _jit_reti_d(jit_state_t*, jit_float64_t);
-extern void _jit_retval_d(jit_state_t*, jit_fpr_t);
-
-#define jit_new_node(c)		_jit_new_node(_jit,c)
-extern jit_node_t *_jit_new_node(jit_state_t*, jit_code_t);
-#define jit_new_node_w(c,u)	_jit_new_node_w(_jit,c,u)
-extern jit_node_t *_jit_new_node_w(jit_state_t*, jit_code_t,
-				   jit_word_t);
-#define jit_new_node_p(c,u)	_jit_new_node_p(_jit,c,u)
-extern jit_node_t *_jit_new_node_p(jit_state_t*, jit_code_t,
-				   jit_pointer_t);
-#define jit_new_node_ww(c,u,v)	_jit_new_node_ww(_jit,c,u,v)
-extern jit_node_t *_jit_new_node_ww(jit_state_t*,jit_code_t,
-				    jit_word_t, jit_word_t);
-#define jit_new_node_wp(c,u,v)	_jit_new_node_wp(_jit,c,u,v)
-extern jit_node_t *_jit_new_node_wp(jit_state_t*,jit_code_t,
-				    jit_word_t, jit_pointer_t);
-#define jit_new_node_pw(c,u,v)	_jit_new_node_pw(_jit,c,u,v)
-extern jit_node_t *_jit_new_node_pw(jit_state_t*,jit_code_t,
-				    jit_pointer_t, jit_word_t);
-#define jit_new_node_wf(c,u,v)	_jit_new_node_wf(_jit,c,u,v)
-extern jit_node_t *_jit_new_node_wf(jit_state_t*, jit_code_t,
-				    jit_word_t, jit_float32_t);
-#define jit_new_node_wd(c,u,v)	_jit_new_node_wd(_jit,c,u,v)
-extern jit_node_t *_jit_new_node_wd(jit_state_t*, jit_code_t,
-				    jit_word_t, jit_float64_t);
-#define jit_new_node_www(c,u,v,w) _jit_new_node_www(_jit,c,u,v,w)
-extern jit_node_t *_jit_new_node_www(jit_state_t*, jit_code_t,
-				     jit_word_t, jit_word_t, jit_word_t);
-#define jit_new_node_qww(c,l,h,v,w) _jit_new_node_qww(_jit,c,l,h,v,w)
-extern jit_node_t *_jit_new_node_qww(jit_state_t*, jit_code_t,
-				     jit_int32_t, jit_int32_t,
-				     jit_word_t, jit_word_t);
-#define jit_new_node_wwf(c,u,v,w) _jit_new_node_wwf(_jit,c,u,v,w)
-extern jit_node_t *_jit_new_node_wwf(jit_state_t*, jit_code_t,
-				     jit_word_t, jit_word_t, jit_float32_t);
-#define jit_new_node_wwd(c,u,v,w) _jit_new_node_wwd(_jit,c,u,v,w)
-extern jit_node_t *_jit_new_node_wwd(jit_state_t*, jit_code_t,
-				     jit_word_t, jit_word_t, jit_float64_t);
-#define jit_new_node_pww(c,u,v,w) _jit_new_node_pww(_jit,c,u,v,w)
-extern jit_node_t *_jit_new_node_pww(jit_state_t*, jit_code_t,
-				     jit_pointer_t, jit_word_t, jit_word_t);
-#define jit_new_node_pwf(c,u,v,w) _jit_new_node_pwf(_jit,c,u,v,w)
-extern jit_node_t *_jit_new_node_pwf(jit_state_t*, jit_code_t,
-				     jit_pointer_t, jit_word_t, jit_float32_t);
-#define jit_new_node_pwd(c,u,v,w) _jit_new_node_pwd(_jit,c,u,v,w)
-extern jit_node_t *_jit_new_node_pwd(jit_state_t*, jit_code_t,
-				     jit_pointer_t, jit_word_t, jit_float64_t);
-
-#define jit_arg_register_p(u)		_jit_arg_register_p(_jit,u)
-extern jit_bool_t _jit_arg_register_p(jit_state_t*, jit_node_t*);
-#define jit_callee_save_p(u)		_jit_callee_save_p(_jit,u)
-extern jit_bool_t _jit_callee_save_p(jit_state_t*, jit_int32_t);
-#define jit_pointer_p(u)		_jit_pointer_p(_jit,u)
-extern jit_bool_t _jit_pointer_p(jit_state_t*,jit_pointer_t);
-
-#define jit_get_note(n,u,v,w)	_jit_get_note(_jit,n,u,v,w)
-extern jit_bool_t _jit_get_note(jit_state_t*,jit_pointer_t,char**,char**,int*);
-
-#define jit_disassemble()		_jit_disassemble(_jit)
-extern void _jit_disassemble(jit_state_t*);
-
-extern void jit_set_memory_functions(jit_alloc_func_ptr,
-				     jit_realloc_func_ptr,
-				     jit_free_func_ptr);
-extern void jit_get_memory_functions(jit_alloc_func_ptr*,
-				     jit_realloc_func_ptr*,
-				     jit_free_func_ptr*);
-
-#endif /* _lightning_h */

+ 0 - 200
bjos/sledge/lightning/build/include/lightning/jit_x86.h

@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2012, 2013  Free Software Foundation, Inc.
- *
- * This file is part of GNU lightning.
- *
- * GNU lightning is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU lightning is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
- *
- * Authors:
- *	Paulo Cesar Pereira de Andrade
- */
-
-#ifndef _jit_x86_h
-#define _jit_x86_h
-
-#define JIT_HASH_CONSTS		1
-#define JIT_NUM_OPERANDS	2
-
-/*
- * Types
- */
-#define jit_sse2_p()		jit_cpu.sse2
-#define jit_x87_reg_p(reg)	((reg) >= _ST0 && (reg) <= _ST7)
-#if __WORDSIZE == 32
-#  if defined(__x86_64__)
-#    define __X64_32		1
-#    define __X64		1
-#  else
-#    define __X32		1
-#  endif
-#else
-#  define __X64			1
-#endif
-
-#define JIT_FP			_RBP
-typedef enum {
-#if __X32
-#  define jit_r(i)		(_RAX + (i))
-#  define jit_r_num()		3
-#  define jit_v(i)		(_RBX + (i))
-#  define jit_v_num()		3
-#  define jit_f(i)		(jit_cpu.sse2 ? _XMM0 + (i) : _ST0 + (i))
-#  define jit_f_num()		(jit_cpu.sse2 ? 8 : 6)
-#  define JIT_R0		_RAX
-#  define JIT_R1		_RCX
-#  define JIT_R2		_RDX
-    _RAX,	_RCX,	_RDX,
-#  define JIT_V0		_RBX
-#  define JIT_V1		_RSI
-#  define JIT_V2		_RDI
-    _RBX,	_RSI,	_RDI,
-    _RSP,	_RBP,
-#  define JIT_F0		(jit_sse2_p() ? _XMM0 : _ST0)
-#  define JIT_F1		(jit_sse2_p() ? _XMM1 : _ST1)
-#  define JIT_F2		(jit_sse2_p() ? _XMM2 : _ST2)
-#  define JIT_F3		(jit_sse2_p() ? _XMM3 : _ST3)
-#  define JIT_F4		(jit_sse2_p() ? _XMM4 : _ST4)
-#  define JIT_F5		(jit_sse2_p() ? _XMM5 : _ST5)
-#  define JIT_F6		(jit_sse2_p() ? _XMM6 : _ST6)
-#  define JIT_F7		(jit_sse2_p() ? _XMM7 : _ST7)
-    _XMM0,	_XMM1,	_XMM2,	_XMM3,	_XMM4,	_XMM5,	_XMM6,	 _XMM7,
-#  define jit_sse_reg_p(reg)	((reg) >= _XMM0 && (reg) <= _XMM7)
-#else
-#  if __CYGWIN__
-#    define jit_r(i)		(_RAX + (i))
-#    define jit_r_num()		3
-#    define jit_v(i)		(_RBX + (i))
-#    define jit_v_num()		7
-#    define jit_f(index)	(_XMM4 + (index))
-#    define jit_f_num()		12
-#    define JIT_R0		_RAX
-#    define JIT_R1		_R10
-#    define JIT_R2		_R11
-#    define JIT_V0		_RBX
-#    define JIT_V1		_RDI
-#    define JIT_V2		_RSI
-#    define JIT_V3		_R12
-#    define JIT_V4		_R13
-#    define JIT_V5		_R14
-#    define JIT_V6		_R15
-    /* Volatile - Return value register */
-    _RAX,
-    /* Volatile */
-    _R10,	_R11,
-    /* Nonvolatile */
-    _RBX,	_RDI,	_RSI,
-    _R12,	_R13,	_R14,	_R15,
-    /* Volatile - Integer arguments (4 to 1) */
-    _R9,	_R8,	_RDX,	_RCX,
-    /* Nonvolatile */
-    _RSP,	_RBP,
-#    define JIT_F0		_XMM4
-#    define JIT_F1		_XMM5
-#    define JIT_F2		_XMM6
-#    define JIT_F3		_XMM7
-#    define JIT_F4		_XMM8
-#    define JIT_F5		_XMM9
-#    define JIT_F6		_XMM10
-#    define JIT_F7		_XMM11
-#    define JIT_F8		_XMM12
-#    define JIT_F9		_XMM13
-#    define JIT_F10		_XMM14
-#    define JIT_F11		_XMM15
-    /* Volatile */
-    _XMM4,	_XMM5,
-    /* Nonvolatile */
-    _XMM6,	_XMM7,	_XMM8,	_XMM9,	_XMM10,
-    _XMM11,	_XMM12, _XMM13,	_XMM14,	_XMM15,
-    /* Volatile - FP arguments (4 to 1) */
-    _XMM3,	_XMM2,	_XMM1,	_XMM0,
-#    define jit_sse_reg_p(reg)	((reg) >= _XMM4 && (reg) <= _XMM0)
-#  else
-#    define jit_r(i)		(_RAX + (i))
-#    define jit_r_num()		4
-#    define jit_v(i)		(_RBX + (i))
-#    define jit_v_num()		4
-#    define jit_f(index)	(_XMM8 + (index))
-#    define jit_f_num()		8
-#    define JIT_R0		_RAX
-#    define JIT_R1		_R10
-#    define JIT_R2		_R11
-#    define JIT_R3		_R12
-    _RAX,	_R10,	_R11,	_R12,
-#    define JIT_V0		_RBX
-#    define JIT_V1		_R13
-#    define JIT_V2		_R14
-#    define JIT_V3		_R15
-    _RBX,	_R13,	_R14,	_R15,
-    _R9,	_R8,	_RCX,	_RDX,	_RSI,	_RDI,
-    _RSP,	_RBP,
-#    define JIT_F0		_XMM8
-#    define JIT_F1		_XMM9
-#    define JIT_F2		_XMM10
-#    define JIT_F3		_XMM11
-#    define JIT_F4		_XMM12
-#    define JIT_F5		_XMM13
-#    define JIT_F6		_XMM14
-#    define JIT_F7		_XMM15
-    _XMM8,	_XMM9,	_XMM10,	_XMM11,	_XMM12,	_XMM13,	_XMM14,	_XMM15,
-    _XMM7,	_XMM6,	_XMM5,	_XMM4,	_XMM3,	_XMM2,	_XMM1,	_XMM0,
-#    define jit_sse_reg_p(reg)	((reg) >= _XMM8 && (reg) <= _XMM0)
-#  endif
-#endif
-    _ST0,	_ST1,	_ST2,	_ST3,	_ST4,	_ST5,	_ST6,	_ST7,
-#  define JIT_NOREG		_NOREG
-    _NOREG,
-} jit_reg_t;
-
-typedef struct {
-    /* x87 present */
-    jit_uint32_t fpu		: 1;
-    /* cmpxchg8b instruction */
-    jit_uint32_t cmpxchg8b	: 1;
-    /* cmov and fcmov branchless conditional mov */
-    jit_uint32_t cmov		: 1;
-    /* mmx registers/instructions available */
-    jit_uint32_t mmx		: 1;
-    /* sse registers/instructions available */
-    jit_uint32_t sse		: 1;
-    /* sse2 registers/instructions available */
-    jit_uint32_t sse2		: 1;
-    /* sse3 instructions available */
-    jit_uint32_t sse3		: 1;
-    /* pcmulqdq instruction */
-    jit_uint32_t pclmulqdq	: 1;
-    /* ssse3 suplemental sse3 instructions available */
-    jit_uint32_t ssse3		: 1;
-    /* fused multiply/add using ymm state */
-    jit_uint32_t fma		: 1;
-    /* cmpxchg16b instruction */
-    jit_uint32_t cmpxchg16b	: 1;
-    /* sse4.1 instructions available */
-    jit_uint32_t sse4_1		: 1;
-    /* sse4.2 instructions available */
-    jit_uint32_t sse4_2		: 1;
-    /* movbe instruction available */
-    jit_uint32_t movbe		: 1;
-    /* popcnt instruction available */
-    jit_uint32_t popcnt		: 1;
-    /* aes instructions available */
-    jit_uint32_t aes		: 1;
-    /* avx instructions available */
-    jit_uint32_t avx		: 1;
-    /* lahf/sahf available in 64 bits mode */
-    jit_uint32_t lahf		: 1;
-} jit_cpu_t;
-
-/*
- * Initialization
- */
-extern jit_cpu_t		jit_cpu;
-
-#endif /* _jit_x86_h */

+ 0 - 18
bjos/sledge/lightning/build/share/info/dir

@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,	Node: Top	This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Software development
-* lightning: (lightning).       Library for dynamic code generation.

+ 0 - 1570
bjos/sledge/lightning/build/share/info/lightning.info

@@ -1,1570 +0,0 @@
-This is lightning.info, produced by makeinfo version 5.2 from
-lightning.texi.
-
-INFO-DIR-SECTION Software development
-START-INFO-DIR-ENTRY
-* lightning: (lightning).       Library for dynamic code generation.
-END-INFO-DIR-ENTRY
-
-
-File: lightning.info,  Node: Top,  Next: Overview,  Up: (dir)
-
-GNU lightning
-*************
-
-This document describes installing and using the GNU lightning library
-for dynamic code generation.
-
-* Menu:
-
-* Overview::                What GNU lightning is
-* Installation::            Configuring and installing GNU lightning
-* The instruction set::     The RISC instruction set used in GNU lightning
-* GNU lightning examples::  GNU lightning's examples
-* Reentrancy::              Re-entrant usage of GNU lightning
-* Customizations::          Advanced code generation customizations
-* Acknowledgements::        Acknowledgements for GNU lightning
-
-
-File: lightning.info,  Node: Overview,  Next: Installation,  Prev: Top,  Up: Top
-
-1 Introduction to GNU lightning
-*******************************
-
-Dynamic code generation is the generation of machine code at runtime.
-It is typically used to strip a layer of interpretation by allowing
-compilation to occur at runtime.  One of the most well-known
-applications of dynamic code generation is perhaps that of interpreters
-that compile source code to an intermediate bytecode form, which is then
-recompiled to machine code at run-time: this approach effectively
-combines the portability of bytecode representations with the speed of
-machine code.  Another common application of dynamic code generation is
-in the field of hardware simulators and binary emulators, which can use
-the same techniques to translate simulated instructions to the
-instructions of the underlying machine.
-
-   Yet other applications come to mind: for example, windowing "bitblt"
-operations, matrix manipulations, and network packet filters.  Albeit
-very powerful and relatively well known within the compiler community,
-dynamic code generation techniques are rarely exploited to their full
-potential and, with the exception of the two applications described
-above, have remained curiosities because of their portability and
-functionality barriers: binary instructions are generated, so programs
-using dynamic code generation must be retargeted for each machine; in
-addition, coding a run-time code generator is a tedious and error-prone
-task more than a difficult one.
-
-   GNU lightning provides a portable, fast and easily retargetable
-dynamic code generation system.
-
-   To be portable, GNU lightning abstracts over current architectures'
-quirks and unorthogonalities.  The interface that it exposes to is that
-of a standardized RISC architecture loosely based on the SPARC and MIPS
-chips.  There are a few general-purpose registers (six, not including
-those used to receive and pass parameters between subroutines), and
-arithmetic operations involve three operands--either three registers or
-two registers and an arbitrarily sized immediate value.
-
-   On one hand, this architecture is general enough that it is possible
-to generate pretty efficient code even on CISC architectures such as the
-Intel x86 or the Motorola 68k families.  On the other hand, it matches
-real architectures closely enough that, most of the time, the compiler's
-constant folding pass ends up generating code which assembles machine
-instructions without further tests.
-
-
-File: lightning.info,  Node: Installation,  Next: The instruction set,  Prev: Overview,  Up: Top
-
-2 Configuring and installing GNU lightning
-******************************************
-
-The first thing to do to use GNU lightning is to configure the program,
-picking the set of macros to be used on the host architecture; this
-configuration is automatically performed by the 'configure' shell
-script; to run it, merely type:
-          ./configure
-
-   GNU lightning supports the '--enable-disassembler' option, that
-enables linking to GNU binutils and optionally print human readable
-disassembly of the jit code.  This option can be disabled by the
-'--disable-disassembler' option.
-
-   Another option that 'configure' accepts is '--enable-assertions',
-which enables several consistency checks in the run-time assemblers.
-These are not usually needed, so you can decide to simply forget about
-it; also remember that these consistency checks tend to slow down your
-code generator.
-
-   After you've configured GNU lightning, run 'make' as usual.
-
-   GNU lightning has an extensive set of tests to validate it is working
-correctly in the build host.  To test it run:
-         make check
-
-   The next important step is:
-         make install
-
-   This ends the process of installing GNU lightning.
-
-
-File: lightning.info,  Node: The instruction set,  Next: GNU lightning examples,  Prev: Installation,  Up: Top
-
-3 GNU lightning's instruction set
-*********************************
-
-GNU lightning's instruction set was designed by deriving instructions
-that closely match those of most existing RISC architectures, or that
-can be easily syntesized if absent.  Each instruction is composed of:
-   * an operation, like 'sub' or 'mul'
-
-   * most times, a register/immediate flag ('r' or 'i')
-
-   * an unsigned modifier ('u'), a type identifier or two, when
-     applicable.
-
-   Examples of legal mnemonics are 'addr' (integer add, with three
-register operands) and 'muli' (integer multiply, with two register
-operands and an immediate operand).  Each instruction takes two or three
-operands; in most cases, one of them can be an immediate value instead
-of a register.
-
-   Most GNU lightning integer operations are signed wordsize operations,
-with the exception of operations that convert types, or load or store
-values to/from memory.  When applicable, the types and C types are as
-follow:
-
-          _c         signed char
-          _uc        unsigned char
-          _s         short
-          _us        unsigned short
-          _i         int
-          _ui        unsigned int
-          _l         long
-          _f         float
-          _d         double
-
-   Most integer operations do not need a type modifier, and when loading
-or storing values to memory there is an alias to the proper operation
-using wordsize operands, that is, if ommited, the type is int on 32-bit
-architectures and long on 64-bit architectures.  Note that lightning
-also expects 'sizeof(void*)' to match the wordsize.
-
-   When an unsigned operation result differs from the equivalent signed
-operation, there is a the '_u' modifier.
-
-   There are at least seven integer registers, of which six are
-general-purpose, while the last is used to contain the frame pointer
-('FP').  The frame pointer can be used to allocate and access local
-variables on the stack, using the 'allocai' instruction.
-
-   Of the general-purpose registers, at least three are guaranteed to be
-preserved across function calls ('V0', 'V1' and 'V2') and at least three
-are not ('R0', 'R1' and 'R2').  Six registers are not very much, but
-this restriction was forced by the need to target CISC architectures
-which, like the x86, are poor of registers; anyway, backends can specify
-the actual number of available registers with the calls 'JIT_R_NUM' (for
-caller-save registers) and 'JIT_V_NUM' (for callee-save registers).
-
-   There are at least six floating-point registers, named 'F0' to 'F5'.
-These are usually caller-save and are separate from the integer
-registers on the supported architectures; on Intel architectures, in 32
-bit mode if SSE2 is not available or use of X87 is forced, the register
-stack is mapped to a flat register file.  As for the integer registers,
-the macro 'JIT_F_NUM' yields the number of floating-point registers.
-
-   The complete instruction set follows; as you can see, most non-memory
-operations only take integers (either signed or unsigned) as operands;
-this was done in order to reduce the instruction set, and because most
-architectures only provide word and long word operations on registers.
-There are instructions that allow operands to be extended to fit a
-larger data type, both in a signed and in an unsigned way.
-
-Binary ALU operations
-     These accept three operands; the last one can be an immediate.
-     'addx' operations must directly follow 'addc', and 'subx' must
-     follow 'subc'; otherwise, results are undefined.  Most, if not all,
-     architectures do not support float or double immediate operands;
-     lightning emulates those operations by moving the immediate to a
-     temporary register and emiting the call with only register
-     operands.
-          addr         _f  _d  O1 = O2 + O3
-          addi         _f  _d  O1 = O2 + O3
-          addxr                O1 = O2 + (O3 + carry)
-          addxi                O1 = O2 + (O3 + carry)
-          addcr                O1 = O2 + O3, set carry
-          addci                O1 = O2 + O3, set carry
-          subr         _f  _d  O1 = O2 - O3
-          subi         _f  _d  O1 = O2 - O3
-          subxr                O1 = O2 - (O3 + carry)
-          subxi                O1 = O2 - (O3 + carry)
-          subcr                O1 = O2 - O3, set carry
-          subci                O1 = O2 - O3, set carry
-          rsbr         _f  _d  O1 = O3 - O1
-          rsbi         _f  _d  O1 = O3 - O1
-          mulr         _f  _d  O1 = O2 * O3
-          muli         _f  _d  O1 = O2 * O3
-          divr     _u  _f  _d  O1 = O2 / O3
-          divi     _u  _f  _d  O1 = O2 / O3
-          remr     _u          O1 = O2 % O3
-          remi     _u          O1 = O2 % O3
-          andr                 O1 = O2 & O3
-          andi                 O1 = O2 & O3
-          orr                  O1 = O2 | O3
-          ori                  O1 = O2 | O3
-          xorr                 O1 = O2 ^ O3
-          xori                 O1 = O2 ^ O3
-          lshr                 O1 = O2 << O3
-          lshi                 O1 = O2 << O3
-          rshr     _u          O1 = O2 >> O3(1)
-          rshi     _u          O1 = O2 >> O3(2)
-
-Four operand binary ALU operations
-     These accept two result registers, and two operands; the last one
-     can be an immediate.  The first two arguments cannot be the same
-     register.
-
-     'qmul' stores the low word of the result in 'O1' and the high word
-     in 'O2'.  For unsigned multiplication, 'O2' zero means there was no
-     overflow.  For signed multiplication, no overflow check is based on
-     sign, and can be detected if 'O2' is zero or minus one.
-
-     'qdiv' stores the quotient in 'O1' and the remainder in 'O2'.  It
-     can be used as quick way to check if a division is exact, in which
-     case the remainder is zero.
-
-          qmulr    _u       O1 O2 = O3 * O4
-          qmuli    _u       O1 O2 = O3 * O4
-          qdivr    _u       O1 O2 = O3 / O4
-          qdivi    _u       O1 O2 = O3 / O4
-
-Unary ALU operations
-     These accept two operands, both of which must be registers.
-          negr         _f  _d  O1 = -O2
-          comr                 O1 = ~O2
-
-     These unary ALU operations are only defined for float operands.
-          absr         _f  _d  O1 = fabs(O2)
-          sqrtr                O1 = sqrt(O2)
-
-     Besides requiring the 'r' modifier, there are no unary operations
-     with an immediate operand.
-
-Compare instructions
-     These accept three operands; again, the last can be an immediate.
-     The last two operands are compared, and the first operand, that
-     must be an integer register, is set to either 0 or 1, according to
-     whether the given condition was met or not.
-
-     The conditions given below are for the standard behavior of C,
-     where the "unordered" comparison result is mapped to false.
-
-          ltr       _u  _f  _d  O1 =  (O2 <  O3)
-          lti       _u  _f  _d  O1 =  (O2 <  O3)
-          ler       _u  _f  _d  O1 =  (O2 <= O3)
-          lei       _u  _f  _d  O1 =  (O2 <= O3)
-          gtr       _u  _f  _d  O1 =  (O2 >  O3)
-          gti       _u  _f  _d  O1 =  (O2 >  O3)
-          ger       _u  _f  _d  O1 =  (O2 >= O3)
-          gei       _u  _f  _d  O1 =  (O2 >= O3)
-          eqr           _f  _d  O1 =  (O2 == O3)
-          eqi           _f  _d  O1 =  (O2 == O3)
-          ner           _f  _d  O1 =  (O2 != O3)
-          nei           _f  _d  O1 =  (O2 != O3)
-          unltr         _f  _d  O1 = !(O2 >= O3)
-          unler         _f  _d  O1 = !(O2 >  O3)
-          ungtr         _f  _d  O1 = !(O2 <= O3)
-          unger         _f  _d  O1 = !(O2 <  O3)
-          uneqr         _f  _d  O1 = !(O2 <  O3) && !(O2 >  O3)
-          ltgtr         _f  _d  O1 = !(O2 >= O3) || !(O2 <= O3)
-          ordr          _f  _d  O1 =  (O2 == O2) &&  (O3 == O3)
-          unordr        _f  _d  O1 =  (O2 != O2) ||  (O3 != O3)
-
-Transfer operations
-     These accept two operands; for 'ext' both of them must be
-     registers, while 'mov' accepts an immediate value as the second
-     operand.
-
-     Unlike 'movr' and 'movi', the other instructions are used to
-     truncate a wordsize operand to a smaller integer data type or to
-     convert float data types.  You can also use 'extr' to convert an
-     integer to a floating point value: the usual options are 'extr_f'
-     and 'extr_d'.
-
-          movr                                 _f  _d  O1 = O2
-          movi                                 _f  _d  O1 = O2
-          extr      _c  _uc  _s  _us  _i  _ui  _f  _d  O1 = O2
-          truncr                               _f  _d  O1 = trunc(O2)
-
-     In 64-bit architectures it may be required to use 'truncr_f_i',
-     'truncr_f_l', 'truncr_d_i' and 'truncr_d_l' to match the equivalent
-     C code.  Only the '_i' modifier is available in 32-bit
-     architectures.
-
-          truncr_f_i    = <int> O1 = <float> O2
-          truncr_f_l    = <long>O1 = <float> O2
-          truncr_d_i    = <int> O1 = <double>O2
-          truncr_d_l    = <long>O1 = <double>O2
-
-     The float conversion operations are _destination first, source
-     second_, but the order of the types is reversed.  This happens for
-     historical reasons.
-
-          extr_f_d    = <double>O1 = <float> O2
-          extr_d_f    = <float> O1 = <double>O2
-
-Network extensions
-     These accept two operands, both of which must be registers; these
-     two instructions actually perform the same task, yet they are
-     assigned to two mnemonics for the sake of convenience and
-     completeness.  As usual, the first operand is the destination and
-     the second is the source.  The '_ul' variant is only available in
-     64-bit architectures.
-          htonr    _us _ui _ul Host-to-network (big endian) order
-          ntohr    _us _ui _ul Network-to-host order 
-
-Load operations
-     'ld' accepts two operands while 'ldx' accepts three; in both cases,
-     the last can be either a register or an immediate value.  Values
-     are extended (with or without sign, according to the data type
-     specification) to fit a whole register.  The '_ui' and '_l' types
-     are only available in 64-bit architectures.  For convenience, there
-     is a version without a type modifier for integer or pointer
-     operands that uses the appropriate wordsize call.
-          ldr     _c  _uc  _s  _us  _i  _ui  _l  _f  _d  O1 = *O2
-          ldi     _c  _uc  _s  _us  _i  _ui  _l  _f  _d  O1 = *O2
-          ldxr    _c  _uc  _s  _us  _i  _ui  _l  _f  _d  O1 = *(O2+O3)
-          ldxi    _c  _uc  _s  _us  _i  _ui  _l  _f  _d  O1 = *(O2+O3)
-
-Store operations
-     'st' accepts two operands while 'stx' accepts three; in both cases,
-     the first can be either a register or an immediate value.  Values
-     are sign-extended to fit a whole register.
-          str     _c  _uc  _s  _us  _i  _ui  _l  _f  _d  *O1 = O2
-          sti     _c  _uc  _s  _us  _i  _ui  _l  _f  _d  *O1 = O2
-          stxr    _c  _uc  _s  _us  _i  _ui  _l  _f  _d  *(O1+O2) = O3
-          stxi    _c  _uc  _s  _us  _i  _ui  _l  _f  _d  *(O1+O2) = O3
-     As for the load operations, the '_ui' and '_l' types are only
-     available in 64-bit architectures, and for convenience, there is a
-     version without a type modifier for integer or pointer operands
-     that uses the appropriate wordsize call.
-
-Argument management
-     These are:
-          prepare     (not specified)
-          pushargr                                   _f  _d
-          pushargi                                   _f  _d
-          arg         _c  _uc  _s  _us  _i  _ui  _l  _f  _d
-          getarg      _c  _uc  _s  _us  _i  _ui  _l  _f  _d
-          putargr                                    _f  _d
-          putargi                                    _f  _d
-          ret         (not specified)
-          retr                                       _f  _d
-          reti                                       _f  _d
-          retval      _c  _uc  _s  _us  _i  _ui  _l  _f  _d
-          epilog      (not specified)
-     As with other operations that use a type modifier, the '_ui' and
-     '_l' types are only available in 64-bit architectures, but there
-     are operations without a type modifier that alias to the
-     appropriate integer operation with wordsize operands.
-
-     'prepare', 'pusharg', and 'retval' are used by the caller, while
-     'arg', 'getarg' and 'ret' are used by the callee.  A code snippet
-     that wants to call another procedure and has to pass arguments
-     must, in order: use the 'prepare' instruction and use the
-     'pushargr' or 'pushargi' to push the arguments *in left to right
-     order*; and use 'finish' or 'call' (explained below) to perform the
-     actual call.
-
-     'arg', 'getarg' and 'putarg' are used by the callee.  'arg' is
-     different from other instruction in that it does not actually
-     generate any code: instead, it is a function which returns a value
-     to be passed to 'getarg' or 'putarg'.  (3) You should call 'arg' as
-     soon as possible, before any function call or, more easily, right
-     after the 'prolog' instructions (which is treated later).
-
-     'getarg' accepts a register argument and a value returned by 'arg',
-     and will move that argument to the register, extending it (with or
-     without sign, according to the data type specification) to fit a
-     whole register.  These instructions are more intimately related to
-     the usage of the GNU lightning instruction set in code that
-     generates other code, so they will be treated more specifically in
-     *note Generating code at run-time: GNU lightning examples.
-
-     'putarg' is a mix of 'getarg' and 'pusharg' in that it accepts as
-     first argument a register or immediate, and as second argument a
-     value returned by 'arg'.  It allows changing, or restoring an
-     argument to the current function, and is a construct required to
-     implement tail call optimization.  Note that arguments in registers
-     are very cheap, but will be overwritten at any moment, including on
-     some operations, for example division, that on several ports is
-     implemented as a function call.
-
-     Finally, the 'retval' instruction fetches the return value of a
-     called function in a register.  The 'retval' instruction takes a
-     register argument and copies the return value of the previously
-     called function in that register.  A function with a return value
-     should use 'retr' or 'reti' to put the return value in the return
-     register before returning.  *Note the Fibonacci numbers: Fibonacci,
-     for an example.
-
-     'epilog' is an optional call, that marks the end of a function
-     body.  It is automatically generated by GNU lightning if starting a
-     new function (what should be done after a 'ret' call) or finishing
-     generating jit.  It is very important to note that the fact that
-     'epilog' being optional may cause a common mistake.  Consider this:
-          fun1:
-              prolog
-              ...
-              ret
-          fun2:
-              prolog
-     Because 'epilog' is added when finding a new 'prolog', this will
-     cause the 'fun2' label to actually be before the return from
-     'fun1'.  Because GNU lightning will actually understand it as:
-          fun1:
-              prolog
-              ...
-              ret
-          fun2:
-              epilog
-              prolog
-
-     You should observe a few rules when using these macros.  First of
-     all, if calling a varargs function, you should use the 'ellipsis'
-     call to mark the position of the ellipsis in the C prototype.
-
-     You should not nest calls to 'prepare' inside a 'prepare/finish'
-     block.  Doing this will result in undefined behavior.  Note that
-     for functions with zero arguments you can use just 'call'.
-
-Branch instructions
-     Like 'arg', these also return a value which, in this case, is to be
-     used to compile forward branches as explained in *note Fibonacci
-     numbers: Fibonacci.  They accept two operands to be compared; of
-     these, the last can be either a register or an immediate.  They
-     are:
-          bltr      _u  _f  _d  if (O2 <  O3) goto O1
-          blti      _u  _f  _d  if (O2 <  O3) goto O1
-          bler      _u  _f  _d  if (O2 <= O3) goto O1
-          blei      _u  _f  _d  if (O2 <= O3) goto O1
-          bgtr      _u  _f  _d  if (O2 >  O3) goto O1
-          bgti      _u  _f  _d  if (O2 >  O3) goto O1
-          bger      _u  _f  _d  if (O2 >= O3) goto O1
-          bgei      _u  _f  _d  if (O2 >= O3) goto O1
-          beqr          _f  _d  if (O2 == O3) goto O1
-          beqi          _f  _d  if (O2 == O3) goto O1
-          bner          _f  _d  if (O2 != O3) goto O1
-          bnei          _f  _d  if (O2 != O3) goto O1
-
-          bunltr        _f  _d  if !(O2 >= O3) goto O1
-          bunler        _f  _d  if !(O2 >  O3) goto O1
-          bungtr        _f  _d  if !(O2 <= O3) goto O1
-          bunger        _f  _d  if !(O2 <  O3) goto O1
-          buneqr        _f  _d  if !(O2 <  O3) && !(O2 >  O3) goto O1
-          bltgtr        _f  _d  if !(O2 >= O3) || !(O2 <= O3) goto O1
-          bordr         _f  _d  if  (O2 == O2) &&  (O3 == O3) goto O1
-          bunordr       _f  _d  if !(O2 != O2) ||  (O3 != O3) goto O1
-
-          bmsr                  if O2 &  O3 goto O1
-          bmsi                  if O2 &  O3 goto O1
-          bmcr                  if !(O2 & O3) goto O1
-          bmci                  if !(O2 & O3) goto O1(4)
-          boaddr    _u          O2 += O3, goto O1 if overflow
-          boaddi    _u          O2 += O3, goto O1 if overflow
-          bxaddr    _u          O2 += O3, goto O1 if no overflow
-          bxaddi    _u          O2 += O3, goto O1 if no overflow
-          bosubr    _u          O2 -= O3, goto O1 if overflow
-          bosubi    _u          O2 -= O3, goto O1 if overflow
-          bxsubr    _u          O2 -= O3, goto O1 if no overflow
-          bxsubi    _u          O2 -= O3, goto O1 if no overflow
-
-Jump and return operations
-     These accept one argument except 'ret' which has none; the
-     difference between 'finishi' and 'calli' is that the latter does
-     not clean the stack from pushed parameters (if any) and the former
-     must *always* follow a 'prepare' instruction.
-          callr     (not specified)                function call to a register
-          calli     (not specified)                function call to O1
-          finishr   (not specified)                function call to a register
-          finishi   (not specified)                function call to O1
-          jmpr      (not specified)                unconditional jump to register
-          jmpi      (not specified)                unconditional jump
-          ret       (not specified)                return from subroutine
-          retr      _c _uc _s _us _i _ui _l _f _d
-          reti      _c _uc _s _us _i _ui _l _f _d
-          retval    _c _uc _s _us _i _ui _l _f _d  move return value
-                                                   to register
-
-     Like branch instruction, 'jmpi' also returns a value which is to be
-     used to compile forward branches.  *Note Fibonacci numbers:
-     Fibonacci.
-
-Labels
-     There are 3 GNU lightning instructions to create labels:
-          label     (not specified)                simple label
-          forward   (not specified)                forward label
-          indirect  (not specified)                special simple label
-
-     'label' is normally used as 'patch_at' argument for backward jumps.
-
-                  jit_node_t *jump, *label;
-          label = jit_label();
-                  ...
-                  jump = jit_beqr(JIT_R0, JIT_R1);
-                  jit_patch_at(jump, label);
-
-     'forward' is used to patch code generation before the actual
-     position of the label is known.
-
-                  jit_node_t *jump, *label;
-          label = jit_forward();
-                  jump = jit_beqr(JIT_R0, JIT_R1);
-                  jit_patch_at(jump, label);
-                  ...
-                  jit_link(label);
-
-     'indirect' is useful when creating jump tables, and tells GNU
-     lightning to not optimize out a label that is not the target of any
-     jump, because an indirect jump may land where it is defined.
-
-                  jit_node_t *jump, *label;
-                  ...
-                  jmpr(JIT_R0);                    /* may jump to label */
-                  ...
-          label = jit_indirect();
-
-     'indirect' is an special case of 'note' and 'name' because it is a
-     valid argument to 'address'.
-
-     Note that the usual idiom to write the previous example is
-                  jit_node_t *addr, *jump;
-          addr  = jit_movi(JIT_R0, 0);             /* immediate is ignored */
-                  ...
-                  jmpr(JIT_R0);
-                  ...
-                  jit_patch(addr);                 /* implicit label added */
-
-     that automatically binds the implicit label added by 'patch' with
-     the 'movi', but on some special conditions it is required to create
-     an "unbound" label.
-
-Function prolog
-
-     These macros are used to set up a function prolog.  The 'allocai'
-     call accept a single integer argument and returns an offset value
-     for stack storage access.
-
-          prolog    (not specified)                function prolog
-          allocai   (not specified)                reserve space on the stack
-
-     'allocai' receives the number of bytes to allocate and returns the
-     offset from the frame pointer register 'FP' to the base of the
-     area.
-
-     As a small appetizer, here is a small function that adds 1 to the
-     input parameter (an 'int').  I'm using an assembly-like syntax here
-     which is a bit different from the one used when writing real
-     subroutines with GNU lightning; the real syntax will be introduced
-     in *Note Generating code at run-time: GNU lightning examples.
-
-          incr:
-               prolog
-          in = arg                     ! We have an integer argument
-               getarg    R0, in        ! Move it to R0
-               addi      R0, R0, 1     ! Add 1
-               retr      R0            ! And return the result
-
-     And here is another function which uses the 'printf' function from
-     the standard C library to write a number in hexadecimal notation:
-
-          printhex:
-               prolog
-          in = arg                     ! Same as above
-               getarg    R0, in
-               prepare                 ! Begin call sequence for printf
-               pushargi  "%x"          ! Push format string
-               ellipsis                ! Varargs start here
-               pushargr  R0            ! Push second argument
-               finishi   printf        ! Call printf
-               ret                     ! Return to caller
-
-Trampolines, continuations and tail call optimization
-
-     Frequently it is required to generate jit code that must jump to
-     code generated later, possibly from another 'jit_context_t'.  These
-     require compatible stack frames.
-
-     GNU lightning provides two primitives from where trampolines,
-     continuations and tail call optimization can be implemented.
-
-          frame   (not specified)                  create stack frame
-          tramp   (not specified)                  assume stack frame
-
-     'frame' receives an integer argument(5) that defines the size in
-     bytes for the stack frame of the current, 'C' callable, jit
-     function.  To calculate this value, a good formula is maximum
-     number of arguments to any called native function times eight(6),
-     plus the sum of the arguments to any call to 'jit_allocai'.  GNU
-     lightning automatically adjusts this value for any backend specific
-     stack memory it may need, or any alignment constraint.
-
-     'frame' also instructs GNU lightning to save all callee save
-     registers in the prolog and reload in the epilog.
-
-          main:                        ! jit entry point
-               prolog                  ! function prolog
-               frame  256              ! save all callee save registers and
-                                       ! reserve at least 256 byte in stack
-          main_loop:
-               ...
-               jmpi   handler          ! jumps to external code
-               ...
-               ret                     ! return to the caller
-
-     'tramp' differs from 'frame' only that a prolog and epilog will not
-     be generated.  Note that 'prolog' must still be used.  The code
-     under 'tramp' must be ready to be entered with a jump at the prolog
-     position, and instead of a return, it must end with a non
-     conditional jump.  'tramp' exists solely for the fact that it
-     allows optimizing out prolog and epilog code that would never be
-     executed.
-
-          handler:                     ! handler entry point
-               prolog                  ! function prolog
-               tramp  256              ! assumes all callee save registers
-                                       ! are saved and there is at least
-                                       ! 256 byte in stack
-               ...
-               jmpi   main_loop        ! return to the main loop
-
-     GNU lightning only supports Tail Call Optimization using the
-     'tramp' construct.  Any other way is not guaranteed to work on all
-     ports.
-
-     An example of a simple (recursive) tail call optimization:
-
-          factorial:                   ! Entry point of the factorial function
-               prolog
-          in = arg                     ! Receive an integer argument
-               getarg R0, in           ! Move argument to RO
-               prepare
-                   pushargi 1          ! This is the accumulator
-                   pushargr R0         ! This is the argument
-               finishi fact            ! Call the tail call optimized function
-               retval R0               ! Fetch the result
-               retr R0                 ! Return it
-               epilog                  ! Epilog *before* label before prolog
-
-          fact:                        ! Entry point of the helper function
-               prolog
-               frame 16                ! Reserve 16 bytes in the stack
-          fact_entry:                  ! This is the tail call entry point
-          ac = arg                     ! The accumulator is the first argument
-          in = arg                     ! The factorial argument
-               getarg R0, ac           ! Move the accumulator to R0
-               getarg R1, in           ! Move the argument to R1
-               blei fact_out, R1, 1    ! Done if argument is one or less
-               mulr R0, R0, R1         ! accumulator *= argument
-               putargr R0, ac          ! Update the accumulator
-               subi R1, R1, 1          ! argument -= 1
-               putargr R1, in          ! Update the argument
-               jmpi fact_entry         ! Tail Call Optimize it!
-          fact_out:
-               retr R0                 ! Return the accumulator
-
-Predicates
-          forward_p      (not specified)           forward label predicate
-          indirect_p     (not specified)           indirect label predicate
-          target_p       (not specified)           used label predicate
-          arg_register_p (not specified)           argument kind predicate
-          callee_save_p  (not specified)           callee save predicate
-          pointer_p      (not specified)           pointer predicate
-
-     'forward_p' expects a 'jit_node_t*' argument, and returns non zero
-     if it is a forward label reference, that is, a label returned by
-     'forward', that still needs a 'link' call.
-
-     'indirect_p' expects a 'jit_node_t*' argument, and returns non zero
-     if it is an indirect label reference, that is, a label that was
-     returned by 'indirect'.
-
-     'target_p' expects a 'jit_node_t*' argument, that is any kind of
-     label, and will return non zero if there is at least one jump or
-     move referencing it.
-
-     'arg_register_p' expects a 'jit_node_t*' argument, that must have
-     been returned by 'arg', 'arg_f' or 'arg_d', and will return non
-     zero if the argument lives in a register.  This call is useful to
-     know the live range of register arguments, as those are very fast
-     to read and write, but have volatile values.
-
-     'callee_save_p' exects a valid 'JIT_Rn', 'JIT_Vn', or 'JIT_Fn', and
-     will return non zero if the register is callee save.  This call is
-     useful because on several ports, the 'JIT_Rn' and 'JIT_Fn'
-     registers are actually callee save; no need to save and load the
-     values when making function calls.
-
-     'pointer_p' expects a pointer argument, and will return non zero if
-     the pointer is inside the generated jit code.  Must be called after
-     'jit_emit' and before 'jit_destroy_state'.
-
-   ---------- Footnotes ----------
-
-   (1) The sign bit is propagated unless using the '_u' modifier.
-
-   (2) The sign bit is propagated unless using the '_u' modifier.
-
-   (3) "Return a value" means that GNU lightning code that compile these
-instructions return a value when expanded.
-
-   (4) These mnemonics mean, respectively, "branch if mask set" and
-"branch if mask cleared".
-
-   (5) It is not automatically computed because it does not know about
-the requirement of later generated code.
-
-   (6) Times eight so that it works for double arguments.  And would not
-need conditionals for ports that pass arguments in the stack.
-
-
-File: lightning.info,  Node: GNU lightning examples,  Next: Reentrancy,  Prev: The instruction set,  Up: Top
-
-4 Generating code at run-time
-*****************************
-
-To use GNU lightning, you should include the 'lightning.h' file that is
-put in your include directory by the 'make install' command.
-
-   Each of the instructions above translates to a macro or function
-call.  All you have to do is prepend 'jit_' (lowercase) to opcode names
-and 'JIT_' (uppercase) to register names.  Of course, parameters are to
-be put between parentheses.
-
-   This small tutorial presents three examples:
-
-* Menu:
-
-* incr::             A function which increments a number by one
-* printf::           A simple function call to printf
-* RPN calculator::   A more complex example, an RPN calculator
-* Fibonacci::        Calculating Fibonacci numbers
-
-
-File: lightning.info,  Node: incr,  Next: printf,  Up: GNU lightning examples
-
-4.1 A function which increments a number by one
-===============================================
-
-Let's see how to create and use the sample 'incr' function created in
-*note GNU lightning's instruction set: The instruction set.:
-
-     #include <stdio.h>
-     #include <lightning.h>
-
-     static jit_state_t *_jit;
-
-     typedef int (*pifi)(int);    /* Pointer to Int Function of Int */
-
-     int main(int argc, char *argv[])
-     {
-       jit_node_t  *in;
-       pifi         incr;
-
-       init_jit(argv[0]);
-       _jit = jit_new_state();
-
-       jit_prolog();                    /*      prolog              */
-       in = jit_arg();                  /*      in = arg            */
-       jit_getarg(JIT_R0, in);          /*      getarg R0           */
-       jit_addi(JIT_R0, JIT_R0, 1);     /*      addi   R0, R0, 1    */
-       jit_retr(JIT_R0);                /*      retr   R0           */
-
-       incr = jit_emit();
-       jit_clear_state();
-
-       /* call the generated code, passing 5 as an argument */
-       printf("%d + 1 = %d\n", 5, incr(5));
-
-       jit_destroy_state();
-       finish_jit();
-       return 0;
-     }
-
-   Let's examine the code line by line (well, almost...):
-
-#include <lightning.h>
-     You already know about this.  It defines all of GNU lightning's
-     macros.
-
-static jit_state_t *_jit;
-     You might wonder about what is 'jit_state_t'.  It is a structure
-     that stores jit code generation information.  The name '_jit' is
-     special, because since multiple jit generators can run at the same
-     time, you must either #define _jit my_jit_state or name it '_jit'.
-
-typedef int (*pifi)(int);
-     Just a handy typedef for a pointer to a function that takes an
-     'int' and returns another.
-
-jit_node_t *in;
-     Declares a variable to hold an identifier for a function argument.
-     It is an opaque pointer, that will hold the return of a call to
-     'arg' and be used as argument to 'getarg'.
-
-pifi incr;
-     Declares a function pointer variable to a function that receives an
-     'int' and returns an 'int'.
-
-init_jit(argv[0]);
-     You must call this function before creating a 'jit_state_t' object.
-     This function does global state initialization, and may need to
-     detect CPU or Operating System features.  It receives a string
-     argument that is later used to read symbols from a shared object
-     using GNU binutils if disassembly was enabled at configure time.
-     If no disassembly will be performed a NULL pointer can be used as
-     argument.
-
-_jit = jit_new_state();
-     This call initializes a GNU lightning jit state.
-
-jit_prolog();
-     Ok, so we start generating code for our beloved function...
-
-in = jit_arg();
-jit_getarg(JIT_R0, in);
-     We retrieve the first (and only) argument, an integer, and store it
-     into the general-purpose register 'R0'.
-
-jit_addi(JIT_R0, JIT_R0, 1);
-     We add one to the content of the register.
-
-jit_retr(JIT_R0);
-     This instruction generates a standard function epilog that returns
-     the contents of the 'R0' register.
-
-incr = jit_emit();
-     This instruction is very important.  It actually translates the GNU
-     lightning macros used before to machine code, flushes the generated
-     code area out of the processor's instruction cache and return a
-     pointer to the start of the code.
-
-jit_clear_state();
-     This call cleanups any data not required for jit execution.  Note
-     that it must be called after any call to 'jit_print' or
-     'jit_address', as this call destroy the GNU lightning intermediate
-     representation.
-
-printf("%d + 1 = %d", 5, incr(5));
-     Calling our function is this simple--it is not distinguishable from
-     a normal C function call, the only difference being that 'incr' is
-     a variable.
-
-jit_destroy_state();
-     Releases all memory associated with the jit context.  It should be
-     called after known the jit will no longer be called.
-
-finish_jit();
-     This call cleanups any global state hold by GNU lightning, and is
-     advisable to call it once jit code will no longer be generated.
-
-   GNU lightning abstracts two phases of dynamic code generation:
-selecting instructions that map the standard representation, and
-emitting binary code for these instructions.  The client program has the
-responsibility of describing the code to be generated using the standard
-GNU lightning instruction set.
-
-   Let's examine the code generated for 'incr' on the SPARC and x86_64
-architecture (on the right is the code that an assembly-language
-programmer would write):
-
-SPARC
-                save  %sp, -112, %sp
-                mov  %i0, %g2                 retl
-                inc  %g2                      inc %o0
-                mov  %g2, %i0
-                restore
-                retl
-                nop
-     In this case, GNU lightning introduces overhead to create a
-     register window (not knowing that the procedure is a leaf
-     procedure) and to move the argument to the general purpose register
-     'R0' (which maps to '%g2' on the SPARC).
-
-x86_64
-              sub   $0x30,%rsp
-              mov   %rbp,(%rsp)
-              mov   %rsp,%rbp
-              sub   $0x18,%rsp
-              mov   %rdi,%rax            mov %rdi, %rax
-              add   $0x1,%rax            inc %rax
-              mov   %rbp,%rsp
-              mov   (%rsp),%rbp
-              add   $0x30,%rsp
-              retq                       retq
-     In this case, the main overhead is due to the function's prolog and
-     epilog, and stack alignment after reserving stack space for word
-     to/from float conversions or moving data from/to x87 to/from SSE.
-     Note that besides allocating space to save callee saved registers,
-     no registers are saved/restored because GNU lightning notices those
-     registers are not modified.  There is currently no logic to detect
-     if it needs to allocate stack space for type conversions neither
-     proper leaf function detection, but these are subject to change
-     (FIXME).
-
-
-File: lightning.info,  Node: printf,  Next: RPN calculator,  Prev: incr,  Up: GNU lightning examples
-
-4.2 A simple function call to 'printf'
-======================================
-
-Again, here is the code for the example:
-
-     #include <stdio.h>
-     #include <lightning.h>
-
-     static jit_state_t *_jit;
-
-     typedef void (*pvfi)(int);      /* Pointer to Void Function of Int */
-
-     int main(int argc, char *argv[])
-     {
-       pvfi          myFunction;             /* ptr to generated code */
-       jit_node_t    *start, *end;           /* a couple of labels */
-       jit_node_t    *in;                    /* to get the argument */
-
-       init_jit(argv[0]);
-       _jit = jit_new_state();
-
-       start = jit_note(__FILE__, __LINE__);
-       jit_prolog();
-       in = jit_arg();
-       jit_getarg(JIT_R1, in);
-       jit_pushargi((jit_word_t)"generated %d bytes\n");
-       jit_ellipsis();
-       jit_pushargr(JIT_R1);
-       jit_finishi(printf);
-       jit_ret();
-       jit_epilog();
-       end = jit_note(__FILE__, __LINE__);
-
-       myFunction = jit_emit();
-
-       /* call the generated code, passing its size as argument */
-       myFunction((char*)jit_address(end) - (char*)jit_address(start));
-       jit_clear_state();
-
-       jit_disassemble();
-
-       jit_destroy_state();
-       finish_jit();
-       return 0;
-     }
-
-   The function shows how many bytes were generated.  Most of the code
-is not very interesting, as it resembles very closely the program
-presented in *note A function which increments a number by one: incr.
-
-   For this reason, we're going to concentrate on just a few statements.
-
-start = jit_note(__FILE__, __LINE__);
-...
-end = jit_note(__FILE__, __LINE__);
-     These two instruction call the 'jit_note' macro, which creates a
-     note in the jit code; arguments to 'jit_note' usually are a
-     filename string and line number integer, but using NULL for the
-     string argument is perfectly valid if only need to create a simple
-     marker in the code.
-
-jit_ellipsis();
-     'ellipsis' usually is only required if calling varargs functions
-     with double arguments, but it is a good practice to properly
-     describe the ... in the call sequence.
-
-jit_pushargi((jit_word_t)"generated %d bytes\n");
-     Note the use of the '(jit_word_t)' cast, that is used only to avoid
-     a compiler warning, due to using a pointer where a wordsize integer
-     type was expected.
-
-jit_prepare();
-...
-jit_finishi(printf);
-     Once the arguments to 'printf' have been pushed, what means moving
-     them to stack or register arguments, the 'printf' function is
-     called and the stack cleaned.  Note how GNU lightning abstracts the
-     differences between different architectures and ABI's - the client
-     program does not know how parameter passing works on the host
-     architecture.
-
-jit_epilog();
-     Usually it is not required to call 'epilog', but because it is
-     implicitly called when noticing the end of a function, if the 'end'
-     variable was set with a 'note' call after the 'ret', it would not
-     consider the function epilog.
-
-myFunction((char*)jit_address(end) - (char*)jit_address(start));
-     This calls the generate jit function passing as argument the offset
-     difference from the 'start' and 'end' notes.  The 'address' call
-     must be done after the 'emit' call or either a fatal error will
-     happen (if GNU lightning is built with assertions enable) or an
-     undefined value will be returned.
-
-jit_clear_state();
-     Note that 'jit_clear_state' was called after executing jit in this
-     example.  It was done because it must be called after any call to
-     'jit_address' or 'jit_print'.
-
-jit_disassemble();
-     'disassemble' will dump the generated code to standard output,
-     unless GNU lightning was built with the disassembler disabled, in
-     which case no output will be shown.
-
-
-File: lightning.info,  Node: RPN calculator,  Next: Fibonacci,  Prev: printf,  Up: GNU lightning examples
-
-4.3 A more complex example, an RPN calculator
-=============================================
-
-We create a small stack-based RPN calculator which applies a series of
-operators to a given parameter and to other numeric operands.  Unlike
-previous examples, the code generator is fully parameterized and is able
-to compile different formulas to different functions.  Here is the code
-for the expression compiler; a sample usage will follow.
-
-   Since GNU lightning does not provide push/pop instruction, this
-example uses a stack-allocated area to store the data.  Such an area can
-be allocated using the macro 'allocai', which receives the number of
-bytes to allocate and returns the offset from the frame pointer register
-'FP' to the base of the area.
-
-   Usually, you will use the 'ldxi' and 'stxi' instruction to access
-stack-allocated variables.  However, it is possible to use operations
-such as 'add' to compute the address of the variables, and pass the
-address around.
-
-     #include <stdio.h>
-     #include <lightning.h>
-
-     typedef int (*pifi)(int);       /* Pointer to Int Function of Int */
-
-     static jit_state_t *_jit;
-
-     void stack_push(int reg, int *sp)
-     {
-       jit_stxi_i (*sp, JIT_FP, reg);
-       *sp += sizeof (int);
-     }
-
-     void stack_pop(int reg, int *sp)
-     {
-       *sp -= sizeof (int);
-       jit_ldxi_i (reg, JIT_FP, *sp);
-     }
-
-     jit_node_t *compile_rpn(char *expr)
-     {
-       jit_node_t *in, *fn;
-       int stack_base, stack_ptr;
-
-       fn = jit_note(NULL, 0);
-       jit_prolog();
-       in = jit_arg();
-       stack_ptr = stack_base = jit_allocai (32 * sizeof (int));
-
-       jit_getarg_i(JIT_R2, in);
-
-       while (*expr) {
-         char buf[32];
-         int n;
-         if (sscanf(expr, "%[0-9]%n", buf, &n)) {
-           expr += n - 1;
-           stack_push(JIT_R0, &stack_ptr);
-           jit_movi(JIT_R0, atoi(buf));
-         } else if (*expr == 'x') {
-           stack_push(JIT_R0, &stack_ptr);
-           jit_movr(JIT_R0, JIT_R2);
-         } else if (*expr == '+') {
-           stack_pop(JIT_R1, &stack_ptr);
-           jit_addr(JIT_R0, JIT_R1, JIT_R0);
-         } else if (*expr == '-') {
-           stack_pop(JIT_R1, &stack_ptr);
-           jit_subr(JIT_R0, JIT_R1, JIT_R0);
-         } else if (*expr == '*') {
-           stack_pop(JIT_R1, &stack_ptr);
-           jit_mulr(JIT_R0, JIT_R1, JIT_R0);
-         } else if (*expr == '/') {
-           stack_pop(JIT_R1, &stack_ptr);
-           jit_divr(JIT_R0, JIT_R1, JIT_R0);
-         } else {
-           fprintf(stderr, "cannot compile: %s\n", expr);
-           abort();
-         }
-         ++expr;
-       }
-       jit_retr(JIT_R0);
-       jit_epilog();
-       return fn;
-     }
-
-   The principle on which the calculator is based is easy: the stack top
-is held in R0, while the remaining items of the stack are held in the
-memory area that we allocate with 'allocai'.  Compiling a numeric
-operand or the argument 'x' pushes the old stack top onto the stack and
-moves the operand into R0; compiling an operator pops the second operand
-off the stack into R1, and compiles the operation so that the result
-goes into R0, thus becoming the new stack top.
-
-   This example allocates a fixed area for 32 'int's.  This is not a
-problem when the function is a leaf like in this case; in a full-blown
-compiler you will want to analyze the input and determine the number of
-needed stack slots--a very simple example of register allocation.  The
-area is then managed like a stack using 'stack_push' and 'stack_pop'.
-
-   Source code for the client (which lies in the same source file)
-follows:
-
-     int main(int argc, char *argv[])
-     {
-       jit_node_t *nc, *nf;
-       pifi c2f, f2c;
-       int i;
-
-       init_jit(argv[0]);
-       _jit = jit_new_state();
-
-       nc = compile_rpn("32x9*5/+");
-       nf = compile_rpn("x32-5*9/");
-       (void)jit_emit();
-       c2f = (pifi)jit_address(nc);
-       f2c = (pifi)jit_address(nf);
-       jit_clear_state();
-
-       printf("\nC:");
-       for (i = 0; i <= 100; i += 10) printf("%3d ", i);
-       printf("\nF:");
-       for (i = 0; i <= 100; i += 10) printf("%3d ", c2f(i));
-       printf("\n");
-
-       printf("\nF:");
-       for (i = 32; i <= 212; i += 18) printf("%3d ", i);
-       printf("\nC:");
-       for (i = 32; i <= 212; i += 18) printf("%3d ", f2c(i));
-       printf("\n");
-
-       jit_destroy_state();
-       finish_jit();
-       return 0;
-     }
-
-   The client displays a conversion table between Celsius and Fahrenheit
-degrees (both Celsius-to-Fahrenheit and Fahrenheit-to-Celsius).  The
-formulas are, F(c) = c*9/5+32 and C(f) = (f-32)*5/9, respectively.
-
-   Providing the formula as an argument to 'compile_rpn' effectively
-parameterizes code generation, making it possible to use the same code
-to compile different functions; this is what makes dynamic code
-generation so powerful.
-
-
-File: lightning.info,  Node: Fibonacci,  Prev: RPN calculator,  Up: GNU lightning examples
-
-4.4 Fibonacci numbers
-=====================
-
-The code in this section calculates a variant of the Fibonacci sequence.
-While the traditional Fibonacci sequence is modeled by the recurrence
-relation:
-          f(0) = f(1) = 1
-          f(n) = f(n-1) + f(n-2)
-
-the functions in this section calculates the following sequence, which
-is more interesting as a benchmark(1):
-          fib(0) = fib(1) = 1
-          fib(n) = fib(n-1) + fib(n-2) + 1
-
-   The purpose of this example is to introduce branches.  There are two
-kind of branches: backward branches and forward branches.  We'll present
-the calculation in a recursive and iterative form; the former only uses
-forward branches, while the latter uses both.
-
-     #include <stdio.h>
-     #include <lightning.h>
-
-     static jit_state_t *_jit;
-
-     typedef int (*pifi)(int);       /* Pointer to Int Function of Int */
-
-     int main(int argc, char *argv[])
-     {
-       pifi       fib;
-       jit_node_t *label;
-       jit_node_t *call;
-       jit_node_t *in;                 /* offset of the argument */
-       jit_node_t *ref;                /* to patch the forward reference */
-
-       init_jit(argv[0]);
-       _jit = jit_new_state();
-
-       label = jit_label();
-             jit_prolog   ();
-       in =  jit_arg      ();
-             jit_getarg   (JIT_V0, in);              /* V0 = n */
-       ref = jit_blti     (JIT_V0, 2);
-             jit_subi     (JIT_V1, JIT_V0, 1);       /* V1 = n-1 */
-             jit_subi     (JIT_V2, JIT_V0, 2);       /* V2 = n-2 */
-             jit_prepare();
-               jit_pushargr(JIT_V1);
-             call = jit_finishi(NULL);
-             jit_patch_at(call, label);
-             jit_retval(JIT_V1);                     /* V1 = fib(n-1) */
-             jit_prepare();
-               jit_pushargr(JIT_V2);
-             call = jit_finishi(NULL);
-             jit_patch_at(call, label);
-             jit_retval(JIT_V2);                     /* V2 = fib(n-2) */
-             jit_addi(JIT_V1,  JIT_V1,  1);
-             jit_addr(JIT_R0, JIT_V1, JIT_V2);       /* R0 = V1 + V2 + 1 */
-             jit_retr(JIT_R0);
-
-       jit_patch(ref);                               /* patch jump */
-             jit_movi(JIT_R0, 1);                    /* R0 = 1 */
-             jit_retr(JIT_R0);
-
-       /* call the generated code, passing 32 as an argument */
-       fib = jit_emit();
-       jit_clear_state();
-       printf("fib(%d) = %d\n", 32, fib(32));
-       jit_destroy_state();
-       finish_jit();
-       return 0;
-     }
-
-   As said above, this is the first example of dynamically compiling
-branches.  Branch instructions have two operands containing the values
-to be compared, and return a 'jit_note_t *' object to be patched.
-
-   Because labels final address are only known after calling 'emit', it
-is required to call 'patch' or 'patch_at', what does tell GNU lightning
-that the target to patch is actually a pointer to a 'jit_node_t *'
-object, otherwise, it would assume that is a pointer to a C function.
-Note that conditional branches do not receive a label argument, so they
-must be patched.
-
-   You need to call 'patch_at' on the return of value 'calli',
-'finishi', and 'calli' if it is actually referencing a label in the jit
-code.  All branch instructions do not receive a label argument.  Note
-that 'movi' is an special case, and patching it is usually done to get
-the final address of a label, usually to later call 'jmpr'.
-
-   Now, here is the iterative version:
-
-     #include <stdio.h>
-     #include <lightning.h>
-
-     static jit_state_t *_jit;
-
-     typedef int (*pifi)(int);       /* Pointer to Int Function of Int */
-
-     int main(int argc, char *argv[])
-     {
-       pifi       fib;
-       jit_node_t *in;               /* offset of the argument */
-       jit_node_t *ref;              /* to patch the forward reference */
-       jit_node_t *jump;             /* jump to start of loop */
-       jit_node_t *loop;             /* start of the loop */
-
-       init_jit(argv[0]);
-       _jit = jit_new_state();
-
-             jit_prolog   ();
-       in =  jit_arg      ();
-             jit_getarg   (JIT_R2, in);              /* R2 = n */
-             jit_movi     (JIT_R1, 1);
-       ref = jit_blti     (JIT_R2, 2);
-             jit_subi     (JIT_R2, JIT_R2, 1);
-             jit_movi     (JIT_R0, 1);
-
-       loop= jit_label();
-             jit_subi     (JIT_R2, JIT_R2, 1);       /* decr. counter */
-             jit_addr     (JIT_V0, JIT_R0, JIT_R1);  /* V0 = R0 + R1 */
-             jit_movr     (JIT_R0, JIT_R1);          /* R0 = R1 */
-             jit_addi     (JIT_R1, JIT_V0, 1);       /* R1 = V0 + 1 */
-       jump= jit_bnei     (JIT_R2, 0);               /* if (R2) goto loop; */
-       jit_patch_at(jump, label);
-
-       jit_patch(ref);                               /* patch forward jump */
-             jit_movr     (JIT_R0, JIT_R1);          /* R0 = R1 */
-             jit_retr     (JIT_R0);
-
-       /* call the generated code, passing 36 as an argument */
-       fib = jit_emit();
-       jit_clear_state();
-       printf("fib(%d) = %d\n", 36, fib(36));
-       jit_destroy_state();
-       finish_jit();
-       return 0;
-     }
-
-   This code calculates the recurrence relation using iteration (a 'for'
-loop in high-level languages).  There are no function calls anymore:
-instead, there is a backward jump (the 'bnei' at the end of the loop).
-
-   Note that the program must remember the address for backward jumps;
-for forward jumps it is only required to remember the jump code, and
-call 'patch' for the implicit label.
-
-   ---------- Footnotes ----------
-
-   (1) That's because, as is easily seen, the sequence represents the
-number of activations of the 'nfibs' procedure that are needed to
-compute its value through recursion.
-
-
-File: lightning.info,  Node: Reentrancy,  Next: Customizations,  Prev: GNU lightning examples,  Up: Top
-
-5 Re-entrant usage of GNU lightning
-***********************************
-
-GNU lightning uses the special '_jit' identifier.  To be able to be able
-to use multiple jit generation states at the same time, it is required
-to used code similar to:
-
-         struct jit_state lightning;
-         #define lightning _jit
-
-   This will cause the symbol defined to '_jit' to be passed as the
-first argument to the underlying GNU lightning implementation, that is
-usually a function with an '_' (underscode) prefix and with an argument
-named '_jit', in the pattern:
-
-         static void _jit_mnemonic(jit_state_t *, jit_gpr_t, jit_gpr_t);
-         #define jit_mnemonic(u, v) _jit_mnemonic(_jit, u, v);
-
-   The reason for this is to use the same syntax as the initial
-lightning implementation and to avoid needing the user to keep adding an
-extra argument to every call, as multiple jit states generating code in
-paralell should be very uncommon.
-
-5.1 Registers
-=============
-
-6 Accessing the whole register file
-***********************************
-
-As mentioned earlier in this chapter, all GNU lightning back-ends are
-guaranteed to have at least six general-purpose integer registers and
-six floating-point registers, but many back-ends will have more.
-
-   To access the entire register files, you can use the 'JIT_R', 'JIT_V'
-and 'JIT_F' macros.  They accept a parameter that identifies the
-register number, which must be strictly less than 'JIT_R_NUM',
-'JIT_V_NUM' and 'JIT_F_NUM' respectively; the number need not be
-constant.  Of course, expressions like 'JIT_R0' and 'JIT_R(0)' denote
-the same register, and likewise for integer callee-saved, or
-floating-point, registers.
-
-
-File: lightning.info,  Node: Customizations,  Next: Acknowledgements,  Prev: Reentrancy,  Up: Top
-
-7 Customizations
-****************
-
-Frequently it is desirable to have more control over how code is
-generated or how memory is used during jit generation or execution.
-
-7.1 Memory functions
-====================
-
-To aid in complete control of memory allocation and deallocation GNU
-lightning provides wrappers that default to standard 'malloc', 'realloc'
-and 'free'.  These are loosely based on the GNU GMP counterparts, with
-the difference that they use the same prototype of the system allocation
-functions, that is, no 'size' for 'free' or 'old_size' for 'realloc'.
-
- -- Function: void jit_set_memory_functions (
-          void *(*ALLOC_FUNC_PTR) (size_t),
-          void *(*REALLOC_FUNC_PTR) (void *, size_t),
-          void (*FREE_FUNC_PTR) (void *))
-     GNU lightning guarantees that memory is only allocated or released
-     using these wrapped functions, but you must note that if lightning
-     was linked to GNU binutils, malloc is probably will be called
-     multiple times from there when initializing the disassembler.
-
-     Because 'init_jit' may call memory functions, if you need to call
-     'jit_set_memory_functions', it must be called before 'init_jit',
-     otherwise, when calling 'finish_jit', a pointer allocated with the
-     previous or default wrappers will be passed.
-
- -- Function: void jit_get_memory_functions (
-          void *(**ALLOC_FUNC_PTR) (size_t),
-          void *(**REALLOC_FUNC_PTR) (void *, size_t),
-          void (**FREE_FUNC_PTR) (void *))
-     Get the current memory allocation function.  Also, unlike the GNU
-     GMP counterpart, it is an error to pass 'NULL' pointers as
-     arguments.
-
-7.2 Alternate code buffer
-=========================
-
-To instruct GNU lightning to use an alternate code buffer it is required
-to call 'jit_realize' before 'jit_emit', and then query states and
-customize as appropriate.
-
- -- Function: void jit_realize ()
-     Must be called once, before 'jit_emit', to instruct GNU lightning
-     that no other 'jit_xyz' call will be made.
-
- -- Function: jit_pointer_t jit_get_code (jit_word_t *CODE_SIZE)
-     Returns NULL or the previous value set with 'jit_set_code', and
-     sets the CODE_SIZE argument to an appropriate value.  If
-     'jit_get_code' is called before 'jit_emit', the CODE_SIZE argument
-     is set to the expected amount of bytes required to generate code.
-     If 'jit_get_code' is called after 'jit_emit', the CODE_SIZE
-     argument is set to the exact amount of bytes used by the code.
-
- -- Function: void jit_set_code (jit_ponter_t CODE, jit_word_t SIZE)
-     Instructs GNU lightning to output to the CODE argument and use SIZE
-     as a guard to not write to invalid memory.  If during 'jit_emit'
-     GNU lightning finds out that the code would not fit in SIZE bytes,
-     it halts code emit and returns 'NULL'.
-
-   A simple example of a loop using an alternate buffer is:
-
-       jit_uint8_t   *code;
-       int           *(func)(int);      /* function pointer */
-       jit_word_t     code_size;
-       jit_word_t     real_code_size;
-       ...
-       jit_realize();                   /* ready to generate code */
-       jit_get_code(&code_size);        /* get expected code size */
-       code_size = (code_size + 4095) & -4096;
-       do (;;) {
-         code = mmap(NULL, code_size, PROT_EXEC | PROT_READ | PROT_WRITE,
-                     MAP_PRIVATE | MAP_ANON, -1, 0);
-         jit_set_code(code, code_size);
-         if ((func = jit_emit()) == NULL) {
-           munmap(code, code_size);
-           code_size += 4096;
-         }
-       } while (func == NULL);
-       jit_get_code(&real_code_size);   /* query exact size of the code */
-
-   The first call to 'jit_get_code' should return 'NULL' and set the
-'code_size' argument to the expected amount of bytes required to emit
-code.  The second call to 'jit_get_code' is after a successful call to
-'jit_emit', and will return the value previously set with 'jit_set_code'
-and set the 'real_code_size' argument to the exact amount of bytes used
-to emit the code.
-
-7.3 Alternate data buffer
-=========================
-
-Sometimes it may be desirable to customize how, or to prevent GNU
-lightning from using an extra buffer for constants or debug annotation.
-Usually when also using an alternate code buffer.
-
- -- Function: jit_pointer_t jit_get_data (jit_word_t *DATA_SIZE,
-          jit_word_t *NOTE_SIZE)
-     Returns 'NULL' or the previous value set with 'jit_set_data', and
-     sets the DATA_SIZE argument to how many bytes are required for the
-     constants data buffer, and NOTE_SIZE to how many bytes are required
-     to store the debug note information.  Note that it always
-     preallocate one debug note entry even if 'jit_name' or 'jit_note'
-     are never called, but will return zero in the DATA_SIZE argument if
-     no constant is required; constants are only used for the 'float'
-     and 'double' operations that have an immediate argument, and not in
-     all GNU lightning ports.
-
- -- Function: void jit_set_data (jit_pointer_t DATA, jit_word_t SIZE,
-          jit_word_t FLAGS)
-
-     DATA can be NULL if disabling constants and annotations, otherwise,
-     a valid pointer must be passed.  An assertion is done that the data
-     will fit in SIZE bytes (but that is a noop if GNU lightning was
-     built with '-DNDEBUG').
-
-     SIZE tells the space in bytes available in DATA.
-
-     FLAGS can be zero to tell to just use the alternate data buffer, or
-     a composition of 'JIT_DISABLE_DATA' and 'JIT_DISABLE_NOTE'
-
-     JIT_DISABLE_DATA
-          Instructs GNU lightning to not use a constant table, but to
-          use an alternate method to synthesize those, usually with a
-          larger code sequence using stack space to transfer the value
-          from a GPR to a FPR register.
-
-     JIT_DISABLE_NOTE
-          Instructs GNU lightning to not store file or function name,
-          and line numbers in the constant buffer.
-
-   A simple example of a preventing usage of a data buffer is:
-
-       ...
-       jit_realize();                        /* ready to generate code */
-       jit_get_data(NULL, NULL);
-       jit_set_data(NULL, 0, JIT_DISABLE_DATA | JIT_DISABLE_NOTE);
-       ...
-
-   Or to only use a data buffer, if required:
-
-       jit_uint8_t   *data;
-       jit_word_t     data_size;
-       ...
-       jit_realize();                        /* ready to generate code */
-       jit_get_data(&data_size, NULL);
-       if (data_size)
-         data = malloc(data_size);
-       else
-         data = NULL;
-       jit_set_data(data, data_size, JIT_DISABLE_NOTE);
-       ...
-       if (data)
-         free(data);
-       ...
-
-
-File: lightning.info,  Node: Acknowledgements,  Prev: Customizations,  Up: Top
-
-8 Acknowledgements
-******************
-
-As far as I know, the first general-purpose portable dynamic code
-generator is DCG, by Dawson R. Engler and T. A. Proebsting.  Further
-work by Dawson R. Engler resulted in the VCODE system; unlike DCG, VCODE
-used no intermediate representation and directly inspired GNU lightning.
-
-   Thanks go to Ian Piumarta, who kindly accepted to release his own
-program CCG under the GNU General Public License, thereby allowing GNU
-lightning to use the run-time assemblers he had wrote for CCG.  CCG
-provides a way of dynamically assemble programs written in the
-underlying architecture's assembly language.  So it is not portable, yet
-very interesting.
-
-   I also thank Steve Byrne for writing GNU Smalltalk, since GNU
-lightning was first developed as a tool to be used in GNU Smalltalk's
-dynamic translator from bytecodes to native code.
-
-
-
-Tag Table:
-Node: Top227
-Node: Overview872
-Node: Installation3391
-Node: The instruction set4683
-Ref: The instruction set-Footnote-133718
-Ref: The instruction set-Footnote-233785
-Ref: The instruction set-Footnote-333852
-Ref: The instruction set-Footnote-433969
-Ref: The instruction set-Footnote-534064
-Ref: The instruction set-Footnote-634177
-Node: GNU lightning examples34313
-Node: incr35153
-Node: printf41222
-Node: RPN calculator45103
-Node: Fibonacci50062
-Ref: Fibonacci-Footnote-155728
-Node: Reentrancy55902
-Node: Customizations57678
-Node: Acknowledgements64392
-
-End Tag Table

+ 0 - 22
bjos/sledge/lightning/check/3to2.ok

@@ -1,22 +0,0 @@
-0
-1
-1
-1
-0
-1
-1
-1
-0
-1
-1
-0
-1
-1
-1
-0
-1
-1
-1
-0
-1
-1

+ 0 - 118
bjos/sledge/lightning/check/3to2.tst

@@ -1,118 +0,0 @@
-.data	32
-dfmt:
-.c	"%1.0f\n"
-ifmt:
-.c	"%d\n"
-
-.code
-	jmpi main
-
-#define def_test_double(a, b, c)		\
-	name test_double_##a##_##b##_##c	\
-test_double_##a##_##b##_##c:			\
-	prolog					\
-	arg_d $d0				\
-	arg_d $d1				\
-	getarg_d %b $d0				\
-	getarg_d %c $d1				\
-	subr_d %a %b %c				\
-	retr_d %a				\
-	epilog
-#define test_double(a, b, c, x, y)		\
-	prepare					\
-		pushargi_d x			\
-		pushargi_d y			\
-	finishi test_double_##a##_##b##_##c	\
-	retval_d %f0				\
-	prepare					\
-		pushargi dfmt			\
-		ellipsis			\
-		pushargr_d %f0			\
-	finishi @printf
-
-#define def_test_int(a, b, c)			\
-	name test_int_##a##_##b##_##c		\
-test_int_##a##_##b##_##c:			\
-	prolog					\
-	arg $i0					\
-	arg $i1					\
-	getarg %b $i0				\
-	getarg %c $i1				\
-	subr %a %b %c				\
-	retr %a					\
-	epilog
-#define test_int(a, b, c, x, y)			\
-	prepare					\
-		pushargi x			\
-		pushargi y			\
-	finishi test_int_##a##_##b##_##c	\
-	retval %r0				\
-	prepare					\
-		pushargi ifmt			\
-		ellipsis			\
-		pushargr %r0			\
-	finishi @printf
-
-def_test_double(f0, f0, f0)
-def_test_double(f0, f0, f1)
-def_test_double(f0, f1, f0)
-def_test_double(f0, f1, f2)
-
-def_test_double(f3, f3, f3)
-def_test_double(f3, f3, f1)
-def_test_double(f3, f1, f3)
-def_test_double(f3, f1, f2)
-
-def_test_double(f3, f0, f0)
-def_test_double(f3, f0, f3)
-def_test_double(f3, f3, f0)
-
-def_test_int(r0, r0, r0)
-def_test_int(r0, r0, r1)
-def_test_int(r0, r1, r0)
-def_test_int(r0, r1, r2)
-
-def_test_int(v0, v0, v0)
-def_test_int(v0, v0, r1)
-def_test_int(v0, r1, v0)
-def_test_int(v0, r1, r2)
-
-def_test_int(v0, r0, r0)
-def_test_int(v0, r0, v0)
-def_test_int(v0, v0, r0)
-
-
-	name main
-main:
-	prolog
-
-	test_double(f0, f0, f0, 3.0, 2.0)
-	test_double(f0, f0, f1, 3.0, 2.0)
-	test_double(f0, f1, f0, 3.0, 2.0)
-	test_double(f0, f1, f2, 3.0, 2.0)
-
-	test_double(f3, f3, f3, 3.0, 2.0)
-	test_double(f3, f3, f1, 3.0, 2.0)
-	test_double(f3, f1, f3, 3.0, 2.0)
-	test_double(f3, f1, f2, 3.0, 2.0)
-
-	test_double(f3, f0, f0, 3.0, 2.0)
-	test_double(f3, f0, f3, 3.0, 2.0)
-	test_double(f3, f3, f0, 3.0, 2.0)
-
-	test_int(r0, r0, r0, 3, 2)
-	test_int(r0, r0, r1, 3, 2)
-	test_int(r0, r1, r0, 3, 2)
-	test_int(r0, r1, r2, 3, 2)
-
-	test_int(v0, v0, v0, 3, 2)
-	test_int(v0, v0, r1, 3, 2)
-	test_int(v0, r1, v0, 3, 2)
-	test_int(v0, r1, r2, 3, 2)
-
-	test_int(v0, r0, r0, 3, 2)
-	test_int(v0, r0, v0, 3, 2)
-	test_int(v0, v0, r0, 3, 2)
-
-	ret
-	epilog

+ 0 - 307
bjos/sledge/lightning/check/Makefile.am

@@ -1,307 +0,0 @@
-#
-# Copyright 2012 Free Software Foundation, Inc.
-#
-# This file is part of GNU lightning.
-#
-# GNU lightning is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published
-# by the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU lightning is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-# License for more details.
-#
-
-AM_CFLAGS = -I$(top_srcdir)/include -D_GNU_SOURCE
-
-check_PROGRAMS = lightning ccall self setcode nodata ctramp carg
-
-lightning_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-lightning_SOURCES = lightning.c
-
-ccall_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-ccall_SOURCES = ccall.c
-
-self_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-self_SOURCES = self.c
-
-setcode_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-setcode_SOURCES = setcode.c
-
-nodata_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-nodata_SOURCES = nodata.c
-
-ctramp_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-ctramp_SOURCES = ctramp.c
-
-carg_LDADD = $(top_builddir)/lib/liblightning.la -lm $(SHLIB)
-carg_SOURCES = carg.c
-
-$(top_builddir)/lib/liblightning.la:
-	cd $(top_builddir)/lib; $(MAKE) $(AM_MAKEFLAGS) liblightning.la
-
-EXTRA_DIST =				\
-	3to2.tst	3to2.ok		\
-	add.tst		add.ok		\
-	align.tst	align.ok	\
-	allocai.tst	allocai.ok	\
-	bp.tst		bp.ok		\
-	divi.tst	divi.ok		\
-	fib.tst		fib.ok		\
-	rpn.tst		rpn.ok		\
-	ldst.inc			\
-	ldstr.tst	ldstr.ok	\
-	ldsti.tst	ldsti.ok	\
-	ldstxr.tst	ldstxr.ok	\
-	ldstxi.tst	ldstxi.ok	\
-	ldstr-c.tst	ldstr-c.ok	\
-	ldstxr-c.tst	ldstxr-c.ok	\
-	ldstxi-c.tst	ldstxi-c.ok	\
-	cvt.tst		cvt.ok		\
-	hton.tst	hton.ok		\
-	branch.tst	branch.ok	\
-	alu.inc				\
-	alu_add.tst	alu_add.ok	\
-	alux_add.tst	alux_add.ok	\
-	alu_sub.tst	alu_sub.ok	\
-	alux_sub.tst	alux_sub.ok	\
-	alu_rsb.tst	alu_rsb.ok	\
-	alu_mul.tst	alu_mul.ok	\
-	alu_div.tst	alu_div.ok	\
-	alu_rem.tst	alu_rem.ok	\
-	alu_and.tst	alu_and.ok	\
-	alu_or.tst	alu_or.ok	\
-	alu_xor.tst	alu_xor.ok	\
-	alu_lsh.tst	alu_lsh.ok	\
-	alu_rsh.tst	alu_rsh.ok	\
-	alu_com.tst	alu_com.ok	\
-	alu_neg.tst	alu_neg.ok	\
-	fop_abs.tst	fop_abs.ok	\
-	fop_sqrt.tst	fop_sqrt.ok	\
-	varargs.tst	varargs.ok	\
-	stack.tst	stack.ok	\
-	clobber.tst	clobber.ok	\
-	carry.tst	carry.ok	\
-	call.tst	call.ok		\
-	float.tst	float.ok	\
-	jmpr.tst	jmpr.ok		\
-	put.tst		put.ok		\
-	qalu.inc			\
-	qalu_mul.tst	qalu_mul.ok	\
-	qalu_div.tst	qalu_div.ok	\
-	range.tst	range.ok	\
-	ret.tst		ret.ok		\
-	tramp.tst	tramp.ok	\
-	check.sh			\
-	check.x87.sh			\
-	check.arm.sh	check.swf.sh	\
-	check.arm.swf.sh		\
-	check.arm4.swf.sh		\
-	check.nodata.sh			\
-	check.x87.nodata.sh		\
-	run-test	all.tst
-
-base_TESTS =				\
-	3to2 add align allocai		\
-	bp divi fib rpn			\
-	ldstr ldsti			\
-	ldstxr ldstxi			\
-	ldstr-c ldstxr-c ldstxi-c	\
-	cvt hton branch			\
-	alu_add alux_add		\
-	alu_sub alux_sub alu_rsb	\
-	alu_mul alu_div alu_rem		\
-	alu_and alu_or alu_xor		\
-	alu_lsh alu_rsh			\
-	alu_com alu_neg			\
-	fop_abs fop_sqrt		\
-	varargs stack			\
-	clobber carry call		\
-	float jmpr put			\
-	qalu_mul qalu_div		\
-	range ret tramp
-
-$(base_TESTS):	check.sh
-	$(LN_S) $(srcdir)/check.sh $@
-
-TESTS = $(base_TESTS)
-
-if test_x86_x87
-#x87_TESTS = $(addsuffix .x87, $(base_TESTS))
-x87_TESTS =					\
-	3to2.x87 add.x87 allocai.x87		\
-	bp.x87 divi.x87 fib.x87 rpn.x87		\
-	ldstr.x87 ldsti.x87			\
-	ldstxr.x87 ldstxi.x87			\
-	ldstr-c.x87 ldstxr-c.x87 ldstxi-c.x87	\
-	cvt.x87 branch.x87			\
-	alu_add.x87 alux_add.x87		\
-	alu_sub.x87 alux_sub.x87 alu_rsb.x87	\
-	alu_mul.x87 alu_div.x87 alu_rem.x87	\
-	alu_and.x87 alu_or.x87 alu_xor.x87	\
-	alu_lsh.x87 alu_rsh.x87			\
-	alu_com.x87 alu_neg.x87			\
-	fop_abs.x87 fop_sqrt.x87		\
-	varargs.x87 stack.x87			\
-	clobber.x87 carry.x87 call.x87		\
-	float.x87 jmpr.x87 put.x87
-$(x87_TESTS):	check.x87.sh
-	$(LN_S) $(srcdir)/check.x87.sh $@
-TESTS += $(x87_TESTS)
-
-#x87_nodata_TESTS = $(addsuffix .x87.nodata, $(base_TESTS))
-x87_nodata_TESTS =							\
-	3to2.x87.nodata add.x87.nodata allocai.x87.nodata		\
-	bp.x87.nodata divi.x87.nodata fib.x87.nodata rpn.x87.nodata	\
-	ldstr.x87.nodata ldsti.x87.nodata				\
-	ldstxr.x87.nodata ldstxi.x87.nodata				\
-	ldstr-c.x87.nodata ldstxr-c.x87.nodata ldstxi-c.x87.nodata	\
-	cvt.x87.nodata branch.x87.nodata				\
-	alu_add.x87.nodata alux_add.x87.nodata				\
-	alu_sub.x87.nodata alux_sub.x87.nodata alu_rsb.x87.nodata	\
-	alu_mul.x87.nodata alu_div.x87.nodata alu_rem.x87.nodata	\
-	alu_and.x87.nodata alu_or.x87.nodata alu_xor.x87.nodata		\
-	alu_lsh.x87.nodata alu_rsh.x87.nodata				\
-	alu_com.x87.nodata alu_neg.x87.nodata				\
-	fop_abs.x87.nodata fop_sqrt.x87.nodata				\
-	varargs.x87.nodata stack.x87.nodata				\
-	clobber.x87.nodata carry.x87.nodata call.x87.nodata		\
-	float.x87.nodata jmpr.x87.nodata put.nodata
-$(x87_nodata_TESTS):	check.x87.nodata.sh
-	$(LN_S) $(srcdir)/check.x87.nodata.sh $@
-TESTS += $(x87_nodata_TESTS)
-endif
-
-if test_arm_arm
-#arm_TESTS = $(addsuffix .arm, $(base_TESTS))
-arm_TESTS =					\
-	3to2.arm add.arm align.arm allocai.arm	\
-	bp.arm divi.arm fib.arm rpn.arm		\
-	ldstr.arm ldsti.arm			\
-	ldstxr.arm ldstxi.arm			\
-	ldstr-c.arm ldstxr-c.arm ldstxi-c.arm	\
-	cvt.arm hton.arm branch.arm		\
-	alu_add.arm alux_add.arm		\
-	alu_sub.arm alux_sub.arm alu_rsb.arm	\
-	alu_mul.arm alu_div.arm alu_rem.arm	\
-	alu_and.arm alu_or.arm alu_xor.arm	\
-	alu_lsh.arm alu_rsh.arm			\
-	alu_com.arm alu_neg.arm			\
-	fop_abs.arm fop_sqrt.arm		\
-	varargs.arm stack.arm			\
-	clobber.arm carry.arm call.arm		\
-	float.arm jmpr.arm tramp.arm range.arm	\
-	put.arm
-$(arm_TESTS):	check.arm.sh
-	$(LN_S) $(srcdir)/check.arm.sh $@
-TESTS += $(arm_TESTS)
-endif
-
-if test_arm_swf
-#swf_TESTS = $(addsuffix .swf, $(base_TESTS))
-swf_TESTS =					\
-	3to2.swf add.swf allocai.swf		\
-	bp.swf divi.swf fib.swf rpn.swf		\
-	ldstr.swf ldsti.swf			\
-	ldstxr.swf ldstxi.swf			\
-	ldstr-c.swf ldstxr-c.swf ldstxi-c.swf	\
-	cvt.swf hton.swf branch.swf		\
-	alu_add.swf alux_add.swf		\
-	alu_sub.swf alux_sub.swf alu_rsb.swf	\
-	alu_mul.swf alu_div.swf alu_rem.swf	\
-	alu_and.swf alu_or.swf alu_xor.swf	\
-	alu_lsh.swf alu_rsh.swf			\
-	alu_com.swf alu_neg.swf			\
-	fop_abs.swf fop_sqrt.swf		\
-	varargs.swf stack.swf			\
-	clobber.swf carry.swf call.swf		\
-	float.swf jmpr.swf tramp.swf range.swf	\
-	put.swf
-$(swf_TESTS):	check.swf.sh
-	$(LN_S) $(srcdir)/check.swf.sh $@
-TESTS += $(swf_TESTS)
-if test_arm_arm
-#arm_swf_TESTS = $(addsuffix .arm.swf, $(base_TESTS))
-arm_swf_TESTS =							\
-	3to2.arm.swf add.arm.swf allocai.arm.swf		\
-	bp.arm.swf divi.arm.swf fib.arm.swf rpn.arm.swf		\
-	ldstr.arm.swf ldsti.arm.swf				\
-	ldstxr.arm.swf ldstxi.arm.swf				\
-	ldstr-c.arm.swf ldstxr-c.arm.swf ldstxi-c.arm.swf	\
-	cvt.arm.swf hton.arm.swf branch.arm.swf			\
-	alu_add.arm.swf alux_add.arm.swf			\
-	alu_sub.arm.swf alux_sub.arm.swf alu_rsb.arm.swf	\
-	alu_mul.arm.swf alu_div.arm.swf alu_rem.arm.swf		\
-	alu_and.arm.swf alu_or.arm.swf alu_xor.arm.swf		\
-	alu_lsh.arm.swf alu_rsh.arm.swf				\
-	alu_com.arm.swf alu_neg.arm.swf				\
-	fop_abs.arm.swf fop_sqrt.arm.swf			\
-	varargs.arm.swf stack.arm.swf				\
-	clobber.arm.swf carry.arm.swf call.arm.swf		\
-	float.arm.swf jmpr.arm.swf tramp.arm.swf range.arm.swf	\
-	put.arm.swf
-$(arm_swf_TESTS):	check.arm.swf.sh
-	$(LN_S) $(srcdir)/check.arm.swf.sh $@
-TESTS += $(arm_swf_TESTS)
-endif
-if test_arm_arm
-#arm4_swf_TESTS = $(addsuffix .arm4.swf, $(base_TESTS))
-arm4_swf_TESTS =						\
-	3to2.arm4.swf add.arm4.swf allocai.arm4.swf		\
-	bp.arm4.swf divi.arm4.swf fib.arm4.swf rpn.arm4.swf	\
-	ldstr.arm4.swf ldsti.arm4.swf				\
-	ldstxr.arm4.swf ldstxi.arm4.swf				\
-	ldstr-c.arm4.swf ldstxr-c.arm4.swf ldstxi-c.arm4.swf	\
-	cvt.arm4.swf hton.arm4.swf branch.arm4.swf		\
-	alu_add.arm4.swf alux_add.arm4.swf			\
-	alu_sub.arm4.swf alux_sub.arm4.swf alu_rsb.arm4.swf	\
-	alu_mul.arm4.swf alu_div.arm4.swf alu_rem.arm4.swf	\
-	alu_and.arm4.swf alu_or.arm4.swf alu_xor.arm4.swf	\
-	alu_lsh.arm4.swf alu_rsh.arm4.swf			\
-	alu_com.arm4.swf alu_neg.arm4.swf			\
-	fop_abs.arm4.swf fop_sqrt.arm4.swf			\
-	varargs.arm4.swf stack.arm4.swf				\
-	clobber.arm4.swf carry.arm4.swf call.arm4.swf		\
-	float.arm4.swf jmpr.arm4.swf tramp.arm4.swf		\
-	range.arm4.swf put.arm4.swf
-$(arm4_swf_TESTS):	check.arm4.swf.sh
-	$(LN_S) $(srcdir)/check.arm4.swf.sh $@
-TESTS += $(arm4_swf_TESTS)
-endif
-endif
-
-if test_nodata
-#nodata_TESTS = $(addsuffix .nodata, $(base_TESTS))
-nodata_TESTS =						\
-	3to2.nodata add.nodata allocai.nodata		\
-	bp.nodata divi.nodata fib.nodata rpn.nodata	\
-	ldstr.nodata ldsti.nodata			\
-	ldstxr.nodata ldstxi.nodata			\
-	ldstr-c.nodata ldstxr-c.nodata ldstxi-c.nodata	\
-	cvt.nodata branch.nodata			\
-	alu_add.nodata alux_add.nodata			\
-	alu_sub.nodata alux_sub.nodata alu_rsb.nodata	\
-	alu_mul.nodata alu_div.nodata alu_rem.nodata	\
-	alu_and.nodata alu_or.nodata alu_xor.nodata	\
-	alu_lsh.nodata alu_rsh.nodata			\
-	alu_com.nodata alu_neg.nodata			\
-	fop_abs.nodata fop_sqrt.nodata			\
-	varargs.nodata stack.nodata			\
-	clobber.nodata carry.nodata call.nodata		\
-	float.nodata jmpr.nodata tramp.nodata		\
-	range.nodata put.nodata
-$(nodata_TESTS):	check.nodata.sh
-	$(LN_S) $(srcdir)/check.nodata.sh $@
-TESTS += $(nodata_TESTS)
-endif
-
-TESTS += ccall self setcode nodata ctramp carg
-CLEANFILES = $(TESTS)
-
-#TESTS_ENVIRONMENT=$(srcdir)/run-test;
-
-debug:		lightning
-	$(LIBTOOL) --mode=execute gdb lightning
-

+ 0 - 1
bjos/sledge/lightning/check/add.ok

@@ -1 +0,0 @@
-5 + 4 = 9

+ 0 - 35
bjos/sledge/lightning/check/add.tst

@@ -1,35 +0,0 @@
-.data	32
-fmt:
-.c	"%d + %d = %d\n"
-
-.code
-	jmpi main
-
-	name test
-test:
-	prolog
-	arg $i0
-	arg $i1
-	getarg %r0 $i0
-	getarg %r1 $i1
-	addr %r0 %r0 %r1
-	retr %r0
-	epilog
-
-	name main
-main:
-	prolog
-	prepare
-		pushargi 5
-		pushargi 4
-	finishi test
-	retval %r0
-	prepare
-		pushargi fmt
-		ellipsis
-		pushargi 5
-		pushargi 4
-		pushargr %r0
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/align.ok

@@ -1 +0,0 @@
-10

+ 0 - 28
bjos/sledge/lightning/check/align.tst

@@ -1,28 +0,0 @@
-.data	32
-fmt:
-.c	"%d\n"
-.code
-	prolog
-	movi %r0 1
-	jmpi L1				/* should not generate this */
-	align $(__WORDSIZE / 8)		/* possible nops */
-L1:
-	bgei L4 %r0 10
-	addi %r0 %r0 1
-	jmpi L2
-	movr %r1 %r0			/* to force jump generation */
-	align $(__WORDSIZE / 8)		/* possible nops */
-L2:
-	bgti L4 %r0 10			/* never executed */
-	align $(__WORDSIZE / 8)		/* possible nops */
-L3:
-	jmpi L1
-	align $(__WORDSIZE / 8)		/* possible nops */
-L4:
-	prepare
-		pushargi fmt
-		ellipsis
-		pushargr %r0
-	finishi @printf
-	ret
-	epilog

+ 0 - 413
bjos/sledge/lightning/check/all.tst

@@ -1,413 +0,0 @@
-.disasm		// only disassemble
-.code
-	prolog
-	allocai 32 $buf
-	arg $c
-	arg $uc
-	arg $s
-	arg $us
-	arg $i
-#if __WORDSIZE == 64
-	arg $ui
-	arg $l
-#endif
-	getarg_c %r0 $c
-	getarg_uc %r0 $uc
-	getarg_s %r0 $s
-	getarg_us %r0 $us
-	getarg_i %r0 $i
-#if __WORDSIZE == 64
-	getarg_ui %r0 $ui
-	getarg_l %r0 $l
-#endif
-	addr %r0 %r1 %r2
-	addi %r0 %r1 2
-	addcr %r0 %r1 %r2
-	addci %r0 %r1 2
-	addxr %r0 %r1 %r2
-	addxi %r0 %r1 2
-	subr %r0 %r1 %r2
-	subi %r0 %r1 2
-	subcr %r0 %r1 %r2
-	subci %r0 %r1 2
-	subxr %r0 %r1 %r2
-	subxi %r0 %r1 2
-	mulr %r0 %r1 %r2
-	muli %r0 %r1 2
-	qmulr %r0 %r1 %r2 %v0
-	qmuli %r0 %r1 %r2 3
-	qmulr_u %r0 %r1 %r2 %v0
-	qmuli_u %r0 %r1 %r2 3
-	divr %r0 %r1 %r2
-	divi %r0 %r1 2
-	divr_u %r0 %r1 %r2
-	divi_u %r0 %r1 2
-	qdivr %r0 %r1 %r2 %v0
-	qdivi %r0 %r1 %r2 3
-	qdivr_u %r0 %r1 %r2 %v0
-	qdivi_u %r0 %r1 %r2 3
-	remr %r0 %r1 %r2
-	remi %r0 %r1 2
-	remr_u %r0 %r1 %r2
-	remi_u %r0 %r1 2
-	andr %r0 %r1 %r2
-	andi %r0 %r1 2
-	orr %r0 %r1 %r2
-	ori %r0 %r1 2
-	xorr %r0 %r1 %r2
-	xori %r0 %r1 2
-	lshr %r0 %r1 %r2
-	lshi %r0 %r1 2
-	rshr %r0 %r1 %r2
-	rshi %r0 %r1 2
-	rshr_u %r0 %r1 %r2
-	rshi_u %r0 %r1 2
-	negr %r0 %r1
-	comr %r0 %r1
-	ltr %r0 %r1 %r2
-	lti %r0 %r1 2
-	ltr_u %r0 %r1 %r2
-	lti_u %r0 %r1 2
-	ler %r0 %r1 %r2
-	lei %r0 %r1 2
-	ler_u %r0 %r1 %r2
-	lei_u %r0 %r1 2
-	eqr %r0 %r1 %r2
-	eqi %r0 %r1 2
-	ger %r0 %r1 %r2
-	gei %r0 %r1 2
-	ger_u %r0 %r1 %r2
-	gei_u %r0 %r1 2
-	gtr %r0 %r1 %r2
-	gti %r0 %r1 2
-	gtr_u %r0 %r1 %r2
-	gti_u %r0 %r1 2
-	ner %r0 %r1 %r2
-	nei %r0 %r1 2
-	movr %r0 %r1
-	movi %r0 1
-	extr_c %r0 %r1
-	extr_uc %r0 %r1
-	extr_s %r0 %r1
-	extr_us %r0 %r1
-#if __WORDSIZE == 64
-	extr_i %r0 %r1
-	extr_ui %r0 %r1
-#endif
-	htonr %r0 %r1
-	ntohr %r0 %r1
-	ldr_c %r0 %r1
-	ldi_c %r0 0x80000000
-	ldr_uc %r0 %r1
-	ldi_uc %r0 0x80000000
-	ldr_s %r0 %r1
-	ldi_s %r0 0x80000000
-	ldr_us %r0 %r1
-	ldi_us %r0 0x80000000
-	ldr_i %r0 %r1
-	ldi_i %r0 0x80000000
-#if __WORDSIZE == 64
-	ldr_ui %r0 %r1
-	ldi_ui %r0 0x80000000
-	ldr_l %r0 %r1
-	ldi_l %r0 0x80000000
-#endif
-	ldxr_c %r0 %r1 %r2
-	ldxi_c %r0 %r1 1
-	ldxr_uc %r0 %r1 %r2
-	ldxi_uc %r0 %r1 1
-	ldxr_s %r0 %r1 %r2
-	ldxi_s %r0 %r1 2
-	ldxr_us %r0 %r1 %r2
-	ldxi_us %r0 %r1 2
-	ldxr_i %r0 %r1 %r2
-	ldxi_i %r0 %r1 4
-#if __WORDSIZE == 64
-	ldxr_ui %r0 %r1 %r2
-	ldxi_ui %r0 %r1 4
-	ldxr_l %r0 %r1 %r2
-	ldxi_l %r0 %r1 8
-#endif
-	str_c %r1 %r0
-	sti_c 0x80000000 %r1
-	str_s %r1 %r0
-	sti_s 0x80000000 %r1
-	str_i %r1 %r0
-	sti_i 0x80000000 %r1
-#if __WORDSIZE == 64
-	str_l %r1 %r0
-	sti_l 0x80000000 %r1
-#endif
-	stxr_c %r2 %r1 %r0
-	stxi_c 1 %r1 %r0
-	stxr_s %r2 %r1 %r0
-	stxi_s 2 %r1 %r0
-	stxr_i %r2 %r1 %r0
-	stxi_i 4 %r1 %r0
-#if __WORDSIZE == 64
-	stxr_l %r2 %r1 %r0
-	stxi_l 8 %r1 %r0
-#endif
-cond:
-	bltr cond %r0 %r1
-condi:
-	blti condi %r0 1
-condu:
-	bltr_u condu %r0 %r1
-condiu:
-	blti_u condiu %r0 1
-	bler cond %r0 %r1
-	blei condi %r0 1
-	bler_u condu %r0 %r1
-	blei_u condiu %r0 1
-bool:
-	beqr bool %r0 %r1
-booli:
-	beqi booli %r0 1
-	bger cond %r0 %r1
-	bgei condi %r0 1
-	bger_u condu %r0 %r1
-	bgei_u condiu %r0 1
-	bgtr cond %r0 %r1
-	bgti condi %r0 1
-	bgtr_u condu %r0 %r1
-	bgti_u condiu %r0 1
-	bner bool %r0 %r1
-	bnei booli %r0 1
-mask:
-	bmsr mask %r0 %r1
-maski:
-	bmsi maski %r0 1
-	bmcr mask %r0 %r1
-	bmci maski %r0 1
-as:
-	boaddr as %r0 %r1
-asi:
-	boaddi asi %r0 1
-asu:
-	boaddr_u as %r0 %r1
-	boaddi_u asi %r0 1
-	bxaddr as %r0 %r1
-	bxaddi asi %r0 1
-	bxaddr_u as %r0 %r1
-	bxaddi_u asi %r0 1
-	bosubr as %r0 %r1
-	bosubi asi %r0 1
-	bosubr_u as %r0 %r1
-	bosubi_u asi %r0 1
-	bxsubr as %r0 %r1
-	bxsubi asi %r0 1
-	bxsubr_u as %r0 %r1
-	bxsubi_u asi %r0 1
-label:
-	jmpr %r0
-	jmpi label
-	callr %r0
-	calli label
-	prepare
-	pushargr %r0
-	finishr %r0
-	prepare
-	pushargi 1
-	ellipsis
-	finishi 0x80000000
-	ret
-	retr %r1
-	reti 2
-	retval_c %r1
-	retval_uc %r1
-	retval_s %r1
-	retval_us %r1
-	retval_i %r1
-#if __WORDSIZE == 64
-	retval_ui %r1
-	retval_l %r1
-#endif
-	arg_f $f
-	getarg_f %f1 $f
-	addr_f %f0 %f1 %f2
-	addi_f %f0 %f1 0.5
-	subr_f %f0 %f1 %f2
-	subi_f %f0 %f1 0.5
-	mulr_f %f0 %f1 %f2
-	muli_f %f0 %f1 0.5
-	divr_f %f0 %f1 %f2
-	divi_f %f0 %f1 0.5
-	negr_f %f0 %f1
-	absr_f %f0 %f1
-	sqrtr_f %f0 %f1
-	ltr_f %r0 %f0 %f1
-	lti_f %r0 %f0 0.5
-	ler_f %r0 %f0 %f1
-	lei_f %r0 %f0 0.5
-	eqr_f %r0 %f0 %f1
-	eqi_f %r0 %f0 0.5
-	ger_f %r0 %f0 %f1
-	gei_f %r0 %f0 0.5
-	gtr_f %r0 %f0 %f1
-	gti_f %r0 %f0 0.5
-	ner_f %r0 %f0 %f1
-	nei_f %r0 %f0 0.5
-	unltr_f %r0 %f0 %f1
-	unlti_f %r0 %f0 0.5
-	unler_f %r0 %f0 %f1
-	unlei_f %r0 %f0 0.5
-	uneqr_f %r0 %f0 %f1
-	uneqi_f %r0 %f0 0.5
-	unger_f %r0 %f0 %f1
-	ungei_f %r0 %f0 0.5
-	ungtr_f %r0 %f0 %f1
-	ungti_f %r0 %f0 0.5
-	ltgtr_f %r0 %f0 %f1
-	ltgti_f %r0 %f0 0.5
-	ordr_f %r0 %f0 %f1
-	ordi_f %r0 %f0 0.5
-	unordr_f %r0 %f0 %f1
-	unordi_f %r0 %f0 0.5
-	truncr_f_i %r0 %f0
-#if __WORDSIZE == 64
-	truncr_f_l %r0 %f0
-#endif
-	extr_f %f0 %r0
-	extr_d_f %f0 %f1
-	movr_f %f0 %f1
-	movi_f %f0 1.5
-	ldr_f %f0 %r0
-	ldi_f %f0 0x80000000
-	ldxr_f %f0 %r0 %r1
-	ldxi_f %f0 %r0 4
-	str_f %r0 %f0
-	sti_f 0x80000000 %f0
-	stxr_f %r1 %r0 %f0
-	stxi_f 4 %r0 %f0
-ord:
-	bltr_f ord %f0 %f1
-ordi:
-	blti_f ordi %f0 0.5
-	bler_f ord %f0 %f1
-	blei_f ordi %f0 0.5
-	beqr_f ord %f0 %f1
-	beqi_f ordi %f0 0.5
-	bger_f ord %f0 %f1
-	bgei_f ordi %f0 0.5
-	bgtr_f ord %f0 %f1
-	bgti_f ordi %f0 0.5
-	bner_f ord %f0 %f1
-	bnei_f ordi %f0 0.5
-unord:
-	bunltr_f unord %f0 %f1
-unordi:
-	bunlti_f unordi %f0 0.5
-	bunler_f unord %f0 %f1
-	bunlei_f unordi %f0 0.5
-	buneqr_f unord %f0 %f1
-	buneqi_f unordi %f0 0.5
-	bunger_f unord %f0 %f1
-	bungei_f unordi %f0 0.5
-	bungtr_f unord %f0 %f1
-	bungti_f unordi %f0 0.5
-	bltgtr_f unord %f0 %f1
-	bltgti_f unordi %f0 0.5
-	bordr_f unord %f0 %f1
-	bordi_f unordi %f0 0.5
-	bunordr_f unord %f0 %f1
-	bunordi_f unordi %f0 0.5
-	prepare
-	pushargr_f %f1
-	pushargi_f 0.5
-	finishi 0x80000000
-	retr_f %f1
-	reti_f 0.5
-	retval_f %f1
-	arg_d $f
-	getarg_d %f1 $f
-	addr_d %f0 %f1 %f2
-	addi_d %f0 %f1 0.5
-	subr_d %f0 %f1 %f2
-	subi_d %f0 %f1 0.5
-	mulr_d %f0 %f1 %f2
-	muli_d %f0 %f1 0.5
-	divr_d %f0 %f1 %f2
-	divi_d %f0 %f1 0.5
-	negr_d %f0 %f1
-	absr_d %f0 %f1
-	sqrtr_d %f0 %f1
-	ltr_d %r0 %f0 %f1
-	lti_d %r0 %f0 0.5
-	ler_d %r0 %f0 %f1
-	lei_d %r0 %f0 0.5
-	eqr_d %r0 %f0 %f1
-	eqi_d %r0 %f0 0.5
-	ger_d %r0 %f0 %f1
-	gei_d %r0 %f0 0.5
-	gtr_d %r0 %f0 %f1
-	gti_d %r0 %f0 0.5
-	ner_d %r0 %f0 %f1
-	nei_d %r0 %f0 0.5
-	unltr_d %r0 %f0 %f1
-	unlti_d %r0 %f0 0.5
-	unler_d %r0 %f0 %f1
-	unlei_d %r0 %f0 0.5
-	uneqr_d %r0 %f0 %f1
-	uneqi_d %r0 %f0 0.5
-	unger_d %r0 %f0 %f1
-	ungei_d %r0 %f0 0.5
-	ungtr_d %r0 %f0 %f1
-	ungti_d %r0 %f0 0.5
-	ltgtr_d %r0 %f0 %f1
-	ltgti_d %r0 %f0 0.5
-	ordr_d %r0 %f0 %f1
-	ordi_d %r0 %f0 0.5
-	unordr_d %r0 %f0 %f1
-	unordi_d %r0 %f0 0.5
-	truncr_d_i %r0 %f0
-#if __WORDSIZE == 64
-	truncr_d_l %r0 %f0
-#endif
-	extr_d %f0 %r0
-	extr_f_d %f0 %f1
-	movr_d %f0 %f1
-	movi_d %f0 1.5
-	ldr_d %f0 %r0
-	ldi_d %f0 0x80000000
-	ldxr_d %f0 %r0 %r1
-	ldxi_d %f0 %r0 8
-	str_d %r0 %f0
-	sti_d 0x80000000 %f0
-	stxr_d %r1 %r0 %f0
-	stxi_d 8 %r0 %f0
-	bltr_d ord %f0 %f1
-	blti_d ordi %f0 0.5
-	bler_d ord %f0 %f1
-	blei_d ordi %f0 0.5
-	beqr_d ord %f0 %f1
-	beqi_d ordi %f0 0.5
-	bger_d ord %f0 %f1
-	bgei_d ordi %f0 0.5
-	bgtr_d ord %f0 %f1
-	bgti_d ordi %f0 0.5
-	bner_d ord %f0 %f1
-	bnei_d ordi %f0 0.5
-	bunltr_d unord %f0 %f1
-	bunlti_d unordi %f0 0.5
-	bunler_d unord %f0 %f1
-	bunlei_d unordi %f0 0.5
-	buneqr_d unord %f0 %f1
-	buneqi_d unordi %f0 0.5
-	bunger_d unord %f0 %f1
-	bungei_d unordi %f0 0.5
-	bungtr_d unord %f0 %f1
-	bungti_d unordi %f0 0.5
-	bltgtr_d unord %f0 %f1
-	bltgti_d unordi %f0 0.5
-	bordr_d unord %f0 %f1
-	bordi_d unordi %f0 0.5
-	bunordr_d unord %f0 %f1
-	bunordi_d unordi %f0 0.5
-	prepare
-	pushargr_d %f1
-	pushargi_d 0.5
-	finishi 0x80000000
-	retr_d %f1
-	reti_d 0.5
-	retval_d %f1

+ 0 - 2
bjos/sledge/lightning/check/allocai.ok

@@ -1,2 +0,0 @@
-received 7777
-succeeded

+ 0 - 100
bjos/sledge/lightning/check/allocai.tst

@@ -1,100 +0,0 @@
-.data	128
-idfmt:
-.c	"received %d\n"
-failure_message:
-.c	"numbers don't add up to zero\n"
-report_message:
-.c	"failed: got %i instead of %i\n"
-succeeded_message:
-.c	"succeeded\n"
-
-.code
-	jmpi main
-
-/*
-static int
-identity (int arg)
-{
-  printf ("received %i\n", arg);
-  return arg;
-}
- */
-	name identify
-identify:
-	prolog
-	arg $i
-	getarg %v0 $i
-	prepare
-		pushargi idfmt
-		ellipsis
-		pushargr %v0
-	finishi @printf
-	retr %v0
-	epilog
-
-	name identity_func
-identity_func:
-	prolog
-	arg $i
-	getarg %r1 $i
-
-	/* Store the argument on the stack.  */
-	allocai $(__WORDSIZE >> 3) $off
-	stxi $off %fp %r1
-
-	/* Store the negative of the argument on the stack.  */
-	allocai $(__WORDSIZE >> 3) $neg
-	negr %r2 %r1
-	stxi $neg %fp %r2
-
-	/* Invoke FUNC.  */
-	prepare
-		pushargr %r1
-	finishi identify
-
-	/* Ignore the result.  */
-
-	/* Restore the negative and the argument from the stack.  */
-	ldxi %r2 %fp $neg
-	ldxi %v1 %fp $off
-
-	/* Make sure they still add to zero.  */
-	addr %r0 %v1 %r2
-	bnei branch %r0 0
-
-	/* Return it.  */
-	retr %v1
-
-	/* Display a failure message.  */
-branch:
-	prepare
-		pushargi failure_message
-		ellipsis
-	finishi @printf
-
-	/* Leave.  */
-	retr %v1
-	epilog
-
-	name main
-main:
-	prolog
-	prepare
-		pushargi 7777
-	finishi identity_func
-	retval %r0
-	beqi succeeded %r0 7777
-	prepare
-		pushargi report_message
-		ellipsis
-		pushargr %r0
-		pushargi 7777
-	finishi @printf
-	reti 1
-succeeded:
-	prepare
-		pushargi succeeded_message
-		ellipsis
-	finishi @printf
-	reti 0
-	epilog

+ 0 - 360
bjos/sledge/lightning/check/alu.inc

@@ -1,360 +0,0 @@
-.data	8
-ok:
-.c	"ok\n"
-
-/* ia64 code generation is not optimized for size, and also some
- * codes generate quite long sequences due to need for stops causing
- * no code template match and needing to add nops, and other cases
- * are division/remainder that needs function calls, or float division
- * that requires a quite long sequence.
- * (the brute force tests of all register combinations can easily
- *  generate several GB of jit).
- */
-
-/* 3 operand */
-
-/* reg0 = reg1 op reg2 */
-#define ALUR(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R1 I0					\
-	movi %R2 I1					\
-	OP##r##T %R0 %R1 %R2				\
-	beqi OP##T##N##r_##R0##R1##R2 %R0 V		\
-	calli @abort					\
-OP##T##N##r_##R0##R1##R2:
-
-/* reg0 = reg1 op im */
-#define ALUI(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R1 I0					\
-	movi %R2 V					\
-	OP##i##T %R0 %R1 I1				\
-	beqr OP##T##N##i_##R0##R1##R2 %R0 %R2		\
-	calli @abort					\
-OP##T##N##i_##R0##R1##R2:
-
-/* reg0 = reg0 op reg1 */
-#define ALUR0(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I0					\
-	movi %R1 I1					\
-	movi %R2 V					\
-	OP##r##T %R0 %R0 %R1				\
-	beqr OP##T##N##r_0##R0##R1##R2 %R0 %R2		\
-	calli @abort					\
-OP##T##N##r_0##R0##R1##R2:
-
-/* reg0 = reg1 op reg0 */
-#define ALUR1(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I1					\
-	movi %R1 I0					\
-	movi %R2 V					\
-	OP##r##T %R0 %R1 %R0				\
-	beqr OP##T##N##r_1##R0##R1##R2 %R0 %R2		\
-	calli @abort					\
-OP##T##N##r_1##R0##R1##R2:
-
-/* reg0 = reg0 op im */
-#define ALUI0(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I0					\
-	movi %R1 V					\
-	OP##i##T %R0 %R0 I1				\
-	beqr OP##T##N##i_0##R0##R1##R2 %R0 %R1		\
-	calli @abort					\
-OP##T##N##i_0##R0##R1##R2:
-
-#define ALU3(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALUR(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALUI(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALUR0(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALUR1(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALUI0(N, T, OP, I0, I1, V, R0, R1, R2)
-
-#define ALU2(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALU3(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALU3(N, T, OP, I0, I1, V, R0, R2, R1)
-
-#define ALU1(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALU2(N, T, OP, I0, I1, V, R0, R1, R2)		\
-	ALU2(N, T, OP, I0, I1, V, R1, R0, R2)		\
-	ALU2(N, T, OP, I0, I1, V, R2, R1, R0)
-
-#if __ia64__
-#  define ALU(N, T, OP, I0, I1, V)			\
-	ALU3(N, T, OP, I0, I1, V, r0, r1, r2)		\
-	ALU3(N, T, OP, I0, I1, V, v0, v1, v2)
-#else
-#  define ALU(N, T, OP, I0, I1, V)			\
-	ALU1(N, T, OP, I0, I1, V, v0, v1, v2)		\
-	ALU1(N, T, OP, I0, I1, V, v0, v1, r0)		\
-	ALU1(N, T, OP, I0, I1, V, v0, v1, r1)		\
-	ALU1(N, T, OP, I0, I1, V, v0, v1, r2)		\
-	ALU1(N, T, OP, I0, I1, V, v1, v2, r1)		\
-	ALU1(N, T, OP, I0, I1, V, v1, v2, r2)		\
-	ALU1(N, T, OP, I0, I1, V, v2, r0, r1)		\
-	ALU1(N, T, OP, I0, I1, V, v2, r0, r2)		\
-	ALU1(N, T, OP, I0, I1, V, r0, r1, r2)
-#endif
-
-/* 3 carry set/propagate */
-
-/*
- * r0 = i0
- * r1 = i1
- * r2 = 0
- * r0 = r0 opc r1	<only want carry>
- * r2 = r2 opx r2	<r2 must match v>
- */
-#define ALUXII(N, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I0					\
-	movi %R2 0					\
-	OP##ci %R0 %R0 I1				\
-	OP##xi %R2 %R2 0				\
-	beqi OP##N##ii##R0##R1##R2 %R2 V		\
-	calli @abort					\
-OP##N##ii##R0##R1##R2:
-
-#define ALUXIR(N, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I0					\
-	movi %R2 0					\
-	OP##ci %R0 %R0 I1				\
-	OP##xr %R2 %R2 %R2				\
-	beqi OP##N##ir##R0##R1##R2 %R2 V		\
-	calli @abort					\
-OP##N##ir##R0##R1##R2:
-
-#define ALUXRI(N, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I0					\
-	movi %R1 I1					\
-	movi %R2 0					\
-	OP##cr %R0 %R0 %R1				\
-	OP##xi %R2 %R2 0				\
-	beqi OP##N##ri##R0##R1##R2 %R2 V		\
-	calli @abort					\
-OP##N##ri##R0##R1##R2:
-
-#define ALUXRR(N, OP, I0, I1, V, R0, R1, R2)		\
-	movi %R0 I0					\
-	movi %R1 I1					\
-	movi %R2 0					\
-	OP##cr %R0 %R0 %R1				\
-	OP##xr %R2 %R2 %R2				\
-	beqi OP##N##rr##R0##R1##R2 %R2 V		\
-	calli @abort					\
-OP##N##rr##R0##R1##R2:
-
-#define ALUX2(N, OP, I0, I1, V, R0, R1, R2)		\
-	 ALUXII(N, OP, I0, I1, V, R0, R1, R2)		\
-	 ALUXIR(N, OP, I0, I1, V, R0, R1, R2)		\
-	 ALUXRI(N, OP, I0, I1, V, R0, R1, R2)		\
-	 ALUXRR(N, OP, I0, I1, V, R0, R1, R2)
-
-#define ALUX1(N, OP, I0, I1, V, R0, R1, R2)		\
-	ALUX2(N, OP, I0, I1, V, R0, R1, R2)		\
-	ALUX2(N, OP, I0, I1, V, R0, R2, R1)
-
-#define ALUX0(N, OP, I0, I1, V, R0, R1, R2)		\
-	ALUX1(N, OP, I0, I1, V, R0, R1, R2)		\
-	ALUX1(N, OP, I0, I1, V, R1, R0, R2)		\
-	ALUX1(N, OP, I0, I1, V, R2, R1, R0)
-
-#if __ia64__
-#  define ALUX(N, OP, I0, I1, V)			\
-	ALUX2(N, OP, I0, I1, V, r0, r1, r2)		\
-	ALUX2(N, OP, I0, I1, V, v0, v1, v2)
-#else
-#  define ALUX(N, OP, I0, I1, V)			\
-	ALUX0(N, OP, I0, I1, V, v0, v1, v2)		\
-	ALUX0(N, OP, I0, I1, V, v0, v1, r0)		\
-	ALUX0(N, OP, I0, I1, V, v0, v1, r1)		\
-	ALUX0(N, OP, I0, I1, V, v0, v1, r2)		\
-	ALUX0(N, OP, I0, I1, V, v1, v2, r0)		\
-	ALUX0(N, OP, I0, I1, V, v1, v2, r1)		\
-	ALUX0(N, OP, I0, I1, V, v1, v2, r2)		\
-	ALUX0(N, OP, I0, I1, V, v2, r0, r1)		\
-	ALUX0(N, OP, I0, I1, V, v2, r0, r2)		\
-	ALUX0(N, OP, I0, I1, V, r0, r1, r2)
-#endif
-
-/* unary int */
-
-#define UNR(N, OP, I, V, R0, R1)			\
-	movi %R1 I					\
-	OP##r %R0 %R1					\
-	beqi OP##N##R0##R1 %R0 V			\
-	calli @abort					\
-OP##N##R0##R1:
-
-#define UNRC(N, OP, I, V, R0, R1)			\
-	movi %R0 I					\
-	OP##r %R0 %R0					\
-	beqi OP##N##c##R0##R1 %R0 V			\
-	calli @abort					\
-OP##N##c##R0##R1:
-
-#define UN2(N, OP, I, V, R0, R1)			\
-	UNR(N, OP, I, V, R0, R1)			\
-	UNRC(N, OP, I, V, R0, R1)
-
-#define UN1(N, OP, I, V, R0, R1)			\
-	UN2(N, OP, I, V, R0, R1)			\
-	UN2(N, OP, I, V, R1, R0)
-
-#if __ia64__
-#  define UN(N, OP, I, V)				\
-	UN2(N, OP, I, V, r0, r1)			\
-	UN2(N, OP, I, V, v0, v1)
-#else
-#  define UN(N, OP, I, V)				\
-	UN1(N, OP, I, V, v0, v1)			\
-	UN1(N, OP, I, V, v0, v2)			\
-	UN1(N, OP, I, V, v0, r0)			\
-	UN1(N, OP, I, V, v0, r1)			\
-	UN1(N, OP, I, V, v0, r2)			\
-	UN1(N, OP, I, V, v1, v2)			\
-	UN1(N, OP, I, V, v1, r0)			\
-	UN1(N, OP, I, V, v1, r1)			\
-	UN1(N, OP, I, V, v1, r2)			\
-	UN1(N, OP, I, V, v2, r0)			\
-	UN1(N, OP, I, V, v2, r1)			\
-	UN1(N, OP, I, V, v2, r2)			\
-	UN1(N, OP, I, V, r0, r1)			\
-	UN1(N, OP, I, V, r0, r2)			\
-	UN1(N, OP, I, V, r1, r2)
-#endif
-
-/* reg0 = reg1 op reg2 */
-#define FOPR(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	movi##T %F1 I0					\
-	movi##T %F2 I1					\
-	OP##r##T %F0 %F1 %F2				\
-	beqi##T OP##T##N##F0##F1##F2 %F0 V		\
-	calli @abort					\
-OP##T##N##F0##F1##F2:
-
-/* reg0 = reg0 op reg1 */
-#define FOPR0(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	movi##T %F0 I0					\
-	movi##T %F1 I1					\
-	OP##r##T %F0 %F0 %F1				\
-	beqi##T OP##T##N##0##F0##F1##F2 %F0 V		\
-	calli @abort					\
-OP##T##N##0##F0##F1##F2:
-
-/* reg1 = reg0 op reg1 */
-#define FOPR1(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	movi##T %F0 I0					\
-	movi##T %F1 I1					\
-	OP##r##T %F1 %F0 %F1				\
-	beqi##T OP##T##N##1##F0##F1##F2 %F1 V		\
-	calli @abort					\
-OP##T##N##1##F0##F1##F2:
-
-/* reg0 = reg1 op im */
-#define FOPI(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	movi##T %F1 I0					\
-	movi##T %F2 V					\
-	OP##i##T %F0 %F1 I1				\
-	beqr##T OP##T##N##i##F0##F1##F2 %F0 %F2		\
-	calli @abort					\
-OP##T##N##i##F0##F1##F2:
-
-/* reg0 = reg0 op im */
-#define FOPI0(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	movi##T %F0 I0					\
-	movi##T %F2 V					\
-	OP##i##T %F0 %F0 I1				\
-	beqr##T OP##T##N##i0##F0##F1##F2 %F0 %F2	\
-	calli @abort					\
-OP##T##N##i0##F0##F1##F2:
-
-#define FOP1(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	FOPR(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	FOPR0(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	FOPR1(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	FOPI(N, T, OP, I0, I1, V, F0, F1, F2)		\
-	FOPI0(N, T, OP, I0, I1, V, F0, F1, F2)
-
-#if __ia64__
-#  define  FOP(N, T, OP, I0, I1, V)			\
-	FOP1(N, T, OP, I0, I1, V, f0, f1, f2)
-#else
-#  define  FOP(N, T, OP, I0, I1, V)			\
-	FOP1(N, T, OP, I0, I1, V, f0, f1, f2)		\
-	FOP1(N, T, OP, I0, I1, V, f0, f2, f3)		\
-	FOP1(N, T, OP, I0, I1, V, f0, f3, f4)		\
-	FOP1(N, T, OP, I0, I1, V, f0, f5, f1)
-#endif
-
-/* unary float */
-
-#define FUNR(N, T, OP, I, V, R0, R1)			\
-	movi##T %R1 I					\
-	OP##r##T %R0 %R1				\
-	beqi##T OP##N##T##R0##R1 %R0 V			\
-	calli @abort					\
-OP##N##T##R0##R1:
-
-#define FUNRC(N, T, OP, I, V, R0, R1)			\
-	movi##T %R0 I					\
-	OP##r##T %R0 %R0				\
-	beqi##T OP##N##T##c##R0##R1 %R0 V		\
-	calli @abort					\
-OP##N##T##c##R0##R1:
-
-#define FUN2(N, T, OP, I, V, R0, R1)			\
-	FUNR(N, T, OP, I, V, R0, R1)			\
-	FUNRC(N, T, OP, I, V, R0, R1)
-
-#define FUN1(N, T, OP, I, V, R0, R1)			\
-	FUN2(N, T, OP, I, V, R0, R1)			\
-	FUN2(N, T, OP, I, V, R1, R0)
-
-#if __ia64__
-#  define FUN(N, T, OP, I, V)				\
-	FUN2(N, T, OP, I, V, f0, f1)
-#else
-#  define FUN(N, T, OP, I, V)				\
-	FUN1(N, T, OP, I, V, f0, f1)			\
-	FUN1(N, T, OP, I, V, f0, f2)			\
-	FUN1(N, T, OP, I, V, f0, f3)			\
-	FUN1(N, T, OP, I, V, f0, f4)			\
-	FUN1(N, T, OP, I, V, f0, f5)
-#endif
-
-/* unordered comparison unary float */
-
-#define UFUNR(N, T, OP, I, V, R0, R1)			\
-	movi##T %R1 I					\
-	OP##r##T %R0 %R1				\
-	buneqi##T OP##N##T##u##R0##R1 %R0 V		\
-	calli @abort					\
-OP##N##T##u##R0##R1:
-
-#define UFUNRC(N, T, OP, I, V, R0, R1)			\
-	movi##T %R0 I					\
-	OP##r##T %R0 %R0				\
-	buneqi##T OP##N##T##uc##R0##R1 %R0 V		\
-	calli @abort					\
-OP##N##T##uc##R0##R1:
-
-#define UFUN2(N, T, OP, I, V, R0, R1)			\
-	UFUNR(N, T, OP, I, V, R0, R1)			\
-	UFUNRC(N, T, OP, I, V, R0, R1)
-
-#define UFUN1(N, T, OP, I, V, R0, R1)			\
-	UFUN2(N, T, OP, I, V, R0, R1)			\
-	UFUN2(N, T, OP, I, V, R1, R0)
-
-#if __ia64__
-#  define UFUN(N, T, OP, I, V)				\
-	UFUN2(N, T, OP, I, V, f0, f1)
-#else
-#  define UFUN(N, T, OP, I, V)				\
-	UFUN1(N, T, OP, I, V, f0, f1)			\
-	UFUN1(N, T, OP, I, V, f0, f2)			\
-	UFUN1(N, T, OP, I, V, f0, f3)			\
-	UFUN1(N, T, OP, I, V, f0, f4)			\
-	UFUN1(N, T, OP, I, V, f0, f5)
-#endif
-
-.	$( $NaN =  0.0/0.0)
-.	$( $Inf =  1.0/0.0)
-.	$($nInf = -1.0/0.0)

+ 0 - 1
bjos/sledge/lightning/check/alu_add.ok

@@ -1 +0,0 @@
-ok

+ 0 - 47
bjos/sledge/lightning/check/alu_add.tst

@@ -1,47 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define ADD(N, I0, I1, V)	ALU(N, , add, I0, I1, V)
-
-	ADD(0,	0x7fffffff, 1,		0x80000000)
-	ADD(1,	1,	    0x7fffffff, 0x80000000)
-	ADD(2,	0x80000000, 1,		0x80000001)
-	ADD(3,	1,	    0x80000000, 0x80000001)
-	ADD(4,	0x7fffffff, 0x80000000, 0xffffffff)
-	ADD(5,	0x80000000, 0x7fffffff, 0xffffffff)
-	ADD(6,	0x7fffffff, 0,		0x7fffffff)
-	ADD(7,	0,	    0x7fffffff,	0x7fffffff)
-#if __WORDSIZE == 32
-	ADD(8,	0x7fffffff, 0xffffffff, 0x7ffffffe)
-	ADD(9,	0xffffffff, 0x7fffffff, 0x7ffffffe)
-	ADD(10,	0xffffffff, 0xffffffff, 0xfffffffe)
-#else
-	ADD(8,	0x7fffffff,	    0xffffffff,		0x17ffffffe)
-	ADD(9,	0xffffffff,	    0x7fffffff,		0x17ffffffe)
-	ADD(10,	0xffffffff,	    0xffffffff,		0x1fffffffe)
-	ADD(11,	0x7fffffffffffffff, 1,			0x8000000000000000)
-	ADD(12,	1,		    0x7fffffffffffffff,	0x8000000000000000)
-	ADD(13,	0x8000000000000000, 1,			0x8000000000000001)
-	ADD(14,	1,		    0x8000000000000000,	0x8000000000000001)
-	ADD(15,	0x7fffffffffffffff, 0x8000000000000000,	0xffffffffffffffff)
-	ADD(16,	0x8000000000000000, 0x7fffffffffffffff,	0xffffffffffffffff)
-	ADD(17,	0x7fffffffffffffff, 0xffffffffffffffff,	0x7ffffffffffffffe)
-	ADD(18,	0x7fffffffffffffff, 0x7fffffffffffffff,	0xfffffffffffffffe)
-	ADD(19,	0xffffffffffffffff, 0xffffffffffffffff,	0xfffffffffffffffe)
-#endif
-
-#undef ADD
-#define ADD(N, T, I0, I1, V)	FOP(N, T, add, I0, I1, V)
-	ADD(0, _f,	-0.5,	    0.5,	0.0)
-	ADD(1, _f,	 0.25,	    0.75,	1.0)
-	ADD(0, _d,	-0.5,	    0.5,	0.0)
-	ADD(1, _d,	 0.25,	    0.75,	1.0)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_and.ok

@@ -1 +0,0 @@
-ok

+ 0 - 36
bjos/sledge/lightning/check/alu_and.tst

@@ -1,36 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define AND(N, I0, I1, V)	ALU(N, , and, I0, I1, V)
-
-	AND(0,	0x7fffffff, 1,		1)
-	AND(1,	1,	    0x7fffffff, 1)
-	AND(2,	0x80000000, 1,		0)
-	AND(3,	1,	    0x80000000, 0)
-	AND(4,	0x7fffffff, 0x80000000, 0)
-	AND(5,	0x80000000, 0x7fffffff, 0)
-	AND(6,	0x7fffffff, 0xffffffff, 0x7fffffff)
-	AND(7,	0xffffffff, 0x7fffffff, 0x7fffffff)
-	AND(8,	0xffffffff, 0xffffffff, 0xffffffff)
-	AND(9,	0x7fffffff, 0,		0)
-	AND(10,	0,	    0x7fffffff,	0)
-#if __WORDSIZE == 64
-	AND(11,	0x7fffffffffffffff, 1,			1)
-	AND(12,	1,		    0x7fffffffffffffff,	1)
-	AND(13,	0x8000000000000000, 1,			0)
-	AND(14,	1,		    0x8000000000000000,	0)
-	AND(15,	0x7fffffffffffffff, 0x8000000000000000,	0)
-	AND(16,	0x8000000000000000, 0x7fffffffffffffff,	0)
-	AND(17,	0x7fffffffffffffff, 0xffffffffffffffff,	0x7fffffffffffffff)
-	AND(18,	0xffffffffffffffff, 0x7fffffffffffffff,	0x7fffffffffffffff)
-	AND(19,	0xffffffffffffffff, 0xffffffffffffffff,	0xffffffffffffffff)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_com.ok

@@ -1 +0,0 @@
-ok

+ 0 - 33
bjos/sledge/lightning/check/alu_com.tst

@@ -1,33 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define COM(N, I0, V)		UN(N, com, I0, V)
-
-#if __WORDSIZE == 32
-	COM(0,	0,			0xffffffff)
-	COM(1,	1,			0xfffffffe)
-	COM(2,	0xffffffff,		0)
-	COM(3,	0x80000000,		0x7fffffff)
-	COM(4,	0x7fffffff,		0x80000000)
-	COM(5,	0x80000001,		0x7ffffffe)
-#else
-	COM(0,	0,			0xffffffffffffffff)
-	COM(1,	1,			0xfffffffffffffffe)
-	COM(2,	0xffffffff,		0xffffffff00000000)
-	COM(3,	0x80000000,		0xffffffff7fffffff)
-	COM(4,	0x7fffffff,		0xffffffff80000000)
-	COM(5,	0x80000001,		0xffffffff7ffffffe)
-	COM(6,	0xffffffffffffffff,	0)
-	COM(7,	0x8000000000000000,	0x7fffffffffffffff)
-	COM(8,	0x7fffffffffffffff,	0x8000000000000000)
-	COM(9,	0x8000000000000001,	0x7ffffffffffffffe)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_div.ok

@@ -1 +0,0 @@
-ok

+ 0 - 83
bjos/sledge/lightning/check/alu_div.tst

@@ -1,83 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define DIV(N, I0, I1, V)	ALU(N, , div, I0, I1, V)
-#define UDIV(N, I0, I1, V)	ALU(N, _u, div, I0, I1, V)
-
-	DIV(0,	0x7fffffff, 1,		0x7fffffff)
-	DIV(1,	1,	    0x7fffffff, 0)
-	DIV(2,	0x80000000, 1,		0x80000000)
-	DIV(3,	1,	    0x80000000, 0)
-	DIV(4,	0x7fffffff, 2,		0x3fffffff)
-	DIV(5,	2,	    0x7fffffff,	0)
-	DIV(6,	2,	    0x80000000, 0)
-	DIV(7,	0x7fffffff, 0x80000000, 0)
-	DIV(8,	0,	    0x7fffffff,	0)
-	DIV(9,	0xffffffff, 0xffffffff, 1)
-	UDIV(0,	0x7fffffff, 1,		0x7fffffff)
-	UDIV(1,	1,	    0x7fffffff, 0)
-	UDIV(2,	0x80000000, 1,		0x80000000)
-	UDIV(3,	1,	    0x80000000, 0)
-	UDIV(4,	0x7fffffff, 2,		0x3fffffff)
-	UDIV(5,	2,	    0x7fffffff,	0)
-	UDIV(6,	0x80000000, 2,		0x40000000)
-	UDIV(7,	2,	    0x80000000, 0)
-	UDIV(8,	0x7fffffff, 0x80000000, 0)
-	UDIV(9,	0x80000000, 0x7fffffff, 1)
-	UDIV(10,0,	    0x7fffffff,	0)
-	UDIV(11,0x7fffffff, 0xffffffff, 0)
-	UDIV(12,0xffffffff, 0x7fffffff, 2)
-	UDIV(13,0xffffffff, 0xffffffff, 1)
-#if __WORDSIZE == 32
-	DIV(10,	0x80000000, 2,		0xc0000000)
-	DIV(11,	0x80000000, 0x7fffffff, 0xffffffff)
-	DIV(12,	0x7fffffff, 0xffffffff, 0x80000001)
-	DIV(13,	0xffffffff, 0x7fffffff, 0)
-#else
-	DIV(10,	0x80000000,	    2,			0x40000000)
-	DIV(11,	0x80000000,	    0x7fffffff,		1)
-	DIV(12,	0x7fffffff,	    0xffffffff,		0)
-	DIV(13,	0xffffffff,	    0x7fffffff,		2)
-	DIV(14,	0x7fffffffffffffff, 1,			0x7fffffffffffffff)
-	DIV(15,	1,		    0x7fffffffffffffff,	0)
-	DIV(16,	0x8000000000000000, 1,			0x8000000000000000)
-	DIV(17,	1,		    0x8000000000000000,	0)
-	DIV(18,	0x7fffffffffffffff, 2,			0x3fffffffffffffff)
-	DIV(19,	2,		    0x7fffffffffffffff,	0)
-	DIV(20,	0x8000000000000000, 2,			0xc000000000000000)
-	DIV(21,	2,		    0x8000000000000000,	0)
-	DIV(22,	0x7fffffffffffffff, 0x8000000000000000,	0)
-	DIV(23,	0x8000000000000000, 0x7fffffffffffffff,	0xffffffffffffffff)
-	DIV(24,	0x7fffffffffffffff, 0xffffffffffffffff,	0x8000000000000001)
-	DIV(25,	0xffffffffffffffff, 0x7fffffffffffffff,	0)
-	DIV(26,	0xffffffffffffffff, 0xffffffffffffffff,	1)
-	UDIV(14,0x7fffffffffffffff, 1,			0x7fffffffffffffff)
-	UDIV(15,1,		    0x7fffffffffffffff,	0)
-	UDIV(16,0x8000000000000000, 1,			0x8000000000000000)
-	UDIV(17,1,		    0x8000000000000000,	0)
-	UDIV(18,0x7fffffffffffffff, 2,			0x3fffffffffffffff)
-	UDIV(19,2,		    0x7fffffffffffffff,	0)
-	UDIV(20,0x8000000000000000, 2,			0x4000000000000000)
-	UDIV(21,2,		    0x8000000000000000,	0)
-	UDIV(22,0x7fffffffffffffff, 0x8000000000000000,	0)
-	UDIV(23,0x8000000000000000, 0x7fffffffffffffff,	1)
-	UDIV(24,0x7fffffffffffffff, 0xffffffffffffffff,	0)
-	UDIV(25,0xffffffffffffffff, 0x7fffffffffffffff,	2)
-	UDIV(26,0xffffffffffffffff, 0xffffffffffffffff,	1)
-#endif
-
-#undef DIV
-#define DIV(N, T, I0, I1, V)	FOP(N, T, div, I0, I1, V)
-	DIV(0, _f,	-0.5,	    0.5,	-1.0)
-	DIV(1, _f,	 1.25,	    0.5,	 2.5)
-	DIV(0, _d,	-0.5,	    0.5,	-1.0)
-	DIV(1, _d,	 1.25,	    0.5,	 2.5)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_lsh.ok

@@ -1 +0,0 @@
-ok

+ 0 - 57
bjos/sledge/lightning/check/alu_lsh.tst

@@ -1,57 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define LSH(N, I0, I1, V)	ALU(N, , lsh, I0, I1, V)
-
-	LSH(0,	 0x7f,		 1,	0xfe)
-	LSH(1,	 0x7fff,	 2,	0x1fffc)
-	LSH(2,	 0x81,		16,	0x810000)
-	LSH(3,	 0xff,		15,	0x7f8000)
-	LSH(4,	 0x7fffffff,	 0,	0x7fffffff)
-#if __WORDSIZE == 32
-	LSH(5,	 0xffffffff,	8,	0xffffff00)
-	LSH(6,	 0x7fffffff,	3,	0xfffffff8)
-	LSH(7,	-0x7f,		31,	0x80000000)
-	LSH(8,	-0x7fff,	30,	0x40000000)
-	LSH(9,	-0x7fffffff,	29,	0x20000000)
-	LSH(10,	 0x80000001,	28,	0x10000000)
-	LSH(11,	 0x8001,	17,	0x20000)
-	LSH(12,	 0x80000001,	18,	0x40000)
-	LSH(13,	-0xffff,	24,	0x1000000)
-#else
-	LSH(5,	 0xffffffff,	 8,	0xffffffff00)
-	LSH(6,	 0x7fffffff,	 3,	0x3fffffff8)
-	LSH(7,	-0x7f,		31,	0xffffffc080000000)
-	LSH(8,	-0x7fff,	30,	0xffffe00040000000)
-	LSH(9,	-0x7fffffff,	29,	0xf000000020000000)
-	LSH(10,	 0x80000001,	28,	0x800000010000000)
-	LSH(11,	 0x8001,	17,	0x100020000)
-	LSH(12,	 0x80000001,	18,	0x2000000040000)
-	LSH(13,	-0xffff,	24,	0xffffff0001000000)
-	LSH(14,	 0x7f,		33,	0xfe00000000)
-	LSH(15,	 0x7ffff,	34,	0x1ffffc00000000)
-	LSH(16,	 0x7fffffff,	35,	0xfffffff800000000)
-	LSH(17,	-0x7f,		63,	0x8000000000000000)
-	LSH(18,	-0x7fff,	62,	0x4000000000000000)
-	LSH(19,	-0x7fffffff,	61,	0x2000000000000000)
-	LSH(20,	 0x80000001,	60,	0x1000000000000000)
-	LSH(21,	 0x81,		48,	0x81000000000000)
-	LSH(22,	 0x8001,	49,	0x2000000000000)
-	LSH(23,	 0x80000001,	40,	0x10000000000)
-	LSH(24,	 0xff,		47,	0x7f800000000000)
-	LSH(25,	 0xffff0001,	56,	0x100000000000000)
-	LSH(26,	 0xffffffff,	40,	0xffffff0000000000)
-	LSH(27,	 0x7fffffffff,	33,	0xfffffffe00000000)
-	LSH(28,	-0x7fffffffff,	63,	0x8000000000000000)
-	LSH(29,	 0x8000000001,	48,	0x1000000000000)
-	LSH(30,	 0xffffffffff,	47,	0xffff800000000000)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_mul.ok

@@ -1 +0,0 @@
-ok

+ 0 - 59
bjos/sledge/lightning/check/alu_mul.tst

@@ -1,59 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define MUL(N, I0, I1, V)	ALU(N, , mul, I0, I1, V)
-
-	MUL(0,	0x7fffffff, 1,		0x7fffffff)
-	MUL(1,	1,	    0x7fffffff, 0x7fffffff)
-	MUL(2,	0x80000000, 1,		0x80000000)
-	MUL(3,	1,	    0x80000000, 0x80000000)
-	MUL(4,	0x7fffffff, 2,		0xfffffffe)
-	MUL(5,	2,	    0x7fffffff,	0xfffffffe)
-	MUL(6,	0x7fffffff, 0,		0)
-	MUL(7,	0,	    0x7fffffff,	0)
-#if __WORDSIZE == 32
-	MUL(8,	0x80000000, 2,		0)
-	MUL(9,	2,	    0x80000000, 0)
-	MUL(10,	0x7fffffff, 0x80000000, 0x80000000)
-	MUL(11,	0x80000000, 0x7fffffff, 0x80000000)
-	MUL(12,	0x7fffffff, 0xffffffff, 0x80000001)
-	MUL(13,	0xffffffff, 0x7fffffff, 0x80000001)
-	MUL(14,	0xffffffff, 0xffffffff, 1)
-#else
-	MUL(8,	0x80000000,	    2,			0x100000000)
-	MUL(9,	2,		    0x80000000, 	0x100000000)
-	MUL(10,	0x7fffffff,	    0x80000000,		0x3fffffff80000000)
-	MUL(11,	0x80000000,	    0x7fffffff,		0x3fffffff80000000)
-	MUL(12,	0x7fffffff,	    0xffffffff,		0x7ffffffe80000001)
-	MUL(13,	0xffffffff,	    0x7fffffff,		0x7ffffffe80000001)
-	MUL(14,	0xffffffff,	    0xffffffff,		0xfffffffe00000001)
-	MUL(15,	0x7fffffffffffffff, 1,			0x7fffffffffffffff)
-	MUL(16,	1,		    0x7fffffffffffffff,	0x7fffffffffffffff)
-	MUL(17,	0x8000000000000000, 1,			0x8000000000000000)
-	MUL(18,	1,		    0x8000000000000000,	0x8000000000000000)
-	MUL(19,	0x7fffffffffffffff, 2,			0xfffffffffffffffe)
-	MUL(20,	2,		    0x7fffffffffffffff,	0xfffffffffffffffe)
-	MUL(21,	0x8000000000000000, 2,			0)
-	MUL(22,	2,		    0x8000000000000000,	0)
-	MUL(23,	0x7fffffffffffffff, 0x8000000000000000,	0x8000000000000000)
-	MUL(24,	0x8000000000000000, 0x7fffffffffffffff,	0x8000000000000000)
-	MUL(25,	0x7fffffffffffffff, 0xffffffffffffffff,	0x8000000000000001)
-	MUL(26,	0xffffffffffffffff, 0x7fffffffffffffff,	0x8000000000000001)
-	MUL(27,	0xffffffffffffffff, 0xffffffffffffffff,	1)
-#endif
-
-#undef MUL
-#define MUL(N, T, I0, I1, V)	FOP(N, T, mul, I0, I1, V)
-	MUL(0, _f,	-0.5,	    0.5,	-0.25)
-	MUL(1, _f,	 0.25,	    0.75,	 0.1875)
-	MUL(0, _d,	-0.5,	    0.5,	-0.25)
-	MUL(1, _d,	 0.25,	    0.75,	 0.1875)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_neg.ok

@@ -1 +0,0 @@
-ok

+ 0 - 42
bjos/sledge/lightning/check/alu_neg.tst

@@ -1,42 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define NEG(N, I, V)			UN(N, neg, I, V)
-
-	NEG(0,	0,			0)
-#if __WORDSIZE == 32
-	NEG(1,	1,			0xffffffff)
-	NEG(2,	0xffffffff,		1)
-	NEG(3,	0x80000000,		0x80000000)
-	NEG(4,	0x7fffffff,		0x80000001)
-	NEG(5,	0x80000001,		0x7fffffff)
-#else
-	NEG(1,	1,			0xffffffffffffffff)
-	NEG(2,	0xffffffff,		0xffffffff00000001)
-	NEG(3,	0x80000000,		0xffffffff80000000)
-	NEG(4,	0x7fffffff,		0xffffffff80000001)
-	NEG(5,	0x80000001,		0xffffffff7fffffff)
-	NEG(6,	0xffffffffffffffff,	1)
-	NEG(7,	0x8000000000000000,	0x8000000000000000)
-	NEG(8,	0x7fffffffffffffff,	0x8000000000000001)
-#endif
-
-#undef NEG
-#define NEG(N, T, I, V)			FUN(N, T, neg, I, V)
-	NEG(0, _f,	0.0,		-0.0)
-	NEG(1, _f,	0.5,		-0.5)
-	NEG(2, _f,	$(1 / 0.0),	$(-1.0 / 0))
-	NEG(3, _f,	-1.25,		 1.25)
-	NEG(0, _d,	 0.0,		-0.0)
-	NEG(1, _d,	 0.5,		-0.5)
-	NEG(2, _d,	 $(1.0 / 0),	$(-1 / 0.0))
-	NEG(3, _d,	-1.25,		 1.25)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_or.ok

@@ -1 +0,0 @@
-ok

+ 0 - 36
bjos/sledge/lightning/check/alu_or.tst

@@ -1,36 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define OR(N, I0, I1, V)	ALU(N, , or, I0, I1, V)
-
-	OR(0,	0x7fffffff, 1,		0x7fffffff)
-	OR(1,	1,	    0x7fffffff, 0x7fffffff)
-	OR(2,	0x80000000, 1,		0x80000001)
-	OR(3,	1,	    0x80000000, 0x80000001)
-	OR(4,	0x7fffffff, 0x80000000, 0xffffffff)
-	OR(5,	0x80000000, 0x7fffffff, 0xffffffff)
-	OR(6,	0x7fffffff, 0xffffffff, 0xffffffff)
-	OR(7,	0xffffffff, 0x7fffffff, 0xffffffff)
-	OR(8,	0xffffffff, 0xffffffff, 0xffffffff)
-	OR(9,	0x7fffffff, 0,		0x7fffffff)
-	OR(10,	0,	    0x7fffffff,	0x7fffffff)
-#if __WORDSIZE == 64
-	OR(11,	0x7fffffffffffffff, 1,			0x7fffffffffffffff)
-	OR(12,	1,		    0x7fffffffffffffff,	0x7fffffffffffffff)
-	OR(13,	0x8000000000000000, 1,			0x8000000000000001)
-	OR(14,	1,		    0x8000000000000000,	0x8000000000000001)
-	OR(15,	0x7fffffffffffffff, 0x8000000000000000,	0xffffffffffffffff)
-	OR(16,	0x8000000000000000, 0x7fffffffffffffff,	0xffffffffffffffff)
-	OR(17,	0x7fffffffffffffff, 0xffffffffffffffff,	0xffffffffffffffff)
-	OR(18,	0xffffffffffffffff, 0x7fffffffffffffff,	0xffffffffffffffff)
-	OR(19,	0xffffffffffffffff, 0xffffffffffffffff,	0xffffffffffffffff)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_rem.ok

@@ -1 +0,0 @@
-ok

+ 0 - 76
bjos/sledge/lightning/check/alu_rem.tst

@@ -1,76 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define REM(N, I0, I1, V)	ALU(N, , rem, I0, I1, V)
-#define UREM(N, I0, I1, V)	ALU(N, _u, rem, I0, I1, V)
-
-	REM(0,	0x7fffffff, 1,		0)
-	REM(1,	1,	    0x7fffffff, 1)
-	REM(2,	0x80000000, 1,		0)
-	REM(3,	1,	    0x80000000, 1)
-	REM(4,	0x7fffffff, 2,		1)
-	REM(5,	2,	    0x7fffffff,	2)
-	REM(6,	0x80000000, 2,		0)
-	REM(7,	2,	    0x80000000, 2)
-	REM(8,	0x7fffffff, 0x80000000, 0x7fffffff)
-	REM(9,	0,	    0x7fffffff,	0)
-	REM(10,	0xffffffff, 0xffffffff, 0)
-	UREM(0,	0x7fffffff, 1,		0)
-	UREM(1,	1,	    0x7fffffff, 1)
-	UREM(2,	0x80000000, 1,		0)
-	UREM(3,	1,	    0x80000000, 1)
-	UREM(4,	0x7fffffff, 2,		1)
-	UREM(5,	2,	    0x7fffffff,	2)
-	UREM(6,	0x80000000, 2,		0)
-	UREM(7,	2,	    0x80000000, 2)
-	UREM(8,	0x7fffffff, 0x80000000, 0x7fffffff)
-	UREM(9,	0x80000000, 0x7fffffff, 1)
-	UREM(10,0,	    0x7fffffff,	0)
-	UREM(11,0x7fffffff, 0xffffffff, 0x7fffffff)
-	UREM(12,0xffffffff, 0x7fffffff, 1)
-	UREM(13,0xffffffff, 0xffffffff, 0)
-
-#if __WORDSIZE == 32
-	REM(11,	0x80000000, 0x7fffffff, 0xffffffff)
-	REM(12,	0x7fffffff, 0xffffffff, 0)
-	REM(13,	0xffffffff, 0x7fffffff, 0xffffffff)
-#else
-	REM(11,	0x80000000,	    0x7fffffff,		1)
-	REM(12,	0x7fffffff,	    0xffffffff,		0x7fffffff)
-	REM(13,	0xffffffff,	    0x7fffffff,		1)
-	REM(14,	0x7fffffffffffffff, 1,			0)
-	REM(15,	1,		    0x7fffffffffffffff,	1)
-	REM(16,	0x8000000000000000, 1,			0)
-	REM(17,	1,		    0x8000000000000000,	1)
-	REM(18,	0x7fffffffffffffff, 2,			1)
-	REM(19,	2,		    0x7fffffffffffffff,	2)
-	REM(20,	0x8000000000000000, 2,			0)
-	REM(21,	2,		    0x8000000000000000,	2)
-	REM(22,	0x7fffffffffffffff, 0x8000000000000000,	0x7fffffffffffffff)
-	REM(23,	0x8000000000000000, 0x7fffffffffffffff,	0xffffffffffffffff)
-	REM(24,	0x7fffffffffffffff, 0xffffffffffffffff,	0)
-	REM(25,	0xffffffffffffffff, 0x7fffffffffffffff,	0xffffffffffffffff)
-	REM(26,	0xffffffffffffffff, 0xffffffffffffffff,	0)
-	UREM(14,0x7fffffffffffffff, 1,			0)
-	UREM(15,1,		    0x7fffffffffffffff,	1)
-	UREM(16,0x8000000000000000, 1,			0)
-	UREM(17,1,		    0x8000000000000000,	1)
-	UREM(18,0x7fffffffffffffff, 2,			1)
-	UREM(19,2,		    0x7fffffffffffffff,	2)
-	UREM(20,0x8000000000000000, 2,			0)
-	UREM(21,2,		    0x8000000000000000,	2)
-	UREM(22,0x7fffffffffffffff, 0x8000000000000000,	0x7fffffffffffffff)
-	UREM(23,0x8000000000000000, 0x7fffffffffffffff,	1)
-	UREM(24,0x7fffffffffffffff, 0xffffffffffffffff,	0x7fffffffffffffff)
-	UREM(25,0xffffffffffffffff, 0x7fffffffffffffff,	1)
-	UREM(26,0xffffffffffffffff, 0xffffffffffffffff,	0)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_rsb.ok

@@ -1 +0,0 @@
-ok

+ 0 - 49
bjos/sledge/lightning/check/alu_rsb.tst

@@ -1,49 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define RSB(N, I0, I1, V)	ALU(N, , rsb, I0, I1, V)
-
-	RSB(0,	1,	    0x7fffffff,	0x7ffffffe)
-	RSB(2,	1,	    0x80000000,	0x7fffffff)
-	RSB(3,	0x7fffffff, 0x80000000,	1)
-	RSB(4,	0xffffffff, 0xffffffff,	0)
-	RSB(5,	0x7fffffff, 0xffffffff, 0x80000000)
-	RSB(6,	0, 0x7fffffff,		0x7fffffff)
-#if __WORDSIZE == 32
-	RSB(7,	0x7fffffff,	     1, 0x80000002)
-	RSB(8,	0x80000000,	     1, 0x80000001)
-	RSB(9,  0x80000000, 0x7fffffff, 0xffffffff)
-	RSB(10, 0xffffffff, 0x7fffffff, 0x80000000)
-	RSB(11,	0x7fffffff,	     0,	0x80000001)
-#else
-	RSB(7,	        0x7fffffff,		    1,	0xffffffff80000002)
-	RSB(8,  0xffffffff80000000,		    1,		0x80000001)
-	RSB(9,  0xffffffff80000000,	   0x7fffffff,		0xffffffff)
-	RSB(10, 0xffffffffffffffff, 0xffffffff7fffffff, 0xffffffff80000000)
-	RSB(11,	        0x7fffffff,		     0, 0xffffffff80000001)
-	RSB(12,	1,		    0x7fffffffffffffff, 0x7ffffffffffffffe)
-	RSB(13,	0x7fffffffffffffff,		     1, 0x8000000000000002)
-	RSB(14,			 1, 0x8000000000000000, 0x7fffffffffffffff)
-	RSB(15,	0x8000000000000000,		     1, 0x8000000000000001)
-	RSB(16, 0x8000000000000000, 0x7fffffffffffffff, 0xffffffffffffffff)
-	RSB(17, 0x7fffffffffffffff, 0x8000000000000000, 1)
-	RSB(18, 0xffffffffffffffff, 0x7fffffffffffffff, 0x8000000000000000)
-	RSB(19, 0x7fffffffffffffff, 0xffffffffffffffff, 0x8000000000000000)
-	RSB(20, 0xffffffffffffffff, 0xffffffffffffffff, 0)
-#endif
-
-#undef RSB
-#define RSB(N, T, I0, I1, V)	FOP(N, T, rsb, I0, I1, V)
-	RSB(0, _f,	    0.5,	-0.5,	-1.0)
-	RSB(1, _f,	    0.75,	 0.25,	-0.5)
-	RSB(0, _d,	    0.5,	-0.5,	-1.0)
-	RSB(1, _d,	    0.75,	 0.25,	-0.5)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_rsh.ok

@@ -1 +0,0 @@
-ok

+ 0 - 85
bjos/sledge/lightning/check/alu_rsh.tst

@@ -1,85 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define RSH(N, I0, I1, V)	ALU(N, , rsh, I0, I1, V)
-#define URSH(N, I0, I1, V)	ALU(N, _u, rsh, I0, I1, V)
-
-	RSH(0,	0xfe,		     1,		0x7f)
-	RSH(1,	0x1fffc,	     2,		0x7fff)
-	RSH(2,	0x40000000,	    30,		1)
-	RSH(3,	0x20000000,	    29,		1)
-	RSH(4,	0x10000000,	    28,		1)
-	RSH(5,	0x810000,	    16,		0x81)
-	RSH(6,	0x20000,	    17,		1)
-	RSH(7,	0x40000,	    18,		1)
-	RSH(8,	0x7f8000,	    15,		0xff)
-	RSH(9,	0x1000000,	    24,		1)
-	RSH(10,	0x7fffffff,	     0,		0x7fffffff)
-	URSH(0,	0xfe,		     1,		0x7f)
-	URSH(1,	0x1fffc,	     2,		0x7fff)
-	URSH(2,	0x80000000,	    31,		1)
-	URSH(3,	0x40000000,	    30,		1)
-	URSH(4,	0x20000000,	    29,		1)
-	URSH(5,	0x10000000,	    28,		1)
-	URSH(6,	0x810000,	    16,		0x81)
-	URSH(7,	0x20000,	    17,		1)
-	URSH(8,	0x40000,	    18,		1)
-	URSH(9,0x7f8000,	    15,		0xff)
-	URSH(10,0x1000000,	    24,		1)
-	URSH(11,0xffffff00,	     8,		0xffffff)
-	URSH(12,0x7fffffff,	     0,		0x7fffffff)
-#if __WORDSIZE == 32
-	RSH(11,	0xfffffff8,	     3,		0xffffffff)
-	RSH(12,	0x80000000,	    31,		0xffffffff)
-	RSH(13,	0xffffff00,	     8,		0xffffffff)
-	URSH(13,0xfffffff8,	     3,		0x1fffffff)
-#else
-	RSH(11,	0x3fffffff8,	     3,		0x7fffffff)
-	RSH(12,	0xffffffc080000000, 31,		0xffffffffffffff81)
-	RSH(13,	0xffffff00,	     8,		0xffffff)
-	RSH(14,	0xfe00000000,	    33,		0x7f)
-	RSH(15,	0x1ffffc00000000,   34,		0x7ffff)
-	RSH(16,	0xfffffff800000000, 29,		0xffffffffffffffc0)
-	RSH(17,	0x8000000000000000, 63,		0xffffffffffffffff)
-	RSH(18,	0x4000000000000000, 62,		1)
-	RSH(19,	0x2000000000000000, 61,		1)
-	RSH(20,	0x1000000000000000, 60,		1)
-	RSH(21,	0x81000000000000,   48,		0x81)
-	RSH(22,	0x2000000000000,    49,		1)
-	RSH(23,	0x10000000000,	    40,		1)
-	RSH(24,	0x7f800000000000,   47,		0xff)
-	RSH(25,	0x100000000000000,  56,		1)
-	RSH(26,	0xffffff0000000000, 40,		0xffffffffffffffff)
-	RSH(27,	0xfffffffe00000000, 33,		0xffffffffffffffff)
-	RSH(28,	0x8000000000000001, 63,		0xffffffffffffffff)
-	RSH(29,	0x1000000000000,    48,		1)
-	RSH(30,	0xffff800000000000, 47,		0xffffffffffffffff)
-	URSH(13,0x3fffffff8,	    3,		0x7fffffff)
-	URSH(14,0xffffffc080000000, 31,		0x1ffffff81)
-	URSH(15,0xfe00000000,	    33,		0x7f)
-	URSH(16,0x1ffffc00000000,   34,		0x7ffff)
-	URSH(17,0xfffffff800000000, 29,		0x7ffffffc0)
-	URSH(18,0x8000000000000000, 63,		1)
-	URSH(19,0x4000000000000000, 62,		1)
-	URSH(20,0x2000000000000000, 61,		1)
-	URSH(21,0x1000000000000000, 60,		1)
-	URSH(22,0x81000000000000,   48,		0x81)
-	URSH(23,0x2000000000000,    49,		1)
-	URSH(24,0x10000000000,	    40,		1)
-	URSH(25,0x7f800000000000,   47,		0xff)
-	URSH(26,0x100000000000000,  56,		1)
-	URSH(27,0xffffff0000000000, 40,		0xffffff)
-	URSH(28,0xfffffffe00000000, 33,		0x7fffffff)
-	URSH(29,0x8000000000000001, 63,		1)
-	URSH(30,0x1000000000000,    48,		1)
-	URSH(31,0xffff800000000000, 47,		0x1ffff)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_sub.ok

@@ -1 +0,0 @@
-ok

+ 0 - 49
bjos/sledge/lightning/check/alu_sub.tst

@@ -1,49 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define SUB(N, I0, I1, V)	ALU(N, , sub, I0, I1, V)
-
-	SUB(0,	0x7fffffff, 1,		0x7ffffffe)
-	SUB(2,	0x80000000, 1,		0x7fffffff)
-	SUB(3,	0x80000000, 0x7fffffff,	1)
-	SUB(4,	0xffffffff, 0xffffffff,	0)
-	SUB(5,	0xffffffff, 0x7fffffff, 0x80000000)
-	SUB(6,	0x7fffffff, 0,		0x7fffffff)
-#if __WORDSIZE == 32
-	SUB(7,	1,	    0x7fffffff, 0x80000002)
-	SUB(8,	1,	    0x80000000, 0x80000001)
-	SUB(9,	0x7fffffff, 0x80000000, 0xffffffff)
-	SUB(10,	0x7fffffff, 0xffffffff, 0x80000000)
-	SUB(11,	0,	    0x7fffffff,	0x80000001)
-#else
-	SUB(7,	1,		    0x7fffffff,		0xffffffff80000002)
-	SUB(8,	1,		    0xffffffff80000000,		0x80000001)
-	SUB(9,	0x7fffffff,	    0xffffffff80000000,		0xffffffff)
-	SUB(10,	0xffffffff7fffffff, 0xffffffffffffffff,	0xffffffff80000000)
-	SUB(11,	0,		    0x7fffffff,		0xffffffff80000001)
-	SUB(12,	0x7fffffffffffffff, 1,			0x7ffffffffffffffe)
-	SUB(13,	1,		    0x7fffffffffffffff, 0x8000000000000002)
-	SUB(14,	0x8000000000000000, 1,			0x7fffffffffffffff)
-	SUB(15,	1,		    0x8000000000000000, 0x8000000000000001)
-	SUB(16,	0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff)
-	SUB(17,	0x8000000000000000, 0x7fffffffffffffff,	1)
-	SUB(18,	0x7fffffffffffffff, 0xffffffffffffffff, 0x8000000000000000)
-	SUB(19,	0xffffffffffffffff, 0x7fffffffffffffff, 0x8000000000000000)
-	SUB(20,	0xffffffffffffffff, 0xffffffffffffffff,	0)
-#endif
-
-#undef SUB
-#define SUB(N, T, I0, I1, V)	FOP(N, T, sub, I0, I1, V)
-	SUB(0, _f,	-0.5,	    0.5,	-1.0)
-	SUB(1, _f,	 0.25,	    0.75,	-0.5)
-	SUB(0, _d,	-0.5,	    0.5,	-1.0)
-	SUB(1, _d,	 0.25,	    0.75,	-0.5)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alu_xor.ok

@@ -1 +0,0 @@
-ok

+ 0 - 36
bjos/sledge/lightning/check/alu_xor.tst

@@ -1,36 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define XOR(N, I0, I1, V)	ALU(N, , xor, I0, I1, V)
-
-	XOR(0,	0x7fffffff,	    1,			0x7ffffffe)
-	XOR(1,	1,	   	    0x7fffffff,		0x7ffffffe)
-	XOR(2,	0x80000000,	    1,			0x80000001)
-	XOR(3,	1,	   	    0x80000000,		0x80000001)
-	XOR(4,	0x7fffffff,	    0x80000000,		0xffffffff)
-	XOR(5,	0x80000000,	    0x7fffffff,		0xffffffff)
-	XOR(6,	0x7fffffff,	    0xffffffff,		0x80000000)
-	XOR(7,	0xffffffff,	    0x7fffffff,		0x80000000)
-	XOR(9,	0xffffffff,	    0xffffffff,		0)
-	XOR(10,	0x7fffffff,	    0,			0x7fffffff)
-	XOR(11,	0,		    0x7fffffff,		0x7fffffff)
-#if __WORDSIZE == 64
-	XOR(12,	0x7fffffffffffffff, 1,			0x7ffffffffffffffe)
-	XOR(13,	1,		    0x7fffffffffffffff,	0x7ffffffffffffffe)
-	XOR(14,	0x8000000000000000, 1,			0x8000000000000001)
-	XOR(15,	1,		    0x8000000000000000,	0x8000000000000001)
-	XOR(16,	0x7fffffffffffffff, 0x8000000000000000,	0xffffffffffffffff)
-	XOR(17,	0x8000000000000000, 0x7fffffffffffffff,	0xffffffffffffffff)
-	XOR(18,	0x7fffffffffffffff, 0xffffffffffffffff,	0x8000000000000000)
-	XOR(19,	0xffffffffffffffff, 0x7fffffffffffffff,	0x8000000000000000)
-	XOR(20,	0xffffffffffffffff, 0xffffffffffffffff,	0)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alux_add.ok

@@ -1 +0,0 @@
-ok

+ 0 - 49
bjos/sledge/lightning/check/alux_add.tst

@@ -1,49 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define ADDX(N, I0, I1, V)	ALUX(N, add, I0, I1, V)
-
-	/* nothing */
-	ADDX(0,	0,		0,		0)
-#if __WORDSIZE == 32
-	/* carry */
-	ADDX(1,	0xffffffff,	0xffffffff,	1)
-	/* overflow */
-	ADDX(2,	0x7fffffff,	1,		0)
-	/* overflow */
-	ADDX(3,	0x7fffffff,	0x7fffffff,	0)
-	/* carry */
-	ADDX(4,	0x7fffffff,	0x80000000,	0)
-	/* carry+overflow */
-	ADDX(5,	0x80000000,	0x80000000,	1)
-#else
-	/* nothing */
-	ADDX(1,	0xffffffff,		0xffffffff,		0)
-	/* nothing */
-	ADDX(2,	0x7fffffff,		1,			0)
-	/* nothing */
-	ADDX(3,	0x7fffffff,		0x7fffffff,		0)
-	/* nothing */
-	ADDX(4,	0x7fffffff,		0x80000000,		0)
-	/* nothing */
-	ADDX(5,	0x80000000,		0x80000000,		0)
-	/* carry */
-	ADDX(6,	0xffffffffffffffff,	0xffffffffffffffff,	1)
-	/* overflow */
-	ADDX(7,	0x7fffffffffffffff,	1,			0)
-	/* overflow */
-	ADDX(8,	0x7fffffffffffffff,	0x7fffffffffffffff,	0)
-	/* overflow */
-	ADDX(9,	0x7fffffffffffffff,	0x8000000000000000,	0)
-	/* carry+overflow */
-	ADDX(10,0x8000000000000000,	0x8000000000000000,	1)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/alux_sub.ok

@@ -1 +0,0 @@
-ok

+ 0 - 49
bjos/sledge/lightning/check/alux_sub.tst

@@ -1,49 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-
-#define SUBX(N, I0, I1, V)	ALUX(N, sub, I0, I1, V)
-
-	/* nothing */
-	SUBX(0,	 0,		0,		0)
-#if __WORDSIZE == 32
-	/* carry */
-	SUBX(1,	0x7fffffff,	0xffffffff,	0xffffffff)
-	/* overflow */
-	SUBX(2,	0x80000000,	1,		0)
-	/* carry */
-	SUBX(3,	0x7fffffff,	0x80000000,	0xffffffff)
-	/* overflow */
-	SUBX(4,	0x80000000,	0x7fffffff,	0)
-	/* carry+overflow */
-	SUBX(5,	1,		0x80000000,	0xffffffff)
-#else
-	/* carry */
-	SUBX(1,	0x7fffffff,		0xffffffff,		-1)
-	/* nothing */
-	SUBX(2,	0x80000000,		1,			0)
-	/* carry */
-	SUBX(3,	0x7fffffff,		0x80000000,		-1)
-	/* nothing */
-	SUBX(4,	0x80000000,		0x7fffffff,		0)
-	/* carry */
-	SUBX(5,	1,			0x80000000,		-1)
-	/* carry */
-	SUBX(6,	0x7fffffffffffffff,	0xffffffffffffffff,	-1)
-	/* overflow */
-	SUBX(7,	0x8000000000000000,	1,			0)
-	/* carry */
-	SUBX(8,	0x7fffffffffffffff,	0x8000000000000000,	-1)
-	/* overflow */
-	SUBX(9,	0x8000000000000000,	0x7fffffffffffffff,	0)
-	/* carry+overflow */
-	SUBX(10,1,			0x8000000000000000,	-1)
-#endif
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/bp.ok

@@ -1 +0,0 @@
-nfibs(32) = 7049155

+ 0 - 46
bjos/sledge/lightning/check/bp.tst

@@ -1,46 +0,0 @@
-.data	32
-fmt:
-.c	"nfibs(%d) = %d\n"
-
-.code
-	jmpi main
-
-	name rfibs
-rfibs:
-	prolog
-	arg $in
-	getarg %v0 $in		/* V0 = N */
-
-	blti_u out %v0 2
-	subi %v1 %v0 1		/* V1 = N-1 */
-	subi %v2 %v0 2		/* V1 = N-2 */
-	prepare
-		pushargr %v1
-	finishi rfibs
-	retval %v1		/* V1 = rfibs(N-1) */
-	prepare
-		pushargr %v2
-	finishi rfibs
-	retval %v2		/* V2 = rfibs(N-2) */
-	addi %v1 %v1 1
-	addr %r0 %v1 %v2
-	retr %r0
-out:
-	reti 1
-	epilog
-
-	name main
-main:
-	prolog
-	prepare
-		pushargi 32
-	finishi rfibs
-	retval %v0
-	prepare
-		pushargi fmt
-		ellipsis
-		pushargi 32
-		pushargr %v0
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/branch.ok

@@ -1 +0,0 @@
-ok

+ 0 - 563
bjos/sledge/lightning/check/branch.tst

@@ -1,563 +0,0 @@
-#if __WORDSIZE == 64
-#  define I7f		0x7fffffffffffffff
-#  define I80		0x8000000000000000
-#  define I81		0x8000000000000001
-#  define Iff		0xffffffffffffffff
-#else
-#  define I7f		0x7fffffff
-#  define I80		0x80000000
-#  define I81		0x80000001
-#  define Iff		0xffffffff
-#endif
-
-.data	12
-ok:
-.c	"ok\n"
-.	$($NaN  =  0.0 / 0.0)
-
-#define BOP(N, Ls, Rs, Lu, Ru, R0, R1)		\
-	movi %R0 Ls				\
-	movi %R1 Rs				\
-	b##N##r N##r_##R0##_##R1 %R0 %R1	\
-	calli @abort				\
-N##r_##R0##_##R1:				\
-	b##N##i N##i_##R0##_##R1 %R0 Rs		\
-	calli @abort				\
-N##i_##R0##_##R1:				\
-	movi %R0 Lu				\
-	movi %R1 Ru				\
-	b##N##r_u N##r_u_##R0##_##R1 %R0 %R1	\
-	calli @abort				\
-N##r_u_##R0##_##R1:				\
-	b##N##i_u N##i_u_##R0##_##R1 %R0 Ru	\
-	calli @abort				\
-N##i_u_##R0##_##R1:				\
-	movi %R0 Ls				\
-	movi %R1 Rs				\
-	N##r %R0 %R0 %R1			\
-	beqi _##N##r_##R0##_##R1 %R0 1		\
-	calli @abort				\
-_##N##r_##R0##_##R1:				\
-	movi %R0 Ls				\
-	N##i %R1 %R0 Rs				\
-	beqi _##N##i_##R0##_##R1 %R1 1		\
-	calli @abort				\
-_##N##i_##R0##_##R1:				\
-	movi %R0 Lu				\
-	movi %R1 Ru				\
-	N##r_u %R0 %R0 %R1			\
-	beqi _##N##r_u_##R0##_##R1 %R0 1	\
-	calli @abort				\
-_##N##r_u_##R0##_##R1:				\
-	movi %R0 Lu				\
-	N##i_u %R1 %R0 Ru			\
-	beqi _##N##i_u_##R0##_##R1 %R1 1	\
-	calli @abort				\
-_##N##i_u_##R0##_##R1:
-
-#define EB(N, L, R, R0, R1)			\
-	movi %R0 L				\
-	movi %R1 R				\
-	b##N##r N##r_##R0##_##R1 %R0 %R1	\
-	calli @abort				\
-N##r_##R0##_##R1:				\
-	b##N##i N##i_##R0##_##R1 %R0 R		\
-	calli @abort				\
-N##i_##R0##_##R1:				\
-	movi %R0 L				\
-	movi %R1 R				\
-	N##r %R0 %R0 %R1			\
-	beqi _##N##r_##R0##_##R1 %R0 1		\
-	calli @abort				\
-_##N##r_##R0##_##R1:				\
-	movi %R0 L				\
-	N##i %R1 %R0 R				\
-	beqi _##N##i_##R0##_##R1 %R1 1		\
-	calli @abort				\
-_##N##i_##R0##_##R1:
-
-#define XEB(N, L, R, R0, R1)			\
-	movi %R0 L				\
-	movi %R1 R				\
-	b##N##r N##r_##R0##_##R1 %R0 %R1	\
-	calli @abort				\
-N##r_##R0##_##R1:				\
-	b##N##i N##i_##R0##_##R1 %R0 R		\
-	calli @abort				\
-N##i_##R0##_##R1:
-
-#define XBOP(N, Ls, Rs, Lu, Ru, R0, R1)		\
-	movi %R0 Ls				\
-	movi %R1 Rs				\
-	b##N##r N##r_##R0##_##R1 %R0 %R1	\
-	calli @abort				\
-N##r_##R0##_##R1:				\
-	movi %R0 Ls				\
-	b##N##i N##i_##R0##_##R1 %R0 Rs		\
-	calli @abort				\
-N##i_##R0##_##R1:				\
-	movi %R0 Lu				\
-	movi %R1 Ru				\
-	b##N##r_u N##r_u_##R0##_##R1 %R0 %R1	\
-	calli @abort				\
-N##r_u_##R0##_##R1:				\
-	movi %R0 Lu				\
-	b##N##i_u N##i_u_##R0##_##R1 %R0 Ru	\
-	calli @abort				\
-N##i_u_##R0##_##R1:
-
-#define BOPI(N, Ls, Rs, Lu, Ru)			\
-	BOP(N, Ls, Rs, Lu, Ru, v0, v1)		\
-	BOP(N, Ls, Rs, Lu, Ru, v0, v2)		\
-	BOP(N, Ls, Rs, Lu, Ru, v0, r0)		\
-	BOP(N, Ls, Rs, Lu, Ru, v0, r1)		\
-	BOP(N, Ls, Rs, Lu, Ru, v0, r2)		\
-	BOP(N, Ls, Rs, Lu, Ru, v1, v0)		\
-	BOP(N, Ls, Rs, Lu, Ru, v1, v2)		\
-	BOP(N, Ls, Rs, Lu, Ru, v1, r0)		\
-	BOP(N, Ls, Rs, Lu, Ru, v1, r1)		\
-	BOP(N, Ls, Rs, Lu, Ru, v1, r2)		\
-	BOP(N, Ls, Rs, Lu, Ru, v2, v0)		\
-	BOP(N, Ls, Rs, Lu, Ru, v2, v1)		\
-	BOP(N, Ls, Rs, Lu, Ru, v2, r0)		\
-	BOP(N, Ls, Rs, Lu, Ru, v2, r1)		\
-	BOP(N, Ls, Rs, Lu, Ru, v2, r2)		\
-	BOP(N, Ls, Rs, Lu, Ru, r0, v0)		\
-	BOP(N, Ls, Rs, Lu, Ru, r0, v1)		\
-	BOP(N, Ls, Rs, Lu, Ru, r0, v2)		\
-	BOP(N, Ls, Rs, Lu, Ru, r0, r1)		\
-	BOP(N, Ls, Rs, Lu, Ru, r0, r2)		\
-	BOP(N, Ls, Rs, Lu, Ru, r1, v0)		\
-	BOP(N, Ls, Rs, Lu, Ru, r1, v1)		\
-	BOP(N, Ls, Rs, Lu, Ru, r1, v2)		\
-	BOP(N, Ls, Rs, Lu, Ru, r1, r0)		\
-	BOP(N, Ls, Rs, Lu, Ru, r1, r2)		\
-	BOP(N, Ls, Rs, Lu, Ru, r2, v0)		\
-	BOP(N, Ls, Rs, Lu, Ru, r2, v1)		\
-	BOP(N, Ls, Rs, Lu, Ru, r2, v2)		\
-	BOP(N, Ls, Rs, Lu, Ru, r2, r0)		\
-	BOP(N, Ls, Rs, Lu, Ru, r2, r1)
-
-#define EBI(N, L, R)				\
-	EB(N, L, R, v0, v1)			\
-	EB(N, L, R, v0, v2)			\
-	EB(N, L, R, v0, r0)			\
-	EB(N, L, R, v0, r1)			\
-	EB(N, L, R, v0, r2)			\
-	EB(N, L, R, v1, v0)			\
-	EB(N, L, R, v1, v2)			\
-	EB(N, L, R, v1, r0)			\
-	EB(N, L, R, v1, r1)			\
-	EB(N, L, R, v1, r2)			\
-	EB(N, L, R, v2, v0)			\
-	EB(N, L, R, v2, v1)			\
-	EB(N, L, R, v2, r0)			\
-	EB(N, L, R, v2, r1)			\
-	EB(N, L, R, v2, r2)			\
-	EB(N, L, R, r0, v0)			\
-	EB(N, L, R, r0, v1)			\
-	EB(N, L, R, r0, v2)			\
-	EB(N, L, R, r0, r1)			\
-	EB(N, L, R, r0, r2)			\
-	EB(N, L, R, r1, v0)			\
-	EB(N, L, R, r1, v1)			\
-	EB(N, L, R, r1, v2)			\
-	EB(N, L, R, r1, r0)			\
-	EB(N, L, R, r1, r2)			\
-	EB(N, L, R, r2, v0)			\
-	EB(N, L, R, r2, v1)			\
-	EB(N, L, R, r2, v2)			\
-	EB(N, L, R, r2, r0)			\
-	EB(N, L, R, r2, r1)
-
-
-#define XEBI(N, L, R)				\
-	XEB(N, L, R, v0, v1)			\
-	XEB(N, L, R, v0, v2)			\
-	XEB(N, L, R, v0, r0)			\
-	XEB(N, L, R, v0, r1)			\
-	XEB(N, L, R, v0, r2)			\
-	XEB(N, L, R, v1, v0)			\
-	XEB(N, L, R, v1, v2)			\
-	XEB(N, L, R, v1, r0)			\
-	XEB(N, L, R, v1, r1)			\
-	XEB(N, L, R, v1, r2)			\
-	XEB(N, L, R, v2, v0)			\
-	XEB(N, L, R, v2, v1)			\
-	XEB(N, L, R, v2, r0)			\
-	XEB(N, L, R, v2, r1)			\
-	XEB(N, L, R, v2, r2)			\
-	XEB(N, L, R, r0, v0)			\
-	XEB(N, L, R, r0, v1)			\
-	XEB(N, L, R, r0, v2)			\
-	XEB(N, L, R, r0, r1)			\
-	XEB(N, L, R, r0, r2)			\
-	XEB(N, L, R, r1, v0)			\
-	XEB(N, L, R, r1, v1)			\
-	XEB(N, L, R, r1, v2)			\
-	XEB(N, L, R, r1, r0)			\
-	XEB(N, L, R, r1, r2)			\
-	XEB(N, L, R, r2, v0)			\
-	XEB(N, L, R, r2, v1)			\
-	XEB(N, L, R, r2, v2)			\
-	XEB(N, L, R, r2, r0)			\
-	XEB(N, L, R, r2, r1)
-
-#define XBOPI(N, Ls, Rs, Lu, Ru)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v0, v1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v0, v2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v0, r0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v0, r1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v0, r2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v1, v0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v1, v2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v1, r0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v1, r1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v1, r2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v2, v0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v2, v1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v2, r0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v2, r1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, v2, r2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r0, v0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r0, v1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r0, v2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r0, r1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r0, r2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r1, v0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r1, v1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r1, v2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r1, r0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r1, r2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r2, v0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r2, v1)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r2, v2)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r2, r0)		\
-	XBOP(N, Ls, Rs, Lu, Ru, r2, r1)
-
-#define TBOPF(N, T, L, R)			\
-	movi_##T %f0 L				\
-	movi_##T %f1 R				\
-	b##N##r##_##T N##r_##T %f0 %f1		\
-	calli @abort				\
-N##r_##T:					\
-	b##N##i##_##T N##i_##T %f0 R		\
-	calli @abort				\
-N##i_##T:					\
-	movi_##T %f1 $NaN			\
-	b##N##r##_##T N##r_##T##_##u %f0 %f1	\
-	jmpi N##r_##T##_##u0			\
-N##r_##T##_##u:					\
-	calli @abort				\
-N##r##_##T##_##u0:				\
-	b##N##i##_##T N##i_##T##_##u %f0 $NaN	\
-	jmpi N##i_##T##_##u0			\
-N##i##_##T##_##u:				\
-	calli @abort				\
-N##i##_##T##_##u0:
-#define BOPF(N, L, R)				\
-	TBOPF(N, f, L, R)			\
-	TBOPF(N, d, L, R)
-
-#define TUBOPF(N, T, L, R)			\
-	movi_##T %f0 L				\
-	movi_##T %f1 R				\
-	b##N##r##_##T N##r_##T %f0 %f1		\
-	calli @abort				\
-N##r_##T:					\
-	b##N##i##_##T N##i_##T %f0 R		\
-	calli @abort				\
-N##i_##T:					\
-	movi_##T %f1 $NaN			\
-	b##N##r##_##T N##r_##T##_##u %f0 %f1	\
-	calli @abort				\
-N##r_##T##_##u:					\
-	b##N##i##_##T N##i_##T##_##u %f0 $NaN	\
-	calli @abort				\
-N##i##_##T##_##u:
-
-#define UBOPF(N, L, R)				\
-	TUBOPF(N, f, L, R)			\
-	TUBOPF(N, d, L, R)
-
-.code
-	prolog
-
-	movi %r0 -1
-	movi %r1 1
-	bltr xltr_r0_r1 %r0 %r1
-	calli @abort
-xltr_r0_r1:
-	blti xlti_r0_r1 %r0 1
-	calli @abort
-xlti_r0_r1:
-	movi %r0 1
-	movi %r1 -1
-	bltr_u xltru_r0_r1 %r0 %r1
-	calli @abort
-xltru_r0_r1:
-	blti_u xltiu_r0_r1 %r0 -1
-	calli @abort
-xltiu_r0_r1:
-	movi %r0 -1
-	movi %r1 -1
-	bler xler_r0_r1 %r0 %r1
-	calli @abort
-xler_r0_r1:
-	blti xlei_r0_r1 %r0 1
-	calli @abort
-xlei_r0_r1:
-	movi %r0 1
-	movi %r1 -1
-	bltr_u xlteu_r0_r1 %r0 %r1
-	calli @abort
-xlteu_r0_r1:
-	blei_u xleiu_r0_r1 %r0 -1
-	calli @abort
-xleiu_r0_r1:
-	movi %r0 32
-	movi %r1 32
-	beqr xeqr_r0_r1 %r0 %r1
-	calli @abort
-xeqr_r0_r1:
-	beqi xeqi_r0_r1 %r0 32
-	calli @abort
-xeqi_r0_r1:
-	movi %r0 -2
-	movi %r1 -2
-	bger xger_r0_r1 %r0 %r1
-	calli @abort
-xger_r0_r1:
-	bgei xgei_r0_r1 %r0 -2
-	calli @abort
-xgei_r0_r1:
-	movi %r0 2
-	movi %r1 2
-	bger_u xgeru_r0_r1 %r0 %r1
-	calli @abort
-xgeru_r0_r1:
-	bgei_u xgeiu_r0_r1 %r0 2
-	calli @abort
-xgeiu_r0_r1:
-	movi %r0 2
-	movi %r1 -2
-	bgtr xgtr_r0_r1 %r0 %r1
-	calli @abort
-xgtr_r0_r1:
-	bgti xgti_r0_r1 %r0 -2
-	calli @abort
-xgti_r0_r1:
-	movi %r0 -2
-	movi %r1 2
-	bgtr_u xgtru_r0_r1 %r0 %r1
-	calli @abort
-xgtru_r0_r1:
-	bgti_u xgtiu_r0_r1 %r0 2
-	calli @abort
-xgtiu_r0_r1:
-	movi %r0 -3
-	movi %r1 3
-	bner xner_r0_r1 %r0 %r1
-	calli @abort
-xner_r0_r1:
-	bnei xnei_r0_r1 %r0 3
-	calli @abort
-xnei_r0_r1:
-	movi %r0 1
-	movi %r1 3
-	bmsr xmsr_r0_r1 %r0 %r1
-	calli @abort
-xmsr_r0_r1:
-	bmsi xmsi_r0_r1 %r0 3
-	calli @abort
-xmsi_r0_r1:
-	movi %r0 1
-	movi %r1 2
-	bmcr xmcr_r0_r1 %r0 %r1
-	calli @abort
-xmcr_r0_r1:
-	bmci xmci_r0_r1 %r0 2
-	calli @abort
-xmci_r0_r1:
-	movi %r0 I7f
-	movi %r1 1
-	boaddr xoaddr_r0_r1 %r0 %r1
-	calli @abort
-xoaddr_r0_r1:
-	movi %r0 Iff
-	movi %r1 1
-	boaddr_u xoaddr_u_r0_r1 %r0 %r1
-	calli @abort
-xoaddr_u_r0_r1:
-	movi %r0 I7f
-	boaddi xoaddi_r0_r1 %r0 1
-	calli @abort
-xoaddi_r0_r1:
-	movi %r0 Iff
-	boaddi_u xoaddi_u_r0_r1 %r0 1
-	calli @abort
-xoaddi_u_r0_r1:
-	movi %r0 I80
-	movi %r1 1
-	bxaddr xxaddr_r0_r1 %r0 %r1
-	calli @abort
-xxaddr_r0_r1:
-	movi %r0 I80
-	bxaddi xxaddi_r0_r1 %r0 1
-	calli @abort
-xxaddi_r0_r1:
-	movi %r0 I7f
-	movi %r1 1
-	bxaddr_u xxaddr_u_r0_r1 %r0 %r1
-	calli @abort
-xxaddr_u_r0_r1:
-	movi %r0 I7f
-	bxaddi_u xxaddi_u_r0_r1 %r0 1
-	calli @abort
-xxaddi_u_r0_r1:
-	movi %r0 I80
-	movi %r1 1
-	bosubr xosubr_r0_r1 %r0 %r1
-	calli @abort
-xosubr_r0_r1:
-	movi %r0 0
-	movi %r1 1
-	bosubr_u xosubr_u_r0_r1 %r0 %r1
-	calli @abort
-xosubr_u_r0_r1:
-	movi %r0 I80
-	bosubi xosubi_r0_r1 %r0 1
-	calli @abort
-xosubi_r0_r1:
-	movi %r0 0
-	bosubi_u xosubi_u_r0_r1 %r0 1
-	calli @abort
-xosubi_u_r0_r1:
-	movi %r0 I81
-	movi %r1 1
-	bxsubr xxsubr_r0_r1 %r0 %r1
-	calli @abort
-xxsubr_r0_r1:
-	movi %r0 I81
-	bxsubi xxsubi_r0_r1 %r0 1
-	calli @abort
-xxsubi_r0_r1:
-	movi %r0 I80
-	movi %r1 1
-	bxsubr_u xxsubr_u_r0_r1 %r0 %r1
-	calli @abort
-xxsubr_u_r0_r1:
-	movi %r0 I80
-	bxsubi_u xxsubi_u_r0_r1 %r0 1
-	calli @abort
-xxsubi_u_r0_r1:
-	movi_f %f0 1
-	movi_f %f1 2
-	bltr_f xltr_f_f0_f1 %f0 %f1
-	calli @abort
-xltr_f_f0_f1:
-	blti_f xlti_f_f0_f1 %f0 2
-	calli @abort
-xlti_f_f0_f1:
-	movi_f %f0 -1
-	movi_f %f1 -1
-	bler_f xler_f_f0_f1 %f0 %f1
-	calli @abort
-xler_f_f0_f1:
-	blei_f xlei_f_f0_f1 %f0 -1
-	calli @abort
-xlei_f_f0_f1:
-	movi_f %f0 -2
-	movi_f %f1 -2
-	beqr_f xeqr_f_f0_f1 %f0 %f1
-	calli @abort
-xeqr_f_f0_f1:
-	beqi_f xeqi_f_f0_f1 %f0 -2
-	calli @abort
-xeqi_f_f0_f1:
-	movi_f %f0 -3
-	movi_f %f1 -3
-	bger_f xger_f_f0_f1 %f0 %f1
-	calli @abort
-xger_f_f0_f1:
-	bgei_f xgei_f_f0_f1 %f0 -3
-	calli @abort
-xgei_f_f0_f1:
-	movi_f %f0 2
-	movi_f %f1 1
-	bgtr_f xgtr_f_f0_f1 %f0 %f1
-	calli @abort
-xgtr_f_f0_f1:
-	bgti_f xgti_f_f0_f1 %f0 1
-	calli @abort
-xgti_f_f0_f1:
-	movi_f %f0 0
-	movi_f %f1 2
-	bner_f xner_f_f0_f1 %f0 %f1
-	calli @abort
-xner_f_f0_f1:
-	bnei_f xnei_f_f0_f1 %f0 2
-	calli @abort
-xnei_f_f0_f1:
-
-	BOPI(lt, -1, 1, 1, -1)
-	BOPI(le, -1, -1, 1, 1)
-	EBI(eq, 32, 32)
-	BOPI(ge, -2, -2, 2, 2)
-	BOPI(gt, 2, -2, -2, 2)
-	EBI(ne, 3, -3)
-	XEBI(ms, 1, 3)
-	XEBI(mc, 1, 2)
-	XBOPI(oadd, I7f, 1, Iff, 1)
-	XBOPI(xadd, I80, 1, I7f, 1)
-	XBOPI(osub, I80, 1, 0, 1)
-	XBOPI(xsub, I81, 1, I80, 1)
-	BOPF(lt, 1, 2)
-	BOPF(le, 2, 2)
-	BOPF(eq, 3, 3)
-	BOPF(ge, 3, 3)
-	BOPF(gt, 4, 3)
-	UBOPF(ne, 4, 3)
-	UBOPF(unlt, 1, 2)
-	UBOPF(unle, 2, 2)
-	UBOPF(uneq, 3, 3)
-	UBOPF(unge, 3, 3)
-	UBOPF(ungt, 4, 3)
-	BOPF(ltgt, 4, 3)
-	movi_f %f0 5
-	movi_f %f1 5
-	bordr_f ordr_f %f0 %f1
-	calli @abort
-ordr_f:
-	bordi_f ordi_f %f0 1
-	calli @abort
-ordi_f:
-	bordi_f ordi_f_u %f0 $NaN
-	jmpi ordi_f_u0
-ordi_f_u:
-	calli @abort
-ordi_f_u0:
-	movi_f %f0 5
-	movi_f %f1 5
-	bunordr_f unordr_f %f0 %f1
-	jmpi unordr_f_0
-unordr_f:
-	calli @abort
-unordr_f_0:
-	bunordi_f unordi_f %f0 1
-	jmpi unordi_f_0
-unordi_f:
-	calli @abort
-unordi_f_0:
-	bunordi_f unordi_f_1 %f0 $NaN
-	calli @abort
-unordi_f_1:
-
-	// just to know did not crash or abort
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-
-	ret
-	epilog

+ 0 - 4
bjos/sledge/lightning/check/call.ok

@@ -1,4 +0,0 @@
-forward
-backward
-forward
-backward

+ 0 - 272
bjos/sledge/lightning/check/call.tst

@@ -1,272 +0,0 @@
-#define def_wi(i)			\
-	name _w##i			\
-_w##i:					\
-	prolog				\
-	arg $arg##i			\
-	getarg##i %r0 $arg##i		\
-	retr %r0			\
-	epilog
-#define def_wf(f)			\
-	name _w##f			\
-_w##f:					\
-	prolog				\
-	arg##f $arg##f			\
-	getarg##f %f0 $arg##f		\
-	truncr##f %r0 %f0		\
-	retr %r0			\
-	epilog
-#define def_fi(f, i)			\
-	name f##i			\
-f##i:					\
-	prolog				\
-	arg $arg##i			\
-	getarg##i %r0 $arg##i		\
-	extr##f %f0 %r0			\
-	retr##f %f0			\
-	epilog
-#define def_f(f)			\
-	name f##f			\
-f##f:					\
-	prolog				\
-	arg##f $arg##f			\
-	getarg##f %f0 $arg##f		\
-	retr##f %f0			\
-	epilog
-#define def_ff(f, g)			\
-	name f##g			\
-	name f##g			\
-f##g:					\
-	prolog				\
-	arg##g $arg##g			\
-	getarg##g %f0 $arg##g		\
-	extr##g##f %f0 %f0		\
-	retr##f %f0			\
-	epilog
-
-.data	32
-fstr:
-.c	"forward"
-bstr:
-.c	"backward"
-
-.code
-	jmpi main
-
-	def_wi(_c)
-	def_wi(_uc)
-	def_wi(_s)
-	def_wi(_us)
-#if __WORDSIZE == 64
-	def_wi(_i)
-	def_wi(_ui)
-#endif
-	def_wf(_f)
-	def_wf(_d)
-	def_fi(_f, _c)
-	def_fi(_f, _uc)
-	def_fi(_f, _s)
-	def_fi(_f, _us)
-	def_fi(_f, _i)
-#if __WORDSIZE == 64
-	def_fi(_f, _ui)
-	def_fi(_f, _l)
-#endif
-	def_fi(_d, _c)
-	def_fi(_d, _uc)
-	def_fi(_d, _s)
-	def_fi(_d, _us)
-	def_fi(_d, _i)
-#if __WORDSIZE == 64
-	def_fi(_d, _ui)
-	def_fi(_d, _l)
-#endif
-	def_f(_f)
-	def_f(_d)
-	def_ff(_f, _d)
-	def_ff(_d, _f)
-
-	name main
-main:
-	prolog
-
-#define _call_w(n, i, a, r)		\
-	prepare				\
-		pushargi a		\
-	finishi _w##i			\
-	retval %r0			\
-	extr##i %r0 %r0			\
-	beqi _w##i##_##n %r0 r		\
-	calli @abort			\
-_w##i##_##n:
-#define call_w(n, i, a, r)		_call_w(n, i, a, r)
-#define _call_wf(n, f, a, r)		\
-	prepare				\
-		pushargi##f a		\
-	finishi _w##f			\
-	retval %r0			\
-	extr##f %f0 %r0			\
-	beqi##f _w##f##_##n %f0 r	\
-	calli @abort			\
-_w##f##_##n:
-#define call_wf(n, f, a, r)		_call_wf(n, f, a, r)
-#define _call_fi(n, f, i, a, r)		\
-	prepare				\
-		pushargi a		\
-	finishi f##i			\
-	retval##f %f0			\
-	beqi##f f##i##n %f0 r		\
-	calli @abort			\
-f##i##n:
-#define call_fi(n, f, i, a, r)		_call_fi(n, f, i, a, r)
-#define _call_f(n, f, a, r)		\
-	prepare				\
-		pushargi##f a		\
-	finishi f##f			\
-	retval##f %f0			\
-	beqi##f f##f##n %f0 r		\
-	calli @abort			\
-f##f##n:
-#define call_f(n, f, a, r)		_call_f(n, f, a, r)
-#define _call_ff(n, f, g, a, r)		\
-	prepare				\
-		pushargi##g a		\
-	finishi f##g			\
-	retval##f %f0			\
-	beqi##f f##g##n %f0 r		\
-	calli @abort			\
-f##g##n:
-#define call_ff(n, f, g, a, r)		_call_ff(n, f, g, a, r)
-
-#define c7f		0x7f
-#define c80		0x80
-#define c81		0x81
-#define cff		0xff
-#define s7f		0x7fff
-#define s80		0x8000
-#define s81		0x8001
-#define i7f		0x7fffffff
-#define i80		0x80000000
-#define i81		0x80000001
-#define iff		0xffffffff
-#define l7f		0x7fffffffffffffff
-#define l80		0x8000000000000000
-#define l81		0x8000000000000001
-#define f7f		 127.0
-#define f80		-128.0
-#define f81		-127.0
-#define uf80		 128.0
-#define uf81		 127.0
-#if __WORDSIZE == 32
-#  define wc80		0xffffff80
-#  define wc81		0xffffff81
-#  define ws80		0xffff8000
-#  define ws81		0xffff8001
-#else
-#  define wc80		0xffffffffffffff80
-#  define wc81		0xffffffffffffff81
-#  define ws80		0xffffffffffff8000
-#  define ws81		0xffffffffffff8001
-#  define wi80		0xffffffff80000000
-#  define wi81		0xffffffff80000001
-#endif
-
-	call_w(__LINE__, _c,  c7f, c7f)
-	call_w(__LINE__, _c,  c80, wc80)
-	call_w(__LINE__, _c,  c81, wc81)
-	call_w(__LINE__, _uc, c7f, c7f)
-	call_w(__LINE__, _uc, c80, c80)
-	call_w(__LINE__, _uc, c81, c81)
-	call_w(__LINE__, _s,  s7f, s7f)
-	call_w(__LINE__, _s,  s80, ws80)
-	call_w(__LINE__, _s,  s81, ws81)
-	call_w(__LINE__, _us, s7f, s7f)
-	call_w(__LINE__, _us, s80, s80)
-	call_w(__LINE__, _us, s81, s81)
-#if __WORDSIZE == 64
-	call_w(__LINE__, _i,  i7f, i7f)
-	call_w(__LINE__, _i,  i80, wi80)
-	call_w(__LINE__, _i,  i81, wi81)
-	call_w(__LINE__, _ui, i7f, i7f)
-	call_w(__LINE__, _ui, i80, i80)
-	call_w(__LINE__, _ui, i81, i81)
-#endif
-	call_wf(__LINE__, _f, c7f, f7f)
-	call_wf(__LINE__, _f, wc80, f80)
-	call_wf(__LINE__, _f, wc81, f81)
-	call_wf(__LINE__, _d, c7f, f7f)
-	call_wf(__LINE__, _d, wc80, f80)
-	call_wf(__LINE__, _d, wc81, f81)
-	call_fi(__LINE__, _f, _c, c7f, f7f)
-	call_fi(__LINE__, _f, _c, c80, f80)
-	call_fi(__LINE__, _f, _uc, c7f, f7f)
-	call_fi(__LINE__, _f, _uc, c80, uf80)
-	call_fi(__LINE__, _f, _s, c7f, f7f)
-	call_fi(__LINE__, _f, _s, c80, uf80)
-	call_fi(__LINE__, _f, _us, c7f, f7f)
-	call_fi(__LINE__, _f, _us, c80, uf80)
-	call_fi(__LINE__, _f, _i, c7f, f7f)
-	call_fi(__LINE__, _f, _i, c80, uf80)
-#if __WORDSIZE == 64
-	call_fi(__LINE__, _f, _ui, c7f, f7f)
-	call_fi(__LINE__, _f, _ui, c80, uf80)
-	call_fi(__LINE__, _f, _l, c7f, f7f)
-	call_fi(__LINE__, _f, _l, c80, uf80)
-#endif
-	call_fi(__LINE__, _d, _c, c7f, f7f)
-	call_fi(__LINE__, _d, _c, c80, f80)
-	call_fi(__LINE__, _d, _uc, c7f, f7f)
-	call_fi(__LINE__, _d, _uc, c80, uf80)
-	call_fi(__LINE__, _d, _s, c7f, f7f)
-	call_fi(__LINE__, _d, _s, c80, uf80)
-	call_fi(__LINE__, _d, _us, c7f, f7f)
-	call_fi(__LINE__, _d, _us, c80, uf80)
-	call_fi(__LINE__, _d, _i, c7f, f7f)
-	call_fi(__LINE__, _d, _i, c80, uf80)
-#if __WORDSIZE == 64
-	call_fi(__LINE__, _d, _ui, c7f, f7f)
-	call_fi(__LINE__, _d, _ui, c80, uf80)
-	call_fi(__LINE__, _d, _l, c7f, f7f)
-	call_fi(__LINE__, _d, _l, c80, uf80)
-#endif
-	call_f(__LINE__, _f, f7f, f7f)
-	call_f(__LINE__, _d, f7f, f7f)
-	call_ff(__LINE__, _f, _d, f80, f80)
-	call_ff(__LINE__, _d, _f, f81, f81)
-
-	movi %r0 forward
-	callr %r0
-
-	calli iforward
-
-	ret
-	epilog
-
-	name backward
-backward:
-	prolog
-	prepare
-		pushargi bstr
-	finishi @puts
-	ret
-	epilog
-
-	name forward
-forward:
-	prolog
-	prepare
-		pushargi fstr
-	finishi @puts
-	movi %r0 backward
-	callr %r0
-	ret
-	epilog
-
-	name iforward
-iforward:
-	prolog
-	prepare
-		pushargi fstr
-	finishi @puts
-	calli backward
-	ret
-	epilog

+ 0 - 538
bjos/sledge/lightning/check/carg.c

@@ -1,538 +0,0 @@
-#include <lightning.h>
-#include <stdio.h>
-
-/*   Simple test for arguments handling, that also shows how to use
- * arguments to store values.
- *   Register arguments, if available, are very fast, but are also
- * very volatile on some ports, because some ports will do C calls
- * to implement division, remainder, sometimes multiplication, or
- * some float operations.
- *   Arguments in registers should be fetched in the prolog of the
- * function, and if they must be saved, they should be saved in
- * the prolog.
- *   The predicate macro "jit_arg_register_p(arg)" allows knowing if
- * an argument lives in a register, where it is known for being a very
- * fast to read/write temporary storage.
- */
-
-#define W		jit_word_t
-#define F		jit_float32_t
-#define D		jit_float64_t
-
-jit_state_t		 *_jit;
-
-void
-cw(W a1, W  a2, W  a3, W  a4, W  a5, W  a6, W  a7, W  a8,
-   W a9, W a10, W a11, W a12, W a13, W a14, W a15, W a16)
-{
-    if ( a1 !=  1 ||  a2 !=  2 ||  a3 !=  3 ||  a4 !=  4 ||
-	 a5 !=  5 ||  a6 !=  6 ||  a7 !=  7 ||  a8 !=  8 ||
-	 a9 !=  9 || a10 != 10 || a11 != 11 || a12 != 12 ||
-	a13 != 13 || a14 != 14 || a15 != 15 || a16 != 16)
-	abort();
-}
-
-void
-cf(F a1, F  a2, F  a3, F  a4, F  a5, F  a6, F  a7, F  a8,
-   F a9, F a10, F a11, F a12, F a13, F a14, F a15, F a16)
-{
-    if ( a1 !=  1 ||  a2 !=  2 ||  a3 !=  3 ||  a4 !=  4 ||
-	 a5 !=  5 ||  a6 !=  6 ||  a7 !=  7 ||  a8 !=  8 ||
-	 a9 !=  9 || a10 != 10 || a11 != 11 || a12 != 12 ||
-	a13 != 13 || a14 != 14 || a15 != 15 || a16 != 16)
-	abort();
-}
-
-void
-cd(D a1, D  a2, D  a3, D  a4, D  a5, D  a6, D  a7, D  a8,
-   D a9, D a10, D a11, D a12, D a13, D a14, D a15, D a16)
-{
-    if ( a1 !=  1 ||  a2 !=  2 ||  a3 !=  3 ||  a4 !=  4 ||
-	 a5 !=  5 ||  a6 !=  6 ||  a7 !=  7 ||  a8 !=  8 ||
-	 a9 !=  9 || a10 != 10 || a11 != 11 || a12 != 12 ||
-	a13 != 13 || a14 != 14 || a15 != 15 || a16 != 16)
-	abort();
-}
-
-int
-main(int argc, char *argv[])
-{
-    void		(*code)(void);
-    jit_node_t		*jmp, *pass;
-    jit_node_t		 *jw,  *jf,  *jd;
-    jit_int32_t		  s1,   s2,   s3,   s4,   s5,   s6,   s7,   s8,
-			  s9,  s10,  s11,  s12,  s13,  s14,  s15,  s16;
-    jit_node_t		 *a1,  *a2,  *a3,  *a4,  *a5,  *a6,  *a7,  *a8,
-			 *a9, *a10, *a11, *a12, *a13, *a14, *a15, *a16;
-
-    init_jit(argv[0]);
-    _jit = jit_new_state();
-
-    /* jump to "main" label */
-    jmp = jit_jmpi();
-
-    /* Create jit function that
-     * o Receives 16 word arguments
-     * o Save in the stack any register argument. Also force register
-     *   arguments to be clobbered to properly make the test
-     * o Calls a C function that receives 16 word arguments, with
-     *   values different from the ones received by this function
-     * o Reload from stack any register argument
-     * o Validated all arguments were not modified in the known
-     *   cases it could have been clobbered
-     */
-    jw = jit_label();
-    jit_name("jw");
-    jit_note(__FILE__, __LINE__);
-    jit_prolog();
-    a1  = jit_arg();
-    a2  = jit_arg();
-    a3  = jit_arg();
-    a4  = jit_arg();
-    a5  = jit_arg();
-    a6  = jit_arg();
-    a7  = jit_arg();
-    a8  = jit_arg();
-    a9  = jit_arg();
-    a10 = jit_arg();
-    a11 = jit_arg();
-    a12 = jit_arg();
-    a13 = jit_arg();
-    a14 = jit_arg();
-    a15 = jit_arg();
-    a16 = jit_arg();
-#define SAVE_ARG(N)							\
-    do {								\
-	if (jit_arg_register_p(a##N)) {					\
-	    s##N = jit_allocai(sizeof(W));				\
-	    jit_getarg(JIT_R0, a##N);					\
-	    jit_stxi(s##N, JIT_FP, JIT_R0);				\
-	    jit_putargi(-1, a##N);					\
-	}								\
-    } while (0)
-    SAVE_ARG(1);
-    SAVE_ARG(2);
-    SAVE_ARG(3);
-    SAVE_ARG(4);
-    SAVE_ARG(5);
-    SAVE_ARG(6);
-    SAVE_ARG(7);
-    SAVE_ARG(8);
-    SAVE_ARG(9);
-    SAVE_ARG(10);
-    SAVE_ARG(11);
-    SAVE_ARG(12);
-    SAVE_ARG(13);
-    SAVE_ARG(14);
-    SAVE_ARG(15);
-    SAVE_ARG(16);
-#undef SAVE_ARG
-    jit_prepare();
-    {
-	jit_pushargi(1);
-	jit_pushargi(2);
-	jit_pushargi(3);
-	jit_pushargi(4);
-	jit_pushargi(5);
-	jit_pushargi(6);
-	jit_pushargi(7);
-	jit_pushargi(8);
-	jit_pushargi(9);
-	jit_pushargi(10);
-	jit_pushargi(11);
-	jit_pushargi(12);
-	jit_pushargi(13);
-	jit_pushargi(14);
-	jit_pushargi(15);
-	jit_pushargi(16);
-    }
-    jit_finishi(cw);
-#define LOAD_ARG(N)							\
-    do {								\
-	if (jit_arg_register_p(a##N)) {					\
-	    jit_ldxi(JIT_R0, JIT_FP, s##N);				\
-	    jit_putargr(JIT_R0, a##N);					\
-	}								\
-    } while (0)
-    LOAD_ARG(1);
-    LOAD_ARG(2);
-    LOAD_ARG(3);
-    LOAD_ARG(4);
-    LOAD_ARG(5);
-    LOAD_ARG(6);
-    LOAD_ARG(7);
-    LOAD_ARG(8);
-    LOAD_ARG(9);
-    LOAD_ARG(10);
-    LOAD_ARG(11);
-    LOAD_ARG(12);
-    LOAD_ARG(13);
-    LOAD_ARG(14);
-    LOAD_ARG(15);
-    LOAD_ARG(16);
-#undef LOAD_ARG
-    pass = jit_forward();
-#define CHECK_ARG(N)							\
-    do {								\
-	jit_getarg(JIT_R0, a##N);					\
-	jit_patch_at(jit_beqi(JIT_R0, 17 - N), pass);			\
-    } while (0)
-    CHECK_ARG(1);
-    CHECK_ARG(2);
-    CHECK_ARG(3);
-    CHECK_ARG(4);
-    CHECK_ARG(5);
-    CHECK_ARG(6);
-    CHECK_ARG(7);
-    CHECK_ARG(8);
-    CHECK_ARG(9);
-    CHECK_ARG(10);
-    CHECK_ARG(11);
-    CHECK_ARG(12);
-    CHECK_ARG(13);
-    CHECK_ARG(14);
-    CHECK_ARG(15);
-    CHECK_ARG(16);
-#undef CHECK_ARG
-    jit_calli(abort);
-    jit_link(pass);
-    jit_ret();
-    jit_epilog();
-
-    /* Create jit function that
-     * o Receives 16 float arguments
-     * o Save in the stack any register argument. Also force register
-     *   arguments to be clobbered to properly make the test
-     * o Calls a C function that receives 16 float arguments, with
-     *   values different from the ones received by this function
-     * o Reload from stack any register argument
-     * o Validated all arguments were not modified in the known
-     *   cases it could have been clobbered
-     */
-    jf = jit_label();
-    jit_name("jf");
-    jit_note(__FILE__, __LINE__);
-    jit_prolog();
-    a1  = jit_arg_f();
-    a2  = jit_arg_f();
-    a3  = jit_arg_f();
-    a4  = jit_arg_f();
-    a5  = jit_arg_f();
-    a6  = jit_arg_f();
-    a7  = jit_arg_f();
-    a8  = jit_arg_f();
-    a9  = jit_arg_f();
-    a10 = jit_arg_f();
-    a11 = jit_arg_f();
-    a12 = jit_arg_f();
-    a13 = jit_arg_f();
-    a14 = jit_arg_f();
-    a15 = jit_arg_f();
-    a16 = jit_arg_f();
-#define SAVE_ARG(N)							\
-    do {								\
-	if (jit_arg_register_p(a##N)) {					\
-	    s##N = jit_allocai(sizeof(F));				\
-	    jit_getarg_f(JIT_F0, a##N);					\
-	    jit_stxi_f(s##N, JIT_FP, JIT_F0);				\
-	    jit_putargi_f(-1, a##N);					\
-	}								\
-    } while (0)
-    SAVE_ARG(1);
-    SAVE_ARG(2);
-    SAVE_ARG(3);
-    SAVE_ARG(4);
-    SAVE_ARG(5);
-    SAVE_ARG(6);
-    SAVE_ARG(7);
-    SAVE_ARG(8);
-    SAVE_ARG(9);
-    SAVE_ARG(10);
-    SAVE_ARG(11);
-    SAVE_ARG(12);
-    SAVE_ARG(13);
-    SAVE_ARG(14);
-    SAVE_ARG(15);
-    SAVE_ARG(16);
-#undef SAVE_ARG
-    jit_prepare();
-    {
-	jit_pushargi_f(1);
-	jit_pushargi_f(2);
-	jit_pushargi_f(3);
-	jit_pushargi_f(4);
-	jit_pushargi_f(5);
-	jit_pushargi_f(6);
-	jit_pushargi_f(7);
-	jit_pushargi_f(8);
-	jit_pushargi_f(9);
-	jit_pushargi_f(10);
-	jit_pushargi_f(11);
-	jit_pushargi_f(12);
-	jit_pushargi_f(13);
-	jit_pushargi_f(14);
-	jit_pushargi_f(15);
-	jit_pushargi_f(16);
-    }
-    jit_finishi(cf);
-#define LOAD_ARG(N)							\
-    do {								\
-	if (jit_arg_register_p(a##N)) {					\
-	    jit_ldxi_f(JIT_F0, JIT_FP, s##N);				\
-	    jit_putargr_f(JIT_F0, a##N);				\
-	}								\
-    } while (0)
-    LOAD_ARG(1);
-    LOAD_ARG(2);
-    LOAD_ARG(3);
-    LOAD_ARG(4);
-    LOAD_ARG(5);
-    LOAD_ARG(6);
-    LOAD_ARG(7);
-    LOAD_ARG(8);
-    LOAD_ARG(9);
-    LOAD_ARG(10);
-    LOAD_ARG(11);
-    LOAD_ARG(12);
-    LOAD_ARG(13);
-    LOAD_ARG(14);
-    LOAD_ARG(15);
-    LOAD_ARG(16);
-#undef LOAD_ARG
-    pass = jit_forward();
-#define CHECK_ARG(N)							\
-    do {								\
-	jit_getarg_f(JIT_F0, a##N);					\
-	jit_patch_at(jit_beqi_f(JIT_F0, 17 - N), pass);			\
-    } while (0)
-    CHECK_ARG(1);
-    CHECK_ARG(2);
-    CHECK_ARG(3);
-    CHECK_ARG(4);
-    CHECK_ARG(5);
-    CHECK_ARG(6);
-    CHECK_ARG(7);
-    CHECK_ARG(8);
-    CHECK_ARG(9);
-    CHECK_ARG(10);
-    CHECK_ARG(11);
-    CHECK_ARG(12);
-    CHECK_ARG(13);
-    CHECK_ARG(14);
-    CHECK_ARG(15);
-    CHECK_ARG(16);
-#undef CHECK_ARG
-    jit_calli(abort);
-    jit_link(pass);
-    jit_ret();
-    jit_epilog();
-
-    /* Create jit function that
-     * o Receives 16 double arguments
-     * o Save in the stack any register argument. Also force register
-     *   arguments to be clobbered to properly make the test
-     * o Calls a C function that receives 16 double arguments, with
-     *   values different from the ones received by this function
-     * o Reload from stack any register argument
-     * o Validated all arguments were not modified in the known
-     *   cases it could have been clobbered
-     */
-    jd = jit_label();
-    jit_name("jd");
-    jit_note(__FILE__, __LINE__);
-    jit_prolog();
-    a1  = jit_arg_d();
-    a2  = jit_arg_d();
-    a3  = jit_arg_d();
-    a4  = jit_arg_d();
-    a5  = jit_arg_d();
-    a6  = jit_arg_d();
-    a7  = jit_arg_d();
-    a8  = jit_arg_d();
-    a9  = jit_arg_d();
-    a10 = jit_arg_d();
-    a11 = jit_arg_d();
-    a12 = jit_arg_d();
-    a13 = jit_arg_d();
-    a14 = jit_arg_d();
-    a15 = jit_arg_d();
-    a16 = jit_arg_d();
-#define SAVE_ARG(N)							\
-    do {								\
-	if (jit_arg_register_p(a##N)) {					\
-	    s##N = jit_allocai(sizeof(D));				\
-	    jit_getarg_d(JIT_F0, a##N);					\
-	    jit_stxi_d(s##N, JIT_FP, JIT_F0);				\
-	    jit_putargi_d(-1, a##N);					\
-	}								\
-    } while (0)
-    SAVE_ARG(1);
-    SAVE_ARG(2);
-    SAVE_ARG(3);
-    SAVE_ARG(4);
-    SAVE_ARG(5);
-    SAVE_ARG(6);
-    SAVE_ARG(7);
-    SAVE_ARG(8);
-    SAVE_ARG(9);
-    SAVE_ARG(10);
-    SAVE_ARG(11);
-    SAVE_ARG(12);
-    SAVE_ARG(13);
-    SAVE_ARG(14);
-    SAVE_ARG(15);
-    SAVE_ARG(16);
-#undef SAVE_ARG
-    jit_prepare();
-    {
-	jit_pushargi_d(1);
-	jit_pushargi_d(2);
-	jit_pushargi_d(3);
-	jit_pushargi_d(4);
-	jit_pushargi_d(5);
-	jit_pushargi_d(6);
-	jit_pushargi_d(7);
-	jit_pushargi_d(8);
-	jit_pushargi_d(9);
-	jit_pushargi_d(10);
-	jit_pushargi_d(11);
-	jit_pushargi_d(12);
-	jit_pushargi_d(13);
-	jit_pushargi_d(14);
-	jit_pushargi_d(15);
-	jit_pushargi_d(16);
-    }
-    jit_finishi(cd);
-#define LOAD_ARG(N)							\
-    do {								\
-	if (jit_arg_register_p(a##N)) {					\
-	    jit_ldxi_d(JIT_F0, JIT_FP, s##N);				\
-	    jit_putargr_d(JIT_F0, a##N);				\
-	}								\
-    } while (0)
-    LOAD_ARG(1);
-    LOAD_ARG(2);
-    LOAD_ARG(3);
-    LOAD_ARG(4);
-    LOAD_ARG(5);
-    LOAD_ARG(6);
-    LOAD_ARG(7);
-    LOAD_ARG(8);
-    LOAD_ARG(9);
-    LOAD_ARG(10);
-    LOAD_ARG(11);
-    LOAD_ARG(12);
-    LOAD_ARG(13);
-    LOAD_ARG(14);
-    LOAD_ARG(15);
-    LOAD_ARG(16);
-#undef LOAD_ARG
-    pass = jit_forward();
-#define CHECK_ARG(N)							\
-    do {								\
-	jit_getarg_d(JIT_F0, a##N);					\
-	jit_patch_at(jit_beqi_d(JIT_F0, 17 - N), pass);			\
-    } while (0)
-    CHECK_ARG(1);
-    CHECK_ARG(2);
-    CHECK_ARG(3);
-    CHECK_ARG(4);
-    CHECK_ARG(5);
-    CHECK_ARG(6);
-    CHECK_ARG(7);
-    CHECK_ARG(8);
-    CHECK_ARG(9);
-    CHECK_ARG(10);
-    CHECK_ARG(11);
-    CHECK_ARG(12);
-    CHECK_ARG(13);
-    CHECK_ARG(14);
-    CHECK_ARG(15);
-    CHECK_ARG(16);
-#undef CHECK_ARG
-    jit_calli(abort);
-    jit_link(pass);
-    jit_ret();
-    jit_epilog();
-
-    /* Create a jit function that calls the 3 previous ones.
-     * o First call the function that receives 16 word arguments
-     * o Then call the function that receives 16 float arguments
-     * o Finally call the function that receives 16 double arguments
-     */
-    jit_patch(jmp);
-    jit_name("main");
-    jit_note(__FILE__, __LINE__);
-    jit_prolog();
-    jit_prepare();
-    {
-	jit_pushargi(16);
-	jit_pushargi(15);
-	jit_pushargi(14);
-	jit_pushargi(13);
-	jit_pushargi(12);
-	jit_pushargi(11);
-	jit_pushargi(10);
-	jit_pushargi(9);
-	jit_pushargi(8);
-	jit_pushargi(7);
-	jit_pushargi(6);
-	jit_pushargi(5);
-	jit_pushargi(4);
-	jit_pushargi(3);
-	jit_pushargi(2);
-	jit_pushargi(1);
-    }
-    jit_patch_at(jit_finishi(NULL), jw);
-    jit_prepare();
-    {
-	jit_pushargi_f(16);
-	jit_pushargi_f(15);
-	jit_pushargi_f(14);
-	jit_pushargi_f(13);
-	jit_pushargi_f(12);
-	jit_pushargi_f(11);
-	jit_pushargi_f(10);
-	jit_pushargi_f(9);
-	jit_pushargi_f(8);
-	jit_pushargi_f(7);
-	jit_pushargi_f(6);
-	jit_pushargi_f(5);
-	jit_pushargi_f(4);
-	jit_pushargi_f(3);
-	jit_pushargi_f(2);
-	jit_pushargi_f(1);
-    }
-    jit_patch_at(jit_finishi(NULL), jf);
-    jit_prepare();
-    {
-	jit_pushargi_d(16);
-	jit_pushargi_d(15);
-	jit_pushargi_d(14);
-	jit_pushargi_d(13);
-	jit_pushargi_d(12);
-	jit_pushargi_d(11);
-	jit_pushargi_d(10);
-	jit_pushargi_d(9);
-	jit_pushargi_d(8);
-	jit_pushargi_d(7);
-	jit_pushargi_d(6);
-	jit_pushargi_d(5);
-	jit_pushargi_d(4);
-	jit_pushargi_d(3);
-	jit_pushargi_d(2);
-	jit_pushargi_d(1);
-    }
-    jit_patch_at(jit_finishi(NULL), jd);
-    jit_ret();
-    jit_epilog();
-
-    code = jit_emit();
-    jit_clear_state();
-
-    (*code)();
-
-    jit_destroy_state();
-    finish_jit();
-    return (0);
-}

+ 0 - 1
bjos/sledge/lightning/check/carry.ok

@@ -1 +0,0 @@
-ok

+ 0 - 186
bjos/sledge/lightning/check/carry.tst

@@ -1,186 +0,0 @@
-
-#define ix0		0
-#define lx0		0
-#define ix1		1
-#define lx1		1
-#define ix2		2
-#define lx2		2
-#define ix4		4
-#define lx4		4
-#if __WORDSIZE == 32
-#  define ix7fe		0x7ffffffe
-#  define ix7f		0x7fffffff
-#  define ix80		0x80000000
-#  define iff		0xffffffff
-#  define ife		0xfffffffe
-#  define ifd		0xfffffffd
-#  define ifc		0xfffffffc
-#else
-#  define ix7fe		0x7ffffffffffffffe
-#  define ix7f		0x7fffffffffffffff
-#  define ix80		0x8000000000000000
-#  define iff		0xffffffffffffffff
-#  define ife		0xfffffffffffffffe
-#  define ifd		0xfffffffffffffffd
-#  define ifc		0xfffffffffffffffc
-#endif
-
-/* check jumps are taken and result value is correct */
-#define bopr_t(l, u, op, r0, r1, il, ir, iv)			\
-	movi %r0 il						\
-	movi %r1 ir						\
-	b##op##r##u op##u##r##l##r0##r1 %r0 %r1			\
-	/* validate did jump */					\
-	movi %r0 0x5a5a5a5a					\
-op##u##r##l##r0##r1:						\
-	beqi op##u##r##l##ok##r0##r1 %r0 iv			\
-	calli @abort						\
-op##u##r##l##ok##r0##r1:
-#define bopi_t(l, u, op, r0, il, ir, iv)			\
-	movi %r0 il						\
-	b##op##i##u op##u##i##l##r0##r1 %r0 ir			\
-	/* validate did jump */					\
-	movi %r0 0x5a5a5a5a					\
-op##u##i##l##r0##r1:						\
-	beqi op##u##i##l##ok##r0##r1 %r0 iv			\
-	calli @abort						\
-op##u##i##l##ok##r0##r1:
-#define bopr_f(l, u, op, r0, r1, il, ir, iv)			\
-	movi %r0 il						\
-	movi %r1 ir						\
-	b##op##r##u op##u##r##l##r0##r1 %r0 %r1			\
-	beqi op##u##r##l##ok##r0##r1 %r0 iv			\
-op##u##r##l##r0##r1:						\
-	calli @abort						\
-op##u##r##l##ok##r0##r1:
-#define bopi_f(l, u, op, r0, il, ir, iv)			\
-	movi %r0 il						\
-	b##op##i##u op##u##i##l##r0##r1 %r0 ir			\
-	beqi op##u##i##l##ok##r0##r1 %r0 iv			\
-op##u##i##l##r0##r1:						\
-	calli @abort						\
-op##u##i##l##ok##r0##r1:
-#define ccop(cc, l, u, op, r0, r1, il, ir, iv)			\
-	bopr##cc(l, u, op, r0, r1, i##il, i##ir, i##iv)		\
-	bopi##cc(l, u, op, r0, i##il, i##ir, i##iv)
-#define tadd(l, u, r0, r1, il, ir, iv)				\
-	ccop(_t, l, u, oadd, r0, r1, il, ir, iv)		\
-	ccop(_f, l, u, xadd, r0, r1, il, ir, iv)
-#define fadd(l, u, r0, r1, il, ir, iv)				\
-	ccop(_f, l, u, oadd, r0, r1, il, ir, iv)		\
-	ccop(_t, l, u, xadd, r0, r1, il, ir, iv)
-#define tsub(l, u, r0, r1, il, ir, iv)				\
-	ccop(_t, l, u, osub, r0, r1, il, ir, iv)		\
-	ccop(_f, l, u, xsub, r0, r1, il, ir, iv)
-#define fsub(l, u, r0, r1, il, ir, iv)				\
-	ccop(_f, l, u, osub, r0, r1, il, ir, iv)		\
-	ccop(_t, l, u, xsub, r0, r1, il, ir, iv)
-
-#define xopr6(l,op,r0,r1,r2,r3,r4,r5,llo,lhi,rlo,rhi,vlo,vhi)	\
-	movi %r1 llo						\
-	movi %r2 lhi						\
-	movi %r4 rlo						\
-	movi %r5 rhi						\
-	op##cr %r0 %r1 %r4					\
-	op##xr %r3 %r2 %r5					\
-	beqi op##l##L##r0##r1##r2##r3##r4##r5 %r0 vlo		\
-	calli @abort						\
-op##l##L##r0##r1##r2##r3##r4##r5:				\
-	beqi op##l##H##r0##r1##r2##r3##r4##r5 %r3 vhi		\
-	calli @abort						\
-op##l##H##r0##r1##r2##r3##r4##r5:
-#define xopr4_(l,op,r0,r1,r2,r3,llo,lhi,rlo,rhi,vlo,vhi)	\
-	movi %r0 llo						\
-	movi %r1 lhi						\
-	movi %r2 rlo						\
-	movi %r3 rhi						\
-	op##cr %r0 %r0 %r2					\
-	op##xr %r1 %r1 %r3					\
-	beqi op##l##L_##r0##r1##r2##r3 %r0 vlo			\
-	calli @abort						\
-op##l##L_##r0##r1##r2##r3:					\
-	beqi op##l##H_##r0##r1##r2##r3 %r1 vhi			\
-	calli @abort						\
-op##l##H_##r0##r1##r2##r3:
-#define xopr_4(l,op,r0,r1,r2,r3,llo,lhi,rlo,rhi,vlo,vhi)	\
-	movi %r0 rlo						\
-	movi %r1 rhi						\
-	movi %r2 llo						\
-	movi %r3 lhi						\
-	op##cr %r0 %r2 %r0					\
-	op##xr %r1 %r3 %r1					\
-	beqi op##l##_L##r0##r1##r2##r3 %r0 vlo			\
-	calli @abort						\
-op##l##_L##r0##r1##r2##r3:					\
-	beqi op##l##_H##r0##r1##r2##r3 %r1 vhi			\
-	calli @abort						\
-op##l##_H##r0##r1##r2##r3:
-
-#define xaddr(l,llo,lhi,rlo,rhi,vlo,vhi)						\
-	xopr6(l,add,r0,r1,r2,v0,v1,v2,i##llo,i##lhi,i##rlo,i##rhi,i##vlo,i##vhi)	\
-	xopr4_(l,add,r0,r1,r2,v0,i##llo,i##lhi,i##rlo,i##rhi,i##vlo,i##vhi)		\
-	xopr_4(l,add,r0,r1,r2,v0,i##llo,i##lhi,i##rlo,i##rhi,i##vlo,i##vhi)
-#define xsubr(l,llo,lhi,rlo,rhi,vlo,vhi)						\
-	xopr6(l,sub,r0,r1,r2,v0,v1,v2,i##llo,i##lhi,i##rlo,i##rhi,i##vlo,i##vhi)	\
-	xopr4_(l,sub,r0,r1,r2,v0,i##llo,i##lhi,i##rlo,i##rhi,i##vlo,i##vhi)		\
-	xopr_4(l,sub,r0,r1,r2,v0,i##llo,i##lhi,i##rlo,i##rhi,i##vlo,i##vhi)
-
-.data	16
-ok:
-.c	"ok\n"
-
-.code
-	prolog
-
-	tadd(__LINE__,   , r0, r1, x7f,  x1, x80)
-	fadd(__LINE__,   , r0, r1, x7fe, x1, x7f)
-	tsub(__LINE__,   , r0, r1, x80,  x1, x7f)
-	fsub(__LINE__,   , r0, r1, x7f,  x1, x7fe)
-	tadd(__LINE__, _u, r0, r1, ff,   x1, x0)
-	fadd(__LINE__, _u, r0, r1, x7f,  x1, x80)
-	tsub(__LINE__, _u, r0, r1, x0,   x1, ff)
-	fsub(__LINE__, _u, r0, r1, x80,  x1, x7f)
-
-	/* 0xffffffffffffffff + 1 = 0x10000000000000000 */
-	xaddr(__LINE__, ff, ff, x1, x0, x0, x0)
-
-	/* 1 + 0xffffffffffffffff = 0x10000000000000000 */
-	xaddr(__LINE__, x1, x0, ff, ff, x0, x0)
-
-	/* 0xfffffffeffffffff + 1 = 0xffffffff00000000 */
-	xaddr(__LINE__, ff, fe, x1, x0, x0, ff)
-
-	/* 1 + 0xfffffffeffffffff = 0xffffffff00000000 */
-	xaddr(__LINE__, x1, x0, ff, fe, x0, ff)
-
-	/* 0xfffffffefffffffe + 2 = 0xffffffff00000000 */
-	xaddr(__LINE__, fe, fe, x2, x0, x0, ff)
-
-	/* 2 + 0xfffffffefffffffe = 0xffffffff00000000 */
-	xaddr(__LINE__, x2, x0, fe, fe, x0, ff)
-
-	/* 0xffffffffffffffff - 1 = 0xfffffffffffffffe */
-	xsubr(__LINE__, ff, ff, x1, x0, fe, ff)
-
-	/* 1 - 0xffffffffffffffff = -0xfffffffffffffffe */
-	xsubr(__LINE__, x1, x0, ff, ff, x2, x0)
-
-	/* 0xfffffffeffffffff - 1 = 0xfffffffefffffffe */
-	xsubr(__LINE__, ff, fe, x1, x0, fe, fe)
-
-	/* 1 - 0xfffffffeffffffff = -0xfffffffefffffffe */
-	xsubr(__LINE__, x1, x0, ff, fe, x2, x1)
-
-	/* 0xfffffffefffffffe - 2 = 0xfffffffefffffffc */
-	xsubr(__LINE__, fe, fe, x2, x0, fc, fe)
-
-	/* 2 + 0xfffffffefffffffe = -0xfffffffefffffffc */
-	xsubr(__LINE__, x2, x0, fe, fe, x4, x1)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-
-	ret
-	epilog

+ 0 - 903
bjos/sledge/lightning/check/ccall.c

@@ -1,903 +0,0 @@
-#include <lightning.h>
-#include <stdio.h>
-
-#define _w0			0
-#define _w1			1
-#define _w2			(_w1-2)
-#define _w3			(_w2-3)
-#define _w4			(_w3-4)
-#define _w5			(_w4-5)
-#define _w6			(_w5-6)
-#define _w7			(_w6-7)
-#define _w8			(_w7-8)
-#define _w9			(_w8-9)
-#define _w10			(_w9-10)
-#define _w11			(_w10-11)
-#define _w12			(_w11-12)
-#define _w13			(_w12-13)
-#define _w14			(_w13-14)
-#define _w15			(_w14-15)
-#define _c0			_w0
-#define _c1			_w1
-#define _c2			_w2
-#define _c3			_w3
-#define _c4			_w4
-#define _c5			_w5
-#define _c6			_w6
-#define _c7			_w7
-#define _c8			_w8
-#define _c9			_w9
-#define _c10			_w10
-#define _c11			_w11
-#define _c12			_w12
-#define _c13			_w13
-#define _c14			_w14
-#define _c15			_w15
-#define _uc0			(_w0&0xff)
-#define _uc1			(_w1&0xff)
-#define _uc2			(_w2&0xff)
-#define _uc3			(_w3&0xff)
-#define _uc4			(_w4&0xff)
-#define _uc5			(_w5&0xff)
-#define _uc6			(_w6&0xff)
-#define _uc7			(_w7&0xff)
-#define _uc8			(_w8&0xff)
-#define _uc9			(_w9&0xff)
-#define _uc10			(_w10&0xff)
-#define _uc11			(_w11&0xff)
-#define _uc12			(_w12&0xff)
-#define _uc13			(_w13&0xff)
-#define _uc14			(_w14&0xff)
-#define _uc15			(_w15&0xff)
-#define _s0			_w0
-#define _s1			_w1
-#define _s2			_w2
-#define _s3			_w3
-#define _s4			_w4
-#define _s5			_w5
-#define _s6			_w6
-#define _s7			_w7
-#define _s8			_w8
-#define _s9			_w9
-#define _s10			_w10
-#define _s11			_w11
-#define _s12			_w12
-#define _s13			_w13
-#define _s14			_w14
-#define _s15			_w15
-#define _us0			(_w0&0xffff)
-#define _us1			(_w1&0xffff)
-#define _us2			(_w2&0xffff)
-#define _us3			(_w3&0xffff)
-#define _us4			(_w4&0xffff)
-#define _us5			(_w5&0xffff)
-#define _us6			(_w6&0xffff)
-#define _us7			(_w7&0xffff)
-#define _us8			(_w8&0xffff)
-#define _us9			(_w9&0xffff)
-#define _us10			(_w10&0xffff)
-#define _us11			(_w11&0xffff)
-#define _us12			(_w12&0xffff)
-#define _us13			(_w13&0xffff)
-#define _us14			(_w14&0xffff)
-#define _us15			(_w15&0xffff)
-#define _i0			_w0
-#define _i1			_w1
-#define _i2			_w2
-#define _i3			_w3
-#define _i4			_w4
-#define _i5			_w5
-#define _i6			_w6
-#define _i7			_w7
-#define _i8			_w8
-#define _i9			_w9
-#define _i10			_w10
-#define _i11			_w11
-#define _i12			_w12
-#define _i13			_w13
-#define _i14			_w14
-#define _i15			_w15
-#if __WORDSIZE == 64
-#  define _ui0			(_w0&0xffffffff)
-#  define _ui1			(_w1&0xffffffff)
-#  define _ui2			(_w2&0xffffffff)
-#  define _ui3			(_w3&0xffffffff)
-#  define _ui4			(_w4&0xffffffff)
-#  define _ui5			(_w5&0xffffffff)
-#  define _ui6			(_w6&0xffffffff)
-#  define _ui7			(_w7&0xffffffff)
-#  define _ui8			(_w8&0xffffffff)
-#  define _ui9			(_w9&0xffffffff)
-#  define _ui10			(_w10&0xffffffff)
-#  define _ui11			(_w11&0xffffffff)
-#  define _ui12			(_w12&0xffffffff)
-#  define _ui13			(_w13&0xffffffff)
-#  define _ui14			(_w14&0xffffffff)
-#  define _ui15			(_w15&0xffffffff)
-#  define _l0			_w0
-#  define _l1			_w1
-#  define _l2			_w2
-#  define _l3			_w3
-#  define _l4			_w4
-#  define _l5			_w5
-#  define _l6			_w6
-#  define _l7			_w7
-#  define _l8			_w8
-#  define _l9			_w9
-#  define _l10			_w10
-#  define _l11			_w11
-#  define _l12			_w12
-#  define _l13			_w13
-#  define _l14			_w14
-#  define _l15			_w15
-#endif
-
-/*
- * Types
- */
-typedef signed char		_c;
-typedef unsigned char		_uc;
-typedef signed short		_s;
-typedef unsigned short		_us;
-typedef signed int		_i;
-#if __WORDSIZE == 64
-typedef unsigned int		_ui;
-typedef signed long		_l;
-#endif
-typedef float			_f;
-typedef double			_d;
-
-#define prt0(T)			T C##T##0(void);
-#define prt1(T)			prt0(T)					\
-				T C##T##1(T);
-#define prt2(T)			prt1(T)					\
-				T C##T##2(T,T);
-#define prt3(T)			prt2(T)					\
-				T C##T##3(T,T,T);
-#define prt4(T)			prt3(T)					\
-				T C##T##4(T,T,T,T);
-#define prt5(T)			prt4(T)					\
-				T C##T##5(T,T,T,T,T);
-#define prt6(T)			prt5(T)					\
-				T C##T##6(T,T,T,T,T,T);
-#define prt7(T)			prt6(T)					\
-				T C##T##7(T,T,T,T,T,T,T);
-#define prt8(T)			prt7(T)					\
-				T C##T##8(T,T,T,T,T,T,T,T);
-#define prt9(T)			prt8(T)					\
-				T C##T##9(T,T,T,T,T,T,T,T,T);
-#define prt10(T)		prt9(T)					\
-				T C##T##10(T,T,T,T,T,T,T,T,T,T);
-#define prt11(T)		prt10(T)				\
-				T C##T##11(T,T,T,T,T,T,T,T,T,T,T);
-#define prt12(T)		prt11(T)				\
-				T C##T##12(T,T,T,T,T,T,T,T,T,T,T,T);
-#define prt13(T)		prt12(T)				\
-				T C##T##13(T,T,T,T,T,T,T,T,T,T,T,T,T);
-#define prt14(T)		prt13(T)				\
-				T C##T##14(T,T,T,T,T,T,T,T,T,T,T,T,T,T);
-#define prt15(T)		prt14(T)				\
-				T C##T##15(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);
-#define prt(T)			prt15(T)
-prt(_c)
-prt(_uc)
-prt(_s)
-prt(_us)
-prt(_i)
-#if __WORDSIZE == 64
-prt(_ui)
-prt(_l)
-#endif
-prt(_f)
-prt(_d)
-#undef prt
-#undef prt15
-#undef prt14
-#undef prt13
-#undef prt12
-#undef prt11
-#undef prt10
-#undef prt9
-#undef prt8
-#undef prt7
-#undef prt6
-#undef prt5
-#undef prt4
-#undef prt3
-#undef prt2
-#undef prt1
-#undef prt0
-
-#define prtn(N,T)		T J##T##n(void);
-#define prt0(T)			prtn(0,T)
-#define prt1(T)			prt0(T)			prtn(1,T)
-#define prt2(T)			prt1(T)			prtn(2,T)
-#define prt3(T)			prt2(T)			prtn(3,T)
-#define prt4(T)			prt3(T)			prtn(4,T)
-#define prt5(T)			prt4(T)			prtn(5,T)
-#define prt6(T)			prt5(T)			prtn(6,T)
-#define prt7(T)			prt6(T)			prtn(7,T)
-#define prt8(T)			prt7(T)			prtn(8,T)
-#define prt9(T)			prt8(T)			prtn(9,T)
-#define prt10(T)		prt9(T)			prtn(10,T)
-#define prt11(T)		prt10(T)		prtn(11,T)
-#define prt12(T)		prt11(T)		prtn(12,T)
-#define prt13(T)		prt12(T)		prtn(13,T)
-#define prt14(T)		prt13(T)		prtn(14,T)
-#define prt15(T)		prt14(T)		prtn(15,T)
-#define prt(T)			prt15(T)
-prt(_c)
-prt(_uc)
-prt(_s)
-prt(_us)
-prt(_i)
-#if __WORDSIZE == 64
-prt(_ui)
-prt(_l)
-#endif
-prt(_f)
-prt(_d)
-#undef prt
-#undef prt15
-#undef prt14
-#undef prt13
-#undef prt12
-#undef prt11
-#undef prt10
-#undef prt9
-#undef prt8
-#undef prt7
-#undef prt6
-#undef prt5
-#undef prt4
-#undef prt3
-#undef prt2
-#undef prt1
-#undef prt0
-#undef prtn
-
-/*
- * Initialization
- */
-
-#define dat0(T)			T (*j##T##0)(void);			\
-				jit_node_t *n##T##0;
-#define dat1(T)			dat0(T)					\
-				T (*j##T##1)(T);			\
-				jit_node_t *n##T##1;
-#define dat2(T)			dat1(T)					\
-				T (*j##T##2)(T,T);			\
-				jit_node_t *n##T##2;
-#define dat3(T)			dat2(T)					\
-				T (*j##T##3)(T,T,T);			\
-				jit_node_t *n##T##3;
-#define dat4(T)			dat3(T)					\
-				T (*j##T##4)(T,T,T,T);			\
-				jit_node_t *n##T##4;
-#define dat5(T)			dat4(T)					\
-				T (*j##T##5)(T,T,T,T,T);		\
-				jit_node_t *n##T##5;
-#define dat6(T)			dat5(T)					\
-				T (*j##T##6)(T,T,T,T,T,T);		\
-				jit_node_t *n##T##6;
-#define dat7(T)			dat6(T)					\
-				T (*j##T##7)(T,T,T,T,T,T,T);		\
-				jit_node_t *n##T##7;
-#define dat8(T)			dat7(T)					\
-				T (*j##T##8)(T,T,T,T,T,T,T,T);		\
-				jit_node_t *n##T##8;
-#define dat9(T)			dat8(T)					\
-				T (*j##T##9)(T,T,T,T,T,T,T,T,T);	\
-				jit_node_t *n##T##9;
-#define dat10(T)		dat9(T)					\
-				T (*j##T##10)(T,T,T,T,T,T,T,T,T,T);	\
-				jit_node_t *n##T##10;
-#define dat11(T)		dat10(T)				\
-				T (*j##T##11)(T,T,T,T,T,T,T,T,T,T,T);	\
-				jit_node_t *n##T##11;
-#define dat12(T)		dat11(T)				\
-				T (*j##T##12)(T,T,T,T,T,T,T,T,T,T,T,T);	\
-				jit_node_t *n##T##12;
-#define dat13(T)		dat12(T)				\
-				T (*j##T##13)(T,T,T,T,T,T,T,T,T,T,T,T,T);\
-				jit_node_t *n##T##13;
-#define dat14(T)		dat13(T)				\
-				T (*j##T##14)(T,T,T,T,T,T,T,T,T,T,T,T,T,T);\
-				jit_node_t *n##T##14;
-#define dat15(T)		dat14(T)				\
-				T (*j##T##15)(T,T,T,T,T,T,T,T,T,T,T,T,T,T,T);\
-				jit_node_t *n##T##15;
-#define dat(T)			dat15(T)
-dat(_c)
-dat(_uc)
-dat(_s)
-dat(_us)
-dat(_i)
-#if __WORDSIZE == 64
-dat(_ui)
-dat(_l)
-#endif
-dat(_f)
-dat(_d)
-#undef dat
-#undef dat15
-#undef dat14
-#undef dat13
-#undef dat12
-#undef dat11
-#undef dat10
-#undef dat9
-#undef dat8
-#undef dat7
-#undef dat6
-#undef dat5
-#undef dat4
-#undef dat3
-#undef dat2
-#undef dat1
-#undef dat0
-
-/*
- * Implementation
- */
-#define dcl0(T)								\
-T C##T##0(void)								\
-{									\
-    return (0);								\
-}
-#define dcl1(T)								\
-dcl0(T)									\
-T C##T##1(T A)								\
-{									\
-    return (A);								\
-}
-#define dcl2(T)								\
-dcl1(T)									\
-T C##T##2(T A,T B)							\
-{									\
-    return (A-B);							\
-}
-#define dcl3(T)								\
-dcl2(T)									\
-T C##T##3(T A,T B,T C)							\
-{									\
-    return (A-B-C);							\
-}
-#define dcl4(T)								\
-dcl3(T)									\
-T C##T##4(T A,T B,T C,T D)						\
-{									\
-    return (A-B-C-D);							\
-}
-#define dcl5(T)								\
-dcl4(T)									\
-T C##T##5(T A,T B,T C,T D,T E)						\
-{									\
-    return (A-B-C-D-E);							\
-}
-#define dcl6(T)								\
-dcl5(T)									\
-T C##T##6(T A,T B,T C,T D,T E,T F)					\
-{									\
-    return (A-B-C-D-E-F);						\
-}
-#define dcl7(T)								\
-dcl6(T)									\
-T C##T##7(T A,T B,T C,T D,T E,T F,T G)					\
-{									\
-    return (A-B-C-D-E-F-G);						\
-}
-#define dcl8(T)								\
-dcl7(T)									\
-T C##T##8(T A,T B,T C,T D,T E,T F,T G,T H)				\
-{									\
-    return (A-B-C-D-E-F-G-H);						\
-}
-#define dcl9(T)								\
-dcl8(T)									\
-T C##T##9(T A,T B,T C,T D,T E,T F,T G,T H,T I)				\
-{									\
-    return (A-B-C-D-E-F-G-H-I);						\
-}
-#define dcl10(T)							\
-dcl9(T)									\
-T C##T##10(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J)			\
-{									\
-    return (A-B-C-D-E-F-G-H-I-J);					\
-}
-#define dcl11(T)							\
-dcl10(T)								\
-T C##T##11(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K)			\
-{									\
-    return (A-B-C-D-E-F-G-H-I-J-K);					\
-}
-#define dcl12(T)							\
-dcl11(T)								\
-T C##T##12(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L)		\
-{									\
-    return (A-B-C-D-E-F-G-H-I-J-K-L);					\
-}
-#define dcl13(T)							\
-dcl12(T)								\
-T C##T##13(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L,T M)		\
-{									\
-    return (A-B-C-D-E-F-G-H-I-J-K-L-M);					\
-}
-#define dcl14(T)							\
-dcl13(T)								\
-T C##T##14(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L,T M,T N)	\
-{									\
-    return (A-B-C-D-E-F-G-H-I-J-K-L-M-N);				\
-}
-#define dcl15(T)							\
-dcl14(T)								\
-T C##T##15(T A,T B,T C,T D,T E,T F,T G,T H,T I,T J,T K,T L,T M,T N,T O)	\
-{									\
-    return (A-B-C-D-E-F-G-H-I-J-K-L-M-N-O);				\
-}
-#define dcl(T)	dcl15(T)
-dcl(_c)
-dcl(_uc)
-dcl(_s)
-dcl(_us)
-dcl(_i)
-#if __WORDSIZE == 64
-dcl(_ui)
-dcl(_l)
-#endif
-dcl(_f)
-dcl(_d)
-#undef dcl
-#undef dcl15
-#undef dcl14
-#undef dcl13
-#undef dcl12
-#undef dcl11
-#undef dcl10
-#undef dcl9
-#undef dcl8
-#undef dcl7
-#undef dcl6
-#undef dcl5
-#undef dcl4
-#undef dcl3
-#undef dcl2
-#undef dcl1
-#undef dcl0
-
-#define dcl0(T)								\
-T CJ##T##0(void)							\
-{									\
-    return ((*j##T##0)());						\
-}
-#define dcl1(T)								\
-dcl0(T)									\
-T CJ##T##1(void)							\
-{									\
-    return ((*j##T##1)(1));						\
-}
-#define dcl2(T)								\
-dcl1(T)									\
-T CJ##T##2(void)							\
-{									\
-    return ((*j##T##2)(1,2));						\
-}
-#define dcl3(T)								\
-dcl2(T)									\
-T CJ##T##3(void)							\
-{									\
-    return ((*j##T##3)(1,2,3));						\
-}
-#define dcl4(T)								\
-dcl3(T)									\
-T CJ##T##4(void)							\
-{									\
-    return ((*j##T##4)(1,2,3,4));					\
-}
-#define dcl5(T)								\
-dcl4(T)									\
-T CJ##T##5(void)							\
-{									\
-    return ((*j##T##5)(1,2,3,4,5));					\
-}
-#define dcl6(T)								\
-dcl5(T)									\
-T CJ##T##6(void)							\
-{									\
-    return ((*j##T##6)(1,2,3,4,5,6));					\
-}
-#define dcl7(T)								\
-dcl6(T)									\
-T CJ##T##7(void)							\
-{									\
-    return ((*j##T##7)(1,2,3,4,5,6,7));					\
-}
-#define dcl8(T)								\
-dcl7(T)									\
-T CJ##T##8(void)							\
-{									\
-    return ((*j##T##8)(1,2,3,4,5,6,7,8));				\
-}
-#define dcl9(T)								\
-dcl8(T)									\
-T CJ##T##9(void)							\
-{									\
-    return ((*j##T##9)(1,2,3,4,5,6,7,8,9));				\
-}
-#define dcl10(T)							\
-dcl9(T)									\
-T CJ##T##10(void)							\
-{									\
-    return ((*j##T##10)(1,2,3,4,5,6,7,8,9,10));				\
-}
-#define dcl11(T)							\
-dcl10(T)								\
-T CJ##T##11(void)							\
-{									\
-    return ((*j##T##11)(1,2,3,4,5,6,7,8,9,10,11));			\
-}
-#define dcl12(T)							\
-dcl11(T)								\
-T CJ##T##12(void)							\
-{									\
-    return ((*j##T##12)(1,2,3,4,5,6,7,8,9,10,11,12));			\
-}
-#define dcl13(T)							\
-dcl12(T)								\
-T CJ##T##13(void)							\
-{									\
-    return ((*j##T##13)(1,2,3,4,5,6,7,8,9,10,11,12,13));		\
-}
-#define dcl14(T)							\
-dcl13(T)								\
-T CJ##T##14(void)							\
-{									\
-    return ((*j##T##14)(1,2,3,4,5,6,7,8,9,10,11,12,13,14));		\
-}
-#define dcl15(T)							\
-dcl14(T)								\
-T CJ##T##15(void)							\
-{									\
-    return ((*j##T##15)(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15));		\
-}
-#define dcl(t)	dcl15(t)
-dcl(_c)
-dcl(_uc)
-dcl(_s)
-dcl(_us)
-dcl(_i)
-#if __WORDSIZE == 64
-dcl(_ui)
-dcl(_l)
-#endif
-dcl(_f)
-dcl(_d)
-#undef dcl
-#undef dcl15
-#undef dcl14
-#undef dcl13
-#undef dcl12
-#undef dcl11
-#undef dcl10
-#undef dcl9
-#undef dcl8
-#undef dcl7
-#undef dcl6
-#undef dcl5
-#undef dcl4
-#undef dcl3
-#undef dcl2
-#undef dcl1
-#undef dcl0
-
-int
-main(int argc, char *argv[])
-{
-    jit_state_t		 *_jit;
-    jit_node_t		 *jmpi_main;
-    void		(*function)(void);
-    jit_node_t		 *a1,*a2,*a3,*a4,*a5,*a6,*a7,*a8,*a9;
-    jit_node_t		 *a10,*a11,*a12,*a13,*a14,*a15;
-    jit_node_t		 *jmp;
-
-    init_jit(argv[0]);
-    _jit = jit_new_state();
-
-    jmpi_main = jit_jmpi();
-
-
-#define arg0(T)			/**/
-#define arg1(T)						a1 = jit_arg##T();
-#define arg2(T)			arg1(T)			a2 = jit_arg##T();
-#define arg3(T)			arg2(T)			a3 = jit_arg##T();
-#define arg4(T)			arg3(T)			a4 = jit_arg##T();
-#define arg5(T)			arg4(T)			a5 = jit_arg##T();
-#define arg6(T)			arg5(T)			a6 = jit_arg##T();
-#define arg7(T)			arg6(T)			a7 = jit_arg##T();
-#define arg8(T)			arg7(T)			a8 = jit_arg##T();
-#define arg9(T)			arg8(T)			a9 = jit_arg##T();
-#define arg10(T)		arg9(T)			a10 = jit_arg##T();
-#define arg11(T)		arg10(T)		a11 = jit_arg##T();
-#define arg12(T)		arg11(T)		a12 = jit_arg##T();
-#define arg13(T)		arg12(T)		a13 = jit_arg##T();
-#define arg14(T)		arg13(T)		a14 = jit_arg##T();
-#define arg15(T)		arg14(T)		a15 = jit_arg##T();
-
-#define get0(B,T,R)		jit_movi##B(R##0,0);
-#define get1(B,T,R)		jit_getarg##B(R##0,a##1);
-#define get2(B,T,R)							\
-	get1(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##2);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get3(B,T,R)							\
-	get2(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##3);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get4(B,T,R)							\
-	get3(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##4);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get5(B,T,R)							\
-	get4(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##5);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get6(B,T,R)							\
-	get5(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##6);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get7(B,T,R)							\
-	get6(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##7);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get8(B,T,R)							\
-	get7(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##8);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get9(B,T,R)							\
-	get8(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##9);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get10(B,T,R)							\
-	get9(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##10);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get11(B,T,R)							\
-	get10(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##11);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get12(B,T,R)							\
-	get11(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##12);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get13(B,T,R)							\
-	get12(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##13);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get14(B,T,R)							\
-	get13(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##14);					\
-	jit_subr##B(R##0, R##1, R##0);
-#define get15(B,T,R)							\
-	get14(B,T,R);							\
-	jit_movr##B(R##1, R##0);					\
-	jit_getarg##T(R##0, a##15);					\
-	jit_subr##B(R##0, R##1, R##0);
-
-#if __WORDSIZE == 32
-#  define jit_extr_i(u, v)			/**/
-#else
-#  define jit_extr_l(u, v)			/**/
-#endif
-
-#define strfy(n)				#n
-#define defi(T, N)							\
-    n##T##N = jit_name(strfy(n##T##N));					\
-    jit_note("ccall.c", __LINE__);					\
-    jit_prolog();							\
-    arg##N();								\
-    get##N(,T,JIT_R)							\
-    jit_extr##T(JIT_R0, JIT_R0);					\
-    jit_retr(JIT_R0);							\
-    jit_epilog();
-#define deff(T, N)							\
-    n##T##N = jit_name(strfy(n##T##N));					\
-    jit_note("ccall.c", __LINE__);					\
-    jit_prolog();							\
-    arg##N(T);								\
-    get##N(T,T,JIT_F);							\
-    jit_retr##T(JIT_F0);						\
-    jit_epilog();
-
-#define  def0(X, T)				def##X(T, 0)
-#define  def1(X, T)	def0(X, T)		def##X(T, 1)
-#define  def2(X, T)	def1(X, T)		def##X(T, 2)
-#define  def3(X, T)	def2(X, T)		def##X(T, 3)
-#define  def4(X, T)	def3(X, T)		def##X(T, 4)
-#define  def5(X, T)	def4(X, T)		def##X(T, 5)
-#define  def6(X, T)	def5(X, T)		def##X(T, 6)
-#define  def7(X, T)	def6(X, T)		def##X(T, 7)
-#define  def8(X, T)	def7(X, T)		def##X(T, 8)
-#define  def9(X, T)	def8(X, T)		def##X(T, 9)
-#define def10(X, T)	def9(X, T)		def##X(T, 10)
-#define def11(X, T)	def10(X, T)		def##X(T, 11)
-#define def12(X, T)	def11(X, T)		def##X(T, 12)
-#define def13(X, T)	def12(X, T)		def##X(T, 13)
-#define def14(X, T)	def13(X, T)		def##X(T, 14)
-#define def15(X, T)	def14(X, T)		def##X(T, 15)
-#define def(T)		def15(i, T)
-	def(_c)
-	def(_uc)
-	def(_s)
-	def(_us)
-	def(_i)
-#if __WORDSIZE == 64
-	def(_ui)
-	def(_l)
-#endif
-#undef def
-#define def(T)		def15(f, T)
-	def(_f)
-	def(_d)
-#undef def
-
-    jit_patch(jmpi_main);
-    jit_name("main");
-    jit_note("ccall.c", __LINE__);
-    jit_prolog();
-
-#define  push0(T)	/**/
-#define  push1(T)				jit_pushargi##T(1);
-#define  push2(T)	push1(T)		jit_pushargi##T(2);
-#define  push3(T)	push2(T)		jit_pushargi##T(3);
-#define  push4(T)	push3(T)		jit_pushargi##T(4);
-#define  push5(T)	push4(T)		jit_pushargi##T(5);
-#define  push6(T)	push5(T)		jit_pushargi##T(6);
-#define  push7(T)	push6(T)		jit_pushargi##T(7);
-#define  push8(T)	push7(T)		jit_pushargi##T(8);
-#define  push9(T)	push8(T)		jit_pushargi##T(9);
-#define  push10(T)	push9(T)		jit_pushargi##T(10);
-#define  push11(T)	push10(T)		jit_pushargi##T(11);
-#define  push12(T)	push11(T)		jit_pushargi##T(12);
-#define  push13(T)	push12(T)		jit_pushargi##T(13);
-#define  push14(T)	push13(T)		jit_pushargi##T(14);
-#define  push15(T)	push14(T)		jit_pushargi##T(15);
-
-#define calin(T,N)							\
-	jit_prepare();							\
-		push##N()						\
-	jit_finishi(C##T##N);						\
-	jit_retval##T(JIT_R0);						\
-	jmp = jit_beqi(JIT_R0, T##N);					\
-	jit_calli(abort);						\
-	jit_patch(jmp);
-#define calfn(T,N)							\
-	jit_prepare();							\
-		push##N(T)						\
-	jit_finishi(C##T##N);						\
-	jit_retval##T(JIT_F0);						\
-	jmp = jit_beqi##T(JIT_F0, _w##N);				\
-	jit_calli(abort);						\
-	jit_patch(jmp);
-#define  calx0(X,T)				cal##X##n(T,0)
-#define  calx1(X,T)	calx0(X,T)		cal##X##n(T,1)
-#define  calx2(X,T)	calx1(X,T)		cal##X##n(T,2)
-#define  calx3(X,T)	calx2(X,T)		cal##X##n(T,3)
-#define  calx4(X,T)	calx3(X,T)		cal##X##n(T,4)
-#define  calx5(X,T)	calx4(X,T)		cal##X##n(T,5)
-#define  calx6(X,T)	calx5(X,T)		cal##X##n(T,6)
-#define  calx7(X,T)	calx6(X,T)		cal##X##n(T,7)
-#define  calx8(X,T)	calx7(X,T)		cal##X##n(T,8)
-#define  calx9(X,T)	calx8(X,T)		cal##X##n(T,9)
-#define calx10(X,T)	calx9(X,T)		cal##X##n(T,10)
-#define calx11(X,T)	calx10(X,T)		cal##X##n(T,11)
-#define calx12(X,T)	calx11(X,T)		cal##X##n(T,12)
-#define calx13(X,T)	calx12(X,T)		cal##X##n(T,13)
-#define calx14(X,T)	calx13(X,T)		cal##X##n(T,14)
-#define calx15(X,T)	calx14(X,T)		cal##X##n(T,15)
-#define cali(T)		calx15(i,T)
-#define calf(T)		calx15(f,T)
-
-    cali(_c)
-    cali(_uc)
-    cali(_s)
-    cali(_us)
-    cali(_i)
-#if __WORDSIZE == 64
-    cali(_ui)
-    cali(_l)
-#endif
-    calf(_f)
-    calf(_d)
-
-#undef calin
-#undef calfn
-#define calin(T,N)							\
-	jit_prepare();							\
-		push##N()						\
-	jit_finishi(CJ##T##N);						\
-	jit_retval##T(JIT_R0);						\
-	jmp = jit_beqi(JIT_R0, T##N);					\
-	jit_calli(abort);						\
-	jit_patch(jmp);
-#define calfn(T,N)							\
-	jit_prepare();							\
-		push##N(T)						\
-	jit_finishi(CJ##T##N);						\
-	jit_retval##T(JIT_F0);						\
-	jmp = jit_beqi##T(JIT_F0, _w##N);				\
-	jit_calli(abort);						\
-	jit_patch(jmp);
-    cali(_c)
-    cali(_uc)
-    cali(_s)
-    cali(_us)
-    cali(_i)
-#if __WORDSIZE == 64
-    cali(_ui)
-    cali(_l)
-#endif
-    calf(_f)
-    calf(_d)
-
-    jit_ret();
-
-    function = jit_emit();
-
-#define initn(T,N)	j##T##N = jit_address(n##T##N);
-#define init0(T)			initn(T,0)
-#define init1(T)	 init0(T)	initn(T,1)
-#define init2(T)	 init1(T)	initn(T,2)
-#define init3(T)	 init2(T)	initn(T,3)
-#define init4(T)	 init3(T)	initn(T,4)
-#define init5(T)	 init4(T)	initn(T,5)
-#define init6(T)	 init5(T)	initn(T,6)
-#define init7(T)	 init6(T)	initn(T,7)
-#define init8(T)	 init7(T)	initn(T,8)
-#define init9(T)	 init8(T)	initn(T,9)
-#define init10(T)	 init9(T)	initn(T,10)
-#define init11(T)	init10(T)	initn(T,11)
-#define init12(T)	init11(T)	initn(T,12)
-#define init13(T)	init12(T)	initn(T,13)
-#define init14(T)	init13(T)	initn(T,14)
-#define init15(T)	init14(T)	initn(T,15)
-#define init(T)		init15(T)
-    init(_c)
-    init(_uc)
-    init(_s)
-    init(_us)
-    init(_i)
-#if __WORDSIZE == 64
-    init(_ui)
-    init(_l)
-#endif
-    init(_f)
-    init(_d)
-
-#if 0
-    jit_print();
-    jit_disassemble();
-#endif
-
-    jit_clear_state();
-    (*function)();
-    jit_destroy_state();
-
-    finish_jit();
-
-    printf("ok\n");
-
-    return (0);
-}

+ 0 - 15
bjos/sledge/lightning/check/check.arm.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.arm$||'`
-./lightning -mthumb=0 $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.arm.swf.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.arm\.swf$||'`
-./lightning -mthumb=0 -mvfp=0 $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.arm4.swf.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.arm4\.swf$||'`
-./lightning -mcpu=4 -mthumb=0 -mvfp=0 $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.nodata.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.nodata$||'`
-./lightning -d $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0`
-./lightning $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.swf.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.swf$||'`
-./lightning -mvfp=0 $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.x87.nodata.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.x87.nodata$||'`
-./lightning -data=0 -mx87=1 $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 15
bjos/sledge/lightning/check/check.x87.sh

@@ -1,15 +0,0 @@
-#!/bin/sh
-test=`basename $0 | sed -e 's|\.x87$||'`
-./lightning -mx87=1 $srcdir/$test.tst | tr -d \\r > $test.out
-if test $? != 0; then
-  exit $?
-fi
-
-cmp -s $srcdir/$test.ok $test.out
-result=$?
-if test $result != 0; then
-    diff $srcdir/$test.ok $test.out
-    rm $test.out
-    exit 1
-fi
-rm $test.out

+ 0 - 1
bjos/sledge/lightning/check/clobber.ok

@@ -1 +0,0 @@
-ok

+ 0 - 1050
bjos/sledge/lightning/check/clobber.tst

@@ -1,1050 +0,0 @@
-/* do not bother about result of operations, only ensure valid arguments
- * and that registers not modified by the operation are not clobbered  */
-
-#define IV0		0x10000
-#define IV1		0x10001
-#define IV2		0x10002
-#define IV3		0x10003
-#define IV4		0x10004
-#define IV5		0x10005
-#define FV0		100.0
-#define FV1		101.0
-#define FV2		102.0
-#define FV3		103.0
-#define FV4		104.0
-#define FV5		105.0
-#define IR0		r0
-#define IR1		r1
-#define IR2		r2
-#define IR3		v0
-#define IR4		v1
-#define IR5		v2
-#define FR0		f0
-#define FR1		f1
-#define FR2		f2
-#define FR3		f3
-#define FR4		f4
-#define FR5		f5
-
-#define setup()							\
-	movi %r0 IV0						\
-	movi %r1 IV1						\
-	movi %r2 IV2						\
-	movi %v0 IV3						\
-	movi %v1 IV4						\
-	movi %v2 IV5
-#define setup_f()						\
-	movi_f %f0 FV0						\
-	movi_f %f1 FV1						\
-	movi_f %f2 FV2						\
-	movi_f %f3 FV3						\
-	movi_f %f4 FV4						\
-	movi_f %f5 FV5
-#define setup_d()						\
-	movi_d %f0 FV0						\
-	movi_d %f1 FV1						\
-	movi_d %f2 FV2						\
-	movi_d %f3 FV3						\
-	movi_d %f4 FV4						\
-	movi_d %f5 FV5
-
-#define check(label, rn)					\
-	beqi label %IR##rn IV##rn				\
-	calli @abort						\
-label:
-#define check1(k, l, i0)					\
-	check(k##l##i0##_0, i0)
-#define check2(k, l, i0, i1)					\
-	check(k##l##i0##i1##_0, i0)				\
-	check(k##l##i0##i1##_1, i1)
-#define check3(k, l, i0, i1, i2)				\
-	check(k##l##i0##i1##i2##_0, i0)				\
-	check(k##l##i0##i1##i2##_1, i1)				\
-	check(k##l##i0##i1##i2##_2, i2)
-#define check4(k, l, i0, i1, i2, i3)				\
-	check(k##l##i0##i1##i2##i3##_0, i0)			\
-	check(k##l##i0##i1##i2##i3##_1, i1)			\
-	check(k##l##i0##i1##i2##i3##_2, i2)			\
-	check(k##l##i0##i1##i2##i3##_3, i3)
-#define check5(k, l, i0, i1, i2, i3, i4)			\
-	check(k##l##i0##i1##i2##i3##i4##_0, i0)			\
-	check(k##l##i0##i1##i2##i3##i4##_1, i1)			\
-	check(k##l##i0##i1##i2##i3##i3##_2, i2)			\
-	check(k##l##i0##i1##i2##i3##i4##_3, i3)			\
-	check(k##l##i0##i1##i2##i3##i4##_4, i4)
-#define check6(k, l, i0, i1, i2, i3, i4, i5)			\
-	check(k##l##i0##i1##i2##i3##i4##i5##_0, i0)		\
-	check(k##l##i0##i1##i2##i3##i4##i5##_1, i1)		\
-	check(k##l##i0##i1##i2##i3##i3##i5##_2, i2)		\
-	check(k##l##i0##i1##i2##i3##i4##i5##_3, i3)		\
-	check(k##l##i0##i1##i2##i3##i4##i5##_4, i4)		\
-	check(k##l##i0##i1##i2##i3##i4##i5##_5, i5)
-
-#define checkf(f, label, rn)					\
-	beqi##f label %FR##rn FV##rn				\
-	calli @abort						\
-label:
-#define checkf1(f, k, l, i0)					\
-	checkf(f, f##k##l##i0##_0, i0)
-#define checkf2(f, k, l, i0, i1)				\
-	checkf(f, f##k##l##i0##i1##_0, i0)			\
-	checkf(f, f##k##l##i0##i1##_1, i1)
-#define checkf3(f, k, l, i0, i1, i2)				\
-	checkf(f, f##k##l##i0##i1##i2##_0, i0)			\
-	checkf(f, f##k##l##i0##i1##i2##_1, i1)			\
-	checkf(f, f##k##l##i0##i1##i2##_2, i2)
-#define checkf4(f, k, l, i0, i1, i2, i3)			\
-	checkf(f, f##k##l##i0##i1##i2##i3##_0, i0)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##_1, i1)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##_2, i2)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##_3, i3)
-#define checkf5(f, k, l, i0, i1, i2, i3, i4)			\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##_0, i0)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##_1, i1)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##i3##_2, i2)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##_3, i3)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##_4, i4)
-#define checkf6(f, k, l, i0, i1, i2, i3, i4, i5)		\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##i5##_0, i0)	\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##i5##_1, i1)	\
-	checkf(f, f##k##l##i0##i1##i2##i3##i3##i5##_2, i2)	\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##i5##_3, i3)	\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##i5##_4, i4)	\
-	checkf(f, f##k##l##i0##i1##i2##i3##i4##i5##_5, i5)
-
-#define alui(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##i %IR##i1 %IR##i0 1					\
-	check4(i, l, i2, i3, i4, i5)
-#define aluic(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##i %IR##i0 %IR##i0 1					\
-	check5(ic, l, i1, i2, i3, i4, i5)
-#define alur(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##r %IR##i2 %IR##i0 %IR##i1				\
-	check3(r, l, i3, i4, i5)
-#define alurc0(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##r %IR##i0 %IR##i0 %IR##i1				\
-	check4(r0, l, i2, i3, i4, i5)
-#define alurc1(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##r %IR##i1 %IR##i0 %IR##i1				\
-	check4(r1, l, i2, i3, i4, i5)
-#define alurc2(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##r %IR##i0 %IR##i0 %IR##i0				\
-	check5(r2, l, i1, i2, i3, i4, i5)
-#define   xalu(l, op, i0, i1, i2, i3, i4, i5)			\
-	  alui(l, op, i0, i1,	i2, i3, i4, i5)			\
-	 aluic(l, op, i0,		i1, i2, i3, i4, i5)	\
-	  alur(l, op, i0, i1, i2,	i3, i4, i5)		\
-	alurc0(l, op, i0, i1,	i2, i3, i4, i5)			\
-	alurc1(l, op, i0, i1,	i2, i3, i4, i5)			\
-	alurc2(l, op, i0,		i1, i2, i3, i4, i5)
-
-#if __ia64__
-#  define alu(l, op)						\
-	 xalu(l, op, 0, 1, 2, 3, 4, 5)
-#else
-#  define alu(l, op)						\
-	 xalu(l, op, 0, 1, 2, 3, 4, 5)				\
-	 xalu(l, op, 1, 2, 3, 4, 5, 0)				\
-	 xalu(l, op, 2, 3, 4, 5, 0, 1)				\
-	 xalu(l, op, 3, 4, 5, 0, 1, 2)				\
-	 xalu(l, op, 4, 5, 0, 1, 2, 3)				\
-	 xalu(l, op, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define fopi(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	op##i##f %FR##f1 %FR##f0 1.0				\
-	checkf4(f, i, l, f2, f3, f4, f5)
-#define fopic(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	op##i##f %FR##f0 %FR##f0 1.0				\
-	checkf5(f, ic, l, f1, f2, f3, f4, f5)
-#define fopr(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	movi##f %FR##f1 1.0					\
-	op##r##f %FR##f2 %FR##f0 %FR##f1			\
-	checkf3(f, r, l, f3, f4, f5)
-#define foprc0(f, l, op, f0, f1, f2, f3, f4, f5)		\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	movi##f %FR##f1 1.0					\
-	op##r##f %FR##f0 %FR##f0 %FR##f1			\
-	checkf4(f, r0, l, f2, f3, f4, f5)
-#define foprc1(f, l, op, f0, f1, f2, f3, f4, f5)		\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	movi##f %FR##f1 1.0					\
-	op##r##f %FR##f1 %FR##f0 %FR##f1			\
-	checkf4(f, r1, l, f2, f3, f4, f5)
-#define foprc2(f, l, op, f0, f1, f2, f3, f4, f5)		\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	op##r##f %FR##f0 %FR##f0 %FR##f0			\
-	checkf5(f, r2, l, f1, f2, f3, f4, f5)
-#define   xfop(f, l, op, f0, f1, f2, f3, f4, f5)		\
-	  fopi(f, l, op, f0, f1, f2,		f3, f4, f5)	\
-	 fopic(f, l, op, f0, f1, f2,		f3, f4, f5)	\
-	  fopr(f, l, op, f0, f1, f2,		f3, f4, f5)	\
-	foprc0(f, l, op, f0, f1,		f2, f3, f4, f5)	\
-	foprc1(f, l, op, f0, f1,		f2, f3, f4, f5)	\
-	foprc2(f, l, op, f0, f1,		f2, f3, f4, f5)
-#if __ia64__
-#  define xxfop(l, op, f, f0, f1, f2, f3, f4, f5)		\
-	   xfop(_f, l, op, f0, f1, f2, f3, f4, f5)
-#else
-#  define xxfop(l, op, f, f0, f1, f2, f3, f4, f5)		\
-	   xfop(_f, l, op, f0, f1, f2, f3, f4, f5)		\
-	   xfop(_d, l, op, f0, f1, f2, f3, f4, f5)
-#endif
-#if __ia64__
-#  define fop(l, op)						\
-	xxfop(l, op, f, 0, 1, 2, 3, 4, 5)
-#else
-#  define fop(l, op)						\
-	xxfop(l, op, f, 0, 1, 2, 3, 4, 5)			\
-	xxfop(l, op, f, 1, 2, 3, 4, 5, 0)			\
-	xxfop(l, op, f, 2, 3, 4, 5, 0, 1)			\
-	xxfop(l, op, f, 3, 4, 5, 0, 1, 2)			\
-	xxfop(l, op, f, 4, 5, 0, 1, 2, 3)			\
-	xxfop(l, op, f, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define aluxii(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##ci %IR##i1 %IR##i0 1				\
-	op##xi %IR##i2 %IR##i0 1				\
-	check3(ii, l, i3, i4, i5)
-#define aluxir(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##ci %IR##i1 %IR##i0 1				\
-	op##xr %IR##i2 %IR##i0 %IR##i1				\
-	check3(ir, l, i3, i4, i5)
-#define aluxri(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##cr %IR##i2 %IR##i0 %IR##i1				\
-	op##xi %IR##i0 %IR##i1 1				\
-	check3(ri, l, i3, i4, i5)
-#define aluxrr(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##cr %IR##i2 %IR##i0 %IR##i1				\
-	op##xr %IR##i2 %IR##i0 %IR##i1				\
-	check3(rr, l, i3, i4, i5)
-#define  xalux(l, op, i0, i1, i2, i3, i4, i5)			\
-	aluxii(l, op, i0, i1, i2,	i3, i4, i5)		\
-	aluxir(l, op, i0, i1, i2,	i3, i4, i5)		\
-	aluxri(l, op, i0, i1, i2,	i3, i4, i5)		\
-	aluxrr(l, op, i0, i1, i2,	i3, i4, i5)
-#if __ia64__
-#  define alux(l, op)						\
-	 xalux(l, op, 0, 1, 2, 3, 4, 5)
-#else
-#  define alux(l, op)						\
-	 xalux(l, op, 0, 1, 2, 3, 4, 5)				\
-	 xalux(l, op, 1, 2, 3, 4, 5, 0)				\
-	 xalux(l, op, 2, 3, 4, 5, 0, 1)				\
-	 xalux(l, op, 3, 4, 5, 0, 1, 2)				\
-	 xalux(l, op, 4, 5, 0, 1, 2, 3)				\
-	 xalux(l, op, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define alui_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##i_u %IR##i1 %IR##i0 1				\
-	check4(i_u, l, i2, i3, i4, i5)
-#define aluic_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##i_u %IR##i0 %IR##i0 1				\
-	check5(ic_u, l, i1, i2, i3, i4, i5)
-#define alur_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##r_u %IR##i2 %IR##i0 %IR##i1				\
-	check3(r_u, l, i3, i4, i5)
-#define alurc0_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##r_u %IR##i0 %IR##i0 %IR##i1				\
-	check4(r0_u, l, i2, i3, i4, i5)
-#define alurc1_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	movi %IR##i1 1						\
-	op##r_u %IR##i1 %IR##i0 %IR##i1				\
-	check4(r1_u, l, i2, i3, i4, i5)
-#define alurc2_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op##r_u %IR##i0 %IR##i0 %IR##i0				\
-	check5(r2_u, l, i1, i2, i3, i4, i5)
-#define   xalu_u(l, op, i0, i1, i2, i3, i4, i5)			\
-	  alui_u(l, op, i0, i1,	i2, i3, i4, i5)			\
-	 aluic_u(l, op, i0,		i1, i2, i3, i4, i5)	\
-	  alur_u(l, op, i0, i1, i2,	i3, i4, i5)		\
-	alurc0_u(l, op, i0, i1,	i2, i3, i4, i5)			\
-	alurc1_u(l, op, i0, i1,	i2, i3, i4, i5)			\
-	alurc2_u(l, op, i0,		i1, i2, i3, i4, i5)
-#if __ia64__
-#  define alu_u(l, op)						\
-	 xalu_u(l, op, 0, 1, 2, 3, 4, 5)
-#else
-#  define alu_u(l, op)						\
-	 xalu_u(l, op, 0, 1, 2, 3, 4, 5)			\
-	 xalu_u(l, op, 1, 2, 3, 4, 5, 0)			\
-	 xalu_u(l, op, 2, 3, 4, 5, 0, 1)			\
-	 xalu_u(l, op, 3, 4, 5, 0, 1, 2)			\
-	 xalu_u(l, op, 4, 5, 0, 1, 2, 3)			\
-	 xalu_u(l, op, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define unir(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op %IR##i1 %IR##i0					\
-	check4(rr, l, i2, i3, i4, i5)
-#define unirc(l, op, i0, i1, i2, i3, i4, i5)			\
-	setup()							\
-	movi %IR##i0 1						\
-	op %IR##i0 %IR##i0					\
-	check5(rc, l, i1, i2, i3, i4, i5)
-#define   xuni(l, op, i0, i1, i2, i3, i4, i5)			\
-	  unir(l, op, i0, i1,	i2, i3, i4, i5)			\
-	 unirc(l, op, i0,		i1, i2, i3, i4, i5)
-#if __ia64__
-#  define uni(l, op)						\
-	 xuni(l, op, 0, 1, 2, 3, 4, 5)
-#else
-#  define uni(l, op)						\
-	 xuni(l, op, 0, 1, 2, 3, 4, 5)				\
-	 xuni(l, op, 1, 2, 3, 4, 5, 0)				\
-	 xuni(l, op, 2, 3, 4, 5, 0, 1)				\
-	 xuni(l, op, 3, 4, 5, 0, 1, 2)				\
-	 xuni(l, op, 4, 5, 0, 1, 2, 3)				\
-	 xuni(l, op, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define unfr(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1					\
-	op##f %FR##f1 %FR##f0					\
-	checkf4(f, rr, l, f2, f3, f4, f5)
-#define unfrc(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1					\
-	op##f %FR##f0 %FR##f0					\
-	checkf5(f, rc, l, f1, f2, f3, f4, f5)
-#define   xunf(f, l, op, f0, f1, f2, f3, f4, f5)		\
-	  unfr(f, l, op, f0, f1,	f2, f3, f4, f5)		\
-	 unfrc(f, l, op, f0,		f1, f2, f3, f4, f5)
-#define xxunf(l, op, f0, f1, f2, f3, f4, f5)			\
-	 xunf(_f, l, op, f0, f1, f2, f3, f4, f5)		\
-	 xunf(_d, l, op, f0, f1, f2, f3, f4, f5)
-#if __ia64__
-#  define unf(l, op)						\
-	xxunf(l, op, 0, 1, 2, 3, 4, 5)
-#else
-#  define unf(l, op)						\
-	xxunf(l, op, 0, 1, 2, 3, 4, 5)				\
-	xxunf(l, op, 1, 2, 3, 4, 5, 0)				\
-	xxunf(l, op, 2, 3, 4, 5, 0, 1)				\
-	xxunf(l, op, 3, 4, 5, 0, 1, 2)				\
-	xxunf(l, op, 4, 5, 0, 1, 2, 3)				\
-	xxunf(l, op, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define fcpi(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	op##i##f %IR##r0 %FR##f0 1.0				\
-	check5(i##f##f0, l, r1, r2, r3, r4, r5)			\
-	checkf5(f, i##r0, l, f1, f2, f3, f4, f5)
-#define fcpr(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	movi##f %FR##f1 1.0					\
-	op##r##f %IR##r0 %FR##f0 %FR##f1			\
-	check5(r##f##f0, l, r1, r2, r3, r4, r5)			\
-	checkf4(f, r##r0, l, f2, f3, f4, f5)
-#define fcprc(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi##f %FR##f0 1.0					\
-	op##r##f %IR##r0 %FR##f0 %FR##f0			\
-	check5(rc##f##f0, l, r1, r2, r3, r4, r5)		\
-	checkf5(f, rc##r0, l, f1, f2, f3, f4, f5)
-#if __ia64__
-#  define ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#else
-#  define ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fcpr(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	 fcprc(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	  fcpr(f, l, op, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	 fcprc(f, l, op, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	  fcpr(f, l, op, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	 fcprc(f, l, op, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	  fcpr(f, l, op, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	 fcprc(f, l, op, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	  fcpr(f, l, op, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	 fcprc(f, l, op, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	  fcpi(f, l, op, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)	\
-	  fcpr(f, l, op, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)	\
-	 fcprc(f, l, op, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)
-#endif
-#if __ia64__
-#  define xfcp(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#else
-#  define xfcp(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f1,f2,f3,f4,f5,f0)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f2,f3,f4,f5,f0,f1)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f3,f4,f5,f0,f1,f2)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f4,f5,f0,f1,f2,f3)	\
-	  ifcp(f, l, op, r0,r1,r2,r3,r4,r5, f5,f0,f1,f2,f3,f4)
-#endif
-#if __ia64__
-#  define fcmp(l, op)						\
-	  xfcp(_f, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)
-#else
-#  define fcmp(l, op)						\
-	  xfcp(_f, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)	\
-	  xfcp(_d, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)
-#endif
-
-#define imvi(l, i0, i1, i2, i3, i4, i5)				\
-	setup()							\
-	movi %IR##i0 1						\
-	check5(i, l, i1, i2, i3, i4, i5)
-#define imvr(l, i0, i1, i2, i3, i4, i5)				\
-	setup()							\
-	movi %IR##i1 1						\
-	movr %IR##i0 %IR##i1					\
-	check4(r, l, i2, i3, i4, i5)
-#define xmvi(l, i0, i1, i2, i3, i4, i5)				\
-	imvi(l, i0,	i1, i2, i3, i4, i5)			\
-	imvr(l, i0, i1,	i2, i3, i4, i5)
-#if __ia64__
-#  define mvi(l)						\
-	 xmvi(l, 0, 1, 2, 3, 4, 5)
-#else
-#  define mvi(l)						\
-	 xmvi(l, 0, 1, 2, 3, 4, 5)				\
-	 xmvi(l, 1, 2, 3, 4, 5, 0)				\
-	 xmvi(l, 2, 3, 4, 5, 0, 1)				\
-	 xmvi(l, 3, 4, 5, 0, 1, 2)				\
-	 xmvi(l, 4, 5, 0, 1, 2, 3)				\
-	 xmvi(l, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define fmvi(f, l, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1					\
-	checkf5(f, i, l, f1, f2, f3, f4, f5)
-#define fmvr(f, l, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f1 1					\
-	movr##f %FR##f0 %FR##f1					\
-	checkf4(f, r, l, f2, f3, f4, f5)
-#define xmvf(f, l, f0, f1, f2, f3, f4, f5)			\
-	fmvi(f, l, f0, f1, f2, f3, f4, f5)			\
-	fmvr(f, l, f0, f1,	f2, f3, f4, f5)
-#if __ia64__
-#  define xxmvf(f, l)						\
-	  xmvf(f, l, 0, 1, 2, 3, 4, 5)
-#else
-#  define xxmvf(f, l)						\
-	   xmvf(f, l, 0, 1, 2, 3, 4, 5)				\
-	   xmvf(f, l, 1, 2, 3, 4, 5, 0)				\
-	   xmvf(f, l, 2, 3, 4, 5, 0, 1)				\
-	   xmvf(f, l, 3, 4, 5, 0, 1, 2)				\
-	   xmvf(f, l, 4, 5, 0, 1, 2, 3)				\
-	   xmvf(f, l, 5, 0, 1, 2, 3, 4)
-#endif
-#define   mvf(l)						\
-	xxmvf(_f, l)						\
-	xxmvf(_d, l)
-
-#define f2fr(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1					\
-	op %FR##f1 %FR##f0					\
-	checkf4(f, rr, l, f2, f3, f4, f5)
-#define f2frc(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	setup##f()						\
-	movi##f %FR##f0 1					\
-	op %FR##f0 %FR##f0					\
-	checkf5(f, rc, l, f1, f2, f3, f4, f5)
-#define  xf2f(f, l, op, f0, f1, f2, f3, f4, f5)			\
-	 f2fr(f, l, op, f0, f1,	f2, f3, f4, f5)			\
-	f2frc(f, l, op, f0,		f1, f2, f3, f4, f5)
-#if __ia64__
-#  define f2f(l, f, op)						\
-	 xf2f(f, l, op, 0, 1, 2, 3, 4, 5)
-#else
-#  define f2f(l, f, op)						\
-	 xf2f(f, l, op, 0, 1, 2, 3, 4, 5)			\
-	 xf2f(f, l, op, 1, 2, 3, 4, 5, 0)			\
-	 xf2f(f, l, op, 2, 3, 4, 5, 0, 1)			\
-	 xf2f(f, l, op, 3, 4, 5, 0, 1, 2)			\
-	 xf2f(f, l, op, 4, 5, 0, 1, 2, 3)			\
-	 xf2f(f, l, op, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define f2ir(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi##f %FR##f0 1					\
-	op##f %IR##r0 %FR##f0					\
-	check5(r##f##f0, l, r1, r2, r3, r4, r5)			\
-	checkf5(f, i##r0, l, f1, f2, f3, f4, f5)
-#if __ia64__
-#  define if2i(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#  define xf2i(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#else
-#  define if2i(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	  f2ir(f, l, op, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)
-#  define xf2i(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f1,f2,f3,f4,f5,f0)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f2,f3,f4,f5,f0,f1)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f3,f4,f5,f0,f1,f2)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f4,f5,f0,f1,f2,f3)	\
-	  if2i(f, l, op, r0,r1,r2,r3,r4,r5, f5,f0,f1,f2,f3,f4)
-#endif
-#define f2i(l, op)						\
-	xf2i(_f, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)	\
-	xf2i(_d, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)
-
-#define i2fr(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 1						\
-	op##f %FR##f0 %IR##r0					\
-	check5(r##f##f0, l, r1, r2, r3, r4, r5)			\
-	checkf5(f, i##r0, l, f1, f2, f3, f4, f5)
-#if __ia64__
-#  define ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#  define xi2f(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#else
-#  define ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	  i2fr(f, l, op, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)
-#  define xi2f(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f1,f2,f3,f4,f5,f0)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f2,f3,f4,f5,f0,f1)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f3,f4,f5,f0,f1,f2)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f4,f5,f0,f1,f2,f3)	\
-	  ii2f(f, l, op, r0,r1,r2,r3,r4,r5, f5,f0,f1,f2,f3,f4)
-#endif
-#define i2f(l, op)						\
-	xi2f(_f, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)	\
-	xi2f(_d, l, op, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5)
-
-#define off_c		1
-#define off_uc		off_c
-#define off_s		2
-#define off_us		off_s
-#define off_i		4
-#define off_ui		off_i
-#define off_l		8
-#define off_f		4
-#define off_d		8
-
-#define ildi(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	ldi##i %IR##r0 buff					\
-	check5(ldi##i, l, r1, r2, r3, r4, r5)
-#define ildr(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	ldr##i %IR##r0 %IR##r1					\
-	check4(ldr##i, l, r2, r3, r4, r5)
-#define ildr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r0 buff					\
-	ldr##i %IR##r0 %IR##r0					\
-	check5(ldr##i, l, r1, r2, r3, r4, r5)
-#define ildxi(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	ldxi##i %IR##r0 %IR##r1 off##i 				\
-	check4(ldxi##i, l, r2, r3, r4, r5)
-#define ildxr(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	movi %IR##r2 off##i					\
-	ldxr##i %IR##r0 %IR##r1 %IR##r2				\
-	check3(ldxr##i, l, r3, r4, r5)
-#define ildxr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	movi %IR##r0 off##i					\
-	ldxr##i %IR##r0 %IR##r1 %IR##r0				\
-	check4(ldxr0##i, l, r2, r3, r4, r5)
-#define ildxr1(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r0 buff					\
-	movi %IR##r1 off##i					\
-	ldxr##i %IR##r0 %IR##r0 %IR##r1				\
-	check4(ldxr1##i, l, r2, r3, r4, r5)
-#define  xxldi(i, l, r0, r1, r2, r3, r4, r5)			\
-	  ildi(i, l, r0, r1, r2, r3, r4, r5)			\
-	  ildr(i, l, r0, r1, r2, r3, r4, r5)			\
-	 ildr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	 ildxi(i, l, r0, r1, r2, r3, r4, r5)			\
-	 ildxr(i, l, r0, r1, r2, r3, r4, r5)			\
-	ildxr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	ildxr1(i, l, r0, r1, r2, r3, r4, r5)
-#if __WORDSIZE == 32
-#define xxxldi(l, r0, r1, r2, r3, r4, r5)
-#else
-#define xxxldi(l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi(_ui, l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi( _l, l, r0, r1, r2, r3, r4, r5)
-#endif
-#define   xldi(l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi( _c, l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi(_uc, l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi( _s, l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi(_us, l, r0, r1, r2, r3, r4, r5)			\
-	 xxldi( _i, l, r0, r1, r2, r3, r4, r5)			\
-	xxxldi(l, r0, r1, r2, r3, r4, r5)
-#if __ia64__
-#  define ldi(l)						\
-	 xldi(l, 0, 1, 2, 3, 4, 5)
-#else
-#  define ldi(l)						\
-	 xldi(l, 0, 1, 2, 3, 4, 5)				\
-	 xldi(l, 1, 2, 3, 4, 5, 0)				\
-	 xldi(l, 2, 3, 4, 5, 0, 1)				\
-	 xldi(l, 3, 4, 5, 0, 1, 2)				\
-	 xldi(l, 4, 5, 0, 1, 2, 3)				\
-	 xldi(l, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define fldi(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	ldi##f %FR##f0 buff					\
-	check6(ldi##f##r0##f0, l, r0, r1, r2, r3, r4, r5)	\
-	checkf5(f, ldi##r0##f0, l, f1, f2, f3, f4, f5)
-#define fldr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 buff					\
-	ldr##f %FR##f0 %IR##r0					\
-	check5(ldr##f##r0##f0, l, r1, r2, r3, r4, r5)		\
-	checkf5(f, ldr##r0##f0, l, f1, f2, f3, f4, f5)
-#define fldxi(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 buff					\
-	ldxi##f %FR##f0 %IR##r0 off##f 				\
-	check5(ldxi##f##r0##f0, l, r1, r2, r3, r4, r5)		\
-	checkf5(f, ldxi##r0##f0, l, f1, f2, f3, f4, f5)
-#define fldxr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 buff					\
-	movi %IR##r1 off##f					\
-	ldxr##f %FR##f0 %IR##r0 %IR##r1 			\
-	check4(ldxr##f##r0##f0, l, r2, r3, r4, r5)		\
-	checkf5(f, ldxr##r0##f0, l, f1, f2, f3, f4, f5)
-#define	  xldf(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fldi(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fldr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fldxi(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fldxr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#define	 xxldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)		\
-	  xldf(_f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xldf(_d, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#if __ia64__
-#  define ixldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#else
-#  define fxldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f1,f2,f3,f4,f5,f0)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f2,f3,f4,f5,f0,f1)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f3,f4,f5,f0,f1,f2)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f4,f5,f0,f1,f2,f3)	\
-	  xxldf(l, r0,r1,r2,r3,r4,r5, f5,f0,f1,f2,f3,f4)
-#  define ixldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fxldf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fxldf(l, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	  fxldf(l, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	  fxldf(l, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	  fxldf(l, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	  fxldf(l, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)
-#endif
-#define   ldf(l)						\
-	ixldf(l, 0,1,2,3,4,5, 0,1,2,3,4,5)
-
-#define isti(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	sti##i buff %IR##r0					\
-	check5(sti##i, l, r1, r2, r3, r4, r5)
-#define istr(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	str##i %IR##r1 %IR##r0					\
-	check4(str##i, l, r2, r3, r4, r5)
-#define istr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	str##i %IR##r1 %IR##r0					\
-	check4(str0##i, l, r2, r3, r4, r5)
-#define istxi(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	stxi##i off##i %IR##r1 %IR##r0 				\
-	check4(stxi##i, l, r2, r3, r4, r5)
-#define istxr(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	movi %IR##r2 off##i					\
-	stxr##i %IR##r2 %IR##r1 %IR##r0				\
-	check3(stxr##i, l, r3, r4, r5)
-#define istxr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r1 buff					\
-	movi %IR##r0 off##i					\
-	stxr##i %IR##r0 %IR##r1 %IR##r0				\
-	check4(stxr0##i, l, r2, r3, r4, r5)
-#define istxr1(i, l, r0, r1, r2, r3, r4, r5)			\
-	setup()							\
-	movi %IR##r0 buff					\
-	movi %IR##r1 off##i					\
-	stxr##i %IR##r1 %IR##r0 %IR##r0				\
-	check4(stxr1##i, l, r2, r3, r4, r5)
-#define  xxsti(i, l, r0, r1, r2, r3, r4, r5)			\
-	  isti(i, l, r0, r1, r2, r3, r4, r5)			\
-	  istr(i, l, r0, r1, r2, r3, r4, r5)			\
-	 istr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	 istxi(i, l, r0, r1, r2, r3, r4, r5)			\
-	 istxr(i, l, r0, r1, r2, r3, r4, r5)			\
-	istxr0(i, l, r0, r1, r2, r3, r4, r5)			\
-	istxr1(i, l, r0, r1, r2, r3, r4, r5)
-#if __WORDSIZE == 32
-#define xxxsti(l, r0, r1, r2, r3, r4, r5)
-#else
-#define xxxsti(l, r0, r1, r2, r3, r4, r5)			\
-	 xxsti( _l, l, r0, r1, r2, r3, r4, r5)
-#endif
-#define   xsti(l, r0, r1, r2, r3, r4, r5)			\
-	 xxsti( _c, l, r0, r1, r2, r3, r4, r5)			\
-	 xxsti( _s, l, r0, r1, r2, r3, r4, r5)			\
-	 xxsti( _i, l, r0, r1, r2, r3, r4, r5)			\
-	xxxsti(l, r0, r1, r2, r3, r4, r5)
-#if __ia64__
-#  define sti(l)						\
-	 xsti(l, 0, 1, 2, 3, 4, 5)
-#else
-#  define sti(l)						\
-	 xsti(l, 0, 1, 2, 3, 4, 5)				\
-	 xsti(l, 1, 2, 3, 4, 5, 0)				\
-	 xsti(l, 2, 3, 4, 5, 0, 1)				\
-	 xsti(l, 3, 4, 5, 0, 1, 2)				\
-	 xsti(l, 4, 5, 0, 1, 2, 3)				\
-	 xsti(l, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define fsti(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	sti##f buff %FR##f0					\
-	check6(sti##f##r0##f0, l, r0, r1, r2, r3, r4, r5)	\
-	checkf5(f, sti##r0##f0, l, f1, f2, f3, f4, f5)
-#define fstr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 buff					\
-	str##f %IR##r0 %FR##f0					\
-	check5(str##f##r0##f0, l, r1, r2, r3, r4, r5)		\
-	checkf5(f, str##r0##f0, l, f1, f2, f3, f4, f5)
-#define fstxi(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 buff					\
-	stxi##f off##f %IR##r0 %FR##f0 				\
-	check5(stxi##f##r0##f0, l, r1, r2, r3, r4, r5)		\
-	checkf5(f, stxi##r0##f0, l, f1, f2, f3, f4, f5)
-#define fstxr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	setup()							\
-	setup##f()						\
-	movi %IR##r0 buff					\
-	movi %IR##r1 off##f					\
-	stxr##f %IR##r1 %IR##r0 %FR##f0 			\
-	check4(stxr##f##r0##f0, l, r2, r3, r4, r5)		\
-	checkf5(f, stxr##r0##f0, l, f1, f2, f3, f4, f5)
-#define	  xstf(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fsti(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fstr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fstxi(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	fstxr(f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#define	 xxstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)		\
-	  xstf(_f, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xstf(_d, l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#if __ia64__
-#  define ixstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)
-#else
-#  define fxstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f1,f2,f3,f4,f5,f0)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f2,f3,f4,f5,f0,f1)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f3,f4,f5,f0,f1,f2)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f4,f5,f0,f1,f2,f3)	\
-	  xxstf(l, r0,r1,r2,r3,r4,r5, f5,f0,f1,f2,f3,f4)
-# define ixstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)		\
-	  fxstf(l, r0,r1,r2,r3,r4,r5, f0,f1,f2,f3,f4,f5)	\
-	  fxstf(l, r1,r2,r3,r4,r5,r0, f0,f1,f2,f3,f4,f5)	\
-	  fxstf(l, r2,r3,r4,r5,r0,r1, f0,f1,f2,f3,f4,f5)	\
-	  fxstf(l, r3,r4,r5,r0,r1,r2, f0,f1,f2,f3,f4,f5)	\
-	  fxstf(l, r4,r5,r0,r1,r2,r3, f0,f1,f2,f3,f4,f5)	\
-	  fxstf(l, r5,r0,r1,r2,r3,r4, f0,f1,f2,f3,f4,f5)
-#endif
-#define   stf(l)						\
-	ixstf(l, 0,1,2,3,4,5, 0,1,2,3,4,5)
-
-/* Need a valid jump or simple optimization will remove it */
-#define bri(l, op, u, il, ir, r0, r1, r2, r3, r4, r5)		\
-	setup()							\
-	movi %IR##r0 il 					\
-	b##op##i##u i##l##op##r0 %IR##r0 ir			\
-	calli @abort						\
-i##l##op##r0:							\
-	check5(i, l, r1, r2, r3, r4, r5)
-#define brr(l, op, u, il, ir, r0, r1, r2, r3, r4, r5)		\
-	setup()							\
-	movi %IR##r0 il						\
-	movi %IR##r1 ir						\
-	b##op##r##u r##l##op##r0 %IR##r0 %IR##r1		\
-	calli @abort						\
-r##l##op##r0:							\
-	check4(r, l, r2, r3, r4, r5)
-#define  xjmpi(l, op, u, il, ir, r0, r1, r2, r3, r4, r5)	\
-	   bri(l, op, u, il, ir, r0, r1, r2, r3, r4, r5)	\
-	   brr(l, op, u, il, ir, r0, r1, r2, r3, r4, r5)
-#if __ia64__
-#  define jmpi(l, op, u, il, ir)				\
-	 xjmpi(l, op, u, il, ir, 0, 1, 2, 3, 4, 5)
-#else
-#  define jmpi(l, op, u, il, ir)				\
-	 xjmpi(l, op, u, il, ir, 0, 1, 2, 3, 4, 5)		\
-	 xjmpi(l, op, u, il, ir, 1, 2, 3, 4, 5, 0)		\
-	 xjmpi(l, op, u, il, ir, 2, 3, 4, 5, 0, 1)		\
-	 xjmpi(l, op, u, il, ir, 3, 4, 5, 0, 1, 2)		\
-	 xjmpi(l, op, u, il, ir, 4, 5, 0, 1, 2, 3)		\
-	 xjmpi(l, op, u, il, ir, 5, 0, 1, 2, 3, 4)
-#endif
-
-#define bfi(f, l, op, il, ir, f0, f1, f2, f3, f4, f5)		\
-	setup##f()						\
-	movi##f %FR##f0 il 					\
-	b##op##i##f i##l##op##f##f0 %FR##f0 ir			\
-	calli @abort						\
-i##l##op##f##f0:						\
-	checkf5(f, i, l, f1, f2, f3, f4, f5)
-#define bff(f, l, op, il, ir, f0, f1, f2, f3, f4, f5)		\
-	setup##f()						\
-	movi##f %FR##f0 il					\
-	movi##f %FR##f1 ir					\
-	b##op##r##f r##l##op##f##f0 %FR##f0 %FR##f1		\
-	calli @abort						\
-r##l##op##f##f0:						\
-	checkf4(f, r, l, f2, f3, f4, f5)
-#define  xjmpf(f, l, op, il, ir, f0, f1, f2, f3, f4, f5)	\
-	   bfi(f, l, op, il, ir, f0, f1, f2, f3, f4, f5)	\
-	   bff(f, l, op, il, ir, f0, f1, f2, f3, f4, f5)
-#define xxjmpf(l, op, il, ir, f0, f1, f2, f3, f4, f5)		\
-	 xjmpf(_f, l, op, il, ir, f0, f1, f2, f3, f4, f5)	\
-	 xjmpf(_d, l, op, il, ir, f0, f1, f2, f3, f4, f5)
-#if __ia64__
-#  define jmpf(l, op, il, ir)					\
-	xxjmpf(l, op, il, ir, 0, 1, 2, 3, 4, 5)
-#else
-#  define jmpf(l, op, il, ir)					\
-	xxjmpf(l, op, il, ir, 0, 1, 2, 3, 4, 5)			\
-	xxjmpf(l, op, il, ir, 1, 2, 3, 4, 5, 0)			\
-	xxjmpf(l, op, il, ir, 2, 3, 4, 5, 0, 1)			\
-	xxjmpf(l, op, il, ir, 3, 4, 5, 0, 1, 2)			\
-	xxjmpf(l, op, il, ir, 4, 5, 0, 1, 2, 3)			\
-	xxjmpf(l, op, il, ir, 5, 0, 1, 2, 3, 4)
-#endif
-
-.data	32
-buff:
-.size	16
-ok:
-.c	"ok\n"
-
-.code
-	prolog
-
-	  alu(__LINE__, add)
-	 alux(__LINE__, add)
-	  fop(__LINE__, add)
-	  alu(__LINE__, sub)
-	 alux(__LINE__, sub)
-	  fop(__LINE__, sub)
-	  alu(__LINE__, mul)
-	  fop(__LINE__, mul)
-	  alu(__LINE__, div)
-	alu_u(__LINE__, div)
-	  fop(__LINE__, div)
-	  alu(__LINE__, rem)
-	alu_u(__LINE__, rem)
-	  alu(__LINE__, and)
-	  alu(__LINE__, or)
-	  alu(__LINE__, xor)
-	  alu(__LINE__, lsh)
-	  alu(__LINE__, rsh)
-	alu_u(__LINE__, rsh)
-	  uni(__LINE__, negr)
-	  unf(__LINE__, negr)
-	  uni(__LINE__, comr)
-	  unf(__LINE__, absr)
-	  unf(__LINE__, sqrtr)
-	  alu(__LINE__, lt)
-	alu_u(__LINE__, lt)
-	 fcmp(__LINE__, lt)
-	  alu(__LINE__, le)
-	alu_u(__LINE__, le)
-	 fcmp(__LINE__, le)
-	  alu(__LINE__, eq)
-	 fcmp(__LINE__, eq)
-	  alu(__LINE__, ge)
-	alu_u(__LINE__, ge)
-	 fcmp(__LINE__, ge)
-	  alu(__LINE__, gt)
-	alu_u(__LINE__, gt)
-	 fcmp(__LINE__, gt)
-	  alu(__LINE__, ne)
-	 fcmp(__LINE__, ne)
-	 fcmp(__LINE__, unlt)
-	 fcmp(__LINE__, unle)
-	 fcmp(__LINE__, uneq)
-	 fcmp(__LINE__, unge)
-	 fcmp(__LINE__, ungt)
-	 fcmp(__LINE__, ltgt)
-	 fcmp(__LINE__, ord)
-	 fcmp(__LINE__, unord)
-	  mvi(__LINE__)
-	  mvf(__LINE__)
-	  uni(__LINE__, extr_c)
-	  uni(__LINE__, extr_uc)
-	  uni(__LINE__, extr_s)
-	  uni(__LINE__, extr_us)
-#if __WORDSIZE == 64
-	  uni(__LINE__, extr_ui)
-#endif
-	  uni(__LINE__, htonr)
-	  f2f(__LINE__, _f, extr_d_f)
-	  f2f(__LINE__, _d, extr_f_d)
-	  f2i(__LINE__, truncr)
-	  i2f(__LINE__, extr)
-	  ldi(__LINE__)
-	  ldf(__LINE__)
-	  sti(__LINE__)
-	  stf(__LINE__)
-	 jmpi(__LINE__, lt,   ,  0,  1)
-	 jmpi(__LINE__, lt, _u,  0,  1)
-	 jmpf(__LINE__, lt,      0,  1)
-	 jmpi(__LINE__, le,   ,  1,  1)
-	 jmpi(__LINE__, le, _u,  1,  1)
-	 jmpf(__LINE__, le,      1,  1)
-	 jmpi(__LINE__, eq,   , -1, -1)
-	 jmpf(__LINE__, eq,     -1, -1)
-	 jmpi(__LINE__, ge,   ,  2,  2)
-	 jmpi(__LINE__, ge, _u,  2,  2)
-	 jmpf(__LINE__, ge,      2,  2)
-	 jmpi(__LINE__, gt,   ,  2,  1)
-	 jmpi(__LINE__, gt, _u,  2,  1)
-	 jmpf(__LINE__, gt,      2,  1)
-	 jmpi(__LINE__, ne,   ,  3,  2)
-	 jmpf(__LINE__, ne,      3,  2)
-	 jmpi(__LINE__, ms, , 1, 1)
-	 jmpi(__LINE__, mc, , 1, 2)
-#if __WORDSIZE == 32
-#  define ix7f		0x7fffffff
-#  define ix80		0x80000000
-#  define ixff		0xffffffff
-#else
-#  define ix7f		0x7fffffffffffffff
-#  define ix80		0x8000000000000000
-#  define ixff		0xffffffffffffffff
-#endif
-	 jmpi(__LINE__, oadd,   , ix7f, 1)
-	 jmpi(__LINE__, oadd, _u, ixff, 1)
-	 jmpi(__LINE__, xadd,   , ix80, 1)
-	 jmpi(__LINE__, xadd, _u, ix7f, 1)
-	 jmpi(__LINE__, osub,   , ix80, 1)
-	 jmpi(__LINE__, osub, _u,    0, 1)
-	 jmpi(__LINE__, xsub,   , ix7f, 1)
-	 jmpi(__LINE__, xsub, _u, ix80, 1)
-	 jmpf(__LINE__, unlt,        0, 1)
-	 jmpf(__LINE__, unle,        1, 1)
-	 jmpf(__LINE__, uneq,        2, 2)
-	 jmpf(__LINE__, unge,        3, 3)
-	 jmpf(__LINE__, ungt,        4, 3)
-	 jmpf(__LINE__, ltgt,        5, 4)
-	 jmpf(__LINE__, ord,         0, 0)
-	 jmpf(__LINE__, unord,       0, $(0.0 / 0.0))
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-
-	ret
-	epilog

+ 0 - 123
bjos/sledge/lightning/check/ctramp.c

@@ -1,123 +0,0 @@
-#include <lightning.h>
-#include <stdio.h>
-
-jit_state_t		*_jit;
-long			 top;
-long			 stk[1024];
-
-int
-main(int argc, char *argv[])
-{
-    void		 *address;
-    void		(*call)(void*);
-    jit_state_t		 *frame_jit, *tramp_jit;
-    jit_node_t		 *arg, *done, *xfibs, *out, *ret1, *ret2;
-
-    init_jit(argv[0]);
-    _jit = frame_jit = jit_new_state();
-    jit_name("main");
-    jit_prolog();
-    jit_frame(64);
-
-    arg = jit_arg();
-    jit_getarg(JIT_R1, arg);
-
-    /* Initialize language stack */
-    jit_movi(JIT_R0, (jit_word_t)stk);
-    jit_sti(&top, JIT_R0);
-
-    /* return address */
-    done = jit_movi(JIT_R0, 0);
-    /* argument */
-    jit_movi(JIT_V0, 32);
-    /* jump to code */
-    jit_jmpr(JIT_R1);
-    jit_patch(done);
-
-    jit_prepare();
-    jit_pushargi((jit_word_t)"xfibs(%d) = %d\n");
-    jit_ellipsis();
-    jit_pushargi(32);
-    jit_pushargr(JIT_V0);
-    jit_finishi(printf);
-    jit_ret();
-    jit_epilog();
-    call = jit_emit();
-    jit_clear_state();
-
-#define SIZE				sizeof(jit_word_t)
-    _jit = tramp_jit = jit_new_state();
-    jit_name("xfibs");
-    xfibs = jit_label();
-    jit_prolog();
-    jit_tramp(64);
-    out = jit_blti(JIT_V0, 2);
-    jit_subi(JIT_V1, JIT_V0, 1);	/* V1 = N-1 */
-    jit_subi(JIT_V2, JIT_V0, 2);	/* V1 = N-2 */
-
-    /* save return address */
-    jit_ldi(JIT_R1, &top);
-    jit_stxi(SIZE * 0, JIT_R1, JIT_R0);
-    /* save operands */
-    jit_stxi(SIZE * 1, JIT_R1, JIT_V0);
-    jit_stxi(SIZE * 2, JIT_R1, JIT_V1);
-    jit_stxi(SIZE * 3, JIT_R1, JIT_V2);
-    /* adjust "language" stack */
-    jit_addi(JIT_R1, JIT_R1, SIZE * 4);
-    jit_sti(&top, JIT_R1);
-
-    /* return address */
-    ret1 = jit_movi(JIT_R0, 0);
-    /* argument */
-    jit_movr(JIT_V0, JIT_V1);
-    /* indirect goto */
-    jit_patch_at(jit_jmpi(), xfibs);
-    jit_patch(ret1);
-    jit_movr(JIT_V1, JIT_V0);		/* V1 = rfibs(N-1) */
-    /* save V1 */
-    jit_ldi(JIT_R1, &top);
-    jit_stxi(-SIZE * 2, JIT_R1, JIT_V1);
-
-    /* reload V2 */
-    jit_ldxi(JIT_V2, JIT_R1, -SIZE * 1);
-
-    /* return address */
-    ret2 = jit_movi(JIT_R0, 0);
-    /* argument */
-    jit_movr(JIT_V0, JIT_V2);
-    /* indirect goto */
-    jit_patch_at(jit_jmpi(), xfibs);
-    jit_patch(ret2);
-    jit_movr(JIT_V2, JIT_V0);		/* V2 = rfibs(N-2) */
-
-    /* reload return address */
-    jit_ldi(JIT_R1, &top);
-    jit_subi(JIT_R1, JIT_R1, SIZE * 4);
-    jit_ldxi(JIT_R0, JIT_R1, SIZE * 0);
-    /* reload operands */
-    jit_ldxi(JIT_V0, JIT_R1, SIZE * 1);
-    jit_ldxi(JIT_V1, JIT_R1, SIZE * 2);
-    /* V2 already loaded */
-    /* update "language" stack */
-    jit_sti(&top, JIT_R1);
-
-    jit_addi(JIT_V1, JIT_V1, 1);
-    jit_addr(JIT_V0, JIT_V1, JIT_V2);
-    jit_jmpr(JIT_R0);
-
-    jit_patch(out);
-    jit_movi(JIT_V0, 1);
-    jit_jmpr(JIT_R0);
-    jit_epilog();
-
-    address = jit_emit();
-    jit_clear_state();
-
-    (*call)(address);
-
-    jit_destroy_state();
-
-    _jit = frame_jit;
-    jit_destroy_state();
-    return 0;
-}

+ 0 - 1
bjos/sledge/lightning/check/cvt.ok

@@ -1 +0,0 @@
-ok

+ 0 - 380
bjos/sledge/lightning/check/cvt.tst

@@ -1,380 +0,0 @@
-.data	12
-ok:
-.c	"ok\n"
-
-#if __WORDSIZE == 32
-#  define w7f		0x7fffffff
-#  define w80		0x80000000
-#  define w81		0x80000001
-#  define wff		0xffffffff
-#  define LEXTII2(N, R0, R1)
-#  define LEXTIC2(N, R0)
-#else
-#  define w7f		0x7fffffffffffffff
-#  define w80		0x8000000000000000
-#  define w81		0x8000000000000001
-#  define wff		0xffffffffffffffff
-#  define i7f		wff
-#  define ui7f		0xffffffff
-#  define i80		0
-#  define ui80		0
-#  define i81		1
-#  define ui81		1
-#  define iff		wff
-#  define uiff		0xffffffff
-#  define LEXTII2(N, R0, R1)					\
-	EXTII2(N, i, R0, R1)					\
-	EXTII2(N, ui, R0, R1)
-#  define LEXTIC2(N, R0)					\
-	EXTIC2(N, i, R0)					\
-	EXTIC2(N, ui, R0)
-#endif
-#define c7f		wff
-#define uc7f		0xff
-#define s7f		wff
-#define us7f		0xffff
-#define c80		0
-#define uc80		0
-#define s80		0
-#define us80		0
-#define c81		1
-#define uc81		1
-#define s81		1
-#define us81		1
-#define cff		wff
-#define ucff		0xff
-#define sff		wff
-#define usff		0xffff
-
-#define EXTII2(N, T, R0, R1)					\
-	movi %R0 w##N						\
-	extr_##T %R1 %R0					\
-	beqi T##_##R0##_##R1##_##N %R1 T##N			\
-	calli @abort						\
-T##_##R0##_##R1##_##N:
-#define EXTII1(N, R0, R1)					\
-	EXTII2(N, c, R0, R1)					\
-	EXTII2(N, uc, R0, R1)					\
-	EXTII2(N, s, R0, R1)					\
-	EXTII2(N, us, R0, R1)					\
-	LEXTII2(N, R0, R1)
-#define EXTII0(R0, R1)						\
-	EXTII1(7f, R0, R1)					\
-	EXTII1(80, R0, R1)					\
-	EXTII1(81, R0, R1)					\
-	EXTII1(ff, R0, R1)
-
-#define EXTIC2(N, T, R0)					\
-	movi %R0 w##N						\
-	extr_##T %R0 %R0					\
-	beqi T##_##R0##_##N %R0 T##N				\
-	calli @abort						\
-T##_##R0##_##N:
-#define EXTIC1(N, R0)						\
-	EXTIC2(N, c, R0)					\
-	EXTIC2(N, uc, R0)					\
-	EXTIC2(N, s, R0)					\
-	EXTIC2(N, us, R0)					\
-	LEXTIC2(N, R0)
-#define EXTIC0(R0)						\
-	EXTIC1(7f, R0)						\
-	EXTIC1(80, R0)						\
-	EXTIC1(81, R0)						\
-	EXTIC1(ff, R0)
-
-#define EXTII(V0, V1, V2, R0, R1, R2)				\
-	EXTII0(V0, V1)						\
-	EXTII0(V0, V2)						\
-	EXTII0(V0, R0)						\
-	EXTII0(V0, R1)						\
-	EXTII0(V0, R2)						\
-	EXTII0(V1, V0)						\
-	EXTII0(V1, V2)						\
-	EXTII0(V1, R0)						\
-	EXTII0(V1, R1)						\
-	EXTII0(V1, R2)						\
-	EXTII0(V2, V0)						\
-	EXTII0(V2, V1)						\
-	EXTII0(V2, R0)						\
-	EXTII0(V2, R1)						\
-	EXTII0(V2, R2)						\
-	EXTII0(R0, V0)						\
-	EXTII0(R0, V1)						\
-	EXTII0(R0, V2)						\
-	EXTII0(R0, R1)						\
-	EXTII0(R0, R2)						\
-	EXTII0(R1, V0)						\
-	EXTII0(R1, V1)						\
-	EXTII0(R1, V2)						\
-	EXTII0(R1, R0)						\
-	EXTII0(R1, R2)						\
-	EXTII0(R2, V0)						\
-	EXTII0(R2, V1)						\
-	EXTII0(R2, V2)						\
-	EXTII0(R2, R0)						\
-	EXTII0(R2, R1)						\
-	EXTIC0(V0)						\
-	EXTIC0(V1)						\
-	EXTIC0(V2)						\
-	EXTIC0(R0)						\
-	EXTIC0(R1)						\
-	EXTIC0(R2)
-
-#define EXIF1(N, V, R0, R1)					\
-	movi %R0 V						\
-	extr_f %R1 %R0						\
-	beqi_f wf##_##R0##_##R1##_##N %R1 V			\
-wf##_##R0##_##R1##_##N:
-#define EXIF0(R0, R1)						\
-	EXIF1(0, -1, R0, R1)					\
-	EXIF1(1, 64, R0, R1)
-#define EXIF(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5)	\
-	EXIF0(V0, F0)						\
-	EXIF0(V1, F1)						\
-	EXIF0(V2, F2)						\
-	EXIF0(R0, F3)						\
-	EXIF0(R1, F4)						\
-	EXIF0(R2, F5)
-#define EXID1(N, V, R0, R1)					\
-	movi %R0 V						\
-	extr_d %R1 %R0						\
-	beqi_d wd##_##R0##_##R1##_##N %R1 V			\
-wd##_##R0##_##R1##_##N:
-#define EXID0(R0, R1)						\
-	EXID1(0, -1, R0, R1)					\
-	EXID1(1, 64, R0, R1)
-#define EXID(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5)	\
-	EXID0(V0, F0)						\
-	EXID0(V1, F1)						\
-	EXID0(V2, F2)						\
-	EXID0(R0, F3)						\
-	EXID0(R1, F4)						\
-	EXID0(R2, F5)
-
-#define EXFI1(N, V, R0, R1)					\
-	movi_f %R1 V						\
-	truncr_f %R0 %R1					\
-	beqi fi##_##R0##_##R1##_##N %R0 V			\
-	calli @abort						\
-fi##_##R0##_##R1##_##N:
-#define EXFI0(R0, R1)						\
-	EXFI1(0,   42, R0, R1)					\
-	EXFI1(1, -128, R0, R1)
-#define EXFI(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5)	\
-	EXFI0(V0, F5)						\
-	EXFI0(V1, F4)						\
-	EXFI0(V2, F3)						\
-	EXFI0(R0, F2)						\
-	EXFI0(R1, F1)						\
-	EXFI0(R2, F0)
-#define EXDI1(N, V, R0, R1)					\
-	movi_d %R1 V						\
-	truncr_d %R0 %R1					\
-	beqi di##_##R0##_##R1##_##N %R0 V			\
-	calli @abort						\
-di##_##R0##_##R1##_##N:
-#define EXDI0(R0, R1)						\
-	EXDI1(0,   42, R0, R1)					\
-	EXDI1(1, -128, R0, R1)
-#define EXDI(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5)	\
-	EXDI0(V0, F5)						\
-	EXDI0(V1, F4)						\
-	EXDI0(V2, F3)						\
-	EXDI0(R0, F2)						\
-	EXDI0(R1, F1)						\
-	EXDI0(R2, F0)
-
-#define LEXFI1(N, V, R0, R1)					\
-	movi_f %R1 V						\
-	truncr_f_i %R0 %R1					\
-	andi %R0 %R0 0xffffffff					\
-	beqi lfi##_##R0##_##R1##_##N %R0 $(V & 0xffffffff)	\
-	calli @abort						\
-lfi##_##R0##_##R1##_##N:
-#define LEXFI0(R0, R1)						\
-	LEXFI1(0,   42, R0, R1)					\
-	LEXFI1(1, -128, R0, R1)
-#define LEXFI(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5)	\
-	LEXFI0(V0, F5)						\
-	LEXFI0(V1, F4)						\
-	LEXFI0(V2, F3)						\
-	LEXFI0(R0, F2)						\
-	LEXFI0(R1, F1)						\
-	LEXFI0(R2, F0)
-#define LEXDI1(N, V, R0, R1)					\
-	movi_d %R1 V						\
-	truncr_d_i %R0 %R1					\
-	andi %R0 %R0 0xffffffff					\
-	beqi ldi##_##R0##_##R1##_##N %R0 $(V & 0xffffffff)	\
-	calli @abort						\
-ldi##_##R0##_##R1##_##N:
-#define LEXDI0(R0, R1)						\
-	LEXDI1(0,   42, R0, R1)					\
-	LEXDI1(1, -128, R0, R1)
-#define LEXDI(V0, V1, V2, R0, R1, R2, F0, F1, F2, F3, F4, F5)	\
-	LEXDI0(V0, F5)						\
-	LEXDI0(V1, F4)						\
-	LEXDI0(V2, F3)						\
-	LEXDI0(R0, F2)						\
-	LEXDI0(R1, F1)						\
-	LEXDI0(R2, F0)
-
-#define EXTFD2(V, R0, R1)					\
-	movi_f %R0 V						\
-	extr_f_d %R1 %R0					\
-	beqi_d fd##_##R0##_##R1 %R1 V				\
-	calli @abort						\
-fd##_##R0##_##R1:
-#define EXTFD1(R0, R1)						\
-	EXTFD2(1.25, R0, R1)
-#define EXTFDC2(V, R0)						\
-	movi_f %R0 V						\
-	extr_f_d %R0 %R0					\
-	beqi_d fdc##_##R0 %R0 V					\
-	calli @abort						\
-fdc##_##R0:
-#define EXTFDC1(R0)						\
-	EXTFDC2(-0.75, R0)
-#define EXTFD(R0, R1, R2, R3, R4, R5)				\
-	EXTFD1(R0, R1)						\
-	EXTFD1(R0, R2)						\
-	EXTFD1(R0, R3)						\
-	EXTFD1(R0, R4)						\
-	EXTFD1(R0, R5)						\
-	EXTFDC1(R0)						\
-	EXTFDC1(R1)						\
-	EXTFDC1(R2)						\
-	EXTFDC1(R3)						\
-	EXTFDC1(R4)						\
-	EXTFDC1(R5)
-
-#define EXTDF2(V, R0, R1)					\
-	movi_d %R0 V						\
-	extr_d_f %R1 %R0					\
-	beqi_f df##_##R0##_##R1 %R1 V				\
-	calli @abort						\
-df##_##R0##_##R1:
-#define EXTDF1(R0, R1)						\
-	EXTDF2(1.25, R0, R1)
-#define EXTDFC2(V, R0)						\
-	movi_d %R0 V						\
-	extr_d_f %R0 %R0					\
-	beqi_f dfc##_##R0 %R0 V					\
-	calli @abort						\
-dfc##_##R0:
-#define EXTDFC1(R0)						\
-	EXTDFC2(-0.75, R0)
-#define EXTDF(R0, R1, R2, R3, R4, R5)				\
-	EXTDF1(R0, R1)						\
-	EXTDF1(R0, R2)						\
-	EXTDF1(R0, R3)						\
-	EXTDF1(R0, R4)						\
-	EXTDF1(R0, R5)						\
-	EXTDFC1(R0)						\
-	EXTDFC1(R1)						\
-	EXTDFC1(R2)						\
-	EXTDFC1(R3)						\
-	EXTDFC1(R4)						\
-	EXTDFC1(R5)
-
-.code
-	prolog
-
-	/* simple sequence for easier disassembly reading and encoding check */
-	movi %r0 w7f
-	extr_c %r1 %r0
-	beqi xc %r1 c7f
-	calli @abort
-xc:
-	movi %r0 w7f
-	extr_uc %r1 %r0
-	beqi xuc %r1 uc7f
-	calli @abort
-xuc:
-	movi %r0 w7f
-	extr_s %r1 %r0
-	beqi xs %r1 s7f
-	calli @abort
-xs:
-	movi %r0 w7f
-	extr_us %r1 %r0
-	beqi xus %r1 us7f
-	calli @abort
-xus:
-#if __WORDSIZE == 64
-	movi %r0 w7f
-	extr_i %r1 %r0
-	beqi xi %r1 i7f
-	calli @abort
-xi:
-	movi %r0 w7f
-	extr_ui %r1 %r0
-	beqi xui %r1 ui7f
-	calli @abort
-xui:
-#endif
-	movi %r0 -2
-	extr_f %f0 %r0
-	beqi_f xif %f0 -2
-	calli @abort
-xif:
-	movi %r0 32
-	extr_d %f0 %r0
-	beqi_d xid %f0 32
-	calli @abort
-xid:
-	movi_f %f0 -128
-	truncr_f %r0 %f0
-	beqi xfi %r0 -128
-	calli @abort
-xfi:
-	movi_d %f0 -128
-	truncr_d %r0 %f0
-	beqi xdi %r0 -128
-	calli @abort
-xdi:
-#if __WORDSIZE == 64
-	movi_f %f0 -128
-	truncr_f_i %r0 %f0
-	andi %r0 %r0 0xffffffff
-	beqi yfi %r0 $(-128 & 0xffffffff)
-	calli @abort
-yfi:
-	movi_d %f0 -128
-	truncr_d_i %r0 %f0
-	andi %r0 %r0 0xffffffff
-	beqi ydi %r0 $(-128 & 0xffffffff)
-	calli @abort
-ydi:
-#endif
-	movi_f %f0 0.5
-	extr_f_d %f1 %f0
-	beqi_d xfd %f1 0.5
-	calli @abort
-xfd:
-	movi_d %f0 0.5
-	extr_d_f %f1 %f0
-	beqi_f xdf %f1 0.5
-	calli @abort
-xdf:
-
-	EXTII(v0, v1, v2, r0, r1, r2)
-	EXIF(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
-	EXID(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
-	EXFI(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
-#if __WORDSIZE == 64
-	LEXFI(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
-	LEXDI(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
-#endif
-	EXDI(v0, v1, v2, r0, r1, r2, f0, f1, f2, f3, f4, f5)
-	EXTFD(f0, f1, f2, f3, f4, f5)
-	EXTDF(f0, f1, f2, f3, f4, f5)
-
-	// just to know did not abort
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-
-	ret
-	epilog

+ 0 - 6
bjos/sledge/lightning/check/divi.ok

@@ -1,6 +0,0 @@
-40/8 = 5 (expected 5)
-64/8 = 8 (expected 8)
-80/8 = 10 (expected 10)
-98304/32768 = 3 (expected 3)
-65536/32768 = 2 (expected 2)
-163840/32768 = 5 (expected 5)

+ 0 - 85
bjos/sledge/lightning/check/divi.tst

@@ -1,85 +0,0 @@
-.data	128
-small_ops:
-.i	40 64 80
-large_ops:
-.i	98304 65536 163840
-fmt:
-.c	"%i/%i = %i (expected %i)\n"
-x:
-.c	"%d\n"
-.code
-	jmpi main
-
-#define generate_divider(operand)	\
-	name divider_##operand		\
-divider_##operand:			\
-	prolog				\
-	arg $i				\
-	getarg %r1 $i			\
-	divi %r2 %r1 operand		\
-	retr %r2			\
-	epilog
-generate_divider(8)
-generate_divider(32768)
-
-#define generate_test_divider(divisor)	\
-	name test_divider_##divisor	\
-test_divider_##divisor:			\
-	prolog				\
-	allocai 4 $loc			\
-	arg $p				\
-	arg $c				\
-	getarg %v0 $p			\
-	getarg %v1 $c			\
-	muli %v1 %v1 4			\
-	addr %v1 %v0 %v1		\
-loop_##divisor:				\
-	bger done_##divisor %v0 %v1	\
-	ldr_i %v2 %v0			\
-	prepare				\
-		pushargr %v2		\
-	finishi divider_##divisor	\
-	retval %v2			\
-	ldr_i %r2 %v0			\
-	divi %r0 %r2 divisor		\
-	/* save div result */		\
-	stxi_i $loc %fp %r0		\
-	prepare				\
-		pushargi fmt		\
-		ellipsis		\
-		pushargr %r2		\
-		pushargi divisor	\
-		pushargr %v2		\
-		pushargr %r0		\
-	finishi @printf			\
-	addi %v0 %v0 4			\
-	/* reload div result */		\
-	ldxi_i %r0 %fp $loc		\
-	beqr loop_##divisor %r0 %v2	\
-	/* return if failed */		\
-	reti 1				\
-done_##divisor:				\
-	reti 0				\
-	epilog
-generate_test_divider(8)
-generate_test_divider(32768)
-
-	name main
-main:
-	prolog
-	prepare
-		pushargi small_ops
-		pushargi 3
-	finishi test_divider_8
-	retval %r0
-	bnei fail %r0 0	
-	prepare
-		pushargi large_ops
-		pushargi 3
-	finishi test_divider_32768
-	retval %r0
-	bnei fail %r0 0	
-	reti 0
-fail:
-	reti 1
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/fib.ok

@@ -1 +0,0 @@
-nfibs(32) = 7049155

+ 0 - 60
bjos/sledge/lightning/check/fib.tst

@@ -1,60 +0,0 @@
-.data	32
-format:
-.c	"nfibs(%d) = %d\n"
-
-.code
-	jmpi main
-
-	name nfibs
-nfibs:
-	prolog
-	arg $in
-	getarg %r2 $in		// R2 = n
-	movi %r1 1
-	blti_u ref %r2 2
-	subi %r2 %r2 1
-	movi %r0 1
-loop:
-	subi %r2 %r2 1		// decr. counter
-	addr %v0 %r0 %r1	// V0 = R0 + R1
-	movr %r0 %r1		// R0 = R1
-	addi %r1 %v0 1		// R1 = V0 + 1
-	bnei loop %r2 0		// if (R2) goto loop
-ref:
-	retr %r1		// RET = R1
-	epilog
-
-	name main
-main:
-	prolog
-	arg $argc
-	arg $argv
-
-	getarg_i %r0 $argc
-	blei default %r0 1
-	getarg %r0 $argv
-	addi %r0 %r0 $(__WORDSIZE >> 3)
-	ldr %r0 %r0
-	prepare
-		pushargr %r0
-	finishi @atoi
-	retval %r0
-	jmpi call
-
-default:
-	movi %r0 32
-
-call:
-	movr %v0 %r0
-	prepare
-		pushargr %r0
-	finishi nfibs
-	retval %r0
-	prepare
-		pushargi format
-		ellipsis
-		pushargr %v0
-		pushargr %r0
-	finishi @printf
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/float.ok

@@ -1 +0,0 @@
-ok

+ 0 - 367
bjos/sledge/lightning/check/float.tst

@@ -1,367 +0,0 @@
-
-.data	4
-ok:
-.c	"ok"
-
-.	$($NaN  =		 0.0 / 0.0)
-.	$($pInf =		 1.0 / 0.0)
-.	$($nInf =		-1.0 / 0.0)
-#if __WORDSIZE == 32
-#  define x7f			0x7fffffff
-#  define x80			0x80000000
-#else
-#  define x7f			0x7fffffffffffffff
-#  define x80			0x8000000000000000
-#endif
-
-#if __mips__ || __sparc__ || __hppa__
-#  define wnan			x7f
-#elif __arm__ || __aarch64__ || __alpha__
-#  define wnan			0
-#else
-#  define wnan			x80
-#endif
-#if __mips__ || __arm__ || __ppc__ || __sparc__ || __hppa__ || __aarch64__ || __s390__
-#  define wpinf			x7f
-#elif __alpha__
-/* (at least) bug compatible with gcc 4.2.3 -ieee */
-#  define wpinf			0
-#else
-#  define wpinf			x80
-#endif
-#if __alpha__
-/* (at least) bug compatible with gcc 4.2.3 -ieee */
-#  define wninf			0
-#else
-#  define wninf			x80
-#endif
-
-/* ensure result is correct and 0 or 1 in the result register */
-#define xtcmp(l, t, op, r0, f0, f1, li, ri)		\
-	movi##t %f0 li					\
-	movi##t %f1 ri					\
-	op##r##t %r0 %f0 %f1				\
-	bnei T##op##r##t##r0##f0##f1##l %r0 0		\
-	calli @abort					\
-T##op##r##t##r0##f0##f1##l:				\
-	movi##t %f0 li					\
-	movi##t %f1 ri					\
-	b##op##r##t bT##op##r##t##r0##f0##f1##l %f0 %f1	\
-	calli @abort					\
-bT##op##r##t##r0##f0##f1##l:				\
-	movi##t %f1 li					\
-	op##i##t %r0 %f0 ri				\
-	bnei T##op##i##t##r0##f0##f1##l %r0 0		\
-	calli @abort					\
-T##op##i##t##r0##f0##f1##l:				\
-	movi##t %f1 li					\
-	b##op##i##t bT##op##i##t##r0##f0##f1##l %f0 ri	\
-	calli @abort					\
-bT##op##i##t##r0##f0##f1##l:				\
-	movi##t %f0 li					\
-	movi##t %f1 ri					\
-	op##r##t %r0 %f0 %f1				\
-	beqi F##op##r##t##r0##f0##f1##l %r0 1		\
-	calli @abort					\
-F##op##r##t##r0##f0##f1##l:				\
-	movi##t %f1 li					\
-	op##i##t %r0 %f0 ri				\
-	beqi F##op##i##t##r0##f0##f1##l %r0 1		\
-	calli @abort					\
-F##op##i##t##r0##f0##f1##l:
-#define tcmp1(l, t, op, r0, li, ri)			\
-	xtcmp(l, t, op, r0, f0, f1, li, ri)		\
-	xtcmp(l, t, op, r0, f1, f2, li, ri)		\
-	xtcmp(l, t, op, r0, f2, f3, li, ri)		\
-	xtcmp(l, t, op, r0, f3, f4, li, ri)		\
-	xtcmp(l, t, op, r0, f4, f5, li, ri)
-#define tcmp0(l, t, op, li, ri)				\
-	tcmp1(l, t, op, v0, li, ri)			\
-	tcmp1(l, t, op, v1, li, ri)			\
-	tcmp1(l, t, op, v2, li, ri)			\
-	tcmp1(l, t, op, r0, li, ri)			\
-	tcmp1(l, t, op, r1, li, ri)			\
-	tcmp1(l, t, op, r2, li, ri)
-#if __ia64__
-#  define tcmp(l, op, li, ri)				\
-	 xtcmp(l, _f, op, r0, f0, f1, li, ri)		\
-	 xtcmp(l, _d, op, r0, f0, f1, li, ri)
-#else
-#  define tcmp(l, op, li, ri)				\
-	 tcmp0(l, _f, op, li, ri)			\
-	 tcmp0(l, _d, op, li, ri)
-#endif
-
-#define xfcmp(l, t, op, r0, f0, f1, li, ri)		\
-	movi##t %f0 li					\
-	movi##t %f1 ri					\
-	op##r##t %r0 %f0 %f1				\
-	beqi T##op##r##t##r0##f0##f1##l %r0 0		\
-	calli @abort					\
-T##op##r##t##r0##f0##f1##l:				\
-	movi##t %f1 li					\
-	op##i##t %r0 %f0 ri				\
-	beqi T##op##i##t##r0##f0##f1##l %r0 0		\
-	calli @abort					\
-T##op##i##t##r0##f0##f1##l:				\
-	movi##t %f0 li					\
-	movi##t %f1 ri					\
-	op##r##t %r0 %f0 %f1				\
-	bnei F##op##r##t##r0##f0##f1##l %r0 1		\
-	calli @abort					\
-F##op##r##t##r0##f0##f1##l:				\
-	movi##t %f1 li					\
-	op##i##t %r0 %f0 ri				\
-	bnei F##op##i##t##r0##f0##f1##l %r0 1		\
-	calli @abort					\
-F##op##i##t##r0##f0##f1##l:
-#define fcmp1(l, t, op, r0, li, ri)			\
-	xfcmp(l, t, op, r0, f0, f1, li, ri)		\
-	xfcmp(l, t, op, r0, f1, f2, li, ri)		\
-	xfcmp(l, t, op, r0, f2, f3, li, ri)		\
-	xfcmp(l, t, op, r0, f3, f4, li, ri)		\
-	xfcmp(l, t, op, r0, f4, f5, li, ri)
-#define fcmp0(l, t, op, li, ri)				\
-	fcmp1(l, t, op, v0, li, ri)			\
-	fcmp1(l, t, op, v1, li, ri)			\
-	fcmp1(l, t, op, v2, li, ri)			\
-	fcmp1(l, t, op, r0, li, ri)			\
-	fcmp1(l, t, op, r1, li, ri)			\
-	fcmp1(l, t, op, r2, li, ri)
-#if __ia64__
-#  define fcmp(l, op, li, ri)				\
-	xfcmp(l, _f, op, r0, f0, f1, li, ri)		\
-	xfcmp(l, _d, op, r0, f0, f1, li, ri)
-#else
-#  define fcmp(l, op, li, ri)				\
-	 fcmp0(l, _f, op, li, ri)			\
-	 fcmp0(l, _d, op, li, ri)
-#endif
-
-#define xf2w(l, f, r0, f0, iv, fv)			\
-	movi##f %f0 fv					\
-	truncr##f %r0 %f0				\
-	beqi W##f##r0##f0##l %r0 iv			\
-	calli @abort					\
-W##f##r0##f0##l:
-#define f2w1(l, t, r0, iv, fv)				\
-	xf2w(l, t, r0, f0, iv, fv)			\
-	xf2w(l, t, r0, f1, iv, fv)			\
-	xf2w(l, t, r0, f2, iv, fv)			\
-	xf2w(l, t, r0, f3, iv, fv)			\
-	xf2w(l, t, r0, f4, iv, fv)			\
-	xf2w(l, t, r0, f5, iv, fv)
-#define f2w0(l, t, iv, fv)				\
-	f2w1(l, t, v0, iv, fv)				\
-	f2w1(l, t, v1, iv, fv)				\
-	f2w1(l, t, v2, iv, fv)				\
-	f2w1(l, t, r0, iv, fv)				\
-	f2w1(l, t, r1, iv, fv)				\
-	f2w1(l, t, r2, iv, fv)
-#if __ia64__
-#  define f2w(l, iv, fv)				\
-	xf2w(l, _f, r0, f0, iv, fv)			\
-	xf2w(l, _d, r0, f0, iv, fv)
-#else
-#  define f2w(l, iv, fv)				\
-	f2w0(l, _f, iv, fv)				\
-	f2w0(l, _d, iv, fv)
-#endif
-
-.code
-	prolog
-
-	tcmp(__LINE__, lt, 0, 1)
-	tcmp(__LINE__, lt, $nInf, $pInf)
-	tcmp(__LINE__, lt, $nInf, 0)
-	tcmp(__LINE__, lt, 0, $pInf)
-	fcmp(__LINE__, lt, $NaN, 0)
-	fcmp(__LINE__, lt, $NaN, $NaN)
-	fcmp(__LINE__, lt, $nInf, $NaN)
-	fcmp(__LINE__, lt, 1, 0)
-	fcmp(__LINE__, lt, 0, 0)
-	fcmp(__LINE__, lt, $pInf, $nInf)
-	fcmp(__LINE__, lt, 0, $nInf)
-	fcmp(__LINE__, lt, 0, $NaN)
-
-	tcmp(__LINE__, le, 0, 1)
-	tcmp(__LINE__, le, 0, 0)
-	tcmp(__LINE__, le, 1, 1)
-	tcmp(__LINE__, le, $nInf, $pInf)
-	tcmp(__LINE__, le, $nInf, 0)
-	tcmp(__LINE__, le, 0, $pInf)
-	fcmp(__LINE__, le, $NaN, 0)
-	fcmp(__LINE__, le, $NaN, $NaN)
-	fcmp(__LINE__, le, $nInf, $NaN)
-	fcmp(__LINE__, le, 1, 0)
-	fcmp(__LINE__, le, $pInf, $nInf)
-	fcmp(__LINE__, le, 0, $nInf)
-	fcmp(__LINE__, le, 0, $NaN)
-
-	tcmp(__LINE__, eq, 0, 0)
-	tcmp(__LINE__, eq, 1, 1)
-	fcmp(__LINE__, eq, $NaN, 0)
-	fcmp(__LINE__, eq, $NaN, $NaN)
-	fcmp(__LINE__, eq, $nInf, $NaN)
-	fcmp(__LINE__, eq, 0, 1)
-	fcmp(__LINE__, eq, 1, 0)
-	fcmp(__LINE__, eq, $pInf, $nInf)
-	fcmp(__LINE__, eq, 0, $nInf)
-	fcmp(__LINE__, eq, 0, $NaN)
-
-	tcmp(__LINE__, ge, 1, 0)
-	tcmp(__LINE__, ge, 0, 0)
-	tcmp(__LINE__, ge, 1, 1)
-	tcmp(__LINE__, ge, $pInf, $nInf)
-	tcmp(__LINE__, ge, 0, $nInf)
-	tcmp(__LINE__, ge, $pInf, 0)
-	fcmp(__LINE__, ge, $NaN, 0)
-	fcmp(__LINE__, ge, $NaN, $NaN)
-	fcmp(__LINE__, ge, $nInf, $NaN)
-	fcmp(__LINE__, ge, 0, 1)
-	fcmp(__LINE__, ge, $nInf, $pInf)
-	fcmp(__LINE__, ge, $nInf, 0)
-	fcmp(__LINE__, ge, 0, $NaN)
-
-	tcmp(__LINE__, gt, 1, 0)
-	tcmp(__LINE__, gt, $pInf, $nInf)
-	tcmp(__LINE__, gt, 0, $nInf)
-	tcmp(__LINE__, gt, $pInf, 0)
-	fcmp(__LINE__, gt, $NaN, 0)
-	fcmp(__LINE__, gt, $NaN, $NaN)
-	fcmp(__LINE__, gt, $nInf, $NaN)
-	fcmp(__LINE__, gt, 0, 1)
-	fcmp(__LINE__, gt, 0, 0)
-	fcmp(__LINE__, gt, $nInf, $pInf)
-	fcmp(__LINE__, gt, $nInf, 0)
-	fcmp(__LINE__, gt, 0, $NaN)
-
-	tcmp(__LINE__, ne, 0, 1)
-	tcmp(__LINE__, ne, 1, 0)
-	tcmp(__LINE__, ne, $NaN, $NaN)
-	tcmp(__LINE__, ne, $nInf, $pInf)
-	tcmp(__LINE__, ne, $NaN, 0)
-	tcmp(__LINE__, ne, $nInf, $NaN)
-	tcmp(__LINE__, ne, $pInf, $nInf)
-	tcmp(__LINE__, ne, 0, $nInf)
-	tcmp(__LINE__, ne, 0, $NaN)
-	fcmp(__LINE__, ne, 0, 0)
-	fcmp(__LINE__, ne, 1, 1)
-
-	tcmp(__LINE__, unlt, 0, 1)
-	tcmp(__LINE__, unlt, $nInf, $pInf)
-	tcmp(__LINE__, unlt, $nInf, 0)
-	tcmp(__LINE__, unlt, 0, $pInf)
-	tcmp(__LINE__, unlt, $NaN, 0)
-	tcmp(__LINE__, unlt, $NaN, $NaN)
-	tcmp(__LINE__, unlt, $nInf, $NaN)
-	tcmp(__LINE__, unlt, 0, $NaN)
-	fcmp(__LINE__, unlt, 1, 0)
-	fcmp(__LINE__, unlt, 0, 0)
-	fcmp(__LINE__, unlt, $pInf, $nInf)
-	fcmp(__LINE__, unlt, 0, $nInf)
-
-	tcmp(__LINE__, unle, 0, 1)
-	tcmp(__LINE__, unle, 0, 0)
-	tcmp(__LINE__, unle, 1, 1)
-	tcmp(__LINE__, unle, $nInf, $pInf)
-	tcmp(__LINE__, unle, $nInf, 0)
-	tcmp(__LINE__, unle, 0, $pInf)
-	tcmp(__LINE__, unle, $NaN, 0)
-	tcmp(__LINE__, unle, $NaN, $NaN)
-	tcmp(__LINE__, unle, $nInf, $NaN)
-	tcmp(__LINE__, unle, 0, $NaN)
-	fcmp(__LINE__, unle, 1, 0)
-	fcmp(__LINE__, unle, $pInf, $nInf)
-	fcmp(__LINE__, unle, 0, $nInf)
-
-	tcmp(__LINE__, uneq, 0, 0)
-	tcmp(__LINE__, uneq, 1, 1)
-	tcmp(__LINE__, uneq, $NaN, 0)
-	tcmp(__LINE__, uneq, $NaN, $NaN)
-	tcmp(__LINE__, uneq, $nInf, $NaN)
-	tcmp(__LINE__, uneq, 0, $NaN)
-	fcmp(__LINE__, uneq, 0, 1)
-	fcmp(__LINE__, uneq, 1, 0)
-	fcmp(__LINE__, uneq, $pInf, $nInf)
-	fcmp(__LINE__, uneq, 0, $nInf)
-
-	tcmp(__LINE__, unge, 1, 0)
-	tcmp(__LINE__, unge, 0, 0)
-	tcmp(__LINE__, unge, 1, 1)
-	tcmp(__LINE__, unge, $pInf, $nInf)
-	tcmp(__LINE__, unge, 0, $nInf)
-	tcmp(__LINE__, unge, $pInf, 0)
-	tcmp(__LINE__, unge, $NaN, 0)
-	tcmp(__LINE__, unge, $NaN, $NaN)
-	tcmp(__LINE__, unge, $nInf, $NaN)
-	tcmp(__LINE__, unge, 0, $NaN)
-	fcmp(__LINE__, unge, 0, 1)
-	fcmp(__LINE__, unge, $nInf, $pInf)
-	fcmp(__LINE__, unge, $nInf, 0)
-
-	tcmp(__LINE__, ungt, 1, 0)
-	tcmp(__LINE__, ungt, $pInf, $nInf)
-	tcmp(__LINE__, ungt, 0, $nInf)
-	tcmp(__LINE__, ungt, $pInf, 0)
-	tcmp(__LINE__, ungt, $NaN, 0)
-	tcmp(__LINE__, ungt, $NaN, $NaN)
-	tcmp(__LINE__, ungt, $nInf, $NaN)
-	tcmp(__LINE__, ungt, 0, $NaN)
-	fcmp(__LINE__, ungt, 0, 1)
-	fcmp(__LINE__, ungt, 0, 0)
-	fcmp(__LINE__, ungt, $nInf, $pInf)
-	fcmp(__LINE__, ungt, $nInf, 0)
-
-	tcmp(__LINE__, ltgt, 0, 1)
-	tcmp(__LINE__, ltgt, 1, 0)
-	tcmp(__LINE__, ltgt, $nInf, $pInf)
-	tcmp(__LINE__, ltgt, $pInf, $nInf)
-	tcmp(__LINE__, ltgt, 0, $nInf)
-	fcmp(__LINE__, ltgt, $NaN, $NaN)
-	fcmp(__LINE__, ltgt, $NaN, 0)
-	fcmp(__LINE__, ltgt, $nInf, $NaN)
-	fcmp(__LINE__, ltgt, 0, $NaN)
-	fcmp(__LINE__, ltgt, 0, 0)
-	fcmp(__LINE__, ltgt, 1, 1)
-
-	tcmp(__LINE__, ord, 0, 1)
-	tcmp(__LINE__, ord, 1, 0)
-	tcmp(__LINE__, ord, $nInf, $pInf)
-	tcmp(__LINE__, ord, $pInf, $nInf)
-	tcmp(__LINE__, ord, 0, $nInf)
-	tcmp(__LINE__, ord, 0, 0)
-	tcmp(__LINE__, ord, 1, 1)
-	fcmp(__LINE__, ord, $NaN, $NaN)
-	fcmp(__LINE__, ord, $NaN, 0)
-	fcmp(__LINE__, ord, $nInf, $NaN)
-	fcmp(__LINE__, ord, 0, $NaN)
-
-	tcmp(__LINE__, unord, $NaN, $NaN)
-	tcmp(__LINE__, unord, $NaN, 0)
-	tcmp(__LINE__, unord, $nInf, $NaN)
-	tcmp(__LINE__, unord, 0, $NaN)
-	fcmp(__LINE__, unord, 0, 1)
-	fcmp(__LINE__, unord, 1, 0)
-	fcmp(__LINE__, unord, $nInf, $pInf)
-	fcmp(__LINE__, unord, $pInf, $nInf)
-	fcmp(__LINE__, unord, 0, $nInf)
-	fcmp(__LINE__, unord, 0, 0)
-	fcmp(__LINE__, unord, 1, 1)
-
-	f2w(__LINE__, 0, 0)
-	f2w(__LINE__, 1, 1)
-        /* not all loongson agree on it */
-#if !__mips__
-	f2w(__LINE__, wninf, $nInf)
-#endif
-	f2w(__LINE__, wpinf, $pInf)
-	f2w(__LINE__, wnan, $NaN)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @puts
-
-	ret
-	epilog

+ 0 - 1
bjos/sledge/lightning/check/fop_abs.ok

@@ -1 +0,0 @@
-ok

+ 0 - 31
bjos/sledge/lightning/check/fop_abs.tst

@@ -1,31 +0,0 @@
-#include "alu.inc"
-
-.code
-	prolog
-#define ABS(N, T, I, V)		FUN(N, T, abs, I, V)
-#define UABS(N, T, I, V)	UFUN(N, T, abs, I, V)
-	ABS(0, _f,	-0.0,		 0.0)
-	ABS(1, _f,	 0.5,		 0.5)
-	ABS(2, _f,	-0.5,		 0.5)
-	ABS(3, _f,	$Inf,		$Inf)
-	ABS(4, _f,	$nInf,		$Inf)
-	ABS(5, _f,	 1.25,		1.25)
-	ABS(6, _f,	-1.25,		1.25)
-	ABS(7, _f,	$nInf,		$Inf)
-	UABS(0, _f,	$NaN,		$NaN)
-	ABS(0, _d,	-0.0,		 0.0)
-	ABS(1, _d,	 0.5,		 0.5)
-	ABS(2, _d,	-0.5,		 0.5)
-	ABS(3, _d,	$Inf,		$Inf)
-	ABS(4, _d,	$nInf,		$Inf)
-	ABS(5, _d,	 1.25,		 1.25)
-	ABS(6, _d,	-1.25,		 1.25)
-	ABS(7, _d,	$nInf,		$Inf)
-	UABS(0, _d,	$NaN,		$NaN)
-
-	prepare
-		pushargi ok
-		ellipsis
-	finishi @printf
-	ret
-	epilog

Some files were not shown because too many files changed in this diff