News for hackers. Stuff that matters.
Re:RISC-V Stumbling Blocks by bonzini on Thursday January 02, 2020 @08:14AM (#21935071)
> Compilers don't do clever masking tricks to avoid branches, in general

They actually do a lot of such tricks. Check out the GCC sources, for example tree-ssa-phiopt.c[1] and ifcvt.c[2]

[1] https://github.com/gcc-mirror/gcc/blob/master/gcc/tree-ssa-p...

[2] https://github.com/gcc-mirror/gcc/blob/master/gcc/ifcvt.c

Re:RISC-V Stumbling Blocks by ncmncm on Thursday January 02, 2020 @01:51PM (#21938393)
They do it a bit, but they leave a very great deal on the table. Clang will convert

  a = (b&m)|(c&~m)
into cmov, but gcc won't.
Re:RISC-V Stumbling Blocks by jleahy on Thursday January 02, 2020 @09:14AM (#21935466)
Well I was thinking of ifcvt when I mentioned a few special cases. Particularly things like minmax and abs are very specific.