Commit Graph
100 Commits
Author SHA1 Message Date
Koakuma 375bb5f4a1 lib: Fix asm code in _start for SPARC
SPARCs have delayed branches, that is, it will unconditionally
run the next instruction following a branch.
Slightly reorder the _start code sequence to prevent it from
accidentally executing stray instructions, which may result in odd
program behavior.
2023-10-12 16:13:32 -07:00
Koakuma ccc9b8caf6 stage2: sparc64: Implement airPtrSliceLenPtr/airPtrSlicePtrPtr stubs 2023-04-28 16:46:04 -07:00
Koakuma 75a1360cdd stage2: sparc64: Implement ASI load/store ops 2023-04-28 16:46:04 -07:00
Koakuma 83e6223192 stage2: sparc64: Implement airByteSwap 2023-04-28 16:46:04 -07:00
Koakuma 486ab3852e stage2: sparc64: Factor machine offset calculation 2023-04-28 16:46:04 -07:00
Koakuma cc2a5185d6 stage2: sparc64: Implement airStructFieldPtr 2023-04-28 16:46:03 -07:00
Koakuma 1794a45572 stage2: sparc64: Add stub for c_va_* 2023-04-28 16:45:37 -07:00
Koakuma d339e86fb1 stage2: sparc64: Skip unimplemented tests 2023-04-28 16:45:37 -07:00
Koakuma f9e9ba784f stage2: sparc64: Skip unimplemented tests 2022-12-10 21:51:46 +07:00
Koakuma 644593ab18 stage2: sparc64: Implement airMinMax 2022-12-10 21:32:00 +07:00
Koakuma b4b7a404cf stage2: sparc64: Implement airBitReverse 2022-12-10 21:31:59 +07:00
Koakuma a369e8af9e stage2: sparc64: Add more types for genTypedValue 2022-12-10 21:31:59 +07:00
Koakuma e9204f84ad stage2: sparc64: Log generated function name for debug purposes 2022-12-10 21:11:14 +07:00
Koakuma fb9357f06c stage2: sparc64: Implement atomic ops 2022-12-10 21:11:14 +07:00
Koakuma 219b5f0ad6 stage2: sparc64: Implement stack argument 2022-12-10 21:11:14 +07:00
Koakuma a72362f395 stage2: sparc64: Implement airWrapErrUnionPayload 2022-12-10 21:11:14 +07:00
Koakuma 1b5b9eb365 stage2: sparc64: Add extra note about stack_offset MCV 2022-12-10 21:11:14 +07:00
Koakuma 57616debf9 stage2: sparc64: Implement airTrunc 2022-12-10 21:11:14 +07:00
Koakuma ef532ada8a stage2: sparc64: Implement airSplat 2022-12-10 21:11:14 +07:00
Koakuma 4687bc2730 stage2: sparc64: Implement airUnionInit 2022-12-10 21:11:14 +07:00
Koakuma 0bc936685b stage2: sparc64: Implement airErrorName 2022-12-10 21:11:14 +07:00
Koakuma 4ddedb3885 stage2: sparc64: Implement get/setUnionTag 2022-12-10 21:11:14 +07:00
Koakuma 86dc982e74 stage2: sparc64: Implement airSlicePtr 2022-09-14 16:58:13 -07:00
Koakuma ed546a7aad stage2: sparc64: Add placeholder for some Air instructions
airAddSat airSubSat airMulSat airShlSat airUnaryMath airPopcount airPrefetch
airPtrElemVal airOptionalPayload airOptionalPayloadPtr airOptionalPayloadPtrSet
2022-09-14 16:58:13 -07:00
Koakuma 0910cb6fcb stage2: sparc64: Skip compile-failing tests for now 2022-09-14 16:58:12 -07:00
Koakuma 0e1c68d90a stage2: sparc64: Don't track condition_flags_inst in checked binOps
This stops the emission of spurious CCR spills.
2022-09-14 16:57:31 -07:00
Koakuma 0464512f2e stage2: sparc64: Implement airShlWithOverflow 2022-09-14 16:57:31 -07:00
Koakuma de17fe66a5 stage2: sparc64: Tidy up binOp and enable more operations
sub, mul, addwrap, subwrap, mulwrap, shr, shr_exact
2022-09-14 16:57:31 -07:00
Koakuma ab3d3b260b stage2: sparc64: Add airClz/airCtz placeholder 2022-09-14 16:57:31 -07:00
Koakuma b9897c3b84 stage2: sparc64: Implement airMulOverflow for <= 32 bits 2022-09-14 16:57:31 -07:00
Koakuma 844d3a5a74 stage2: sparc64: Fix SPARCv9 shift opcodes encoding 2022-09-14 16:57:31 -07:00
Koakuma 2263bba6cd stage2: sparc64: Skip Sema-failing tests for now 2022-09-14 16:57:31 -07:00
Koakuma 61265fba04 stage2: sparc64: Implement airBinop for bool_and/or 2022-09-14 16:57:31 -07:00
Koakuma 4fc6df9f62 stage2: sparc64: Implement airTagName 2022-09-14 16:57:31 -07:00
Koakuma f01867f78e stage2: sparc64: Implement airWrapOptional 2022-09-14 16:57:31 -07:00
Koakuma b6307144c0 stage2: sparc64: Implement airPtrToInt 2022-09-14 16:57:31 -07:00
Koakuma 2c9ab03b0b stage2: sparc64: Add airCmpLtErrorsLen placeholder 2022-09-14 16:57:31 -07:00
Koakuma 5b0134e3ed stage2: sparc64: Change branch_link Mir field definition 2022-09-14 16:57:31 -07:00
Koakuma 64b61f0740 stage2: sparc64: Add airFloatToInt & airIntToFloat placeholder 2022-09-14 16:57:31 -07:00
Koakuma 672d6df429 stage2: sparc64: Skip Sema-failing tests for now 2022-06-24 21:19:33 +07:00
Koakuma ad176b319d stage2: sparc64: Implement SPARCv9 movr 2022-06-24 21:19:33 +07:00
Koakuma 65c5ef52e9 stage2: sparc64: Implement airRem, airMod, and SPARCv9 s/udivx 2022-06-24 21:19:33 +07:00
Koakuma 27adee3f12 stage2: sparc64: Implement airErrUnionPayloadPtrSet 2022-06-24 21:19:33 +07:00
Koakuma 84a57987c7 stage2: sparc64: Implement airAggregateInit 2022-06-24 21:19:33 +07:00
Koakuma dd57729299 stage2: sparc64: Update BigTomb implementation to use Liveness
Change BigTomb implementation to call to Liveness' implementation
rather than implementing feed() in itself.
This is modelled after the AArch64 backend.
2022-06-24 21:19:33 +07:00
Koakuma e2cb25358e stage2: sparc64: Implement airCall with BigTomb use for return 2022-06-24 21:19:33 +07:00
Koakuma 26b63b022f stage2: sparc64: Add airMemset placeholder 2022-06-24 21:19:33 +07:00
Koakuma 4fd0500bb5 stage2: sparc64: Implement airBoolToInt 2022-06-24 21:19:33 +07:00
Koakuma 837cd0d8af stage2: sparc64: Fix airNot comments/error messages 2022-06-24 21:19:33 +07:00
Koakuma be6718b796 stage2: sparc64: Implement airIsNull/airIsNonNull 2022-06-24 21:19:33 +07:00
Koakuma 4d15284c3c stage2: sparc64: Implement SPARCv9 shifts 2022-06-24 21:19:33 +07:00
Koakuma 513ab4eb56 stage2: sparc64: Implement airIntCast basics 2022-06-24 21:19:33 +07:00
Koakuma 36bfe4b7ef stage2: sparc64: Implement airFence + SPARCv9 membar 2022-06-24 21:19:33 +07:00
Koakuma 18d61d691c stage2: sparc64: Implement airArrayElemVal 2022-06-24 21:19:33 +07:00
Koakuma 672cd2f02f stage2: sparc64: Implement SPARCv9 and 2022-06-24 21:19:33 +07:00
Koakuma 6218d70d09 stage2: sparc64: Implement airBinOp for and, or, and xor 2022-06-24 21:19:33 +07:00
Koakuma 921f776224 stage2: sparc64: Implement airTry 2022-06-24 21:19:27 +07:00
Koakuma 40590c8bf9 stage2: sparc64: Save registers before calling another function 2022-06-24 21:08:41 +07:00
Koakuma 5c8612642b stage2: sparc64: Use official encoding for not rs2, rs1 2022-06-24 21:08:41 +07:00
Koakuma e7fde5f64e stage2: sparc64: Introduce condition_register MCValue type
Introduce condition_register MCValue type for future uses with BPr/MOVr
(mostly when needing to compare a signed value with zero)
2022-06-24 21:08:41 +07:00
Koakuma accc3bad63 stage2: sparc64: Move conditional branch emission out of airCondBr 2022-06-24 21:08:41 +07:00
Koakuma 8b3f7d2ad8 stage2: sparc64: Merge the compare_flag structs into condition_flags
This follows the design in the aarch64 backend (commit
61844b6bd4).
2022-06-24 21:08:40 +07:00
Koakuma 97d35a5147 behaviortest: Skip 'align(N) on functions' on sparc64 for now 2022-06-06 21:17:09 +07:00
Koakuma ec7f2a105f stage2: sparc64: Implement airPtrElemPtr 2022-06-06 21:17:09 +07:00
Koakuma f6eb83c91c stage2: sparc64: Implement airArrayToSlice 2022-06-06 21:17:09 +07:00
Koakuma f87dd285bb stage2: sparc64: binOp/mul: Use template from add 2022-06-06 20:34:53 +07:00
Koakuma 31f24dbc55 stage2: sparc64: Implement airWrapErrUnionErr 2022-06-06 20:34:53 +07:00
Koakuma c00d493a00 stage2: sparc64: Add some notes about stack space allocation 2022-06-06 20:34:53 +07:00
Koakuma 5d61f32887 stage2: sparc64: Implement airSlice 2022-06-06 20:34:53 +07:00
Koakuma 8b70abfcc6 stage2: sparc64: Fix & optimize 64-bit truncRegister 2022-06-06 20:34:53 +07:00
Koakuma 4d50e52c37 stage2: sparc64: Implement SPARCv9 xor, xnor, & not 2022-06-06 20:34:53 +07:00
Koakuma 97f9bf7e90 stage2: sparc64: Add BPr relocation to performReloc 2022-06-06 20:34:53 +07:00
Koakuma 23150de9c4 stage2: sparc64: Implement airNot 2022-06-06 20:34:53 +07:00
Koakuma 9ad74b6087 stage2: sparc64: Implement SPARCv9 addcc and movcc 2022-06-06 20:34:53 +07:00
Koakuma 97c43afefe stage2: sparc64: Spill CCR before doing calls 2022-06-06 20:34:53 +07:00
Koakuma 2dfe307d60 stage2: sparc64: Some bookkeeping fixes 2022-06-06 20:34:53 +07:00
Koakuma 89b4195c69 stage2: sparc64: Account for delay slot in airBlock 2022-06-06 20:34:53 +07:00
Koakuma 3220e0b61c stage2: sparc64: Proper handling of compare flags 2022-06-06 20:34:53 +07:00
Koakuma 9db81fee5d stage2: sparc64: Implement airStructFieldVal 2022-06-06 20:34:53 +07:00
Koakuma 3d662cfaf4 stage2: sparc64: Implement airAddSubOverflow 2022-06-06 20:34:53 +07:00
Koakuma 093332c02e stage2: sparc64: Implement condition code spilling 2022-06-06 20:34:53 +07:00
Koakuma 38aa431e03 stage2: sparc64: Fix CompareOperator <-> ICondition mapping 2022-06-06 20:34:52 +07:00
Koakuma c5b99267c0 stage2: sparc64: Remove saved_regs_stack_space calculation
SPARC does not have an explicit notion of saving/restoring registers.
The usual windowing mechanism (save/restore/return) already takes care of that
for us.
2022-05-26 13:48:39 +07:00
Koakuma 3923722cc6 stage2: sparc64: Account for stack bias & reserved area in genSetReg
genSetReg with ptr_stack_offset should add the bias and reserved area
before emitting the instruction.
2022-05-26 13:48:29 +07:00
Koakuma 5fa971610e stage2: sparc64: Change binOpImmediate immediates to u12
Sync with the check in binOp.
2022-05-26 13:09:56 +07:00
Koakuma 0310d88d7e stage2: sparc64: Add cmp and mov synthetic instructions 2022-05-26 13:08:39 +07:00
Koakuma b618dbdf69 stage2: sparc64: Implement SPARCv9 mulx 2022-05-16 23:30:54 +07:00
Koakuma 7245aad689 stage2: sparc64: Implement airBinOp for addition 2022-05-16 23:30:54 +07:00
Koakuma 67a1fedf84 stage2: sparc64: Implement airUnwrapErrErr 2022-05-16 23:30:54 +07:00
Koakuma 77eef33c04 stage2: sparc64: Implement airStructFieldPtrIndex 2022-05-16 23:30:54 +07:00
Koakuma 26116211ec stage2: sparc64: Implement inline memcpy for genSetStack 2022-05-16 23:30:54 +07:00
Koakuma 7822426ff2 stage2: sparc64: Implement airSliceElemVal 2022-05-16 23:30:54 +07:00
Koakuma ccf438e4de stage2: sparc64: Replace freezeRegs with RegisterLock 2022-05-16 23:30:54 +07:00
Koakuma 26e3d36d74 stage2: sparc64: Implement airSliceLen 2022-05-16 23:30:54 +07:00
Koakuma 8ea80fdf7a stage2: sparc64: Implement airLoop 2022-05-16 23:30:47 +07:00
Koakuma e4a725c597 stage2: sparc64: Implement airBitCast 2022-05-16 23:17:11 +07:00
Koakuma 0c8ce9ed9d stage2: sparc64: Implement airCmp 2022-05-16 23:17:11 +07:00
Koakuma ae2d6b7eea stage2: sparc64: Add BPr support for airCondBr 2022-05-16 23:17:11 +07:00
Koakuma e057ff2496 stage2: sparc64: Implement SPARCv9 bpr 2022-05-16 23:17:11 +07:00
Koakuma 8f8853cd4f stage2: sparc64: Implement airLoad/airStore 2022-05-16 23:17:06 +07:00