| 885 | } |
| 886 | |
| 887 | static ParseResult parseIntegerRoundingMode(OpAsmParser &parser, |
| 888 | RoundingModeAttr &attr) { |
| 889 | static const StringRef allowedModes[] = {"nearest_int_to_zero"}; |
| 890 | |
| 891 | auto intgerValidator = [](OpAsmParser &parser, RoundingMode roundingMode, |
| 892 | StringRef roundingModeStr) -> ParseResult { |
| 893 | // Only allow integer rounding modes |
| 894 | if (roundingMode != RoundingMode::NEAREST_INT_TO_ZERO) |
| 895 | return failure(); |
| 896 | return success(); |
| 897 | }; |
| 898 | |
| 899 | return parseRoundingModeWithModes(parser, attr, allowedModes, |
| 900 | RoundingMode::NEAREST_INT_TO_ZERO, |
| 901 | intgerValidator); |
| 902 | } |
| 903 | |
| 904 | static void printIntegerRoundingMode(OpAsmPrinter &printer, Operation *op, |
| 905 | RoundingModeAttr attr) { |
nothing calls this directly
no test coverage detected