summaryrefslogtreecommitdiff
path: root/sys/src/cmd/7c
AgeCommit message (Collapse)Author
2023-05-187l, 7c: Remove STLP(W), finish LDAXR(W)/STLXR(W).Aidan K. Wiggins
2023-05-157c: clean up the garbage in -S output, fix printing instructions using FCONSTSigrid Solveig Haflínudóttir
2023-05-107c, 7l: revert CASE change, fix linker clobbering offset if given the same ↵Sigrid Solveig Haflínudóttir
register twice
2023-05-097c: peephole: ACASE needs two distinctive registers - nothing to optimizeSigrid Solveig Haflínudóttir
2023-05-095c, 7c: fix !x compilation when x is a negative floatSigrid Solveig Haflínudóttir
test case: void main(int, char **) { union { float f; u32int u; }x; x.u = 1U<<31; print("%d %d\n", !x.f, x.f == 0.0f); exits(nil); }
2023-05-067c: node offsets aren't necessarily 0 - fixup packed structsSigrid Solveig Haflínudóttir
2023-05-047c: copy the remainder of packed structsSigrid Solveig Haflínudóttir
2023-02-067c: eliminate MOVWU r, r instructions when possiblecinap_lenrek
2023-02-047c: help and improve peephole optimizercinap_lenrek
When using non signed integer variables, the registerizer would produce multiple converting load instructions on each use, which gives the peephole optimizer a hard time as it assumes that converting move instructions are there to actually change the data type (hence it cannot eleminate them). To avoid this, when we replace a variable reference with a register, we check that the move instruction is in fact the same as used in the initial load (which is based on variable type only), and replace the instruction with a full register move (AMOV). The peephole optimizer then is able to eleminate these instruction giving way better code.
2021-06-26kencc: revert back to "set but not used"cinap_lenrek
The change to "assignment not used" breaks symmetry with "used and not set" and removes the reference to the specific warning mentioned in /sys/doc/comp.ms. Also, the patch was half-assed as that it left some typos in like "used an not set", which this change also fixed.
2021-06-21kencc: clarify warning for unused assignmentsNoam Preil
2021-03-135c, 6c, 7c, 8c, kc, qc, vc: use explicit gmove(... , nn) in cgen() for ↵cinap_lenrek
result of OAS*, OPREINC, OPOSTINC The expression value of the assignment operation was returned implicitely by relying on regalloc() on the right hand side "nod" borrowing the register from nn. But this only works if nn is a register. In case of 6c, it can also be a ONAME from a .safe rathole returned by regsalloc(). This change adds explicit gmove() calls to assign the expression value. Note that gmove() checks if source and destination are the same register so it wont emit redundant move operations in the common case. The same is applied also to OPREINC and OPOSTINC operations.
2020-08-047c: now really fix OASxxx operationscinap_lenrek
the previous patch broke 64-bit ops as the type for the operation is determined from the first argument to gopcode() (nod1.type), not the type the result (nod.type). so we need to include the conversion of nod1 type to the type of nod.
2020-08-03reverting 7c change, breaks some 64-bit shifts...cinap_lenrek
2020-08-027c: fix wrong type on OASxxx operationscinap_lenrek
the bug can be reproduced with the following test case: #include <u.h> #include <libc.h> void main() { int size = 1; size*=1.5; exits(0); } this produces the following assembly: TEXT main+0(SB),0,$16 MOVW $1,R1 FCVTZSDW $1.50000000000000000e+00,R2 <- tries to convert rhs to int?? MULW R2,R1,R2 <- multiplication done in int? bug! MOV $0,R0 BL ,exits+0(SB) RETURN , END , the confusion comes from the *= operation using the wrong type for the multiplication. in this case we should use the float type of the rhs, do the operation, and then convert the result back to int type of the lhs. this change ports the same logic from 5c's getasop().
2020-04-19?c: get rid of sprint(), strcpy() and strcat()/strncat(), cleanupcinap_lenrek
2020-04-11cc, ?[acl]: fix gethunk() and move common memory allocator code to cc/compatcinap_lenrek
for gethunk() to work, all allocators have to use it, including allocations done by libc thru malloc(), so the fake allocation functions are mandatory for everyone. to avoid duplication the code is moved to cc/compat and prototypes provided in new cc/compat.h header.
2019-06-19cc: remove nullwarn() from OCAST codegen, zap void castscinap_lenrek
implicit casts would cause spurious "result of operation not used" warnings such as ape's stdio putc() macro. make (void) casts non-ops when the casted expression has no side effects. this avoid spurious warning with ape's assert() macro.
2019-05-01[5678vq]c: fix .safe node type for *FUNC() = *FUNC() sugencinap_lenrek
2019-04-257c: don't emit SXTW for non-register source operandcinap_lenrek
2019-04-177c: fix long to vlong/pointer conversion, avoid negative immediate offsetscinap_lenrek
we have to explicitely convert to vlong by sign or zero extending as not every operation leaves a proper zero/sign extended result in the register. for example NEGW will zero extend, breaking negative int offsets on pointers. we explicitely insert SXTW or MOVWU instructions which the peephole optimizer takes out again when it is safe todo so. when promoting constant offsets to immediate offsets, make sure the offset will be in range. otherwise the linker will produce not so optimal pointer arithmetic instructions to calculate the offset.
2019-04-087c: fix registerization of vlong constantscinap_lenrek
2019-04-08add arm64 c compiler and assembler (thanks charles forsyth)cinap_lenrek
this is the the initial sync of charles forsyths plan9 c compiler suite from http://bitbucket.org/plan9-from-bell-labs/9-cc at changeset version 54:65fb8bb56c59
2016-05-04retire the dec alpha portcinap_lenrek
2015-08-021c,2c,7c,kc,vc: honor suppress condition for outstring() in swt.ccinap_lenrek
2015-02-17[125678kqv][cl]: fix sprint() and strcpy() buffer overflowscinap_lenrek
2012-07-30import updated compilers from sourcescinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen