Hello. I have made following changes to inspect inlining of roundeven with the following test code: double plusone (double d) { return __builtin_roundeven (d) + 1; } Running the program using -O2 foo.c gave internal compiler error which I believe is because gcc_unreachable() at: if (TARGET_SSE4_1) emit_insn (gen_sse4_1_round2 (operands[0], operands[1], GEN_INT (ROUND_ | ROUND_NO_EXC))); I think the following condition matches the criterion? : > I think the code will be much clearer if it explicitly says > ROUND_ROUNDEVEN | ROUND_NO_EXC, else if (TARGET_64BIT || (mode != DFmode)) { if (ROUND_ == ROUND_FLOOR) ix86_expand_floorceil (operands[0], operands[1], true); else if (ROUND_ == ROUND_CEIL) ix86_expand_floorceil (operands[0], operands[1], false); else if (ROUND_ == ROUND_TRUNC) ix86_expand_trunc (operands[0], operands[1]); else gcc_unreachable (); } in: (define_expand "2" But with -mavx, generated the vroundsd insn. Does it mean ROUNDEVEN should have a condition in the else if, but comments above ix86_expand* functions in i386-expand.c says that those are for SSE2 sequences? Thanks, --Tejas On Mon, 17 Jun 2019 at 22:45, Joseph Myers wrote: > > On Mon, 17 Jun 2019, Tejas Joshi wrote: > > > > existing ROUND_NO_EXC definition in GCC. A new definition will need > > > adding alongside ROUND_FLOOR, ROUND_CEIL and ROUND_TRUNC to correspond to > > > rounding to nearest with ties to even, evaluating to 0.) > > > > So (ROUND_ROUNDEVEN 0x0) be declared for rounding towards nearest > > even for rounding mode argument? But reference says that RC field > > should end up as 00B for rounding ties to even? I am also much > > I think the code will be much clearer if it explicitly says > ROUND_ROUNDEVEN | ROUND_NO_EXC, than if it hardcodes implicit knowledge > that 0 is the value used for rounding to nearest with ties to even. > > -- > Joseph S. Myers > joseph@codesourcery.com