Page MenuHomePhabricator

aykevl (Ayke)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 25 2018, 9:12 AM (129 w, 5 d)

Recent Activity

Mon, Sep 21

aykevl added a comment to D86629: [AVR][clang] Pass the address of the data section to the linker for ATmega328.

Looks reasonable to me, although I can't really comment on the contents of this as I'm not very familiar with this code.

Mon, Sep 21, 12:18 PM · Restricted Project

Sep 14 2020

aykevl added a comment to D87631: [AVR] Fix global references to function symbols.

As a quick review (without looking into this carefully): you need to add tests. Without tests this will not be accepted. It also gives a better idea of what it does exactly and thus makes reviewing easier.

Sep 14 2020, 5:48 PM · Restricted Project

Aug 23 2020

aykevl added a comment to D86418: [AVR] Improve inline rotate/shift expansions.

I have tested this locally with my compiler-rt test setup. All tests still pass with this patch applied while the binary size is slightly reduced (when optimizing for size).

Aug 23 2020, 2:27 PM · Restricted Project
aykevl requested review of D86418: [AVR] Improve inline rotate/shift expansions.
Aug 23 2020, 5:27 AM · Restricted Project

Aug 9 2020

aykevl added a comment to D78663: [builtins] Add 32-bit shift builtins.

ping?

Aug 9 2020, 1:57 PM · Restricted Project

Aug 7 2020

aykevl added a comment to D54749: Saturating float to int casts..

That's unfortunate. I was looking forward to this to use in TinyGo. For TinyGo it doesn't matter what the exact behavior is, just that it is something sensible (and not UB). Saturating float operations would be great.

Aug 7 2020, 6:03 PM · Restricted Project

Jul 25 2020

aykevl abandoned D82536: [AVR] Use correct relocation for function pointers in globals.

The way avr-gcc works, the compiler is responsible for figuring this out, not the assembler. A code pointer should be emitted as .word gs(func) i.e. VK_AVR_GS.

Jul 25 2020, 9:16 AM · Restricted Project

Jul 12 2020

aykevl added a comment to D83634: [AVRInstPrinter] printOperand: support llvm-objdump --print-imm-hex.

Thanks. I'll push this to unblock D78741.

Jul 12 2020, 9:25 AM · Restricted Project
aykevl committed rG69e60c9dc766: [LLD][ELF][AVR] Implement the missing relocation types (authored by aykevl).
[LLD][ELF][AVR] Implement the missing relocation types
Jul 12 2020, 9:21 AM
aykevl closed D78741: [LLD][ELF][AVR] Implement the missing relocation types.
Jul 12 2020, 9:20 AM · Restricted Project, lld
aykevl updated the diff for D78741: [LLD][ELF][AVR] Implement the missing relocation types.
  • added --print-imm-hex (so this patch depends on D83634)
  • deleted some redundant parentheses
  • changed all comment markers to ;
Jul 12 2020, 3:17 AM · Restricted Project, lld
aykevl added a comment to D83634: [AVRInstPrinter] printOperand: support llvm-objdump --print-imm-hex.

Looks good to me. I've confirmed this works with D78741 and I have updated the patch to make use of it.

Jul 12 2020, 3:04 AM · Restricted Project

Jul 11 2020

aykevl updated the diff for D78741: [LLD][ELF][AVR] Implement the missing relocation types.

I think this addresses all review comments.

Jul 11 2020, 2:06 PM · Restricted Project, lld
aykevl added inline comments to D78741: [LLD][ELF][AVR] Implement the missing relocation types.
Jul 11 2020, 2:02 PM · Restricted Project, lld
aykevl added inline comments to D78741: [LLD][ELF][AVR] Implement the missing relocation types.
Jul 11 2020, 1:07 PM · Restricted Project, lld
aykevl updated the diff for D78741: [LLD][ELF][AVR] Implement the missing relocation types.
  • add relocation types in comments
Jul 11 2020, 10:04 AM · Restricted Project, lld
aykevl added inline comments to D78741: [LLD][ELF][AVR] Implement the missing relocation types.
Jul 11 2020, 9:56 AM · Restricted Project, lld

Jul 10 2020

aykevl added inline comments to D78663: [builtins] Add 32-bit shift builtins.
Jul 10 2020, 8:55 AM · Restricted Project
aykevl updated the diff for D78741: [LLD][ELF][AVR] Implement the missing relocation types.

Thanks for the review! This should address all comments.

Jul 10 2020, 8:50 AM · Restricted Project, lld

Jul 9 2020

aykevl added a comment to D78741: [LLD][ELF][AVR] Implement the missing relocation types.

ping?

Jul 9 2020, 5:41 AM · Restricted Project, lld

Jul 1 2020

aykevl updated the diff for D78741: [LLD][ELF][AVR] Implement the missing relocation types.
  • some minor formatting fixes to CHECK lines
Jul 1 2020, 8:38 AM · Restricted Project, lld
aykevl abandoned D82854: [LLD][ELF][AVR] Implement the missing relocation types.

I've taken over the old revision, so this is now a duplicate.

Jul 1 2020, 8:37 AM · Restricted Project
aykevl updated the diff for D78741: [LLD][ELF][AVR] Implement the missing relocation types.

@MaskRay thanks! I wasn't aware of that option.

Jul 1 2020, 8:37 AM · Restricted Project, lld
aykevl commandeered D78741: [LLD][ELF][AVR] Implement the missing relocation types.

Ok, let's see whether this works...

Jul 1 2020, 8:37 AM · Restricted Project, lld

Jun 30 2020

aykevl added a comment to D82536: [AVR] Use correct relocation for function pointers in globals.

@efriedma yeah I know, it's not right in the current state. See my previous comment. Do you have any idea how it is possible to get the object type (function or data) when determining the relocation type, when the referenced symbol is external?

Jun 30 2020, 5:23 PM · Restricted Project
aykevl updated the summary of D82854: [LLD][ELF][AVR] Implement the missing relocation types.
Jun 30 2020, 4:18 AM · Restricted Project
aykevl created D82854: [LLD][ELF][AVR] Implement the missing relocation types.
Jun 30 2020, 3:46 AM · Restricted Project
aykevl updated the summary of D82854: [LLD][ELF][AVR] Implement the missing relocation types.
Jun 30 2020, 3:46 AM · Restricted Project
aykevl added a comment to D78741: [LLD][ELF][AVR] Implement the missing relocation types.

Looks like I'm not able to upload a new diff, so I've made a new revision: D82854.

Jun 30 2020, 3:46 AM · Restricted Project, lld

Jun 29 2020

aykevl added a comment to D82536: [AVR] Use correct relocation for function pointers in globals.

I experimented a bit more but I really can't find a way to tell the difference between undefined functions and undefined globals. Assuming one or the other will still be incorrect in some cases.

Jun 29 2020, 3:18 PM · Restricted Project
aykevl added a comment to D78741: [LLD][ELF][AVR] Implement the missing relocation types.

I have attached a patch that addresses review comments:

Jun 29 2020, 1:01 PM · Restricted Project, lld

Jun 26 2020

aykevl added a reviewer for D78741: [LLD][ELF][AVR] Implement the missing relocation types: aykevl.
Jun 26 2020, 3:11 PM · Restricted Project, lld

Jun 25 2020

aykevl added a comment to D81282: [builtins] Move more float128-related helpers to GENERIC_TF_SOURCES list.

Look reasonable from my POV, but I don't know enough about CMake or the compiler-rt build system to LGTM this.

Jun 25 2020, 4:17 AM · Restricted Project
aykevl added a comment to D82536: [AVR] Use correct relocation for function pointers in globals.

I could perhaps add a test to relocations-abs.s that .type foo,@object creates a relocation of type R_AVR_16?

Jun 25 2020, 4:09 AM · Restricted Project
aykevl updated the diff for D82536: [AVR] Use correct relocation for function pointers in globals.
  • fixed MC test failure
Jun 25 2020, 3:44 AM · Restricted Project
aykevl added a comment to D82536: [AVR] Use correct relocation for function pointers in globals.

There is a test failure in llvm/test/MC/AVR/relocations-abs.s. With this change the LLVM behavior would start to differ from the avr-gcc behavior. But actually, the avr-gcc behavior might be a bug.

Jun 25 2020, 3:36 AM · Restricted Project
aykevl created D82536: [AVR] Use correct relocation for function pointers in globals.
Jun 25 2020, 3:04 AM · Restricted Project

Jun 23 2020

aykevl added inline comments to rGede6005e7092: [AVR] Explicitly set the address of the data section when invoking the linker.
Jun 23 2020, 3:38 PM
aykevl added a comment to D63852: [Clang] Move assembler into a separate file.

The reason to not call into LLVM directly is because I want to use the compiler driver, to be compatible with all the compiler flags. Reimplementing the assembler driver would be a pain.

Jun 23 2020, 7:58 AM · Restricted Project
aykevl added a comment to D63852: [Clang] Move assembler into a separate file.

(sorry, I missed your comment)

Jun 23 2020, 7:58 AM · Restricted Project
aykevl updated the diff for D78663: [builtins] Add 32-bit shift builtins.
  • Changed __inline to inline
  • Put REQUIRES line at the top
Jun 23 2020, 7:58 AM · Restricted Project

Jun 22 2020

aykevl committed rGeac4a6015485: [AVR] Disassemble double register instructions (authored by aykevl).
[AVR] Disassemble double register instructions
Jun 22 2020, 5:46 PM
aykevl committed rG9f09c29f0158: [AVR] Disassemble instructions with fixed Z operand (authored by aykevl).
[AVR] Disassemble instructions with fixed Z operand
Jun 22 2020, 5:45 PM
aykevl closed D82093: [AVR] Disassemble double register instructions.
Jun 22 2020, 5:45 PM · Restricted Project
aykevl closed D82088: [AVR] Disassemble instructions with fixed Z operand.
Jun 22 2020, 5:45 PM · Restricted Project
aykevl committed rGff4817ec2adb: [AVR] Don't adjust for instruction size (authored by aykevl).
[AVR] Don't adjust for instruction size
Jun 22 2020, 5:45 PM
aykevl committed rG01c2209d518c: [AVR] Decode single register instructions (authored by aykevl).
[AVR] Decode single register instructions
Jun 22 2020, 5:45 PM
aykevl committed rGec9efb856c6f: [AVR] Disassemble multiplication instructions (authored by aykevl).
[AVR] Disassemble multiplication instructions
Jun 22 2020, 5:45 PM
aykevl closed D81968: [AVR] Decode single register instructions.
Jun 22 2020, 5:45 PM · Restricted Project
aykevl closed D81971: [AVR] Disassemble multiplication instructions.
Jun 22 2020, 5:45 PM · Restricted Project
aykevl closed D78459: [AVR] Don't adjust for instruction size.
Jun 22 2020, 5:45 PM · Restricted Project

Jun 19 2020

aykevl added a comment to D81285: [builtins] Change si_int to int in some helper declarations.

On renaming fixed width integer types to their traditional names: I would prefer sending such patch afterwards, it would probably be as simple as just running sed --in-place several times.

Jun 19 2020, 5:21 AM · Restricted Project

Jun 18 2020

aykevl added a comment to D78439: [AVR] Fix miscompilation of zext + add.

I suspect the patterns are technically a bug, but may not show up in practice if they're all buggy in the exact same way. If all additions in a chain are replaced with subtractions, then it should work.

Jun 18 2020, 8:40 AM · Restricted Project
aykevl added a comment to D78439: [AVR] Fix miscompilation of zext + add.

Patch committed!

Jun 18 2020, 8:08 AM · Restricted Project
aykevl committed rGb4c91462e84e: [AVR] Fix miscompilation of zext + add (authored by aykevl).
[AVR] Fix miscompilation of zext + add
Jun 18 2020, 8:08 AM
aykevl closed D78439: [AVR] Fix miscompilation of zext + add.
Jun 18 2020, 8:07 AM · Restricted Project
aykevl created D82093: [AVR] Disassemble double register instructions.
Jun 18 2020, 7:02 AM · Restricted Project
aykevl created D82088: [AVR] Disassemble instructions with fixed Z operand.
Jun 18 2020, 6:29 AM · Restricted Project
aykevl updated the diff for D81971: [AVR] Disassemble multiplication instructions.
  • fix formatting
Jun 18 2020, 3:46 AM · Restricted Project
aykevl updated the diff for D81968: [AVR] Decode single register instructions.
  • updated formatting
Jun 18 2020, 3:46 AM · Restricted Project
aykevl updated the diff for D78459: [AVR] Don't adjust for instruction size.
  • Add testcase
Jun 18 2020, 3:46 AM · Restricted Project
aykevl committed rG15bf42d503b9: [AVR] Implement disassembly of 32-bit instructions (authored by aykevl).
[AVR] Implement disassembly of 32-bit instructions
Jun 18 2020, 2:42 AM
aykevl closed D81961: [AVR] Implement disassembly of 32-bit instructions.
Jun 18 2020, 2:42 AM · Restricted Project

Jun 16 2020

aykevl added a comment to D78663: [builtins] Add 32-bit shift builtins.

@MaskRay ping?

Jun 16 2020, 3:56 PM · Restricted Project
aykevl created D81971: [AVR] Disassemble multiplication instructions.
Jun 16 2020, 2:51 PM · Restricted Project
aykevl created D81968: [AVR] Decode single register instructions.
Jun 16 2020, 2:18 PM · Restricted Project
aykevl added a comment to D78459: [AVR] Don't adjust for instruction size.

I have made a patch to support disassembly of jmp/call instructions, which should make this patch testable: D81961

Jun 16 2020, 1:12 PM · Restricted Project
aykevl created D81961: [AVR] Implement disassembly of 32-bit instructions.
Jun 16 2020, 1:12 PM · Restricted Project
aykevl updated the summary of D81961: [AVR] Implement disassembly of 32-bit instructions.
Jun 16 2020, 1:12 PM · Restricted Project
aykevl committed rG5aa8014ca811: [AVR] Remove faulty stack pushing behavior (authored by aykevl).
[AVR] Remove faulty stack pushing behavior
Jun 16 2020, 4:59 AM
aykevl committed rG3ab1c97e3516: [AVR] Fix stack size in functions with a frame pointer (authored by aykevl).
[AVR] Fix stack size in functions with a frame pointer
Jun 16 2020, 4:59 AM
aykevl closed D78581: [AVR] Remove faulty stack pushing behavior.
Jun 16 2020, 4:58 AM · Restricted Project
aykevl closed D78579: [AVR] Fix stack size in functions with a frame pointer.
Jun 16 2020, 4:58 AM · Restricted Project

Jun 14 2020

aykevl added a comment to D78459: [AVR] Don't adjust for instruction size.

I'm trying to make a test case, but I'm not sure how to do it. I have converted the test to IR here: https://gist.github.com/aykevl/08e87000370d0f7ed7780932b32d7924
The difference in disassembly output is only visible when disassembling the instructions (not just the instruction encodings), and llvm-objdump doesn't yet support 32-bit AVR instructions. Therefore the output is the same with or without this patch:

Jun 14 2020, 9:36 AM · Restricted Project

Jun 10 2020

aykevl added a comment to D81285: [builtins] Change si_int to int in some helper declarations.

I need to recompile LLVM to test this patch so it might take a while.

Jun 10 2020, 1:21 PM · Restricted Project
aykevl added a comment to D78459: [AVR] Don't adjust for instruction size.

Ok, I can add the test case (need to recompile LLVM first). It just seems a bit large to me (over 1000 lines).

Jun 10 2020, 1:21 PM · Restricted Project
aykevl added inline comments to D78741: [LLD][ELF][AVR] Implement the missing relocation types.
Jun 10 2020, 12:47 PM · Restricted Project, lld
aykevl added a comment to D78741: [LLD][ELF][AVR] Implement the missing relocation types.

I actually wrote a patch very similar to this one (but not implementing as many relocations). It's here: https://gist.github.com/aykevl/ce3c04e1175d9602c9dfaf0cf91298ba
I wanted to hold off on submitting it before the AVR disassembler was a bit more reliable, to make proper tests.

Jun 10 2020, 12:47 PM · Restricted Project, lld
aykevl committed rG1ba780979391: [AVR] Implement disassembly support for I/O instructions (authored by aykevl).
[AVR] Implement disassembly support for I/O instructions
Jun 10 2020, 12:15 PM
aykevl closed D74049: [AVR] Implement disassembly support for I/O instructions.
Jun 10 2020, 12:15 PM · Restricted Project
aykevl added a comment to D63852: [Clang] Move assembler into a separate file.

@echristo any chance you could take a look at this?

Jun 10 2020, 11:41 AM · Restricted Project

Jun 9 2020

aykevl added a comment to D81285: [builtins] Change si_int to int in some helper declarations.

I'm not sure whether native_int is any clearer than just int. I'm afraid it only introduces more complexity ("What's native_int? Oh, it's just int").

Jun 9 2020, 8:12 AM · Restricted Project
aykevl added a comment to D81408: [builtins] Improve compatibility with 16 bit targets.

I tested this patch against my local testing system to make sure it didn't break anything, and I get the same number of failures (most of which are due to a missing complex.h file, which is unrelated). So it looks fine from my point of view, although I know not enough about this code to LGTM it.
Note that double float (float128) doesn't work in my setup, so I can't test changes related to that.

Jun 9 2020, 5:59 AM · Restricted Project

May 18 2020

aykevl added a comment to D78459: [AVR] Don't adjust for instruction size.

Glad to see you're working on AVR again!

May 18 2020, 3:12 PM · Restricted Project
aykevl added a comment to rGede6005e7092: [AVR] Explicitly set the address of the data section when invoking the linker.

