Displaying 20 results from an estimated 800 matches similar to: "TableGen change in LLVM 3.9 allows only prefix instruction notation"
2017 Dec 15
2
InstAlias with tied operands - can it be supported?
Hello,
InstAlias does not allow tied operands (repeated operands) in the asm
string to be matched.
It seems this situation is explicitly prevented in
AsmMatcherEmitter.cpp:
if (!Hack)
PrintFatalError(TheDef->getLoc(),
"ERROR: matchable with tied operand '" + Tok +
"' can never be matched!");
2017 Dec 15
0
InstAlias with tied operands - can it be supported?
Hi,
On Instructions you can use checkEarlyTargetMatchPredicate() to check that the operands are the same. There's an example of that in MipsAsmParser.cpp for DATI and DAHI. I can't think of a reason TableGen couldn't be made to allow this for InstAlias too.
> On 15 Dec 2017, at 02:12, via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Hello,
>
> InstAlias
2018 Jan 04
1
InstAlias with tied operands - can it be supported?
Hi Daniel,
I defined checkEarlyTargetMatchPredicate() to explicitly check for the
tied operands, and it worked.
I could define an alias like: InstAlias<"oldOP $rd, $rd, $rs1", (NEWOP
$rd, $rs1)>
However, I had to additionally change AsmMatcherEmitter 'Hack' variable
setting to allow the repeated operand $rd in the AsmString.
Do you or anyone else know the history
2018 Jan 08
0
about AsmMatcherEmitter rules for setting matchables precedence
Hi,
In AsmMatcherEmitter.cpp, the operator “<” for comparing matchables
(MatchableInfo objects) only checks matches that require more features
as the last rule.
I would like to propose that we check for that rule earlier, in the case
of
unrelated UserClasses, before we decide to set precedence based on
UserClass name.
The motivation is that unrelated UserClasses seem to be Immediate
2015 Dec 07
2
Immediate value boundary checking
Dear all,
I have written an assembler which reads assembly instructions and produces
the equivalent binary. I have a problem. Although I set the bit range and
immediate type for an instruction like add which accepts a register and an
immediate value, I can simply overflow that value and llvm/tablegen doesn't
care!
for example for a i8imm imm value (bits<8> val) these two produce the
2017 Mar 16
2
Support for user defined unary functions
I guess this would establish a separate "namespace" of symbolic prefix
operators, %*% being an example in the infix case. So you could have stuff
like %?%, but for non-symbolic (spelled out stuff like %foo%), it's hard to
see the advantage vs. foo(x).
Those examples you mention should probably be addressed (eventually) in the
core language, and it looks like people are already able
2017 Mar 16
2
Support for user defined unary functions
Martin,
Jim can speak directly to his motivations; I don't claim to be able to do
so. That said, I suspect this is related to a conversation on twitter about
wanting an infix "unquote" operator in the context of the non-standard
evaluation framework Hadley Wickham and Lionel Henry (and possibly others)
are working on.
They're currently using !!! and !! for things related to
2017 Mar 17
3
Support for user defined unary functions
I agree there is no reason they _need_ to be the same precedence, but
I think SPECIALS are already have the proper precedence for both unary
and binary calls. Namely higher than all the binary operators (except
for `:`), but lower than the other unary operators. Even if we gave
unary specials their own precedence I think it would end up in the
same place.
`%l%` <- function(x) tail(x, n =
2004 Mar 05
4
Command Line Expressions
Hi,
Is it possible to run R in command line to evalute R expressions
and return results to stdout, something like
>R CMD -e "R.version$minor"
then you got return
>"8.1"
Or do a simple calculation
>R CMD -e "sin(1.2)"
>0.932039
Thanks.
--
Pingping Zheng
Department of Mathematics and Statistics
Fylde College
Lancaster University
Lancaster LA1 4YF
2011 Sep 30
3
[LLVMdev] Tablegen: RegisterInfoEmitter.cpp
Hi,
I just bumped into a bug in this code. The problem was as follows:
I have defined a set of registers with rather similar names including digits.
The code section at
RegisterInfoEmitter::run(){
...
// Process sub-register sets.
runs and fills the RegisterAliases map.
then,
...
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
RegNo[Regs[i].TheDef] = i;
NumAliases +=
2020 Sep 08
2
TableGen enhancements
I spent some time playing with TableGen in order to improve the ability of backends to generate error messages with more precise source locations. The main requirement was to add a slot to the RecordVal class to hold the source location of the statement that defined the field. To make that easier to use, I added a third PrintFatalError() method that accepts a RecordVal and grabs the source
2017 Mar 17
2
Support for user defined unary functions
>After off list discussions with Jonathan Carrol and with
>Michael Lawrence I think it's doable, unambiguous,
>and even imo pretty intuitive for an "unquote" operator.
For those of us who are not CS/Lisp mavens, what is an
"unquote" operator? Can you expression quoting and unquoting
in R syntax and show a few examples where is is useful,
intuitive, and fits in to
2013 Apr 23
3
[LLVMdev] Optimize away sqrt in simple cases?
hi!
I'm using LLVM 3.2. Does it optimize away llvm.pow(llvm.sqrt(x), 2) to `x`
with any settings? I tried with llc -O3, but that didn't do it.
Would be nice to write |v|² in my language ('v' being a 2D vector say and
|...| and ...² being two separate infix "operators") -- when I could
compare squares of lengths as well as lengths, and know that the sqrt is
optimized
2017 Mar 17
2
Support for user defined unary functions
Your example
x = 5
exp = parse(text="f(uq(x)) + y +z") # expression: f(uq(x)) +y + z
do_unquote(expr)
# -> the language object f(5) + y + z
could be done with the following wrapper for bquote
my_do_unquote <- function(language, envir = parent.frame()) {
if (is.expression(language)) {
# bquote does not go into expressions, only calls
2011 Oct 20
3
Strange R behavior for product of two sum of integers
Dear gentlemen,
Can you explain me why the following happens (any OS I think, and even
on 64 bits)?
> sum(1000:1205)^2
[1] 51581223225
> sum(1000:1205)*sum(1000:1205)
[1] NA
Warning message:
In sum(1000:1205) * sum(1000:1205) : NAs produced by integer overflow
Best,
Pierre
--
Pierre Lafaye de Micheaux
Adresse courrier:
D?partement de Math?matiques et Statistique
Universit? de
2017 Mar 17
2
Support for user defined unary functions
The unquoting discussion is IMHO separate from this proposal and as
you noted probably better served by a native operator with different
precedence.
I think the main benefit to providing user defined prefix operators is
it allows package authors to experiment with operator ideas and gauge
community interest. The current situation means any novel unary
semantics either need to co-opt existing
2017 Mar 16
4
Support for user defined unary functions
R has long supported user defined binary (infix) functions, defined
with `%fun%`. A one line change [1] to R's grammar allows users to
define unary (prefix) functions in the same manner.
`%chr%` <- function(x) as.character(x)
`%identical%` <- function(x, y) identical(x, y)
%chr% 100
#> [1] "100"
%chr% 100 %identical% "100"
#> [1] TRUE
2011 Oct 07
4
[LLVMdev] Enhancing TableGen
Che-Liang Chiou <clchiou at gmail.com> writes:
> My purpose is to eliminate copy-paste style of programming in td files
> as much as possible, but only to a point that the new language
> constructs do not create too much overhead/readability-downgrade.
Yes!
> In other words, I am targeting those low-hanging fruit of copy-paste
> programmings in td files that are eliminated
2011 Oct 07
0
[LLVMdev] Enhancing TableGen
My purpose is to eliminate copy-paste style of programming in td files
as much as possible, but only to a point that the new language
constructs do not create too much overhead/readability-downgrade.
In other words, I am targeting those low-hanging fruit of copy-paste
programmings in td files that are eliminated by a simple for-loop
syntax. The repetitive patterns I observed in PTX backend (and
2002 Nov 29
2
Regular Expressionsionism
Isn't there a cryptic footnote somewhere in the blue book that describes regular expressions as "a funny little language ..." ? Well, I'm not laughing!
I've googled and Man paged, but the GREP-style solution to the following problem still eludes me:
... Using a regular expression in the "pattern" argument to list.files() to restrict the return to filenames which