Page MenuHomePhabricator

[WebAssembly] Properly align fp128 arguments in outgoing varargs arguments
ClosedPublic

Authored by sunfish on Feb 25 2019, 4:47 PM.

Details

Summary

For outgoing varargs arguments, it's necessary to check the OrigAlign field of the corresponding OutputArg entry to determine argument alignment, rather than just computing an alignment from the argument value type. This is because types like fp128 are split into multiple argument values, with narrower types that don't reflect the ABI alignment of the full fp128.

This fixes the printf("printfL: %4.*Lf\n", 2, lval); testcase.

Diff Detail

Repository
rL LLVM

Event Timeline

sunfish created this revision.Feb 25 2019, 4:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2019, 4:47 PM
jgravelle-google accepted this revision.Feb 25 2019, 5:24 PM

Nice, lgtm

lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
677 ↗(On Diff #188276)

Is it this diff or is the spacing off here?

This revision is now accepted and ready to land.Feb 25 2019, 5:24 PM
sunfish marked 2 inline comments as done.Feb 25 2019, 8:44 PM
sunfish added inline comments.
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
677 ↗(On Diff #188276)

I was somehow in 4-space indent mode there. Fixed.

This revision was automatically updated to reflect the committed changes.