See my inline comment.

May 18 2020, 3:12 PM

May 7 2020

aykevl added a comment to D78662: [builtins] Support architectures with 16-bit int.

I was trying with msp430; I had trouble getting a testcase to build with AVR (I forget why). I guess AVR actually behaves differently: it doesn't respect "zeroext" markings on arguments, unlike most targets.

Given that, there's probably a bug we need to fix, in either the AVR backend or type legalization.

May 7 2020, 11:20 AM · Restricted Project

Apr 29 2020

Herald added a project to D77221: [AVR] Rework MCU family detection to support more AVR MCUs: Restricted Project.

A thought: should the AVR family be included in the target triple? Like avr5-unknown-unknown (similar to armv6m-none-eabi, armv7m-none-eabi, etc).
The different variations do sometimes change the architecture in incompatible ways, such as with the call instruction which pushes a return address of two or three bytes depending on the architecture variant (and thus makes it impossible to pass parameters on the stack reliably).

Apr 29 2020, 5:17 PM · Restricted Project, Restricted Project

Apr 28 2020

aykevl added a comment to D78459: [AVR] Don't adjust for instruction size.

While creating a commit for disassembling branch/rcall/rjmp instructions, I noticed that it makes the LLVM assembler for AVR less buggy. Previously it would output the wrong addend for relocations (off by two) and sometimes emit an instruction that was also off by two. This patch fixes that partially: the instructions are correct while the relocations are still off-by-two. So that looks like an improvement.

Apr 28 2020, 7:28 AM · Restricted Project

Apr 26 2020

aykevl updated the diff for D74049: [AVR] Implement disassembly support for I/O instructions.
  • better formatting of return statement
  • added testcases to exercise all the bits in every instruction
Apr 26 2020, 7:57 AM · Restricted Project

Apr 25 2020

aykevl added a comment to D78662: [builtins] Support architectures with 16-bit int.

In summary: I think using int is fine as LLVM internally passes an i8

That doesn't seem quite right. Consider, for example, long long a(long long a, int b) { return a << (char)(b); }. To generate correct code, you need to clear the high bits of b. If we just model the argument as an anyext i8, we'll skip clearing those bits, and the compiler-rt C implementations will have undefined behavior. It looks like LLVM does actually extend the value to "int", though. (It doesn't choose between sign/zero extend consistently, but it doesn't actually matter here).

Apr 25 2020, 5:32 PM · Restricted Project
aykevl committed rGceba881aeac1: [AVR][NFC] Move preprocessor tests to Preprocessor directory (authored by aykevl).
[AVR][NFC] Move preprocessor tests to Preprocessor directory
Apr 25 2020, 5:00 PM
aykevl closed D78163: [AVR][NFC] Move preprocessor tests to Preprocessor directory.
Apr 25 2020, 5:00 PM · Restricted Project
aykevl committed rG4d41df648281: [builtins] Support architectures with 16-bit int (authored by aykevl).
[builtins] Support architectures with 16-bit int
Apr 25 2020, 4:28 PM
aykevl closed D78662: [builtins] Support architectures with 16-bit int.
Apr 25 2020, 4:28 PM · Restricted Project

Apr 23 2020

aykevl added a reviewer for D78663: [builtins] Add 32-bit shift builtins: efriedma.
Apr 23 2020, 4:19 PM · Restricted Project
aykevl added inline comments to D78663: [builtins] Add 32-bit shift builtins.
Apr 23 2020, 1:33 PM · Restricted Project
aykevl updated the diff for D78163: [AVR][NFC] Move preprocessor tests to Preprocessor directory.
  • moved test files out of the AVR-specific directory
  • removed the REQUIRES: line
Apr 23 2020, 10:18 AM · Restricted Project
aykevl updated the diff for D78663: [builtins] Add 32-bit shift builtins.
  • formatted test files with clang-format
  • moved shift implementations into common _impl.inc files
  • fixed comment style of shift implementations (// instead of /* ... */)
Apr 23 2020, 10:16 AM · Restricted Project
aykevl updated the diff for D78662: [builtins] Support architectures with 16-bit int.
  • defined two macros clzsi and ctzsi for counting bits in si_int and su_int
  • changed int32_t to si_int in two places
Apr 23 2020, 6:59 AM · Restricted Project
aykevl added a comment to D78662: [builtins] Support architectures with 16-bit int.

Is making all shift amounts "int" consistent with what LLVM does?

Apr 23 2020, 5:21 AM · Restricted Project